Face recognition is one of the important elements that can be used for securing the facilities, emotion recognition, sentiment exploration, fraud analysis, and traffic pattern analysis. Intelligent face recognition has yielded excellent accuracy in a controlled environment whereas vice versa in an uncontrolled environment. However, conventional methods can no longer satisfy the demand at present due to their low recognition accuracy and restrictions on many occasions. This study proposed an optimal deep learning-based face recognition system that improves the security of the model developed in the IoT cloud environment. Initially, the dataset of images was gathered from the public repository. The captured images are explored using image processing techniques like image preprocessing employing the Gaussian filter technique for removing the noise and smoothing the image. The histogram of oriented gradients (HOGs) is used for the image segmentation. The processed images are preserved at the cloud service layer. Extract features were linked to facial activities using the spatial-temporal interest point (STIP). On the other hand, the extracted feature vectors are investigated using galactic swarm optimization (GSO) techniques that give optimized feature vectors. The necessary features are selected using the gray level co-occurrence matrix (GLCM), which separates the statistical texture features. The GSO output is fed into the deep convolutional neural network (DCNN) that effectively trains the captured face images. This will allow the effectiveness of the GSO-CNN technique to be assessed in terms of recognition accuracy, recall, precision, and error rate.