We recast the multilayered sparse inversion problem as a multilayered neural network problem. Unlike standard least squares migration (LSM) which finds the optimal reflectivity image, neural network least squares migration (NNLSM) finds both the optimal reflectivity image and the quasi-migration Green's functions. These quasi-migration Green's functions are also denoted as the convolutional filters in a convolutional neural network and are similar to migration Green's functions. The advantage of NNLSM over standard LSM is that its computational cost is significantly less and it can be used for denoising migration images. Its disadvantage is that the NNLSM reflectivity image is only an approximation to the actual reflectivity distribution.