{"id":18622431,"url":"https://github.com/nizarassad/face-mask-detection","last_synced_at":"2025-06-26T07:03:52.947Z","repository":{"id":251790895,"uuid":"822637984","full_name":"Nizarassad/Face-mask-detection","owner":"Nizarassad","description":"This project aims to develop a real-time face mask detection and classification system using computer vision techniques. ","archived":false,"fork":false,"pushed_at":"2024-08-05T18:22:51.000Z","size":9584,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T12:52:06.546Z","etag":null,"topics":["cctv-detection","cnn","computer-vision","data-processing","face-mask-detection","feature-extraction","hog-features","lbp","mlp","python","real-time-detection","svm"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nizarassad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-07-01T14:16:24.000Z","updated_at":"2024-09-30T12:28:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"4acc85e2-9f01-4227-bfa5-f5701cebece3","html_url":"https://github.com/Nizarassad/Face-mask-detection","commit_stats":null,"previous_names":["nizarassad/face-mask-detection"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Nizarassad/Face-mask-detection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nizarassad%2FFace-mask-detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nizarassad%2FFace-mask-detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nizarassad%2FFace-mask-detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nizarassad%2FFace-mask-detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nizarassad","download_url":"https://codeload.github.com/Nizarassad/Face-mask-detection/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nizarassad%2FFace-mask-detection/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262018760,"owners_count":23245619,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cctv-detection","cnn","computer-vision","data-processing","face-mask-detection","feature-extraction","hog-features","lbp","mlp","python","real-time-detection","svm"],"created_at":"2024-11-07T04:16:50.809Z","updated_at":"2025-06-26T07:03:52.942Z","avatar_url":"https://github.com/Nizarassad.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Face Mask Detection and Classification in Real-Time\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://drive.google.com/uc?id=1fD0fEHzppnu_MLXEjyh07JmNHjKSH0JA\" alt=\"Face mask\"\u003e\n\u003c/p\u003e\n\nThe goal of this project is to develop a Face Covering Detection (FCD) computer vision system. The system is capable of detecting whether a person is wearing a face mask correctly, incorrectly, or not wearing a mask at all. The three classes for classification are:\n\n1. **Mask**: The face mask is worn correctly, covering both the nose and mouth.\n2. **No Mask**: The face mask is not worn, and the face is fully visible.\n3. **Mask Incorrect**: The face mask is worn incorrectly, not covering either the nose or mouth properly.\n\n## Features\n\n- **Real-Time Detection**: Utilizes a webcam or video feed to detect and classify face masks in real-time.\n- **Multi-Class Classification**: Distinguishes between three classes: mask, no mask, and mask incorrect.\n- **High Accuracy**: Employs deep learning models to ensure high accuracy in detection and classification.\n- **User-Friendly Interface**: Simple and intuitive interface for easy use and interaction.\n- **Cross-Platform Compatibility**: Runs on various operating systems including Windows, macOS, and Linux.\n\n## Technologies Used\n\n- **Programming Languages**: Python\n- **Deep Learning Framework**: TensorFlow/Keras and PyTorch\n- **Computer Vision**: OpenCV\n- **Webcam Integration**: OpenCV for capturing real-time video feed\n- **Pre-trained Models**: Transfer learning using models like MobileNetV2 or ResNet\n\n## Dataset\n\nThe dataset can be found in the link below.\n- https://www.kaggle.com/datasets/andrewmvd/face-mask-detection\n\n## Models\n\nIn this study, four machine learning combinations were compared based on their accuracy, precision, recall, inference time, and model size:\n\n1. **CNN+HOG**\n2. **SVM+HOG**\n3. **MLP+HOG**\n4. **MLP+LBP**\n\nThese models were chosen due to their different strengths and weaknesses, such as size differences. HOG and LBP features were extracted from the original images to create a more condensed representation of the images. \n\n- CNN+HOG model can be downloaded through this link: https://drive.google.com/file/d/165IkA47Tov2M3CfhYvJuQ5mCWGxkhMe1/view?usp=sharing\n\n## Results\n\n### Qualitative Results\n\nWe tested our model on images and videos to evaluate its real-world performance. The models should be able to detect face masks in different settings, such as indoor and outdoor environments, and varying lighting conditions.\n\n**Images:** We tested the models on a set of four random images, which included the 3 different classes. In most cases, the models were able to successfully identify the presence and position of face masks, even under challenging lighting conditions. \n\n**Videos:** We further evaluated the performances of all four models on video files, where each model processed a continuous stream of frames in real-time. The models maintained a consistent level of accuracy throughout the video, accurately detecting face masks despite changes in subject positions, lighting, and background. \n\n\n\n### Quantitative Results\n\nThe table below shows the performances of the four models on the test set:\n\n| Model      | Accuracy | Precision | Recall  | Inference Time | Model Size |\n|------------|----------|-----------|---------|----------------|------------|\n| CNN+HOG    | 85.15%   | 61.70%    | 34.64%  | 1.2629s        | 130.18 MB  |\n| SVM+HOG    | 82.10%   | 57.43%    | 56.01%  | 0.2232s        | 9.62 MB    |\n| MLP HOG    | 83.62%   | 79.76%    | 52.86%  | 0.0086s        | 2.50 MB    |\n| MLP LBP    | 83.62%   | 42.15%    | 40.28%  | 0.0020s        | 1.15 MB    |\n\n## Discussion\n\nOverall, the CNN+HOG model delivered the best performance in terms of accuracy, making it the best choice for the face mask detection system. However, the MLP+LBP model can be more recommended as speed and model size are important.\n\n## References\n\n[1] Wang, L., Lin, Z., Wong, A., \"Covid-19 Face Mask Detection Using Deep Learning and Computer Vision Techniques,\" Image Processing On Line, 10 (2020), pp. 252-262. https://doi.org/10.5201/ipol.2020.288\n\n[2] Elaziz, M. A., Hosny, K. M., Salah, A., Darwish, M. M., Lu, S., \u0026 Sahlol, A. T. (2021). Deep Learning for Face Mask Detection in the Era of COVID-19 Pandemic:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnizarassad%2Fface-mask-detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnizarassad%2Fface-mask-detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnizarassad%2Fface-mask-detection/lists"}