Few-Shot Continual Learning for Activity Recognition in Classroom Surveillance Images

Yilei Qian, Kanglei Geng, Kailong Chen, Shaoxu Cheng, Linfeng Xu, Hongliang Li, Fanman Meng, Qingbo WuarXiv 2024

Abstract

The application of activity recognition in the "AI + Education" field is gaining increasing attention. However, current work mainly focuses on the recognition of activities in manually captured videos and a limited number of activity types, with little attention given to recognizing activities in surveillance images from real classrooms. In real classroom settings, normal teaching activities such as reading account for a large proportion of samples, while rare non-teaching activities such as eating continue to appear. This requires a model that can learn non-teaching activities from few samples without forgetting the normal teaching activities, which necessitates few-shot continual learning (FSCL) capability. To address this gap, we constructed a continual learning dataset focused on classroom surveillance image activity recognition called ARIC (Activity Recognition in Classroom). To overcome challenges like similar activities and imbalanced sample distribution, we designed a few-shot continual learning method that combines supervised contrastive learning (SCL) and an adaptive covariance classifier (ACC). Experimental results demonstrate that our method outperforms other existing methods on the ARIC dataset.

Introduction

While "AI + Education" is a booming field, most activity recognition models are trained on curated, manually captured videos with limited action types. Real-world classroom surveillance presents a much messier reality. Models must navigate extreme class imbalance where common activities like reading happen constantly, while rare ones like eating or using a phone appear infrequently. Furthermore, subtle differences distinguish activities, such as a student looking at a book versus looking at a hidden smartphone. Finally, models must solve the "plasticity-stability" dilemma: learning new activities as they occur in the real world (plasticity) without forgetting the "base" activities they already know (stability).

The ARIC Dataset

The researchers introduced the ARIC (Activity Recognition in Classroom) dataset to provide a realistic benchmark for these challenges. It consists of 36,453 images across 32 classroom activity categories, sourced from three surveillance perspectives (front, middle, rear) in actual classrooms. To protect student privacy, the authors do not release raw images; instead, they provide low-level features extracted from the shallow layers of pre-trained models like ResNet50 or CLIP.

Figure 1: Activity frequency distribution in the ARIC dataset, highlighting the extreme imbalance between common teaching activities and rare non-teaching behaviors.

As shown in the frequency chart, the dataset is heavily long-tailed. Activities like "listening" and "reading" have over 80,000 samples, while "speaking" or "picking up computers" have fewer than 20. This distribution necessitates a few-shot approach for the tail classes.

Methodology

The proposed framework addresses FSCL through a two-stage approach: a base phase focused on robust feature representation and an incremental phase focused on adaptive classification.

1. Base Phase: Feature-Augmented Supervised Contrastive Learning (SCL)

To prepare the model for future classes, the authors use Supervised Contrastive Learning. Unlike standard classification, SCL pulls samples of the same category together and pushes different categories apart in the embedding space. This creates "manifold reservation," leaving room for new classes to be inserted later without overlapping with existing ones.

Figure 5: The proposed framework architecture featuring feature augmentation, a MoCo-style momentum update, and supervised contrastive loss to enhance feature discriminability.

Because the dataset is released as features for privacy, the team developed a novel feature augmentation strategy that simulates spatial transformations (like cropping or rotation) directly in the feature space. This is integrated into a momentum framework to ensure stable and compact clusters.

2. Incremental Phase: Adaptive Covariance Classifier (ACC)

When a few samples of a new activity arrive, standard classifiers often fail because they only look at the "mean" of the new class. The ACC module uses the Mahalanobis distance but introduces an adaptive covariance matrix. By analyzing the variance of new classes, the model dynamically adjusts its decision boundaries, helping it distinguish between a new class and an old class that might look semantically similar.

Key Results

The proposed method was tested against state-of-the-art (SOTA) FSCL methods like FACT, SAVC, and ALICE. In a "20 base + 4 incremental stages" setup, the method achieved a final average accuracy of 55.95%, outperforming the next best method (SAVC) by over 2.5%. Notably, while a standard "Finetune" approach saw accuracy plummet from 51.7% to 1.23% due to catastrophic forgetting, this framework maintained high stability across all incremental steps.

Conclusion

This work demonstrates that high-performance activity recognition is possible even when restricted to privacy-preserving "shallow" features. By combining contrastive learning for structured feature spaces with adaptive classifiers for dynamic boundaries, the model effectively manages the long-tailed nature of real-world classroom data. Future work will explore the integration of the ARIC dataset's other modalities, such as audio and text captions, to further improve recognition accuracy in complex educational environments.

Summary updated

Abstract

The application of activity recognition in the "AI + Education" field is gaining increasing attention. However, current work mainly focuses on the recognition of activities in manually captured videos and a limited number of activity types, with little attention given to recognizing activities in surveillance images from real classrooms. In real classroom settings, normal teaching activities such as reading, account for a large proportion of samples, while rare non-teaching activities such as eating, continue to appear. This requires a model that can learn non-teaching activities from few samples without forgetting the normal teaching activities, which necessitates fewshot continual learning (FSCL) capability. To address this gap, we constructed a continual learning dataset focused on classroom surveillance image activity recognition called ARIC (Activity Recognition in Classroom). The dataset has advantages such as multiple perspectives, a wide variety of activities, and real-world scenarios, but it also presents challenges like similar activities and imbalanced sample distribution. To overcome these challenges, we designed a few-shot continual learning method that combines supervised contrastive learning (SCL) and an adaptive covariance classifier (ACC). During the base phase, we proposed a SCL approach based on feature augmentation to enhance the model's generalization ability. In the incremental phase, we employed an ACC to more accurately describe the distribution of new classes. Experimental results demonstrate that our method outperforms other existing methods on the ARIC dataset.
BibTeX
@misc{qian2024few,
  author = {Yilei Qian and Kanglei Geng and Kailong Chen and Shaoxu Cheng and Linfeng Xu and Hongliang Li and Fanman Meng and Qingbo Wu},
  title = {{Few-Shot Continual Learning for Activity Recognition in Classroom Surveillance Images}},
  year = {2024},
  eprint = {2409.03354},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2409.03354},
}
Figure