In institutions such as universities, corporate offices, and restricted-access areas, enforcing ID card compliance is critical for ensuring security, tracking attendance, and maintaining discipline. Manual enforcement is often inefficient and prone to oversight. To address this, we propose an automated ID Card Detection and Penalty Mechanism that leverages deep learning models for object detection and facial recognition. The system utilizes YOLOv5 for real-time identification of ID cards worn by individuals in front of a camera. If the system fails to detect an ID card, it automatically initiates a secondary process that uses facial recognition to identify the person, predicts their roll number, and triggers an alert mechanism. This includes sending an automated email notification to a predefined recipient, reporting the incident along with the identified individual's details.The system is trained specifically on a dataset comprising known faces and ID card positions to ensure high accuracy in controlled environments. It includes a user-friendly interface where users can start the camera, initiate detection, and send email notifications directly through the GUI. The model is effective in both detecting the presence of ID cards and in handling non-compliance scenarios by linking the individual's identity to the infraction. Experimental evaluations show that the system performs reliably across Automated ID Card Detection and Penalty System Using YOLOv5 and Face Recognition 64 various lighting conditions and backgrounds, with minimal false detections. The proposed solution offers a scalable and efficient method to automate ID enforcement, enhance security monitoring, and reduce dependency on manual supervision. INTRODUCTION In today's technologically advanced world, automated surveillance and identity verification systems have become increasingly important across various sectors, including educational institutions, corporate offices, research labs, and secure government facilities. One fundamental component of such security frameworks is the enforcement of visible identification cards (ID cards) worn by employees, students, or visitors. ID cards serve not only as authentication tools but also as key enablers for access control, attendance monitoring, and accountability. However, ensuring consistent compliance with ID-wearing policies remains a challenge when done manually. Relying on security personnel or administrative staff to monitor ID card usage is time-consuming, resource-intensive, and susceptible to human error.To address this issue, there is a growing need for automated systems that can detect whether individuals are wearing their ID cards and take corrective actions if non-compliance is observed. In this context, computer vision and deep learning techniques offer powerful tools for real-time monitoring and decision-making. Object detection models such as YOLO (You Only Look Once), combined with face recognition and identity prediction algorithms, enable systems to detect ID cards, recognize faces, and link individuals to a known database. These technologies allow institutions to build intelligent surveillance systems that can proactively enforce policies without requiring continuous human intervention. This paper presents an integrated ID Card Detection and Penalty Mechanism system that automates the process of identifying individuals who are not wearing their ID cards and subsequently triggering a disciplinary or notification process. The system uses the YOLOv5 object detection model to identify the presence or absence of an ID card in live camera feeds. If no card is detected, the system uses facial recognition to predict the identity or roll number of the person. Once the individual is identified, the system allows an administrator or supervisor to send a warning message to a designated email address directly from the application interface.The proposed system is particularly useful in educational campuses where students are required to wear ID cards as part of institutional discipline. In such environments, the model can be trained on a dataset containing students' facial images and sample ID card images. The system interface includes real-time camera access, detection initiation, identity display, and email alert generation, making it a complete solution for daily compliance enforcement.Additionally, the model is designed to be lightweight, fast, and easy to deploy on any machine with a webcam. It achieves high detection accuracy under various lighting conditions and works effectively in real-time, thus meeting the practical requirements of a surveillance-grade system. In summary, this research contributes an end-to-end automated framework that enforces ID-wearing compliance using deep learning. By eliminating manual checking and incorporating intelligent alert mechanisms, the system significantly enhances institutional security, operational efficiency, and rule enforcement.