Classroom Engagement MobileNetV2

A lightweight MobileNetV2 classifier trained to estimate classroom engagement from cropped person bounding boxes.

Classes

Index Label Description
0 0_oriented Student facing the instructor/board
1 1_diverted Student turned away or looking elsewhere
2 2_obscured Student occluded or not clearly visible

Architecture

  • Backbone: MobileNetV2 (ImageNet pre-trained, features frozen)
  • Classifier head: nn.Linear(1280, 3)
  • Loss: Weighted CrossEntropyLoss to handle class imbalance
  • Optimizer: Adam (lr=0.001)
  • Input size: 224 x 224 RGB, ImageNet-normalized

Training

Trained on ~200 manually annotated person crops extracted from classroom lecture videos using YOLOv8-nano detection. Strict video-level train/val/test split to prevent data leakage.

Usage

import torch
from torchvision import models, transforms

model = models.mobilenet_v2(weights=None)
model.classifier[1] = torch.nn.Linear(1280, 3)
model.load_state_dict(torch.load("best_baseline.pth", map_location="cpu"))
model.eval()
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Space using ummanmm/classroom-engagement-mobilenet 1