An AI-powered Classroom Management System that automates student attendance using face recognition and monitors classroom emotions in real-time.
Built with Streamlit, DeepFace, MTCNN, and TensorFlow, this app streamlines attendance tracking, detects impersonation during exams, and provides insights into student engagement through emotion analysis.
- To obtain and preprocess emotion dataset.
- To build and train emotion recognition system based on the collected data.
- To development attendance and emotion management system based on the model in
- To integrate sub-systems developed into a fully functional system.
- To evaluate the system performance using accuracy, precision, recall and Response time.
-
Automated Attendance Marking
Real-time face detection and recognition during class sessions using images streamed from a Raspberry Pi camera. -
Emotion Analysis
Detects dominant emotions (anger, calm, disgust, fear, happy, sadness, surprise) across the classroom and visualizes percentages with charts. -
Exam Mode with Impersonation Detection
Restricts access to students meeting 75% attendance threshold and flags unrecognized faces as "Impersonation". -
Student Management
Enroll/remove students with face images (via upload or local webcam), organized by courses. -
Course Management
Create new courses and download attendance records as CSV files. -
Raspberry Pi Integration
Receives live classroom images over a socket connection from a Raspberry Pi.
(Add actual screenshots here once available – recommended: Homepage, Enroll Student, Start Class with emotion chart, Exam Mode)
- Frontend/UI: Streamlit
- Face Detection: MTCNN
- Face Recognition: DeepFace (Facenet / Facenet512)
- Emotion Recognition: Custom TensorFlow Keras model (
Latest FER.keras) - Image Processing: OpenCV, PIL
- Data Handling: Pandas, JSON
- Networking: Python sockets (for Raspberry Pi image streaming)
- Python 3.9 or higher
- A webcam (for enrollment) or Raspberry Pi with camera (for live capture)
- Pre-trained emotion model:
Latest FER.keras(place in project root)
-
Clone the repository
git clone https://github.com/yourusername/classroom-assistant.git cd classroom-assistant -
Create a virtual environment (recommended)
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install streamlit tensorflow deepface opencv-python mtcnn pandas matplotlib pillow
-
Folder Structure Setup The app expects:
student_data/ ├── attendance/ # CSV files per course ├── course list.json # List of courses └── faces/ # Subfolders per course with student face imagesRun the app once – it will create default folders and files automatically.
-
(Optional) Raspberry Pi Setup
- Run a simple server script on your Raspberry Pi to stream images to IP
192.168.43.230:8000. - Update
raspi_ipin the code if needed.
- Run a simple server script on your Raspberry Pi to stream images to IP
streamlit run main.pyOpen your browser at http://localhost:8501.
- Homepage – Create new courses or download attendance CSVs.
- Enroll Student – Add student details and capture/upload face image.
- Remove Student – Delete a student and their face data.
- Start Class – Select course, set duration, and begin real-time attendance + emotion monitoring.
- Exam Mode – Only eligible students (≥75% attendance) are marked; others flagged.
- Requires good lighting and frontal faces for accurate recognition.
- Raspberry Pi streaming uses a hotspot connection (update IP/port as needed).
- Emotion model is custom-trained; accuracy depends on training data.
- For production use, consider security enhancements (e.g., encrypted connections).
Contributions are welcome! Feel free to:
- Open issues for bugs or feature requests
- Submit pull requests with improvements
Please follow standard GitHub flow: fork → branch → PR.
This project is licensed under the MIT License – see LICENSE for details.
Made with ❤️ for smarter classrooms
If you find this project useful, give it a ⭐ on GitHub!
Contact sundayabraham81@gmail.com for more information and collaboration.