Abstract
YOLO-based detectors typically use multiscale fusion to localize and classify student behavior in classroom images, but complex backgrounds and similar postures can obscure local behavioral cues. This paper proposes SAR-YOLO, an improved YOLO11n model that combines adaptive information selection with multiscale feature fusion to jointly represent local behavioral details and context. To reduce interference from the background and nearby students, a simple, parameter-free attention module (SimAM) recalibrates feature responses to emphasize behavioral cues. Adaptively spatial feature fusion (ASFF) combines spatial detail and semantic information through spatially varying scale weights to account for variation in student scale. A selective-receptive entropy adapter (SREA) uses channel-level receptive field selection to combine the posture and context cues needed to recognize reading and writing. Normalized selection entropy characterizes how weights are distributed across scales and receptive fields. Distributional comparisons and weight interventions help assess each information source’s contribution to detection. On the SCB5-A test set, SAR-YOLO improves mean average precision over YOLO11n by 1.63 percentage points for mAP50 and 2.31 points for mAP50–95. AP50–95 improves noticeably for all three classes. These results show that combining information selection with multiscale fusion improves behavior discrimination and provides an effective detection method for classroom scenes.
1. Introduction
Student behavior reflects teaching activities and teacher–student interactions. The occurrence and distribution of behaviors such as hand-raising, reading, and writing can support analyses of classroom participation and documentation of the teaching process. Traditional classroom observation relies mainly on in-person monitoring or video review after class. Reviewing large volumes of classroom footage is time-consuming, and these approaches make it difficult to continuously record the behavior of multiple students. As classroom video acquisition has improved, automatic student localization and behavior recognition using computer vision have become a focus of research in classroom visual analysis [1,2]. Improving detection accuracy and efficiency in complex classrooms can support these applications.
Deep learning-based object detection is widely used for classroom behavior recognition. Faster Region-Based Convolutional Neural Network (Faster R-CNN) generates region proposals before classification and localization [3], whereas single-stage methods such as You Only Look Once (YOLO) [4] and Single Shot MultiBox Detector (SSD) [5] directly predict classes and locations. Because classroom images usually contain multiple students, many studies modify single-stage detectors to model posture details, multiscale features, and contextual relationships.
Guo et al. [6] proposed SCB-YOLO, which uses global edge information transfer and feature fusion to strengthen the representation of classroom behaviors. To distinguish similar behavioral postures, Zhang [7] combined context-position attention, adaptively spatial feature fusion (ASFF), and a class-aware loss in SBR-YOLO. Yu et al. used attention to fuse high-resolution features in EduYOLO to preserve behavioral details [8]. Cheng et al. designed SmartLite-YOLO for lightweight classroom behavior detection, seeking to balance model size and recognition performance [9]. Similar approaches to information enhancement and multiscale feature fusion have been used for detection in other complex scenes [10,11]. These studies focus mainly on posture and attention modeling, multiscale feature fusion, and lightweight design to address background interference, scale variation, and similar postures in classrooms.
YOLO11 uses a single-stage framework with modified feature extraction and fusion structures to balance detection accuracy and computational efficiency. YOLO11n is one of the smaller configurations in this family; its low parameter count facilitates training and deployment [12]. The C3k2 and C2PSA modules in its backbone, together with multiscale fusion in its neck, provide a foundation for classroom student behavior detection. In classroom scenes, the baseline can be improved in the following respects.
- (1)
- Limited selection of behavior-relevant features in complex backgrounds. The feature extractor processes desks, textbooks, and neighboring students together with the target. Occlusion can also partially obscure arm and head cues. General-purpose feature extractors represent both targets and backgrounds. Irrelevant information can therefore interfere with the local responses used for behavior discrimination, affecting subsequent localization and classification.
- (2)
- Cross-scale fusion lacks explicit weights that vary across spatial positions. Camera viewpoints and student positions produce differences in object scale. High-resolution features emphasize spatial detail, whereas low-resolution features contain more semantic information. YOLO11n uses upsampling, concatenation, and convolution for fusion. However, the relative need for information from each scale varies by position. Scale selection can therefore balance the contributions of detail and semantics.
- (3)
- Limited joint representation of local posture and context for similar behaviors. Reading and writing may both involve a lowered head and a forward-leaning upper body, so a single local posture cue may not distinguish them. Occlusion can also limit information around the arms and desk surface. The model therefore needs a way to combine local details with information from the surrounding region for each feature channel while keeping model size in check.
These limitations interact. Background interference can weaken local behavioral cues, and inadequate coordination of detail and semantics across scales can make similar behaviors harder to distinguish. From an information-processing perspective, additional feature extraction must be accompanied by selection of behavior-relevant information. This selection concerns feature responses, source scales, and receptive field extents.
SAR-YOLO extends the YOLO11n baseline for classroom student behavior detection by incorporating adaptive information selection for behavior discrimination into multiscale feature extraction and fusion. A simple, parameter-free attention module (SimAM) recalibrates neck feature responses to emphasize behavior-relevant information [13]. ASFF performs spatially adaptive fusion before the detection head to balance local details and high-level semantics, improving feature representations for students at different scales [14]. Inspired by the selective kernel mechanism, the selective-receptive entropy adapter (SREA) is a lightweight, dual-branch residual module in the P4 path. It uses channel-level receptive field selection to combine local posture and contextual information for distinguishing similar behaviors [15]. We adapt these modules to the YOLO11n feature processing path to distinguish student behaviors in classroom scenes. Using Shannon entropy [16], we define two measures of normalized selection entropy to characterize how weights are distributed across source scales and receptive field branches, respectively. We compare these distributions and test the effect of fixing the weights to examine how weight allocation relates to detection performance. We evaluate the architecture through model comparisons, ablations of module configurations, module substitutions, and controlled comparisons of design choices. SAR-YOLO combines feature response recalibration, spatially adaptive scale fusion, and receptive field selection in a single detector that balances detection accuracy and model size. The weight analysis provides a quantitative account of information selection within the model.
2. YOLO11n
YOLO11 is an object detection model family developed by Ultralytics, with a decoupled detection head and an anchor-free design. YOLO11n is a lightweight configuration for detecting multiple objects with limited computational resources [12]. This study uses YOLO11n as the baseline, with hand-raising, reading, and writing as the detection classes. Figure 1 shows its network architecture.
Figure 1.
Network architecture of YOLO11n.
In the backbone, strided convolutions progressively downsample features, C3k2 extracts features, and spatial pyramid pooling–fast (SPPF) aggregates information from different receptive fields. C2PSA models feature relationships within a subset of channels. The neck uses top-down and bottom-up paths to fuse features from different levels through upsampling, concatenation, downsampling, and C3k2. This bidirectional interaction is similar to semantic information transfer in feature pyramid networks (FPNs) [17] and path aggregation networks (PANets) [18].
The detection head performs classification and bounding box regression at three scales: P3, P4, and P5. For a 640 × 640 input, the feature maps measure 80 × 80, 40 × 40, and 20 × 20, with 64, 128, and 256 channels, respectively. Training uses task-aligned sample assignment [19]. The classification branch uses binary cross-entropy loss, and bounding box regression combines complete intersection over union (CIoU) [20] with distribution focal loss [21]. The proposed method retains the detection task and three-scale outputs while modifying information selection and fusion in the neck.
3. SAR-YOLO
The architecture of SAR-YOLO is shown in Figure 2. In classroom images, students overlap with desks and neighboring students, object scale varies with distance from the camera, and reading and writing can involve similar head-down postures. SAR-YOLO combines information selection and multiscale feature fusion through three modifications to the YOLO11n neck and the layers before the detection head. SimAM adjusts convolutional feature responses. SREA combines features from two receptive fields on the P4 path, and ASFF fuses the P3, P4, and P5 features.
Figure 2.
Network architecture of SAR-YOLO. S, A, and R denote SimAM, ASFF, and SREA, respectively.
SimAM is incorporated at the second convolution in the Bottleneck blocks of the C3k2 modules at neck layers 16, 19, and 22. SREA is placed after the P4 output of layer 19. Its output is used in both the P4 detection path and the subsequent generation of P5 features. ASFF is placed before the detection head and generates fused features for each of the three detection scales. Layer numbers follow the zero-based indexing of the YOLO11n configuration. In Figure 2, P4* denotes the SREA output, which serves as the P4 input to ASFF throughout this section. The number of detection scales, task definition, and detection loss remain unchanged.
3.1. Feature Recalibration with SimAM
Arms, desks, and neighboring students often appear within the same detection region in classroom images. SimAM [13] is introduced into the neck to recalibrate convolutional feature responses. Squeeze-and-excitation (SE) [22] uses learnable channel weights, and the convolutional block attention module (CBAM) [23] combines channel and spatial attention. SimAM instead computes three-dimensional weights from statistical differences among spatial positions within each channel, without adding trainable parameters. In Equation (1), x and denote the input and recalibrated feature maps for a single channel, each with spatial dimensions H × W. The spatial mean of the channel is μ, and its variance v is the sum of squared deviations from μ divided by HW − 1. Here, σ is the sigmoid function, λ = 10−4, and ⊙ denotes elementwise multiplication. Statistics are computed separately for each channel, and recalibration is applied at each spatial position.
Figure 3 shows the placement of SimAM. SimAM is placed after the second convolution and before batch normalization (BN) in the Bottleneck blocks of the C3k2 modules at neck layers 16, 19, and 22. The subsequent sigmoid linear unit (SiLU) activation and original residual connections are retained.
Figure 3.
Placement of SimAM inside the Bottleneck blocks in the neck. Statistics are computed over spatial positions within each channel.
3.2. Spatial Scale Selection and Fusion with ASFF
Concatenation and addition can convey information across scales, but the relative importance of detail and semantic information varies with spatial position. ASFF [14] aligns P3, P4, and P5 features to each target scale and learns the relative fusion weights of these source scales at each spatial position. In Equation (2), l denotes the target output scale, and s indexes the three sources. In the implementation, source indices 1, 2, and 3 correspond to P5, P4, and P3, respectively. Xs→l denotes the features from source s aligned to scale l, αl,s is the corresponding spatial weight map, and Yl is the fused output. Both sums run over the three sources. The operator ⊙ denotes elementwise multiplication with weights broadcast across channels. The weights sum to 1 at each spatial position.
Figure 4 shows the scale alignment and fusion paths. Features from each scale are aligned through channel projection, upsampling, or downsampling. A 1 × 1 mapping produces three score maps, and softmax across sources converts these scores to spatial weights. The weights at each position are shared across channels. The weighted features are then processed by a 3 × 3 convolutional block. The projection layers are adapted to the channel counts of YOLO11n, while ASFF retains a separate output for each of the three scales. The convolutional blocks used for feature transformation include BN and LeakyReLU. The final projection that produces the selection scores uses neither. For the P3 output, features from P4 and P5 are upsampled by factors of 2 and 4, respectively, using nearest-neighbor interpolation. Alignment to lower-resolution scales uses strided convolutions and pooling, where required, to match the spatial dimensions.
Figure 4.
Three-scale feature alignment and spatially adaptive fusion in ASFF. Pyramid levels P5, P4, and P3 correspond to source indices s = 1, 2, and 3. Z denotes the weighted features before the output convolution.
ASFF distributes fusion weights across source scales at each spatial position and supplies the resulting features to the detection head. Higher-resolution branches help preserve posture details in classroom images, while lower-resolution branches provide semantic information. Adaptive weighting allows different positions to use different scale combinations. The three independent outputs correspond to the three scales of the YOLO11n detection head.
3.3. Channel-Level Receptive Field Selection with SREA
Reading and writing often involve similar head-down postures. Features around the arms and desk surface may help distinguish these behaviors, but these regions are also subject to occlusion. Inspired by the selective kernel mechanism [15], SREA uses two 3 × 3 depthwise convolution branches on the P4 path. Their dilation rates are 1 and 2, respectively. Dilated convolution expands the receptive field without changing the number of sampling points [24]. Depthwise convolution controls the parameter count and computational cost [25]. With X as the input, Equation (3) defines the two branch outputs, F1 and F2.
The two branch outputs are summed and processed by global average pooling (GAP). A 1 × 1 convolution reduces the channel count. After rectified linear unit (ReLU) activation, a second 1 × 1 convolution expands the channel count to produce the selection scores. With 128 channels in P4, the intermediate representation contains 8 channels. The 256 output scores are reshaped into two branches of 128 channels each. Softmax along the branch dimension generates weights w1 and w2. In Equation (4), the branch weights are broadcast across spatial positions. The weighted branch combination is scaled by a trainable scalar γ, initialized to 0, and added to the input.
As shown in Figure 5, SREA generates selection weights from globally aggregated features of the current input. The two branch weights form a selection distribution for each channel and are shared across all spatial positions within that channel. Receptive field selection therefore operates at the channel level. For the 128-channel P4 features, SREA adds 5633 trainable parameters, combining local detail and context at low cost.
Figure 5.
Dual-branch receptive-field selection and residual output in SREA. GAP denotes global average pooling, and the branch weights are shared across spatial positions within each channel.
3.4. Information-Theoretic Characterization of Selection Distributions
ASFF and SREA use softmax weight distributions to coordinate different information sources. ASFF weights three source scales at each spatial position, whereas SREA weights two receptive field branches in each feature channel. Let z denote the selection scores for K sources. For each source s, the softmax weight is . These weights are nonnegative and sum to 1. The source index s runs from 1 to K. In ASFF, it indexes P5, P4, and P3 in that order (K = 3). In SREA, it indexes the two receptive field branches (K = 2). Both modules use standard softmax with τ = 1.
For fixed selection scores and a positive temperature τ, the softmax weight distribution has the equivalent entropy-regularized formulation in Equation (5) [26].
In Equation (5), ΔK denotes the probability simplex for K components, and q is a probability vector in that simplex. H(q) is the Shannon entropy computed with natural logarithms, with the convention that 0 ln 0 = 0. The temperature τ is positive. Constrained differentiation of the objective gives an optimal solution whose components are proportional to exp(zs/τ). Normalization gives the standard softmax form. This established equivalence interprets weight allocation in terms of score preferences and the entropy of the weight distribution. The resulting scale and receptive field selection distributions are analyzed quantitatively on this basis. The equivalence applies to weight allocation for fixed selection scores. Training retains the original detection loss. The selection entropy defined below is used only to analyze the model’s internal behavior after training.
The concentration of these selection distributions is quantified using two normalized measures based on Shannon entropy [16]. The normalized scale selection entropy of ASFF at output scale l and position (i, j) is given in Equation (6).
The normalized receptive field selection entropy of SREA for channel c is given in Equation (7). Here, w1,c and w2,c are the two branch weights for channel c. Both entropy measures are defined for an individual image, and the image index is omitted.
Both normalized entropies range from 0 to 1. Lower values indicate more concentrated weights, while higher values indicate a more balanced allocation across sources. For each image, SREA entropy is averaged over channels. ASFF entropy is averaged over valid spatial positions separately for each output scale. These image-level means are then averaged with equal weights within the validation and test sets separately. The three ASFF output scales are reported separately. ASFF statistics include only the valid image region and exclude padding. These entropies measure only how evenly the internal weights are distributed across sources. They do not measure image grayscale entropy or uncertainty in class predictions.
We use the equally weighted Jensen–Shannon divergence [27] to distinguish concentration within an individual weight distribution from variation in distributions across samples. Let p1, …, pn denote a set of K-dimensional source weight distributions and their mean. Equation (8) defines the normalized Jensen–Shannon divergence used in the analyses below. It uses the unnormalized entropy H from Equation (5) and divides the divergence by ln K.
For SREA, we compute the divergence across images for each channel and then average over channels. This distinguishes persistent channel preferences from variation across inputs. For ASFF, we compute the spatial divergence among valid positions within each image and the divergence across the spatially averaged distributions of individual images. These quantities describe how the allocation of source weights varies with the input.
With the network parameters held fixed, we replace the learned selection weights of SREA or ASFF at inference with either training-set means or uniform weights. For SREA, we compute the training-set mean separately for each channel. For ASFF, we first average over valid positions within each image and then give each training image equal weight, computing the mean separately for each output scale. The uniform weights are 1/2 for each SREA branch and 1/3 for each ASFF source scale. Each intervention replaces the weights of one module type and leaves all other computations unchanged. We evaluate each intervention under the same settings on the validation and test sets to assess how strongly detection depends on the learned allocation. Entropy serves only as a descriptive measure in this analysis.
4. Experimental Results and Discussion
4.1. Experimental Environment and Settings
Baseline and SAR-YOLO training and common forward-pass timing were performed on an NVIDIA GeForce RTX 4090 GPU with 24 GB of memory. The training server ran Ubuntu 22.04.4 LTS, Python 3.12.3, PyTorch 2.5.1, and CUDA 12.4, with Ultralytics 8.4.37 as the object detection framework. The baseline and ablation configurations used the same software versions and training settings. Table 1 lists the complete configuration.
Table 1.
Environment for baseline and SAR-YOLO training.
For SAR-YOLO and the ablation models, shared layers were initialized with YOLO11n weights pretrained on Common Objects in Context (COCO) [28]. Newly added layers were initialized according to their module implementations. Training used AdamW [29] with an initial learning rate of 0.001429, exponential decay rates of 0.9 and 0.999 for the first and second moment estimates, respectively, and weight decay of 0.0005. The learning rate decayed linearly to 0.01 times its initial value, with warmup during the first 3 epochs. The input size was 640 × 640, and the batch size was 8. Automatic mixed precision was enabled. SAR-YOLO and all ablation configurations completed 100 training epochs without early stopping. The baseline and SAR-YOLO used the same detection loss. The weights for bounding box regression, classification, and distribution focal loss were 7.5, 0.5, and 1.5, respectively. Table 2 lists the main training parameters.
Table 2.
Shared training settings for the baseline, SAR-YOLO, and ablations.
All methods used the same image lists, training budget, and data augmentation settings. For each model, we selected the checkpoint with the highest validation mAP50–95 reported by the training framework. The selected checkpoints were then evaluated on the test set using the same offline procedure. The external methods retained the detection architectures and loss functions in their authors’ implementations. EduYOLO and SmartLite-YOLO used compatible COCO-pretrained weights for approximately 27.77% and 63.16% of their parameter elements, respectively. The comparisons therefore measure performance under the shared training budget. They do not establish the best performance achievable by tuning each method separately. The main tables report results for models trained with random seed 0.
4.2. Dataset
The experiments used a three-class subset of the public SCB data resource [1], covering hand-raising, reading, and writing. In this study, SCB5-A denotes the cleaned version of this subset. After the images and annotations were checked, 6851 images with 45,792 annotated objects were retained. An approximately 8:1:1 split yielded 5480 training images, 685 validation images, and 686 test images, with 36,662, 4577, and 4553 annotations, respectively. Using filename associations and near-duplicate checks, we formed 144 constraint groups and assigned each group to a single split, so that no group spans multiple splits. The validation set was used for checkpoint selection and the test set for the final comparisons.
Images were resized with their aspect ratios preserved and padded to 640 × 640. Training augmentation included color perturbation, random translation, scaling, horizontal flipping, and Mosaic. Mosaic was disabled for the final 10 epochs. No random augmentation was applied during validation or testing. Figure 6 presents classroom images and their behavior annotations. Identifiable faces and school information were masked in the display copies of all images. Model inference used the original images.
Figure 6.
Classroom images and behavior annotations from SCB5-A. Privacy masking is applied only to display copies. Red, blue, and green boxes denote hand-raising, reading, and writing, respectively. Gray circles mark faces masked for privacy in the classroom images.
4.3. Evaluation Metrics
Performance was evaluated using mean average precision (mAP50–95 and mAP50), precision (P), recall (R), parameter count, computational cost (GFLOPs), forward-pass latency, and throughput in frames per second (FPS). The primary accuracy metric was mAP50–95.
- (1)
- Average precision (AP and mAP). AP is the area under the precision–recall curve, and mAP is the mean AP across the three classes, as defined in Equations (9) and (10), respectively. The IoU threshold for mAP50 is 0.5. The primary accuracy metric, mAP50–95, averages mAP over ten IoU thresholds from 0.50 to 0.95 in increments of 0.05. For the reported AP values, the COCO evaluation protocol was used [28]. Predictions with confidence scores of at least 0.001 were retained for AP evaluation, with a maximum of 300 detections per image. Models using non-maximum suppression (NMS) had an NMS IoU threshold of 0.7. YOLO26n retained its native NMS-free outputs.Here, C is the number of detection classes, set to 3 in this study. All predictions were mapped to the original image coordinates before evaluation. All models used the same annotation lists and evaluation settings.
- (2)
- Precision and recall. Precision is the proportion of predictions that are correct, and recall is the proportion of annotated objects detected. Both are calculated using Equation (11), where TP, FP, and FN denote the numbers of true positives, false positives, and false negatives, respectively. Micro-averaging was used with a confidence threshold of 0.25 and a matching IoU threshold of 0.5. Counts were pooled across all classes and images.
- (3)
- Parameter count and computational cost. Model size is measured by the number of parameters in millions (M). For a 640 × 640 input, floating-point operations were counted as twice the number of multiply–accumulate operations (MACs) and reported in billions (GFLOPs). Some elementwise operations implemented as functions were excluded. GFLOPs measure theoretical computational cost. Latency on a device also depends on the implementation and hardware.
- (4)
- Forward-pass latency and throughput. All models were timed on the same NVIDIA GeForce RTX 4090 GPU model as used for training, with two CPU threads. All measurements used 32-bit floating-point precision (FP32), a batch size of 1, and 640 × 640 inputs. Each model was warmed up and timed in a separate process, with convolution and batch normalization left unfused. Timing was performed in two rounds, with the model order reversed in the second round. Each round began with 50 warmup iterations, followed by five sets of 200 forward passes timed with CUDA events. Mean latency was calculated over the 2000 forward passes across both rounds. Throughput was calculated as 1000 divided by the mean forward-pass time in milliseconds. Timing included the model forward pass and detection head decoding but excluded image loading, preprocessing, and external NMS.
4.4. Training Performance
Figure 7 compares the native validation curves of SAR-YOLO and the YOLO11n baseline on the same dataset under identical training conditions. SAR-YOLO generally achieved higher mAP50–95, mAP50, precision, and recall during the middle and later epochs and converged to a higher, relatively stable performance plateau. Over epochs 91–100, mean mAP50–95 was 46.195% for YOLO11n and 47.745% for SAR-YOLO, a difference of 1.550 percentage points. The corresponding mean mAP50 values were 62.992% and 64.585%. These values are the native validation metrics from the training logs, whereas the intervention results in Section 4.7 uses the offline COCO evaluation procedure.
Figure 7.
Native validation metrics over 100 epochs. Raw epoch values are shown without smoothing.
The two curves still crossed and fluctuated locally during the middle of training. The reason is that the modifications do not simply stack modules; they adjust the information pathway at feature responses, source scales, and receptive fields simultaneously, making feature learning and gradient optimization more complex. SimAM recalibrates responses according to neuron energy, changing their distribution as it suppresses background interference. ASFF learns spatially adaptive fusion weights for three scales. These input-dependent weights continually adjust the combination of cross-scale features during training. SREA uses global context to generate its two branch weights, so the balance of local detail and surrounding context varies across samples. The validation curves leveled off in the later epochs.
Classroom images contain occlusion, posture variation, and scale differences, so these fluctuations are a normal part of feature reconstruction. Importantly, SAR-YOLO remained stable in the later stages and reached a higher plateau on all four metrics, indicating that the observed fluctuations mainly reflect more complex feature reconstruction and richer cross-scale interaction rather than training instability. These results show that the adaptive information selection and multiscale fusion structure achieves better detection performance on this dataset.
4.5. Detection Results and Model Comparison
SAR-YOLO was compared with YOLOv8n, YOLO11n, YOLO26n [30], and two classroom behavior detectors, EduYOLO [8] and SmartLite-YOLO [9]. We used the authors’ publicly available implementations of the two classroom detectors. EduYOLO uses a higher-capacity feature fusion architecture, whereas SmartLite-YOLO is designed for lightweight detection. All models used the same data split and training budget and were evaluated under a unified protocol. Table 3 reports overall detection performance, computational cost, model size, and forward-pass latency. Table 4 reports AP50–95 for each behavior class.
Table 3.
Detection performance, computational cost, and forward latency.
Table 4.
Classwise AP50–95 on the test set.
As shown in Table 3, SAR-YOLO achieved a test mAP50–95 of 47.78%, outperforming the lightweight comparison models and exceeding YOLO11n by 2.31 percentage points. Both precision and recall improved. SAR-YOLO thus detected more objects and improved the combined quality of classification and localization. EduYOLO achieved a higher mAP50–95 (48.79%) with 21.23 M parameters and 94.06 GFLOPs. SAR-YOLO achieved its result with 3.97 M parameters and 8.61 GFLOPs, reductions of 81.31% and 90.85%, respectively, making it more practical when computational resources are limited. SmartLite-YOLO reduced the parameter count to 1.60 M, with a lower mAP50–95 of 42.77%.
Under the common timing protocol, SAR-YOLO had a mean forward-pass latency of 8.01 ms, corresponding to 124.88 FPS; its latency was 41.34% lower than that of EduYOLO. Compared with YOLO11n, latency increased from 5.65 to 8.01 ms, but the detector still maintained a high forward-pass throughput, leaving headroom for subsequent classroom behavior analysis. Taken together, the accuracy, model size, and speed results show a good balance between detection performance and computational cost.
SAR-YOLO improved AP50–95 over YOLO11n by 2.83, 2.35, and 1.74 percentage points for hand-raising, reading, and writing, respectively (Table 4). The largest gain was for hand-raising. Recognizing hand-raising depends on the spatial relationship between the arm and the body. Distinguishing reading from writing often requires cues from the arms, books, and surrounding desk area. Feature recalibration and the combination of features across scales and receptive fields allow these cues to be represented together. Individual models had different strengths across classes, while SAR-YOLO improved on the baseline for all three behaviors.
Figure 8 shows the precision–recall curves for each class and their equally weighted mean at different confidence thresholds, illustrating the trade-off between detection and false positives. Together with Table 3 and Table 4, these results show that SAR-YOLO improves both object detection and the combined quality of behavior classification and localization relative to the baseline. The curves are consistent with the results in Table 3 and Table 4 at most operating points, and they maintain a good balance between detection and false positives as recall increases, providing more complete detections for classroom behavior statistics.
Figure 8.
Classwise precision–recall curves and their mean on the test set at IoU = 0.50, with 101-point interpolation and maxDets = 300.
Figure 9 shows detection results on two test images, with the same confidence threshold and crop regions for all models. Closely spaced students, similar postures, and partial occlusion make both body contours and details around the arms and desk surface important for behavior discrimination. The full images and shared crops illustrate differences in bounding box placement and class predictions, complementing the aggregate metrics. Missed detections in crowded regions show that occlusion continues to obscure information needed for detection.
Figure 9.
Detection examples on two fixed test images. All models use confidence 0.25; dashed rectangles indicate shared annotation-centered crops.
We used gradient-weighted class activation mapping (Grad-CAM) [31] to compare how P4 features contributed to the class score for the same target in YOLO11n and SAR-YOLO (Figure 10). For each image, we selected the largest annotated object correctly detected by both models and used corresponding layers and a shared normalization scale. In both models, responses were concentrated on the target and its surroundings, indicating that behavior discrimination relies on both local posture and surrounding context. These patterns are consistent with SimAM feature recalibration, ASFF multiscale feature fusion, and SREA receptive field selection. They provide a qualitative interpretation of the detection results in Table 3 and Table 4.
Figure 10.
Class-targeted Grad-CAM at the neck P4 output. The same jointly detected target and pairwise normalization are used for both models. White boxes on the heatmaps mark the ground-truth target.
4.6. Ablation Experiments
The individual and combined contributions of SimAM, ASFF, and SREA were examined using eight YOLO11n-based configurations under the same data and training conditions. Table 5 reports the baseline, three single-module variants, three two-module variants, and the complete model. Each configuration was trained separately, and its best checkpoint was selected. S, A, and R denote SimAM, ASFF, and SREA, respectively. The modules act on feature responses, source scales, and receptive field combinations, respectively. The ablations examine how these stages of information processing work together.
Table 5.
Ablation results for eight separately trained configurations.
Among the single-module variants, ASFF increased test mAP50–95 to 46.90%, indicating that adjusting the contributions of source scales by spatial position helps coordinate posture details and semantic information. SimAM and SREA alone achieved 44.99% and 45.03%, respectively, close to the baseline value of 45.48%. These results indicate that the two modules need to work with other stages, such as scale fusion, to form effective representations at the detection head.
The combination results show that different modules change the feature distribution and optimization path, so the combined gain is not necessarily additive. SA reached 46.38%, below the 46.90% achieved by ASFF alone. AR reached 46.67%. SR reached 47.32%, exceeding SimAM alone by 2.33 percentage points and SREA alone by 2.29 points. SAR-YOLO achieved the highest test mAP50–95 among the eight module combinations at 47.78%, exceeding AR, SR, and SA by 1.12, 0.47, and 1.40 percentage points, respectively. The three modifications worked best together, and each module’s contribution should be interpreted within the configuration in which it was tested.
SimAM recalibrates neck feature responses, and SREA combines receptive fields along P4 and the subsequent feature path. ASFF then weights the source scales before the detection head. The complete configuration can therefore use local behavioral details together with context from multiple levels and achieved the highest test mAP50–95 in these ablations. We next compare lightweight alternatives and examine the SREA design.
Starting from SAR-YOLO, we varied one factor at a time to examine lightweight attention, the fusion method, and the SREA settings (Table 6). We tested efficient channel attention (ECA) [32] at the SimAM position and, separately, after the second convolutional block. To test the need for spatially adaptive fusion, we replaced it with learned global scalar weights shared across positions. All configurations used the same data and training budget. Both validation and test results are reported.
Table 6.
Lightweight replacements and SREA design controls relative to SAR-YOLO.
Test mAP50–95 was 47.23% for ECA after the Conv2 block, 47.02% for ECA at the SimAM position, and 47.35% for global scalar fusion. All three values were below the 47.78% of SAR-YOLO, supporting the use of SimAM recalibration at its designated position and spatially adaptive ASFF in this architecture. SREA placement had a larger effect. Test mAP50–95 was 47.78% at P4 and 47.34% at P3, falling to 44.52% at P5. P4 gave the highest test mAP50–95 among the three placements. P4 balances spatial resolution and semantic representation and is the adapted position for the receptive-field combination in this work.
With dilation rates of (1, 3), mAP50–95 reached 45.39% on the validation set and 48.06% on the test set, slightly above the original configuration (45.00% and 47.78%, respectively). A hidden width of 16 gave a small gain on the validation set and a small decrease on the test set while adding 3072 parameters. The chosen design uses P4, dilation rates of (1, 2), and a hidden width of 8 to keep the module lightweight. Other settings achieved higher accuracy in some comparisons. The modest gain from wider dilation warrants further study.
4.7. Selection Distributions and Detection Performance
Table 7 and Figure 11 compare unmodified SAR-YOLO with four fixed-weight interventions to examine how weight allocation relates to detection performance. All changes are relative to a local evaluation of the unmodified checkpoint under the same inference settings. We replaced only the selection weights with training-set means or uniform weights. The means preserve the learned average preference across sources, while uniform weights remove that preference, thereby distinguishing the roles of long-term preference and image-to-image variation in detection.
Table 7.
Inference-only selection-weight interventions using a frozen SAR checkpoint.
Figure 11.
Changes in validation and test mAP50–95 after replacing selection weights. All changes are relative to the locally evaluated original SAR.
Replacing SREA weights with their channel-specific training-set means left mAP50–95 nearly unchanged. The changes on the validation and test sets were −0.003 and +0.024 percentage points, respectively. Uniform weights reduced mAP50–95 by 1.204 and 0.464 percentage points, respectively. These results indicate that learned channel-specific branch preferences account for most of the observed effect, with little contribution from image-to-image weight variation. Different channels combine local and surrounding features in different proportions, providing complementary cues for similar postures. Fixing the weights at their channel means preserves this specialization, the branch convolutions, and the residual path, yielding performance close to that of the original model.
Detection was more sensitive to changes in ASFF weights. Fixing the weights at their training-set means reduced validation and test mAP50–95 by 0.614 and 0.839 percentage points, respectively. Uniform weights reduced the same metrics by 4.721 and 5.404 percentage points. Compared with shared or uniform weights, the learned scale allocation more effectively combines spatial detail and semantic features before the detection head. Because fixing the weights at their means removes variation both across positions and across images, this result reflects the overall role of the learned scale allocation.
The test-set distribution statistics in Figure 12 help explain the intervention results. SREA had a mean normalized receptive field selection entropy of 0.708 and a mean within-channel divergence across images of 0.016. These values indicate relatively stable channel preferences, consistent with the small change in accuracy when the channel means were fixed. Mean normalized scale selection entropy at each ASFF output scale (P3, P4, and P5) was higher than for SREA, indicating a more even mixture of source scales. The spatial divergence terms for P3, P4, and P5 were 0.022, 0.043, and 0.062, respectively, each higher than the corresponding image-mean term (0.001, 0.004, and 0.002). Weight allocation therefore varied mainly across positions within images, with less variation in the mean allocation from image to image. This spatial pattern is consistent with the position-specific scale weighting in ASFF. Normalized entropy measures how concentrated the weights are, while divergence indicates in which dimension their allocation varies; the two provide complementary perspectives.
Figure 12.
Normalized selection entropy and Jensen–Shannon decomposition on the test set. Spatial and image-mean variation are reported separately for ASFF.
Figure 13 shows the ASFF source weights at the P4 output for two classroom images. P4 was the main source at most positions, with P3 and P5 contributing in localized regions. The entropy maps show that the concentration of the weights varied by position. ASFF thus combines information from different levels in spatially varying proportions, consistent with its position-specific scale weighting.
Figure 13.
Source weights and normalized selection entropy at the ASFF P4 output. Padding is removed; source order follows the implementation: P5, P4, P3.
Selection entropy measures the concentration of the weights, but it is not a direct measure of detection quality. We assessed detection quality separately for each image using F1, the harmonic mean of its precision and recall (F1 = 2PR/(P + R)). Spearman correlations between mean SREA entropy per image and the change in F1 relative to the baseline were −0.050 on the validation set and 0.023 on the test set. The corresponding 95% bootstrap confidence intervals, calculated from 1000 resamples of image groups within each split, were [−0.138, 0.081] and [−0.053, 0.137]. Both intervals included zero, providing no evidence of a monotonic relationship between entropy and per-image performance gains. Entropy characterizes concentration, Jensen–Shannon divergence measures variation in allocation, and the interventions test whether detection depends on the learned weights. Taken together, the results show that the learned ASFF scale allocation contributes to detection, while SREA mainly reflects stable channel-level branch preferences. Selection entropy and divergence quantify these two forms of information selection. The results do not support consistently increasing or decreasing entropy as an optimization objective. We therefore retain the original detection loss without adding an entropy loss.
5. Conclusions
SAR-YOLO extends YOLO11n with adaptive information selection and multiscale feature fusion to address background interference, scale variation, and similar postures in classroom student behavior detection. Feature response recalibration, spatial scale fusion, and channel-level receptive field combinations improve behavior representations. We also examined how the model distributes weights across sources and how these weights affect detection. The main conclusions are as follows.
- (1)
- SAR-YOLO combines SimAM feature recalibration in the neck, spatially adaptive scale fusion with ASFF, and channel-level receptive field selection with SREA, which selects between two receptive-field branches; together, the three modifications form an information selection and fusion structure for behavior discrimination. On the SCB5-A test set, mAP50 and mAP50–95 reached 65.25% and 47.78%, exceeding YOLO11n by 1.63 and 2.31 percentage points, respectively. AP50–95 increased by 2.83, 2.35, and 1.74 percentage points for hand-raising, reading, and writing, respectively. SAR-YOLO achieved the highest test mAP50–95 among the eight combinations of SimAM, ASFF, and SREA. The model has 3.97 M parameters, requires 8.61 GFLOPs, and has a mean forward-pass latency of 8.01 ms (124.88 FPS) on the RTX 4090. It thus strikes a good balance between detection accuracy and lightweight design.
- (2)
- Under the same data split and evaluation protocol, SAR-YOLO was compared with YOLOv8n, YOLO11n, YOLO26n, EduYOLO, and SmartLite-YOLO. Its mAP50–95 of 47.78% exceeded that of the four lightweight comparison models. YOLO26n achieved 64.90% recall, and SAR-YOLO exceeded it by 4.83 percentage points. The recall advantage is relevant to classroom behavior statistics, where reducing missed detections is a priority. EduYOLO achieved a higher mAP50–95 (48.79%) with 21.23 M parameters and 94.06 GFLOPs. SAR-YOLO reached 47.78% with 3.97 M parameters and 8.61 GFLOPs, reductions of 81.31% and 90.85%, respectively, relative to EduYOLO. Its forward-pass latency was 41.34% lower. SmartLite-YOLO achieved a smaller model size with a lower mAP50–95 of 42.77%. These comparisons show that SAR-YOLO offers a practical trade-off between detection accuracy and computational cost for classroom scenes.
- (3)
- Selection entropy, divergence, and weight interventions characterize different aspects of how the model allocates information. Detection with ASFF depends on the learned combination of source scales, while SREA primarily reflects stable branch preferences across channels. Selection entropy and divergence provide quantitative descriptions of both patterns. Together, the analyses show how the model coordinates information across scales at each spatial position and across receptive fields within each feature channel. They provide a quantitative view of how information is used for classroom behavior detection.
- (4)
- SAR-YOLO achieved high detection accuracy with a compact model and a fast forward pass. It could be deployed on classroom-side edge devices to analyze video streams from classroom cameras in real time. Such a deployment could support participation statistics, documentation of the teaching process, and analysis of teaching behavior in smart classrooms.
Author Contributions
Y.L.: conceptualization, supervision, writing—review and editing; Y.Y. (Yubo Yao): methodology, software, investigation, validation, formal analysis, data curation, visualization, writing—original draft preparation, writing—review and editing; Y.Y. (Yicheng Yin): Data curation. All authors have read and agreed to the published version of the manuscript.
Funding
This research was funded by the Undergraduate Innovation Training Program of China University of Mining and Technology (Beijing), grant number 202614001.
Institutional Review Board Statement
Not applicable. This study is a secondary analysis of the publicly available SCB dataset; no new data involving human participants were collected.
Informed Consent Statement
Not applicable. This study used only the publicly available SCB dataset; no participants were recruited.
Data Availability Statement
The SCB data resource is described in reference [1], with access information at https://github.com/Whiffe/SCB-dataset (accessed on 15 October 2026). This study used the SCB5-A subset. The main experimental results supporting the conclusions are presented in this article.
Conflicts of Interest
The authors declare no conflicts of interest.
References
- Yang, F. SCB-Dataset: A Dataset for Detecting Student and Teacher Classroom Behavior. arXiv 2023, arXiv:2304.02488. [Google Scholar]
- Sheng, X.; Li, S.; Chan, S. Real-time classroom student behavior detection based on improved YOLOv8s. Sci. Rep. 2025, 15, 14470. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Ren, S.; He, K.; Girshick, R.; Sun, J. Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks. In Proceedings of the Advances in Neural Information Processing Systems 28, Montreal, QC, Canada, 7–12 December 2015. [Google Scholar]
- Redmon, J.; Divvala, S.; Girshick, R.; Farhadi, A. You Only Look Once: Unified, Real-Time Object Detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition; IEEE: New York, NY, USA, 2016; pp. 779–788. [Google Scholar]
- Liu, W.; Anguelov, D.; Erhan, D.; Szegedy, C.; Reed, S.; Fu, C.-Y.; Berg, A.C. SSD: Single Shot MultiBox Detector. In Computer Vision—ECCV 2016; Lecture Notes in Computer Science; Springer: Cham, Switzerland, 2016; Volume 9905, pp. 21–37. [Google Scholar]
- Guo, C.; Yuan, B.; Xie, J.; Xie, L.; Li, H.; Tian, J.; Zhai, T.; Wang, Y.; Guo, J. SCB-YOLO: A lightweight adaptive attention-enhanced network for student behavior detection in complex classroom settings. Sci. Rep. 2026, 16, 13309. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Zhang, Y. SBR-YOLO: Context-position attention and adaptive feature fusion for student behavior recognition. Front. Comput. Neurosci. 2026, 20, 1804422. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Yu, J.; Li, S.; Liu, H.; Liu, Q.; Tan, C.; Cheng, Z.; Wu, J. EduYOLO: A classroom behavior recognition framework based on high-resolution feature attention fusion. Expert Syst. Appl. 2026, 311, 131370. [Google Scholar] [CrossRef] [Scilit]
- Cheng, F.; Zhang, H.; Zhang, T. SmartLite-YOLO: A smart classroom lightweight YOLO for student behavior recognition. J. Electron. Imaging 2025, 34, 053034. [Google Scholar] [CrossRef] [Scilit]
- Liu, Y.; Liu, Y.; Xue, R.; Zhao, Z.; Xiao, J. SIRI-YOLO: A Foreign Object Detection Method for Belt Conveyors in High-Entropy Underground Scenes. Entropy 2026, 28, 673. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Li, X.; Liu, Y. A Fusion of Entropy-Enhanced Image Processing and Improved YOLOv8 for Smoke Recognition in Mine Fires. Entropy 2025, 27, 791. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Ultralytics. Ultralytics YOLO11. Available online: https://docs.ultralytics.com/models/yolo11/ (accessed on 15 October 2026).
- Yang, L.; Zhang, R.-Y.; Li, L.; Xie, X. SimAM: A Simple, Parameter-Free Attention Module for Convolutional Neural Networks. Proc. Mach. Learn. Res. 2021, 139, 11863–11874. [Google Scholar]
- Liu, S.; Huang, D.; Wang, Y. Learning Spatial Fusion for Single-Shot Object Detection. arXiv 2019, arXiv:1911.09516. [Google Scholar]
- Li, X.; Wang, W.; Hu, X.; Yang, J. Selective Kernel Networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition; IEEE: New York, NY, USA, 2019; pp. 510–519. [Google Scholar]
- Shannon, C.E. A Mathematical Theory of Communication. Bell Syst. Tech. J. 1948, 27, 379–423, 623–656. [Google Scholar]
- Lin, T.-Y.; Dollár, P.; Girshick, R.; He, K.; Hariharan, B.; Belongie, S. Feature Pyramid Networks for Object Detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition; IEEE: New York, NY, USA, 2017; pp. 2117–2125. [Google Scholar]
- Liu, S.; Qi, L.; Qin, H.; Shi, J.; Jia, J. Path Aggregation Network for Instance Segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition; IEEE: New York, NY, USA, 2018; pp. 8759–8768. [Google Scholar]
- Feng, C.; Zhong, Y.; Gao, Y.; Scott, M.R.; Huang, W. TOOD: Task-Aligned One-Stage Object Detection. In Proceedings of the IEEE/CVF International Conference on Computer Vision; IEEE: New York, NY, USA, 2021; pp. 3510–3519. [Google Scholar]
- Zheng, Z.; Wang, P.; Liu, W.; Li, J.; Ye, R.; Ren, D. Distance-IoU Loss: Faster and Better Learning for Bounding Box Regression. Proc. AAAI Conf. Artif. Intell. 2020, 34, 12993–13000. [Google Scholar] [CrossRef] [Scilit]
- Li, X.; Wang, W.; Wu, L.; Chen, S.; Hu, X.; Li, J.; Tang, J.; Yang, J. Generalized Focal Loss: Learning Qualified and Distributed Bounding Boxes for Dense Object Detection. Adv. Neural Inf. Process. Syst. 2020, 33, 21002–21012. [Google Scholar]
- Hu, J.; Shen, L.; Sun, G. Squeeze-and-Excitation Networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition; IEEE: New York, NY, USA, 2018; pp. 7132–7141. [Google Scholar]
- Woo, S.; Park, J.; Lee, J.-Y.; Kweon, I.S. CBAM: Convolutional Block Attention Module. In Computer Vision—ECCV 2018; Lecture Notes in Computer Science; Springer: Cham, Switzerland, 2018; Volume 11211, pp. 3–19. [Google Scholar]
- Yu, F.; Koltun, V. Multi-Scale Context Aggregation by Dilated Convolutions. In Proceedings of the International Conference on Learning Representations, San Juan, Puerto Rico, USA, 2–4 May 2016. [Google Scholar]
- Sandler, M.; Howard, A.; Zhu, M.; Zhmoginov, A.; Chen, L.-C. MobileNetV2: Inverted Residuals and Linear Bottlenecks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition; IEEE: New York, NY, USA, 2018; pp. 4510–4520. [Google Scholar]
- Gao, B.; Pavel, L. On the Properties of the Softmax Function with Application in Game Theory and Reinforcement Learning. arXiv 2017, arXiv:1704.00805. [Google Scholar]
- Lin, J. Divergence Measures Based on the Shannon Entropy. IEEE Trans. Inf. Theory 1991, 37, 145–151. [Google Scholar] [CrossRef] [Scilit]
- Lin, T.-Y.; Maire, M.; Belongie, S.; Hays, J.; Perona, P.; Ramanan, D.; Dollár, P.; Zitnick, C.L. Microsoft COCO: Common Objects in Context. In Computer Vision—ECCV 2014; Lecture Notes in Computer Science; Springer: Cham, Switzerland, 2014; Volume 8693, pp. 740–755. [Google Scholar]
- Loshchilov, I.; Hutter, F. Decoupled Weight Decay Regularization. In Proceedings of the International Conference on Learning Representations, New Orleans, LA, USA, 6–9 May 2019. [Google Scholar]
- Ultralytics. Ultralytics YOLO26. Available online: https://docs.ultralytics.com/models/yolo26/ (accessed on 15 October 2026).
- Selvaraju, R.R.; Cogswell, M.; Das, A.; Vedantam, R.; Parikh, D.; Batra, D. Grad-CAM: Visual Explanations from Deep Networks via Gradient-Based Localization. In Proceedings of the IEEE International Conference on Computer Vision; IEEE: New York, NY, USA, 2017; pp. 618–626. [Google Scholar]
- Wang, Q.; Wu, B.; Zhu, P.; Li, P.; Zuo, W.; Hu, Q. ECA-Net: Efficient Channel Attention for Deep Convolutional Neural Networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition; IEEE: New York, NY, USA, 2020; pp. 11534–11542. [Google Scholar]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.












