Lecture Attendance Estimator
by sobolev-ctai in Circuits > Raspberry Pi
19 Views, 1 Favorites, 0 Comments
Lecture Attendance Estimator
Manual attendance checks take time during lectures. This project uses computer vision and a Raspberry Pi to estimate classroom attendance from a single photo.
The system detects students, empty chairs, bags on chairs, jackets on chairs, and chairs placed on tables. It then calculates the attendance percentage and saves the result for later review.
The project combines AI object detection, Raspberry Pi hardware integration, a Gradio web interface, and a portable classroom setup. The Gradio interface is the main interface for teachers, while the physical hardware setup is mainly used for startup messages, administrator access, and debugging.
Supplies
Hardware
- Raspberry Pi 5
- MicroSD Card
- USB Camera
- OLED Display (I2C)
- LCD Display 16x2 (I2C)
- 4x4 Matrix Keypad
- Breadboard
- Jumper Wires
- Raspberry Pi Power Supply
- Tripod
- Organizer Bag / Electronics Case
- Cable Ties
Total Cost
The total hardware cost of the prototype is approximately €307.19.
Software
- Python 3
- YOLO11 Object Detection Model
- Roboflow
- Gradio
- OpenCV
- VS Code
- GitHub
Planning the System
Before building the prototype, I planned how the software and hardware parts would work together.
The goal was to create a portable attendance estimation system that could:
- Capture a classroom image
- Detect classroom objects using AI
- Calculate attendance automatically
- Store attendance records
- Show results through a web interface
- Provide basic hardware status and admin/debug tools
The final workflow is:
Camera → AI Detection Model → Attendance Calculation → Data Storage → Gradio Web Interface
The Gradio web interface is the main interface for teachers. When the Raspberry Pi starts, the physical setup shows a message telling the teacher to continue in the Gradio application.
The OLED, LCD, and keypad are mainly used for administrator access, debugging, and hardware testing.
Collecting and Annotating the Dataset
To train the AI model, I collected classroom photos from different positions and seating arrangements.
The dataset included:
- Empty classrooms
- Partially occupied classrooms
- Nearly full classrooms
- Different camera angles
- Different lighting conditions
I used Roboflow to manually label five custom classes:
- Student
- Empty Chair
- Bag on Chair
- Jacket on Chair
- Chair on Table
More than 1000 annotations were created manually.
Training the AI Model
The YOLO11 small model was used because it gave better results than the nano version during testing.
The training process included dataset preprocessing, data augmentation, and model evaluation.
The model learned to detect the five classroom object classes from a single image.
Building the Attendance Logic and Web Interface
Once the AI model could detect classroom objects, I implemented the attendance calculation logic.
The system works as follows:
- A classroom image is captured or uploaded
- The AI model detects all objects
- Students are counted automatically
- The detected number of students is compared with the expected number
- The attendance percentage is calculated
- The result is saved with lecture information and timestamps
Formula:
Attendance (%) = Detected Students / Expected Students × 100
A Gradio web interface was developed as the main user interface for teachers.
The interface includes:
- About page
- Attendance estimator
- History of saved records
- Analytics
- Admin management tools
Teachers use the Gradio interface to run attendance estimation and review results. Administrators have access to extra tools for testing, debugging, and managing records.
Raspberry Pi Hardware Integration
To turn the project into a physical prototype, the system was integrated with a Raspberry Pi 5.
The Raspberry Pi is connected to:
- USB camera
- OLED display
- LCD display
- Matrix keypad
- Breadboard and jumper wires
The USB camera is used to capture classroom photos.
The OLED and LCD displays show startup messages, system status, and short debugging information.
The keypad is mainly used for admin/debug input, not for the regular teacher workflow.
For normal use, the teacher is guided to continue in the Gradio web application. This keeps the user experience simple while still demonstrating Raspberry Pi hardware integration.
Building the Portable Classroom Setup
One goal of the project was to make the system portable.
A tripod was used to position the camera at an elevated angle for classroom image capture.
The Raspberry Pi and electronic components were placed inside an organizer bag attached to the tripod. This made the setup easier to move and protected the electronics during transport.
Cable ties were used to improve cable management and keep the setup organized.
The final setup can be deployed in a classroom without making permanent changes to the room.
Testing and Final Result
The system was tested with different classroom scenarios.
The testing process included:
- Different classroom sizes
- Different student counts
- Different seating arrangements
- Different lighting conditions
Each test produced:
- Annotated detection image
- Object counts
- Attendance percentage
- Stored attendance record
The final prototype successfully combines:
- Computer vision
- Artificial intelligence
- Raspberry Pi hardware
- Web development
- Attendance analytics
- Portable physical setup
The Lecture Attendance Estimator can estimate classroom attendance from a single photograph and save the results for future review.
The project demonstrates how AI and embedded systems can be combined to solve a practical classroom management problem using affordable hardware and open-source software.
Future Improvements
Possible future improvements include:
- Larger training dataset
- Improved detection accuracy
- Multiple camera support
- Cloud synchronization
- Mobile application integration