## 3 Methods
### Facial Expression Recognition
After each stimulus application, the system evaluated whether the engagement improved (reward = 1), and it updated the posterior using the Beta-Bernoulli model. The reward updates were

* Visual (at \(t=20\,\)s): \(\alpha^{\prime}_{V}=2\), \(\beta^{\prime}_{V}=1\)
* Auditory (at \(t=30\,\)s): \(\alpha^{\prime}_{A}=2\), \(\beta^{\prime}_{A}=1\)
* Textual (at \(t=40\,\)s): \(\alpha^{\prime}_{T}=2\), \(\beta^{\prime}_{T}=1\)

The posterior mean reward for each cue was calculated as \(\hat{\theta}_{V}=\hat{\theta}_{A}=\hat{\theta}_{T}=\frac{2}{2+1}=0.6667\). Applying the Upper Confidence Bound (UCB) rule, \(UCB_{i}=\hat{\theta}_{i}+\sqrt{\frac{\alpha_{0}+\beta_{0}}{\alpha^{\prime}_{i }+\beta^{\prime}_{i}}}\), we had \(UCB_{V}=UCB_{A}=UCB_{T}=0.6667+\sqrt{\frac{2}{3}}\approx 1.483\). Since all the stimuli achieved the same UCB score, a predefined heuristic (e.g., selecting the most recently successful stimulus) would determine the next action if necessary. Child 2 (ADHD)

Child 2, diagnosed with ADHD, showed sharp concentration dips and more reactive emotional responses. From \[\hat{\theta}_{i}=\frac{\alpha_{i}^{\prime}}{\alpha_{i}^{\prime}+\beta_{i}^{ \prime}}\rightarrow\mu_{i}, \tag{2}\]9

* At \(t=10\,\)s, EEG concentration dropped, triggering a textual cue. * At \(t=20\,\)s, a negative emotion (sadness) was detected, prompting a visual cue. * From \(t=30\,\)s onward, EEG concentration and emotional state improved, and no further stimuli were needed. Assuming both visual and textual cues were effective (reward = 1), we updated their Beta parameters as
* Textual: \(\alpha^{\prime}_{T}=2\), \(\beta^{\prime}_{T}=1\);
* Visual: \(\alpha^{\prime}_{V}=2\), \(\beta^{\prime}_{V}=1\);
* Auditory: unused \(\Rightarrow\alpha^{\prime}_{A}=1\), \(\beta^{\prime}_{A}=1\). Posterior means: \(\hat{\theta}_{T}=\hat{\theta}_{V}=\frac{2}{3}=0.6667\), and \(\hat{\theta}_{A}=\frac{1}{2}=0.5\). UCB values: \(UCB_{T}=UCB_{V}=0.6667+\sqrt{2/3}\approx 1.483\), \(UCB_{A}=0.5+\sqrt{2/2}=1.5\). Although auditory cue had a higher UCB (due to fewer trials and greater uncertainty), the system favored proven stimuli unless high uncertainty justified exploration. As visual feedback successfully stabilized engagement at \(t=20\,\)s, the system maintained it as the best cue for further use. This validates the convergence behavior of BIFL, where effective cues gain higher confidence and become the preferred stimuli. Table 1 presents the short-term evaluation for both children and game adaptation using BIFL. #### 5.3.2 Group-Level Stimulus Distribution Analysis

While the previous case studies demonstrate individual responses to BIFL-driven stimulus adaptation, we also analyzed the stimulus distribution across the full cohort. Visual feedback emerged as the most frequently reinforced modality, selected in 62.5% of the sessions--especially during moments of low concentration. Auditory stimuli were dominant in 22.5% of the sessions, often triggered when signs of emotional disengagement were detected. Multimodal cues (combining visual and auditory feedback) accounted for the remaining 15%, typically used to maintain engagement during complex or socially oriented tasks. This distribution underscores the importance of personalized stimulus adaptation, as BIFL dynamically selects cues that align with each child's engagement profile in real time. #### 5.3.3 Overall Evaluation of BIFL with 40 Children

Figure 10 summarizes the impact of BIFL-driven adaptation over four weeks of interaction with 40 neurodivergent children. The results reveal notable improvements in concentration, emotional engagement, and game performance. Among the 25 children with ADHD, auditory-based stimuli (e.g., verbal hints and feedback) were particularly effective, leading to a 25.3% increase in concentration and a 22.3% boost in emotional engagement. Tasks involving memory and reasoning showed the highest concentration gains (30% and 28%, respectively). For the 15 children with ASD, visual and structured multimodal cues yielded the best outcomes.