Engagement is the state of alertness that a person experiences and the deliberate focus of their attention on a task-relevant stimulus. It positively correlates with many aspects such as learning, social support, and acceptance. Facial emotion recognition using artificial intelligence can be beneficial to automatically measure individual engagement especially when using automated learning and playing modalities such as using Robots. In this study, we proposed an automatic engagement detection model through facial emotional recognition, particularly in determining autistic children's engagement. The methodology employed a transfer learning approach at the dataset level, utilizing facial image datasets from typically developing (TD) children and children with ASD. The classification task was performed using convolutional neural network (CNN) methods. Comparative analysis revealed that the CNN method demonstrated superior accuracy compared to random forest (RF), support vector machine (SVM), and decision tree algorithms in both the TD and ASD datasets. The findings highlight the potential of CNN-based facial emotion recognition for accurately assessing engagement in children with ASD, with implications for enhancing learning, social support, and acceptance in this population. This research contributes to the field of engagement measurement in autism and underscores the importance of leveraging AI techniques for improving understanding and support for children with ASD.