Computer Vision & Edge AI

Real-Time Face Mask Compliance Detection

High-Throughput Object Localization with YOLOv5 Architecture

Model Family
YOLOv5
Single-stage detector
Classes
3 Classes
Masked / Unmasked / Incorrect
Throughput
Real-Time
Edge video stream capable
Real-Time Face Mask Compliance Detection — Applied Machine Learning Architecture

Key contributions

  • Trained custom YOLOv5 weights with mosaic augmentations and anchor box tuning.
  • Handles partial facial occlusions, varied angles, and diverse illumination levels.
  • Structured for edge CCTV camera deployment and live video stream inference.

Applied Machine Learning Engineering Specification

Structured technical analysis conforming to production machine learning standards.

STEP 01

Problem Formulation

Manual verification of public health compliance in crowded facilities is non-scalable, labor-intensive, and prone to human inspection fatigue.

STEP 02

Data Ingestion & Feature Space

Annotated multi-class image dataset with precise bounding box coordinates categorized into three states: masked, unmasked, and incorrectly worn masks.

STEP 03

Preprocessing & Methodology

Engineered robust preprocessing pipeline leveraging mosaic augmentation, color jittering, spatial scaling, and normalized bounding box coordinate conversions.

STEP 04

Model Architecture & Training

Fine-tuned YOLOv5 architecture featuring CSPDarknet53 backbone and Path Aggregation Network (PANet) neck for multi-scale feature localization.

STEP 05

Validation & Evaluation Protocol

Validated against mean Average Precision (mAP@0.5 and mAP@0.5:0.95), inference latency (milliseconds per frame), and precision-recall trade-offs.

STEP 06

Empirical Results & Discoveries

Demonstrated accurate multi-target localization in high-density frames with minimal latency, distinguishing subtle mask placement variations.

STEP 07

Production & Business Impact

Enables contactless, automated compliance telemetry across transit hubs and commercial facilities without requiring on-site personnel.

Tech stack

YOLOv5PyTorchPythonOpenCVMatplotlibComputer Vision

Want to see the source code?

Access the complete Jupyter notebook, preprocessing routines, and evaluation logs.

Open GitHub Notebook