High-order numerical solvers for conservation laws suer 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 the superior performance of the network-based model in capturing both complex and fine structures.