Machine learning has several essential applications, including classification and recognition. Both people and objects may be identified using the Machine learning technique. It is particularly important in the verification process since it recognizes the characteristics of human eyes, fingerprints, and facial patterns. With the advanced technology developments, nowadays, Facial recognition is used as one of the authentication processes by utilizing machine learning and deep learning algorithms and it has been the subject of several academic studies. These algorithms performed well on faces without masks, but not well on faces with masks. since the masks obscured the preponderance of the facial features. As a result, an improved algorithm for facial identification with and without masks is required. After the Covid-19 breakout, deep learning algorithms were utilized in research to recognize faces wearing masks. Those algorithms, however, were trained on both mask- and mask-free faces. Hence, in this, the cropped region for the faces is only used for facial recognition. Here, the features were extracted using the texture features, and the best-optimized features from the glow worm optimization algorithm are used in this paper. With these features set, the hybrid Dolphin glow worm optimization is used for finding the optimal features and spread function value for the neural network. The regression neural network is trained with the optimized feature set and spread function for the face recognition task. The performance of the suggested method will be compared to that of known approaches such as CNN-GSO and CNN for face recognition with and without masks using accuracy, sensitivity, and specificity will next be examined.