A method of detecting one or more lanes included in an input image by using a lane mask, comprising steps of: (a) on condition that (i) a first CNN has generated a final feature map by applying one or more first convolution operations and first deconvolution operations to the input image and (ii) has generated a segmentation score map by applying softmax operations to the final feature map and an embedded feature map by transforming values of the final feature map, a learning device instructing a second CNN to acquire the final feature map, the segmentation score map, and the embedded feature map, wherein the embedded feature map is generated by applying embedding operations to the final feature map, wherein the transforming of values of the final feature map is performed in a way of (i) increasing each of inter-class differences among each of means of the values, included in the final feature map, corresponding to pixels of the respective lanes included in the input image or (ii) decreasing each of intra-class variances of the values, included in the final feature map, corresponding to pixels included in the respective lanes included in the input image; (b) the learning device instructing a lane masking layer of the second CNN to (i) recognize one or more lane candidates, corresponding to the lanes included in the input image, on the final feature map by using the segmentation score map to detect the one or more lane candidates and the embedded feature map to classify the one or more lane candidates, (ii) generate the lane mask which assigns one or more weights to one or more regions, which correspond to the lane candidates, on the final feature map and (iii) generate a masked feature map by multiplying the final feature map and the lane mask; (c) the learning device instructing a convolutional layer of the second CNN to generate a lane feature map by applying one or more second convolution operations to the masked feature map; (d) the learning device instructing a first FC layer of the second CNN to generate a softmax score map by referring to the lane feature map, and instructing a second FC layer of the second CNN to generate one or more lane parameters by referring to the lane feature map; and (e) the learning device (i) instructing a multinomial logistic loss layer of the second CNN to generate softmax loss values by referring to the softmax score map and its corresponding first GT, (ii) instructing a line fitting loss layer of the second CNN to generate line fitting loss values by referring to the lane parameters and their corresponding second GTs, and (iii) backpropagating the softmax loss values and the line fitting loss values, to thereby learn parameters of at least part of the first FC layer, the second FC layer and the convolutional layer included in the second CNN. (a) on condition that (i) a first CNN has generated a final feature map by applying one or more first convolution operations and first deconvolution operations to the input image and (ii) has generated a segmentation score map by applying softmax operations to the final feature map and an embedded feature map by transforming values of the final feature map, a learning device instructing a second CNN to acquire the final feature map, the segmentation score map, and the embedded feature map, wherein the embedded feature map is generated by applying embedding operations to the final feature map, wherein the transforming of values of the final feature map is performed in a way of (i) increasing each of inter-class differences among each of means of the values, included in the final feature map, corresponding to pixels of the respective lanes included in the input image or (ii) decreasing each of intra-class variances of the values, included in the final feature map, corresponding to pixels included in the respective lanes included in the input image; (b) the learning device instructing a lane masking layer of the second CNN to (i) recognize one or more lane candidates, corresponding to the lanes included in the input image, on the final feature map by using the segmentation score map to detect the one or more lane candidates and the embedded feature map to classify the one or more lane candidates, (ii) generate the lane mask which assigns one or more weights to one or more regions, which correspond to the lane candidates, on the final feature map and (iii) generate a masked feature map by multiplying the final feature map and the lane mask; (c) the learning device instructing a convolutional layer of the second CNN to generate a lane feature map by applying one or more second convolution operations to the masked feature map; (d) the learning device instructing a first FC layer of the second CNN to generate a softmax score map by referring to the lane feature map, and instructing a second FC layer of the second CNN to generate one or more lane parameters by referring to the lane feature map; and (e) the learning device (i) instructing a multinomial logistic loss layer of the second CNN to generate softmax loss values by referring to the softmax score map and its corresponding first GT, (ii) instructing a line fitting loss layer of the second CNN to generate line fitting loss values by referring to the lane parameters and their corresponding second GTs, and (iii) backpropagating the softmax loss values and the line fitting loss values, to thereby learn parameters of at least part of the first FC layer, the second FC layer and the convolutional layer included in the second CNN.