Lecture Attendance Estimator

by sobolev-ctai in Circuits > Raspberry Pi

19 Views, 1 Favorites, 0 Comments

Lecture Attendance Estimator

ChatGPT Image Jun 19, 2026, 05_46_00 AM.png

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

  1. Raspberry Pi 5
  2. MicroSD Card
  3. USB Camera
  4. OLED Display (I2C)
  5. LCD Display 16x2 (I2C)
  6. 4x4 Matrix Keypad
  7. Breadboard
  8. Jumper Wires
  9. Raspberry Pi Power Supply
  10. Tripod
  11. Organizer Bag / Electronics Case
  12. Cable Ties

Total Cost

The total hardware cost of the prototype is approximately €307.19.

Software

  1. Python 3
  2. YOLO11 Object Detection Model
  3. Roboflow
  4. Gradio
  5. OpenCV
  6. VS Code
  7. 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:

  1. Capture a classroom image
  2. Detect classroom objects using AI
  3. Calculate attendance automatically
  4. Store attendance records
  5. Show results through a web interface
  6. 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

photo_2026-06-19_05-20-36.jpg

To train the AI model, I collected classroom photos from different positions and seating arrangements.

The dataset included:

  1. Empty classrooms
  2. Partially occupied classrooms
  3. Nearly full classrooms
  4. Different camera angles
  5. Different lighting conditions

I used Roboflow to manually label five custom classes:

  1. Student
  2. Empty Chair
  3. Bag on Chair
  4. Jacket on Chair
  5. 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

photo_2026-06-18_20-35-10.jpg

Once the AI model could detect classroom objects, I implemented the attendance calculation logic.

The system works as follows:

  1. A classroom image is captured or uploaded
  2. The AI model detects all objects
  3. Students are counted automatically
  4. The detected number of students is compared with the expected number
  5. The attendance percentage is calculated
  6. 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:

  1. About page
  2. Attendance estimator
  3. History of saved records
  4. Analytics
  5. 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

no2.jpg

To turn the project into a physical prototype, the system was integrated with a Raspberry Pi 5.

The Raspberry Pi is connected to:

  1. USB camera
  2. OLED display
  3. LCD display
  4. Matrix keypad
  5. 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

no4.jpg

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:

  1. Different classroom sizes
  2. Different student counts
  3. Different seating arrangements
  4. Different lighting conditions

Each test produced:

  1. Annotated detection image
  2. Object counts
  3. Attendance percentage
  4. Stored attendance record

The final prototype successfully combines:

  1. Computer vision
  2. Artificial intelligence
  3. Raspberry Pi hardware
  4. Web development
  5. Attendance analytics
  6. 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:

  1. Larger training dataset
  2. Improved detection accuracy
  3. Multiple camera support
  4. Cloud synchronization
  5. Mobile application integration