The magnetic field plays an essential role in the initiation and evolution of different solar phenomena in the corona. The structure and evolution of the 3D coronal magnetic field are still not very well known. A way to get the 3D structure of the coronal magnetic field is by performing magnetic field extrapolations from the photosphere to the corona. In previous work, it was shown that by prescribing the 3D reconstructed loops geometry, the magnetic field extrapolation finds a solution with a better agreement between the modeled field and the reconstructed loops. Also, it improves the quality of the field extrapolation. Stereoscopy represents the classical method for performing 3D coronal loop reconstruction. It uses at least two view directions. When only one vantage point of the coronal loops is available, other 3D reconstruction methods must be applied. Within this work, we present a method for the 3D loop reconstruction based on machine learning. Our purpose for developing this method is to use as many observed coronal loops in space and time for the modeling of the coronal magnetic field. Our results show that we can build machine learning models that can retrieve 3D loops based only on their projection information. In the end, the neural network model will be able to use only 2D information of the coronal loops, identified, traced and extracted from the EUV images, for the calculation of their 3D geometry.