## 3 Methods
### Facial Expression Recognition
This level of accuracy demonstrates the effectiveness of our approach in integrating multiple feature representations, allowing for robust classification even in dynamic, spontaneous scenarios. Figure 9 presents representative real-time samples of emotion classification during Child-Game Interactions, integrating facial expression recognition with EEG-based brain activity analysis. The left side of each panel shows the detected facial expression and the model's confidence level, while the right side illustrates the corresponding EEG signals and their decomposition across the five canonical frequency bands: \(\delta\) (delta), \(\theta\) (theta), \(\alpha\) (alpha), \(\beta\) (beta), and \(\gamma\) (gamma). In the top panel, the system identifies a happy facial expression with high confidence (99%). The associated EEG activity reveals elevated power in the \(\alpha\) and \(\beta\) bands, particularly \(\beta\), which is commonly linked to focused attention and cognitive engagement. This pattern suggests an emotionally positive and concentrated mental state during the task. In contrast, the bottom panel shows a neutral expression with 90% confidence. The EEG signals display dominant \(\delta\) and \(\theta\) activity with comparatively lower \(\alpha\) and \(\beta\) band powers. Such a pattern is typically associated with a resting or low-attention state, indicating reduced cognitive engagement at that moment. This figure illustrates the system's ability to interpret multimodal signals in real time, effectively mapping emotional and attentional states based on both facial and neurophysiological cues. ### Experimental Results on Game Adaptation: BIFL

The following subsections present representative examples of short-term interactions involving two neurodivergent children playing a memory game where engagement levels and emotional responses were dynamically adjusted. #### 5.3.1 Short-Term Individual BIFL Experiment Example

The memory game consists of a grid of face-down cards in which players attempt to match pairs by flipping two cards at a time. Cognitive engagement is monitored using EEG signals, while emotional responses are tracked through facial expression analysis. Stimuli adjustments are triggered adaptively, including the following:

* Visual cues (highlighting matching cards);
* Auditory cues (verbal hints);
* Textual cues (written hints). Every 10 s, concentration levels and facial expressions are assessed. If concentration decreases by more than 10% or if negative emotions persist then a stimulus is triggered. The BIFL framework continuously adapts by learning which stimulus best enhances user engagement. \[\hat{\theta}_{i}=\frac{\alpha_{i}^{\prime}}{\alpha_{i}^{\prime}+\beta_{i}^{ \prime}}\rightarrow\mu_{i}, \tag{2}\]8 Real-time facial expression recognition during CGI tasks, alongside corresponding EEG-based brain activity. These examples illustrate on-the-fly emotion and concentration classification, with our models achieving an average accuracy of 89% across the collected samples. Top row: Detected happy facial expression with elevated beta activity, indicating a concentrated and engaged cognitive state. Bottom row: Detected neutral expression with dominant delta/theta bands, reflecting a low concentration or resting state. Child 1 (ASD)

To illustrate the application of BIFL, we present a detailed computation for a child diagnosed with ASD during a short-term evaluation in a memory task game. This child exhibited moderate concentration fluctuations and emotional variability. Table 1 summarizes the recorded engagement parameters:

* At \(t=20\,\)s, EEG concentration dropped by 15%, leading to a **visual cue** trigger. * anger, prompting an auditory cue. * At \(t=40\,\)s, concentration dropped again, triggering a textual cue. * By \(t=50\,\)s, engagement stabilized. We began with a uniform Beta prior for each stimulus: \(\theta_{i}\sim\text{Beta}(\alpha_{0}=1,\beta_{0}=1)\).