Autism Spectrum Disorder (ASD) is a developmental condition resulting from abnormalities in brain structure and function, which can manifest as communication and social interaction difficulties. Conventional methods for diagnosing ASD may not be effective in the early stages of the disorder. Hence, early diagnosis is crucial to improving the patient's overall health and well-being. One alternative and effective method for early autism diagnosis is facial expression recognition since autistic children typically exhibit distinct facial expressions that can aid in distinguishing them from other children. This paper provides a deep convolutional neural network (DCNN)-based real-time emotion recognition system for autistic kids. The proposed system is designed to identify six facial emotions, including surprise, delight, sadness, fear, joy, and natural, and to assist medical professionals and families in recognizing facial expressions in autistic children for early diagnosis and intervention. In this study, an attention-based YOLOv8 (AutYOLO-ATT) algorithm for facial expression recognition is proposed, which enhances the YOLOv8 model's performance by integrating an attention mechanism. The proposed method (AutYOLO-ATT) outperforms all other classifiers in all metrics, achieving a precision of 93.97%, recall of 97.5%, F1-score of 92.99%, and accuracy of 97.2%. These results highlight the potential of the proposed method for real-world applications, particularly in fields where high accuracy is essential.