Inverse problems are encountered in many domains of physics, with analytic continuation of the imaginary Green's function into the real frequency domain being a particularly important example. However, the analytic continuation problem is ill defined and currently no analytic transformation for solving it is known. We present a general framework for building an artificial neural network (ANN) that solves this task with a supervised learning approach. Application of the ANN approach to quantum Monte Carlo calculations and simulated Green's function data demonstrates its high accuracy. By comparing with the commonly used maximum entropy approach, we show that our method can reach the same level of accuracy for low-noise input data, while performing significantly better when the noise strength increases. The computational cost of the proposed neural network approach is reduced by almost three orders of magnitude compared to the maximum entropy method.