We proposed a data-driven approach to alleviate motion artifacts in Magnetic Resonance (MR) images. Firstly, MR images were acquired using a pseudo-random k-space sampling sequence. Then a convolutional network was trained to denoise MR images containing motion artifacts, before the k-space of the denoised images were compared with the raw k-space to find out k-space lines influenced by the motion. Finally, compressed sensing (CS) was applied to those unaffected lines to reconstruct the final image. Simulated experiments proved that this approach can accurately detect k-space lines influenced by motion and reconstruct images better than those reconstructed directly by CS.