In this study, we present the improved artificial neural network based on cosine similarity in facial emotion recognition. We apply a shifting window that employs a neural network for two concurrent processes consisting of face detection and emotional recognition. To prevent the slow and futile computations, non-face areas need to be filtered from neurons on each network layer, thus we propose the improved artificial neural network based on cosine similarity. Cosine similarity is employed to bypass the process of non-face areas in the neural network. The accuracy of the proposed method reaches 0.84, while the accuracy of the original neural network method reaches 0.74. It can be concluded that our methods work accurately. It can be concluded that our method works accurately. The proposed method is superior to the state-of-theart algorithms