With the major goals of enhancing picture quality, correcting aberrations, and optimizing light-matter interactions, the suggested technique makes use of neural network methodologies to improve mid- and near-field optics. This strategy makes use of three fundamental algorithms: Convolutional Neural Network (CNN) image restoration, Wavefront Sensing aberration correction, and Generative Adversarial Network (GAN) nanostructure optimization. The first approach, Image Restoration using CNNs, leverages deep convolutional neural networks to recover images in mid- and near-field optics, collecting complicated characteristics in the process. The second approach, Aberration Correction using Wavefront Sensing, employs wavefront sensing techniques to quantify and correct optical aberrations. The third approach, Nanostructure Optimization using GANs, employs a generative adversarial network to create nanostructures optimized for certain optical tasks. The success of the suggested technique is measured with regards to metrics like the enhancement of image quality (PSNR), the accuracy of aberration correction (RMS wavefront error), and the effectiveness of optimizing nanostructures (FOM). Together, these methods tackle the problems plaguing the field and improve the quality of optical pictures captured at mid- and near-field distances.