01 / 05 · 2019.07 — 2020.07
Beijing Yunshangzuo Technology Co., Ltd.
Applied algorithms and full-stack work in AI × education: real-time classroom-behaviour analysis and alerts with Mask R-CNN + ResNet, an internal labelling and training platform, the stats backend of an online-class monitoring system, face verification and screenshot-recognition services.
- Role
- Software Engineer
- Industry
- AI × education
- Location
- Beijing
- Team
- 5 people
- Tenure
- 1 yr 1 mo
Key results
6 classes
Classroom behaviours (heads up, head down, standing, slumped, turned away, hand raised); confidence below 0.95 is "uncertain", never forced
21 routes
Stats-engine backend for online-class monitoring (~1,650 lines of Tornado) on Elasticsearch aggregations
10,000+
Screenshots I labelled myself for the WeChat-screenshot recogniser (plus 1,000+ icons)
Projects here
PROJECTS · 42019 – 2020 · Full-stack engineer (algorithms, backend, internal training platform) · Team 5
AI classroom behaviour analysis system
Classroom cameras recognise student behaviour (heads up, head down, hand raised, slumped on desk, turned away), face recognition maps it to individual students, and the system offers live alerts and multi-level class reports. I built two subsystems: a school-facing real-time analysis and alert platform, and an internal data-labelling and model-training platform.
- Two-stage recognition: Mask R-CNN (R-101-FPN) finds students, ResNet18 classifies behaviour into 6 classes (confidence below 0.95 becomes "uncertain") — more accurate than one detector doing both, and changing the behaviour set only means retraining the small classifier
- Real-time analysis: OpenCV reads the RTSP stream and drops frames whenever the video timestamp lags wall-clock time; one GPU process per class, with an nvidia-smi free-memory check before launch
- Tracking and identity: wrote my own tracker using bidirectional overlap over a 5-second window; face_recognition (dlib) 128-d features are matched to the class face gallery, and the most frequent ID within a track wins — so identity survives head-down and side-face frames
- Live alerts for slumping / turning away: the student's face crop (base64) goes into the alert; latest results and per-frame history are stored separately in MongoDB
- Tornado backend: accounts with three roles, alerts and reports at four levels (student, class, grade, school), a WeChat mini-program API and an open API for third-party platforms; designed API field protocols against the product manager's prototype
- Analysed behaviour data with scikit-learn and produced weekly, monthly and term reports per student, pushed to parents' WeChat mini program
- Internal labelling and training platform: video trimming → Mask R-CNN pre-labelling (labelme JSON) → human correction → cropping → dataset building → ResNet18 training (resumable, loss/accuracy curves) → validation; the whole-lesson offline analysis was the prototype of the real-time algorithm
- Delivery: compiled the core tracking algorithm to .so with Cython, ran under supervisor and used a licence dongle, deployed on-premise at several customers
- Python
- Tornado
- PyTorch
- maskrcnn-benchmark
- face_recognition (dlib)
- OpenCV
- FFmpeg
- MongoDB
- scikit-learn
- Cython
- ECharts
- jQuery
Live demos
Real-time platform: class monitoring overview Principal's dashboard Multi-class live feeds
System architecture
2020 · Stats-engine backend, admin frontend, part of the algorithm analysis
AI diagnostic online-class monitoring system
For online English classes (lessons moved online because of the pandemic): teacher and student audio/video are captured live and structured by ASR / CV / VAD. Red-line behaviours (speaking Chinese, the teacher talking too long, too little student participation, leaving the camera, black screen or drop-out) trigger near-real-time alerts, and teaching-quality reports are compared and ranked by headquarters/branch/campus, course, teacher and student.
- Stats-engine backend (Tornado, ~1,650 lines, 21 routes): lists, details and history trends for classes, teachers and students, teaching-attitude time series, model-class TopN
- Elasticsearch queries: bool + terms + range, nested avg sub-aggregations under terms (per-class teacher happiness probability, word count, speech rate), scan/scroll for large result sets; CV and ASR results merged and sorted in the application layer
- Admin frontend (vue-element-admin 4.4): role-based dynamic route permissions, data dashboard, class/teacher/student lists and details, rankings, trends, filters; ECharts visualisation, Docker and multi-environment config
- Part of the algorithm analysis: combined speaking share, fluency and positive emotion to find ~30-second "highlight" clips, flagging noise, courseware audio interference and parent presence, for the progress report sent to parents
- Python
- Tornado
- Elasticsearch
- Redis
- Vue 2
- Element UI
- ECharts
- MQTT
- Docker
- Alibaba Cloud
System architecture
2020 · Algorithm and service development
FaceID face verification and search
Face verification for an online-education customer: confirm from class video that the person on camera is the registered student, with full-gallery, incremental and per-person face search to catch one person with several accounts or several people sharing one.
- Inference flow: random frame sampling → YuFaceDetectNet detection with 5 landmarks → affine alignment → occlusion / pose-blur / age models filter → ResNet18 features compared by cosine similarity; the youngest face (< 17 years) is taken as the student, excluding parents
- Mixed-framework inference: PyTorch for detection and features, MXNet Gluon for occlusion, pose and age, all on CPU; iterated from v1.0 to v3.4 (dlib 68-point + Laplacian blur check → new models and alignment → three quality models → rewritten full-gallery search and video validation)
- Features live in Redis with global, incremental and per-person search; a full pairwise pass is estimated at about 40 million comparisons per the code comments
- Commercial licence control: call counts, expiry and daily quota are AES-encrypted in Redis, SETNX gives a distributed lock, and the device SN is verified; the core module ships as a Cython-built .so
- Config is read in the order command line > environment variables > JSON/YAML; Docker deployment pulls model weights from OSS at build time
- Python
- PyTorch
- MXNet
- dlib
- ResNet18
- Redis
- Cython
- Docker
- OSS
System architecture
2020 · Training, inference, service and deployment
WeChat screenshot recognition (Moments ad-delivery checks)
Automatic recognition of uploaded WeChat screenshots to verify Moments ad delivery: classify the screen type (chat / feed list / post detail) and extract the post time, ad copy, poster ID, QR-code link and like/comment counts.
- YOLOv5s as the main detector (7 UI-element classes) with rules to decide the screen type; labelled 10,000+ screenshots and 1,000+ like/comment icons myself, with k-means anchor boxes
- Post detail: PaddleOCR (PP-OCR, DB detection + CRNN recognition) reads post time, ad copy and poster ID by layout position; QR decoding; the bottom-right is cropped, like/comment icons are detected with YOLOv5 and the digits read by a 3-layer CNN
- Tornado + PyTorch + PaddlePaddle service: token and MD5 integrity checks, nanoid request tracing, originals in OSS, every result and latency written to Elasticsearch for debugging production errors
- Upgraded the PP-OCR model release, improving poster-ID and post-time recognition
- Python
- PyTorch
- YOLOv5
- PaddleOCR
- PaddlePaddle
- Tornado
- Elasticsearch
- OSS
- Docker
System architecture
System data flow
Abstract sketch · no internal detailsClassroom camera
Live RTSP stream
OpenCV reader
Drops frames when late
Mask R-CNN detection
Locate students · conf ≥ 0.7
▲ My part
ResNet18 behaviour
6 classes · slump / turn → alert
▲ My part
Face ID + tracking
128-d features · in-track vote
▲ My part
MongoDB → Tornado
Live alerts · reports · mini program
What I learned here
After graduating I joined an AI × education company and, away from campus, learned and used more languages on the job. I implemented object detection and classification (Mask R-CNN, ResNet) with PyTorch inside the business logic; web services ran on Tornado and the company frontend moved from HTML / JS / CSS to Vue, which broadened my computer-science base.
Classroom-behaviour analysis taught me to split a problem: detect people first, then classify behaviour, and put unsure cases in their own bucket instead of forcing a verdict; cross-frame tracking and in-track voting make up for weak single frames, and frame dropping keeps the system real-time. It was also my first systematic taste of delivery engineering — Cython to protect algorithm source, supervisor for process management, on-premise deployment at several customers, and Elasticsearch aggregation queries for the online-class monitor.
TECH STACK
- Python
- PyTorch
- Mask R-CNN
- ResNet
- YOLOv5
- MXNet
- PaddleOCR
- dlib
- Tornado
- Elasticsearch
- MongoDB
- Redis
- Cython
- Vue 2
- Docker