High-order numerical solvers for conservation laws suffer from Gibbs phenomenon close to discontinuities, leading to spurious oscillations and a detrimental effect on the solution accuracy. A possible strategy to reduce it comprises adding a suitable amount of artificial dissipation. Although several viscosity models have been proposed in the literature, their dependence on problem-dependent parameters often limits their performances. Motivated by the objective to construct a universal artificial viscosity method, we propose a new technique based on neural networks, integrated into a Runge-Kutta Discontinuous Galerkin solver. Numerical results are presented to demonstrate the performance of this network-based technique. We show that it is able both to guarantee optimal accuracy for smooth problems, and to accurately detect discontinuities, where dissipation has to be injected. A comparison with some classical models is carried out, showing that the network-based model is always at par with the best among the traditional optimized models, independently of the selected problem and parameters. (C) 2020 Elsevier Inc. All rights reserved.