ID Card Detection – Detect if a student is wearing their ID card/lanyard

:rocket: ID Card Detection – Detect if a student is wearing their ID card/lanyard. :dizzy:

:busts_in_silhouette: Team Members

  • Yadav Atul
  • Vijay Yadav
  • Harsh Mhatre
  • Dnyanada Patil
  • Jayesh koli

:star2: Use Case Importance

It is important for safety and security that students and employees wear their ID cards. This helps staff know who is allowed in the building or school, or college, etc. Our AI project uses a camera and a trained model to automatically check in real time if someone is wearing their ID card or not.

:camera_flash: Data Collection and Annotation

Our Team members collected over 2000+ real-world images of people wearing id card or not wearing from different places like our college and nearby offices, capturing them in various lighting conditions.
To label the images, we used Roboflow and labelimg tools.
We annotated two classes: “id_card_wearing” and “id_not_wearing”

The labeled images were then split into training, validation, and test sets:

  • Training set: 1632 images
  • Validation set: 341 images
  • Test set: 173 images

To improve the model’s performance, we applied data augmentation techniques like brightness changes and image flipping. This helped the model learn better and perform well in different real-world scenarios.
sample Image

:brain: Model Training and Validation

We trained a YOLOv8m model to detect whether people are wearing their ID cards. This version was chosen because it gives a good balance between speed and accuracy—perfect for real-time use in schools, colleges, or offices.

To make sure the model worked well, we tracked key metrics like mAP, precision, and recall. We improved its performance by:

  • Increasing the training epochs
  • Using higher resolution images (416×416)
  • Adding more labeled data to reduce errors and class imbalance

Final Results:

Metric All Classes id_not_wearing id_wearing
Precision 0.967 0.964 0.970
Recall 0.958 0.960 0.956
mAP@50 0.987 0.988 0.986
mAP@50–95 0.784 0.871 0.696

The model showed strong accuracy and reliability, making it suitable for real-world ID card detection.

:iphone::sparkles: Model Deployment and Demo Video

We tested our YOLOv8m model in real life to check how well it works. It was able to detect ID cards with 92% to 98% accuracy and ran at about 5–10 frames per second (FPS) on devices with good performance.

The model worked smoothly on iPhones, but on some Android phones, there was a little delay—probably because of weaker hardware or slower graphics support.

  • Performance: ~8 FPS on a mid-range Android device with ~95% mAP@0.5 in live inference.
  • Models Deployed: One YOLOv8n model in the YOLOvX mobile app.

:clapper: Demo Video
Demo Video
Real-time ID card checking using the YOLOv8m model on a mobile device.

:white_check_mark: Conclusion

Our project successfully built an AI model to detect whether individuals are wearing their ID cards using the YOLOv8m model. The model showed high accuracy and worked well in real-time on mobile devices.

Through this project, we learned how important good-quality data, balanced classes, and proper training settings are for achieving reliable results. We also found that device performance can affect real-time detection, especially on lower-end Android phones.

Overall, the solution is practical, efficient, and ready to be used in schools, colleges, and offices to improve security and identification.

1 Like

Nice work guys :rocket:

Video demo is missing!

Hey guys,

Please update the app and rate us on Play Store / App Store:

Also run AI Benchmark in the App!!!