DEV Community

Guangyi Zhao
Guangyi Zhao

Posted on Edited on

Emotion-Guard explained in Eng

What if you could see whether kindergarten kids are happy? Meet Emotion-Guard: an open-source classroom emotion monitor. It reads children's and teachers' facial emotions — happy, calm, sad, angry — into a live dashboard, and raises early warnings so staff can do a caring check-in before a situation escalates.

Why build it? One teacher watches twenty or thirty kids. A child sliding into sustained distress, or a teacher's own stress spike, is easy to miss — and once something blows up, it's too late. Emotion-Guard turns reading the room into a pipeline that never looks away, helping kindergartens prevent mistreatment and violent incidents.

Four steps. One, detect: OpenCV's Haar cascade finds faces in classroom frames — detector.py, mock in the demo. Two, classify: the EmotionClassifier interface scores each face into four emotions — classifier.py, a seeded mock labeled SIMULATED. Three, aggregate: ClassroomSession builds per-person and classroom mood summaries — classroom.py. Four, alert: the AlertEngine fires on three rules — sustained negative mood, teacher anger spike, sudden mood swings — alerts.py — reporting via console dashboard, JSON and HTML — dashboard.py.

I ran the built-in demo for real: the "Sunshine Class" — 8 children plus 1 teacher, 24 observations each. Classroom mood: happy 50 percent, calm 32, sad 11, angry 7. All three rules fired: Child-04 slid into afternoon distress, WARNING to CRITICAL; Teacher-01 flashed anger at 0.91 confidence; Child-02 swung happy to angry in 20 minutes — WATCH. Scripted story, real pipeline.

The honest part: this demo runs on fully synthetic data. No real children, no real photos; a real model — fer or DeepFace — is still TODO. Real deployment needs written parental consent, on-premise processing, no cloud upload, and human review of every alert — the system suggests check-ins, never disciplinary decisions. MIT open source, link in the description. Give it a run — see you next time!

S6: Take a breather. In China, friendship is brewed over tea. One cup of tea is enough time to truly hear a heart. May we all slow down and notice the feelings of those around us. May God, the Creator of heaven and earth, bless the work of your hands.

S7: May the favor of the Lord our God rest on us. Psalm 90:17 Technology becomes outdated, but love never ends. May God bless you and your family. If this project helped you, please give it a Star and share it with more people.

Top comments (0)