This section evaluates the proposed HARM-YOLO11n framework for classroom behavior detection. The experimental evaluation covers dataset descriptions and implementation details, followed by ablation studies, quantitative comparisons, qualitative analysis, and multi-dataset evaluation.
4.1. Datasets and Implementation Details
Experiments are conducted on three publicly available classroom behavior datasets: POCO-Dataset, SCB-Dataset3, and STBD-08. These datasets feature dense classroom layouts, frequent occlusions, and significant object-scale variations, providing representative conditions for real-world classroom behavior detection.
The POCO-Dataset [
37] contains 1903 RGB images with 137,960 annotated instances across ten behavior categories. As illustrated in
Figure 8, a large proportion of annotated objects occupy small-scale regions, making accurate localization challenging under standard detection settings.
The SCB-Dataset3 [
38] consists of 5015 images covering three behavior categories: hand-raising, reading, and writing. It exhibits substantial variations in viewpoint, illumination, and partial occlusion across different classroom environments.
The STBD-08 [
39] dataset contains 8844 images with 267,888 annotated instances across eight behavior categories, including writing, reading, listening, standing, talking, guiding, turning around, and hand-raising. Compared with the other datasets, STBD-08 exhibits higher annotation density and more complex spatial interactions, making it suitable for evaluating dense-scene detection performance.
For dataset partitioning, the POCO-Dataset is randomly divided into training, validation, and testing sets with a ratio of 60%, 20%, and 20%, respectively, following the protocol of the original study. Since SCB-Dataset3 and STBD-08 do not provide official fixed partition files, we generate their training, validation, and testing splits using a fixed random seed. The same partition strategy is applied to all compared methods to ensure fair evaluation.
All experiments are implemented in PyTorch 2.3.0 and conducted on a workstation equipped with an NVIDIA RTX 4090 GPU (24 GB VRAM; NVIDIA Corporation, Santa Clara, CA, USA) and an Intel Xeon Platinum 8352V CPU (Intel Corporation, Santa Clara, CA, USA) under Ubuntu 22.04. CUDA 12.1 and Python 3.12 are used for training and inference.
The proposed HARM-YOLO11n is trained for 300 epochs from scratch using stochastic gradient descent (SGD) with momentum 0.937 and weight decay . Input images are resized to , and the batch size is set to 16. The initial learning rate is set to 0.01 with a three-epoch linear warm-up. Automatic mixed precision (AMP) is enabled, and the random seed is fixed to 0 with deterministic algorithmic operations.
Data augmentation consists of offline and online stages. Offline augmentation applies geometric transformations, photometric adjustments, blur and noise operations, and occlusion simulation to each training image up to four times using randomly selected strategies, yielding a five-fold expansion of the original dataset. Online augmentation is applied during training and includes mosaic augmentation (disabled after epoch 10), random horizontal flipping (), HSV channel perturbations (H = 0.015, S = 0.7, V = 0.4), random translation (), random scaling (), RandAugment, and random erasing ().
The classification loss weights are set to 7.5, 0.5, and 1.5 for bounding box regression, classification, and distribution focal loss (DFL), respectively.
For inference, the confidence threshold is set to 0.25, and non-maximum suppression (NMS) is applied with an IoU threshold of 0.5, a maximum of 300 detections per image, and class-agnostic NMS disabled. The frames per second (FPS) metric is measured on the inference stage only (excluding data preprocessing and postprocessing), with a batch size of 1, 30 warm-up iterations, and the average over 3 repeated runs.
For fair comparison, all baseline methods reported in Tables 5–7 are re-trained under the same experimental protocol, using identical training schedules, input resolution, batch size, optimization strategy, and data augmentation settings. Unless otherwise specified, all reported results are obtained under this unified evaluation protocol.
4.3. Ablation Studies
To systematically evaluate the effectiveness of the proposed components, ablation experiments are conducted on the POCO-Dataset using YOLO11n as the baseline detector. SRFE, the SCAM, PAMSF, and IASW are progressively integrated into the baseline model under identical training and evaluation settings. Quantitative results are reported in
Table 1, while sensitivity analyses are provided in
Table 2 and
Table 3.
Overall results. As shown in
Table 1, all proposed components contribute positively to the final performance. Compared with the baseline YOLO11n, the complete HARM-YOLO11n framework improves mAP1 from 84.4% to 87.5% and mAP2 from 62.3% to 66.5%, corresponding to gains of 3.1 and 4.2 percentage points, respectively. The larger improvement observed under mAP2 indicates that the proposed framework mainly benefits localization-sensitive scenarios involving small-scale and partially occluded targets.
Effect of structural re-parameterized feature enhancement (SRFE). After introducing SRFE, mAP2 increases from 62.3% to 63.3% with only a minor increase in model parameters. Since SRFE combines structural re-parameterization and channel recalibration, the improvement is mainly associated with enhanced feature representation under occlusion and incomplete visual observations. The relatively larger gain under localization-sensitive metrics suggests that SRFE primarily improves structural feature extraction rather than confidence estimation.
Effect of spatial-channel adaptive module (SCAM). The SCAM increases mAP2 from 62.3% to 64.9%, yielding the largest individual gain among the lightweight feature enhancement modules. This result indicates that selective spatial-channel computation effectively suppresses redundant responses in dense classroom scenes. The simultaneous improvement in precision and recall further suggests that the SCAM enhances feature discrimination while preserving useful contextual information.
Effect of position-adaptive multi-scale fusion (PAMSF). PAMSF improves mAP2 from 62.3% to 64.7% and increases recall from 79.7% to 81.3%. Considering the substantial scale variation present in classroom images, the observed improvement is mainly attributed to adaptive cross-scale feature aggregation. The larger gain in recall suggests improved perception of small and distant behavior targets that are difficult to capture using fixed fusion strategies.
Effect of IoU-adaptive soft weight (IASW). When applied independently, IASW produces relatively limited performance variation. However, after integration with SRFE, the SCAM, and PAMSF, the complete framework further improves mAP2 from 66.2% to 66.5%. This observation suggests that IASW primarily acts as an optimization-oriented component rather than a feature representation module. By dynamically adjusting sample contributions according to localization quality, IASW helps to stabilize optimization and refine decision boundaries during later training stages.
Comparison with related loss functions. To further evaluate the effectiveness of IASW, comparative experiments are conducted with representative training-time weighting and supervision strategies, including focal loss (FL) [
34], quality focal loss (QFL) [
35], and varifocal loss (VFL) [
36]. All loss-function variants are implemented under identical architectural settings, where only the classification and localization supervision strategy is replaced while keeping SRFE, the SCAM, and PAMSF unchanged. The model parameters remain 4.4 M for all variants since the loss formulation does not affect inference-time complexity.
Quantitative results are reported in
Table 4. Compared with FL, QFL, and VFL, the proposed IASW achieves the highest mAP and recall across all metrics. Specifically, IASW improves mAP1 by 2.2–2.4 percentage points and mAP2 by 1.0–1.8 percentage points over the compared loss functions. The recall improvement is particularly notable, suggesting that IASW’s localization-aware weighting is more effective in recovering hard positive samples under occlusion and scale variation, where positioning quality varies substantially across anchors.
The performance differences stem from the design choices of each loss function. FL down-weights easy samples via class-prediction confidence, but does not explicitly model localization quality. QFL extends FL by jointly modeling classification and IoU, but uses a fixed weighting scheme that is not adaptive to the batch-wise optimization state. VFL introduces IoU-aware supervision by reweighting positive samples with IoU scores, yet its IoU-weighting is not modulated by batch-level statistics. In contrast, IASW combines localization awareness with dynamic batch-wise thresholding (), enabling it to adjust sample emphasis according to the current training state, which is particularly beneficial when annotation quality varies across batches in dense classroom scenes.
Module coupling analysis. The contributions of the proposed modules are not strictly additive. Summing the individual mAP2 gains of SRFE (+1.0), the SCAM (+2.6), PAMSF (+2.4), and IASW () yields a theoretical improvement of 5.7 percentage points. In contrast, the complete framework achieves an overall gain of 4.2 percentage points. This discrepancy indicates the existence of overlapping feature refinement effects among different modules.
From a functional perspective, SRFE mainly improves representation robustness under occlusion, the SCAM enhances feature selectivity by suppressing redundant responses, PAMSF strengthens multi-scale interaction across pyramid levels, and IASW stabilizes optimization through localization-aware sample weighting. Since these components operate at different stages of the detection pipeline, their effects are complementary rather than fully independent. The observed performance gains therefore arise from coordinated feature refinement and optimization instead of simple accumulation of isolated improvements.
Efficiency analysis. The complete framework increases the parameter count from 2.6 M to 4.4 M (approximately 70% relative to the baseline). As reported in
Table 1, the majority of this growth is attributable to PAMSF, which introduces parallel fusion pathways across feature pyramid levels to handle multi-scale objects in dense classroom scenes; this structural expansion is the primary cost of the observed gains in localization accuracy (mAP2: +2.4 percentage points from PAMSF alone). Importantly, at 4.4 M parameters, HARM-YOLO11n remains substantially more compact than several detectors with comparable or lower accuracy, including YOLOv9s (7.2 M), YOLOv7-tiny (6.0 M), and YOLOv6s (16.3 M), while maintaining 88.1 FPS—well within the real-time regime. The “lightweight” characterization therefore rests on the overall accuracy–efficiency trade-off rather than on parameter count in isolation: the framework achieves the highest mAP1 and mAP2 among all compared methods in
Table 5 at a parameter budget that is lower than most alternatives at similar performance levels, and its inference speed remains sufficient for practical deployment in classroom monitoring scenarios.
Sensitivity analysis. To ensure statistical reliability, the PConv ratio experiments are repeated with three different random seeds (0, 42, and 123), and the results are reported as mean ± standard deviation in
Table 2. The sensitivity results in
Table 2 and
Table 3 indicate stable operating regions for both architectural and optimization hyperparameters. For the SCAM, the channel ratio
provides the best trade-off between detection performance and model complexity, achieving an mAP@0.5 and mAP@[0.5:0.95] comparable to
while reducing parameters by 4.3%, GFLOPs by 4.7%, model size by 3.3%, and latency by 1.7%, with a 2.8% improvement in FPS. For IASW,
achieves the highest overall detection accuracy, indicating that moderate localization-aware weighting is more effective than overly aggressive or overly conservative reweighting. The low standard deviations in
Table 2 further confirm the robustness of the proposed design under different parameter settings.
4.4. Comparison with Representative Detection Models
To evaluate the effectiveness of HARM-YOLO11n, comparative experiments are conducted on the POCO-Dataset under identical training settings. The comparison spans diverse detection paradigms. YOLOv12 [
40] and YOLOv13 [
41] are included as they represent the latest developments in attention-centric and hypergraph-enhanced real-time detection, respectively, offering up-to-date baselines. YOLOv8-Ghost-P2 [
42], although originally designed for medical imaging, is adopted here as a lightweight architectural reference: its Ghost-module-based design and dedicated P2 small-object detection head are potentially beneficial for dense small-target scenarios such as classroom behavior detection. Transformer-based detectors, two-stage detectors, and recent classroom-specific methods are also evaluated for completeness.
As reported in
Table 5, HARM-YOLO11n achieves 87.5% mAP@0.5 and 66.5% mAP@[0.5:0.95], outperforming YOLO11n by 3.1% and 4.2%, respectively. The proposed method also achieves the highest precision (87.7%) and competitive recall (82.4%) among lightweight detectors while maintaining 88.1 FPS inference speed.
Compared with transformer-based and two-stage detectors, HARM-YOLO11n shows a more favorable balance between accuracy and efficiency. Although some YOLO variants achieve higher inference speed, their performance under stricter localization metrics is lower.
Compared with YOLO11n, the increase in computational cost (2.6 M to 4.4 M parameters) is accompanied by consistent improvements in both detection accuracy and recall, indicating an improved accuracy–efficiency trade-off under the evaluated settings.
Table 5.
Comparison with representative detection models on the POCO-Dataset. Note: mAP1 denotes mAP@0.5, while mAP2 denotes mAP@[0.5:0.95].
Table 5.
Comparison with representative detection models on the POCO-Dataset. Note: mAP1 denotes mAP@0.5, while mAP2 denotes mAP@[0.5:0.95].
| Models | P/% | R/% | mAP1 | mAP2 | Params | FPS |
|---|
| YOLOv13n [41] | 87.1 | 79.0 | 85.1 | 63.7 | 2.5 M | 43.4 |
| YOLOv12n [40] | 83.7 | 79.1 | 83.7 | 62.1 | 2.5 M | 60.3 |
| YOLOv11n [15] | 84.1 | 79.7 | 84.4 | 62.3 | 2.6 M | 112.5 |
| YOLOv10n [43] | 82.6 | 79.1 | 83.6 | 61.9 | 2.3 M | 95.7 |
| YOLOv9s [44] | 87.5 | 80.9 | 86.2 | 66.2 | 7.2 M | 46.9 |
| YOLOv8n [14] | 85.1 | 78.3 | 84.1 | 62.2 | 3.0 M | 148.1 |
| YOLOv7-tiny [45] | 86.1 | 82.2 | 82.8 | 54.9 | 6.0 M | 243.9 |
| YOLOv6s [46] | 87.6 | 81.1 | 86.3 | 65.7 | 16.3 M | 104.9 |
| YOLOv5n [13] | 84.1 | 78.1 | 83.5 | 61.0 | 2.5 M | 129.7 |
| RT-DETR [47] | 76.0 | 76.7 | 80.0 | 53.9 | 31.6 M | 24.6 |
| Faster R-CNN [21] | 74.9 | 54.7 | 56.5 | 27.2 | 137.1 M | 11.7 |
| YOLOv8-Ghost-P2 [42] | 85.8 | 81.7 | 86.6 | 63.8 | 1.6 M | 95.9 |
| Wang et al. [23] (2023) | 83.3 | 79.4 | 84.2 | 61.2 | 2.6 M | 102.1 |
| Tang et al. [22] (2022) | 84.9 | 77.2 | 83.6 | 61.1 | 2.4 M | 111.8 |
| SmartLite-YOLO [30] | 84.2 | 75.7 | 82.3 | 60.9 | 1.6 M | 138.7 |
| YOLOv8n_BT [31] | 87.4 | 81.8 | 87.1 | 65.9 | 3.0 M | 148.3 |
| YOLO-CBR [32] | 85.1 | 83.5 | 86.9 | 65.4 | 3.0 M | 87.1 |
| HARM-YOLO11n (Ours) | 87.7 | 82.4 | 87.5 | 66.5 | 4.4 M | 88.1 |
Figure 9 presents confusion matrices on the POCO-Dataset. HARM-YOLO11n reduces inter-class confusion in visually similar categories such as
raise-hand and
play-phone, indicating improved discriminative capability in dense classroom scenes.
Comparison with classroom-specific methods. Among classroom-specific detectors, YOLOv8n_BT and YOLO-CBR are the most competitive baselines. YOLOv8n_BT [
31] achieves 87.1% mAP1 and 65.9% mAP2 through bi-level routing attention, yet its design remains focused on architectural enhancement alone. YOLO-CBR [
32] attains 86.9% mAP1 and 65.4% mAP2 using dual-stage routing attention on YOLOv11n, but does not address optimization-level coupling. HARM-YOLO11n surpasses both by 0.4–0.6 percentage points in mAP1 and 0.6–1.1 percentage points in mAP2, while also achieving higher recall. SmartLite-YOLO [
30] maintains the smallest parameter count (1.6 M) but yields the lowest mAP2 (60.9%) among classroom-specific methods, suggesting that aggressive lightweight design may compromise localization quality. Tang et al. [
22] and Wang et al. [
23] similarly lag in mAP2 (61.1% and 61.2%), as they rely solely on attention-enhanced detection without jointly optimizing feature fusion and training objectives. The consistent margin over these methods—particularly under the stricter mAP2 metric—suggests that the unified treatment of representation, fusion, and optimization in HARM-YOLO11n provides complementary benefits beyond single-dimension improvements.
Overall, the results show consistent improvements over representative methods while maintaining real-time performance constraints.