{"id":20672418,"url":"https://github.com/kalthommusa/face-mask-application","last_synced_at":"2026-05-10T03:40:11.132Z","repository":{"id":63356801,"uuid":"566789558","full_name":"kalthommusa/Face-Mask-Application","owner":"kalthommusa","description":"Develop a custom classifier with PyTorch and transfer learning techniques to recognize face masks, and then deploy it as a web application using Code Engine on IBM cloud.","archived":false,"fork":false,"pushed_at":"2022-11-17T13:11:33.000Z","size":65679,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-16T20:36:59.674Z","etag":null,"topics":["cnn-classification","cnn-model","computer-vision","convolutional-neural-networks","deep-learning","deep-neural-networks","face-mask-classification","image-classification","image-recognition","python","pytorch","resnet-18","transfer-learning"],"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/kalthommusa.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}},"created_at":"2022-11-16T12:30:49.000Z","updated_at":"2024-03-25T01:26:40.000Z","dependencies_parsed_at":"2022-11-17T14:15:53.352Z","dependency_job_id":null,"html_url":"https://github.com/kalthommusa/Face-Mask-Application","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kalthommusa%2FFace-Mask-Application","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kalthommusa%2FFace-Mask-Application/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kalthommusa%2FFace-Mask-Application/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kalthommusa%2FFace-Mask-Application/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kalthommusa","download_url":"https://codeload.github.com/kalthommusa/Face-Mask-Application/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234375165,"owners_count":18822156,"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":["cnn-classification","cnn-model","computer-vision","convolutional-neural-networks","deep-learning","deep-neural-networks","face-mask-classification","image-classification","image-recognition","python","pytorch","resnet-18","transfer-learning"],"created_at":"2024-11-16T20:37:18.637Z","updated_at":"2026-05-10T03:40:11.056Z","avatar_url":"https://github.com/kalthommusa.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Project Objective\n\nDesign, train, and test deep convolutional neural networks with transfer learning to perform a face mask classification task with PyTorch and IBM Computer Vision Studio.\n\n----------------------------------------------------------\n\n# CV Studio\n\nWhen building Computer Vision applications, we deal with a lot of images, videos, and other assets that require storage. Image processing also requires significant computing power. The ultimate goal of every computer vision project is to have it deployed as part of an application and every application requires infrastructure to run.  \n\n[CV Studio](https://vision.skills.network/?utm_medium=Exinfluencer\u0026utm_source=Exinfluencer\u0026utm_content=000026UJ\u0026utm_term=10006555\u0026utm_id=NA-SkillsNetwork-Channel-SkillsNetworkCoursesIBMDeveloperSkillsNetworkCV0101ENCoursera25797139-2022-01-01/) is a Computer Vision learning tool for building, running, and managing AI Vision computer models and optimizing decisions anywhere on the IBM Cloud. It uses cutting-edge tools like Jupyter Notebook, Watson Machine Learning, Elyra, and more. \n\n----------------------------------------------------------\n\n# Project steps / pipline:\n\n  * ## 1- Built the dataset\n\n  When gathering data, my goal was to build a diverse database that contains images of people (with or without masks) of different nationalities, races, and with different styles. And I made sure to include some pictures that reflect the Saudi identity (for both women and men)\n\n  Look at the database:\n\n  (mask category) \n  ![](images/dataset-mask.png)\n\n  (no-mask category)\n  ![](images/dataset-no-mask.png)\n\n  I collected and uploaded 360 images divided into 180 images of people wearing masks and 180 images of people without masks on their faces.\n\n  ![](images/upload-images.png)\n\n  ----------------------------------------------------------\n\n  * ## 2- Annotate the dataset\n\n  Since I named both of my folders with the respective categories (mask, no_mask) when I uploaded my images in the previous upload step, the annotations happened automatically on CV Studio.     \n\n  And here in the annotate section, I verified that my images are labeled as expected.\n\n  ![](images/annotate-images.png)\n\n  ----------------------------------------------------------\n\n  * ## 3- Train the model\n\n  I chose a Jupyter notebook as a \"Training tool\" and used the image annotations from the previous step to train a CNN model using transfer learning (using the `ResNet` pre-trained model as a fixed feature extractor) to perform a face mask classification task with PyTorch. \n\n  ![](images/creating-traning-run.png)\n\n  ----------------------------------------------------------\n\n  * ## 4- Test the model\n\n  To test the classifier, enter the URL of the web app below into any web browser, and enjoy testing the model:\n\n  `\n  https://face-mask-application-6364868bf3cbb858b65c1d1a.u8wpmjcrkw2.eu-gb.codeengine.appdomain.cloud/\n  `\n\n  Upload or drop \u0026 drag an image into the box and the prediction of the deep network will show at the bottom.\n\n  ![](images/the-app.png)\n\n----------------------------------------------------------\n\n# Results \u0026 Observations \n\nBy feeding the classifier with 360 images, it has the opportunity to learn and gather enough information about the mask and no_mask data, and understand the relationship between input and output, as a result, the classifier's accuracy is 94% which is very high and promising, and indicates an excellent performance and accurate predictions.\n\n![](images/accuracy.png)\n\n\nI've tested the app on several images, and the overall performance of the classifier seems pretty excellent.\n\ncorrect mask1 prediction:\n\n![](images/prediction-1.png)\n\ncorrect mask2 prediction:\n\n![](images/prediction-2.png)\n\ncorrect mask3 prediction:\n\n![](images/prediction-3.png)\n\ncorrect mask4 prediction:\n\n![](images/prediction-4.png)\n\ncorrect mask5 prediction: \n\n![](images/prediction-5.png)\n\ncorrect mask6 prediction: \n\n![](images/prediction-6.png)\n\ncorrect mask7 prediction:\n\n![](images/prediction-7.png)\n\ncorrect mask8 prediction:\n\n![](images/prediction-8.png)\n\ncorrect mask9 prediction:\n\n![](images/prediction-9.png)\n\ncorrect mask10 prediction:\n\n![](images/prediction-10.png)\n\ncorrect mask11 prediction:\n\n![](images/prediction-11.png)\n\ncorrect mask12 prediction:\n\n![](images/prediction-12.png)\n\ncorrect mask13 prediction:\n\n![](images/prediction-13.png)\n\ncorrect mask14 prediction:\n\n![](images/prediction-14.png)\n\ncorrect mask15 prediction:\n\n![](images/prediction-15.png)\n\nThe model made correct predictions and succeeded in classifying all the test images. Therefore, there is no need to retrain the classifier or collect more data.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkalthommusa%2Fface-mask-application","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkalthommusa%2Fface-mask-application","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkalthommusa%2Fface-mask-application/lists"}