SICD ▸ CA-YOLOv8
loading
000
000
campus vision · 2025/26
Live campus pipeline · 2025/26
▸ The systemDetects.

Smart ID Card.

Detection & Authentication.

A campus vision pipeline built on CA-YOLOv8. Watches the live stream, flags students without a visible ID, captures the frame, runs InsightFace against the enrolled gallery, and routes a clean incident packet to the HOD or Principal.

live · cam-04 · gate-a
·InsightFace
scanning

fps

18

lat

142ms

frames

00:42

▸ pipelinewatching cam-04

▸ simulated · cam-04 · pipeline state machine

0.0%▸ mAP@50 all classes
0 fps▸ GPU inference (T4)
0.0 ms▸ Inference latency
0%▸ F1 peak @ conf 0.4
Scroll to explore
00HowItWorksIn30Seconds

One camera. Five clear steps.

This is the fastest way for examiners and visitors to understand your full pipeline before they dive into architecture details.

step 01

Capture

Read live camera frames from corridor feed.

step 02

Detect

CA-YOLO finds person and visible card boxes.

step 03

Check

Rule engine decides ID visible vs no-ID case.

step 04

Identify

InsightFace matches face to enrolled gallery.

step 05

Escalate

Send one clean incident packet to staff.

CA-YOLOv8✦No-ID detection✦InsightFace identification✦HOD / Principal alerts✦Face-based identification✦Campus vision pipeline✦CA-YOLOv8✦No-ID detection✦InsightFace identification✦HOD / Principal alerts✦Face-based identification✦Campus vision pipeline✦
00Manifesto
/00

Acameraisjustglassandsilicon—untilyouteachittosee.

We rebuilt YOLOv8 into CA-YOLOv8 so the camera reliably sees people and whether an ID card is actually on them — then we close the loop: violation → capture → InsightFace → alert to HOD / Principal. Identity comes from the face gallery. This is a working campus story, not a slide-deck fantasy.

+CBAM+Coord-Attn+P2 Head+Wise-IoU
∴Thestoryinfiveframes

Problem · Detection · CA-YOLOv8 · InsightFace · Delivery

chapter 0101 / 05
/01Problem

▸ Problem

Busy corridors. Missed ID cards.

Every college expects students to wear an ID, but no one can watch every gate, corridor, and canteen line all day. So when a card is missing, it is often noticed late.

chapter 0202 / 05
FRAME · 640×640person 0.99id 0.92
/02Detection

▸ Detection

One model, two questions per frame.

Built on YOLOv8, each frame answers two simple questions: is there a person, and is an ID card visible on them? That gives us a fast baseline we can improve without losing real-time performance.

chapter 0303 / 05
CBAM × Coord-Attn × P2
/03CA-YOLOv8

▸ CA-YOLOv8

We taught it to look closer.

We added CBAM and Coordinate Attention so the model focuses better on people and small card regions. A custom P2 head helps catch tiny cards on lanyards, and Wise-IoU keeps training stable on noisy real scenes.

chapter 0404 / 05
cosine 0.83 · matchedARCFACE · BUFFALO_L
/04InsightFace

▸ InsightFace

Who is in the frame?

If the system decides no ID is visible, it captures the frame, crops the face, and runs InsightFace against an enrolled gallery. A name is attached only when the match confidence is strong enough.

chapter 0505 / 05
TO: HOD · PRINCIPALevidence
/05Delivery

▸ Delivery

A clean packet to the right desk.

FastAPI connects the full flow: streaming, detection, identity lookup, and incident logging. Instead of spamming raw frames, staff receive one clear incident with time, snapshot, match score, and student details.

Scroll for each chapter

01Overview
01

From missing ID to named incident.

Corridors and gates are busy: staff cannot catch every student who walks past without an ID. Our pipeline watches one camera stream, detects each person and whether an ID card is visible, and when the rules say no ID, it freezes evidence and continues down the identification path using face matching from the enrolled gallery.

InsightFace then answers who was in the frame by matching the face to an enrolled gallery. The backend packages timestamp, snapshot, match score, and student fields for the HOD or Principal. CA-YOLOv8 is upgraded with CBAM, Coordinate Attention, and a P2 head so small, distant cards still register when they are worn.

▸ Problem

In busy campus spaces, missing IDs are easy to miss manually

01 / 04

▸ Approach

Detect person + card, flag no-ID cases, identify face, notify staff

02 / 04

▸ Dataset

Campus-like video data labeled for person, card, and no-card cases

03 / 04

▸ Deployment

FastAPI backend + web dashboard with evidence-first incident alerts

04 / 04
01ADataset

Our custom dataset, built manually.

We captured real-time student scenes, annotated manually in Roboflow, and validated labels before training. This makes the model behavior grounded in realistic campus data.

▸ Dataset creation pipeline

step 01

Real campus capture

Collected real-time student corridor frames from campus-like camera viewpoints.

step 02

Manual annotation

Used Roboflow for manual box labeling (person and ID-card) across varied scenes.

step 03

Label QA pass

Manually reviewed class IDs, box placements, and edge cases before training.

step 04

Custom export

Exported in YOLO format and built train/val/test splits for controlled experiments.

▸ Dataset summary

Source
Real-time student images + corridor footage
Annotation
Manual bounding boxes in Roboflow
Classes
2 classes: person, ID-card
Format
YOLO normalized labels (cx, cy, w, h)

Dataset access

private dataset

Dataset is maintained privately due to student privacy. Access can be shared for academic review on request.

02Modules

Eight modules, one signal.

Every module exists for one campus story: spot a student without a visible ID, keep proof, identify them with InsightFace, and push a clean packet to the HOD or Principal.

▸ detection core/10 stages/With ID vs No ID/InsightFace after violation/auto-play/▸ detection core/10 stages/With ID vs No ID/InsightFace after violation/auto-play/
03CA-YOLOPipeline

The CA-YOLOv8 deep pipeline.

This block is the detection core only — how CA-YOLO decides person + card boxes before any InsightFace or HOD / Principal step. Ten stages, inline visualisers, scrubbable timeline.

▸ Scenario
stage 01 / 10
stage 1 / 10

Input preprocessing

Every frame is resized to 640x640 and split into R, G, B channels.

Simple explanation: We standardize each camera frame so the model gets clean, consistent input.

ID
1920×1080
resize
640×640
R
G
B
[640, 640, 3]
04Architecture

From frame to verdict, in six steps.

Each step is a guarded checkpoint. If the frame is unusable, confidence collapses, or InsightFace cannot match the gallery, the pipeline degrades cleanly — we log uncertainty instead of firing a bad name at the HOD or Principal.

  1. 01step

    Framestream

    Live campus feed at 18+ FPS

    →
  2. 02step

    Preprocess

    Resize, normalise, channel split

    →
  3. 03step

    CA-YOLO

    Detect every person + visible ID card

    →
  4. 04step

    No-IDcheck

    Spatial rules — no card on student?

    →
  5. 05step

    InsightFace

    Match face to enrolled gallery

    →
  6. 06step

    Staffescalation

    Student details + evidence to HOD / Principal

    →
05Performance

Measurably better. Every metric.

Detection accuracy on our held-out test set, gallery match rate against the enrolled face index, and operating speed on a CPU baseline — the numbers we keep ourselves honest with.

▸ mAP@50 all

0.0%

▸ mAP@50 person

0.0%

▸ mAP@50 card

0.0%

▸ Inference (T4)

0.0 ms

▸ Quality bars — real val results

mAP@50 (all)98.6%
mAP@50 (person)99.1%
mAP@50 (card)98%
mAP50-95 (all)85%
Precision (all)97.4%
Recall (all)96.4%

▸ CA-YOLOv8m · 25.84M params · 78.7 GFLOPs

▸ Val: 392 images · 815 instances · 100 epochs

▸ Hardware: Tesla T4 · 3.936 hrs training

▸ mAP@50 training curve

100 epochs · sampled at 1, 5, 10, 20, 30, 40, 50, 75, 100

98.690756015102030405075100

▸ Why CA-YOLOv8 — module contributions

Four custom additions on top of the YOLOv8m backbone — each solving a specific weakness for small ID-card detection.

CBAM

Convolutional Block Attention Module

What: Channel attention + spatial attention applied after every C2f block in the backbone.

Why: Suppresses irrelevant background channels and focuses spatial weight on the ID card region.

Coord Attn

Coordinate Attention

What: Decomposes the 2D attention map into two 1D pooling paths — one per axis (H and W).

Why: Preserves directional position information lost by standard global average pooling. Tells the model where horizontally and vertically the card sits.

P2 Head

Micro-Detection Head (Stride 4)

What: An additional detection head operating at stride 4 (160 × 160 feature map), alongside the standard P3/P4/P5 heads.

Why: ID cards occupy only 16 × 16 pixels or fewer in wide-angle campus footage. Stride-4 gives the model 4× finer spatial resolution for small-object detection.

Wise-IoU

Wise-IoU Dynamic Loss

What: Replaces CIoU with a non-monotonic focusing mechanism — high-quality anchors receive more gradient, low-quality ones are down-weighted dynamically.

Why: Improves mAP50-95 (tight box quality) by penalising imprecise regression more than imprecise classification. Key reason for 85.0% mAP50-95.

▸ Training configuration

Base model
YOLOv8m
Parameters
25.84M
GFLOPs
78.7
Input size
640 × 640
Epochs
100
Training time
3.936 h (Tesla T4)
Inference
11.2 ms / frame
Loss fn
Wise-IoU (dynamic)
Augmentation
Mosaic · MixUp · Copy-Paste

▸ Dataset statistics

Total images
~3 920 (est. 80/10/10)
Val images
392
Val instances
815
Card instances
404 (val)
Person instances
411 (val)
Annotation fmt
YOLO · cx cy w h norm
Classes
2 — person · card
Source
Campus corridor footage

Annotated by Deepika — campus corridor footage across varied lighting, angles, and occlusion conditions. Augmented with Mosaic 4-image, MixUp, and Copy-Paste strategies to maximise small-object density.

Precision-Recall Curve

▸ Precision-Recall Curve

card 0.980 · person 0.991 · all 0.986 mAP@0.5

F1-Confidence Curve

▸ F1-Confidence Curve

all classes 0.97 at confidence 0.399

Training & Val Curves

▸ Training & Val Curves

loss convergence + precision / recall / mAP over 100 epochs

06Benchmarks&References

Side-by-side comparisons, with sources.

This block shows where the final stack stands: standard YOLO variants versus CA-YOLO, and face-model options versus the InsightFace pipeline used in the final system.

▸ Before vs after CA-YOLO

ModelmAP@50mAP50-95LatencyTiny-card recallWhy it matters
YOLOv8m baseline97.3%84.1%10.8 ms88.2%Strong baseline but weaker tiny-card recall in crowded scenes.
CA-YOLOv8m (ours)98.6%85.0%11.2 ms93.7%Better card reliability from CBAM + CoordAttn + P2 head.

This is the primary detector comparison used in viva: baseline YOLOv8m versus CA-YOLOv8m.

▸ Why InsightFace?

Face model comparison

We compared common alternatives and selected InsightFace because it gives the best identity quality-to-speed balance for this campus pipeline.

ModelStrengthWeaknessDecision
OpenCV LBPHVery lightLower unconstrained accuracyNot selected
FaceNetSolid embeddingsMore tuning needed for this setupBackup option
InsightFace (buffalo_l)Best quality-speed tradeoffNeeds proper gallery enrollmentSelected
06Stack

A lean, hybrid stack with real tooling.

The detector runs in Python, the experience runs in the browser, and FastAPI connects everything in real-time. Each layer is selected for speed, clarity, and deployment practicality.

Python+PyTorch

Model training, data handling, and inference runtime.

▸ used in this project

YOLOv8+CustomModules

Core detector with CBAM, Coordinate Attention, and P2 micro-head upgrades.

▸ used in this project

OpenCV

Video stream IO, frame operations, and crop preparation.

▸ used in this project

InsightFace

Face embedding and identity matching against enrolled gallery.

▸ used in this project

Next.js+TailwindCSS

Frontend experience, storytelling UI, and dashboard views.

▸ used in this project

FastAPI+SQLite

API orchestration, incidents, alerts, and persistence.

▸ used in this project
Nithwin · model architect✦Dharun Raj · backend engineer✦Deepika · data & research✦the people behind the system✦Nithwin · model architect✦Dharun Raj · backend engineer✦Deepika · data & research✦the people behind the system✦
07Team

The people who built this.

Three people, three honest scopes — model architecture, backend systems, and dataset engineering. Everything below maps to real files in the repository, not slides.

Nithwin — Smart-ID Detection team
▸ Member 01 / 03Model Architect

▸ AI / ML Core, Architecture & Frontend Lead

Nithwin

CBAM Block

Channel + Spatial after every C2f

Coord-Attn

Directional 1D pooling H × W

P2 Detect Head

Stride-4, 160×160 for 16×16 cards

Loss

Wise-IoU dynamic focusing

Architected the CA-YOLOv8 model — custom YOLOv8 enhanced with CBAM and Coordinate Attention

Wrote attention.py — Channel Attention, Spatial Attention, full CBAM, and Coord-Attn modules in PyTorch

Designed YAML configs (ca_yolov8.yaml, ca_yolov8_p2.yaml) defining attention placement in backbone + neck

Built the interactive Next.js architecture visualizer with Framer Motion

Replaced CIoU loss with Wise-IoU dynamic non-monotonic focusing for low-quality boxes

Set up Colab training, hyperparameters, and produced final best.pt weights

Dharun Raj — Smart-ID Detection team
▸ Member 02 / 03Backend Engineer

▸ Backend Systems & Pipeline Engineer

Dharun Raj

REST Endpoints

17 routes (FastAPI)

Stream Engine

MJPEG @ 1/3-frame inference

InsightFace

ArcFace gallery ≥ 0.4

Alert Cooldown

30 s / identified person

Built FastAPI backend with 17 REST endpoints — detection, video, camera, alerts, statistics, face registration

Implemented no-ID violation rules (spatial checks on person vs card boxes)

Integrated InsightFace (buffalo_l) for gallery match after violation capture; cosine threshold 0.4

Staff escalation payloads — student identity, confidence, snapshot, timestamp for HOD / Principal

Wrote MJPEG camera streaming with every-third-frame inference for live performance

Designed alert deduplication with 30-second cooldown windows per identified person

Wrote prepare_dataset.py for 80/10/10 splits with full label validation

Built model export pipeline to ONNX / TensorRT for production deployment

Deepika — Smart-ID Detection team
▸ Member 03 / 03Data & Research

▸ Data Engineering & Research

Deepika

Format

YOLO normalized [0,1]

Classes

0 = card · 1 = person

Augmentation

Mosaic + MixUp + Copy-Paste

Papers

CBAM · Coord-Attn · ArcFace · Wise-IoU

Curated campus-style footage — visible ID vs no-ID cases, lighting, angle, and occlusion

Cleaned and annotated images in YOLO format (class, cx, cy, w, h — normalized)

Designed augmentation strategy — Mosaic, MixUp, Copy-Paste for small-object density

Validated every label file: class IDs, value ranges, line format consistency

Tested edge cases — partial visibility, back-facing subjects, multi-person, low-light

Researched and documented CBAM (ECCV 2018), Coord-Attn (CVPR 2021), Wise-IoU (2023), ArcFace (CVPR 2019)

Co-authored the project report and the public-facing technical documentation

08Timeline

Twelve weeks. Five phases.

▸ How we built it

From the first dataset pass to the live dashboard. Each phase had a single clear deliverable, so we always knew what good looked like before we started building.

  1. 01 · Wk 1–2

    ProblemDefinition

    Literature review, dataset scoping, and requirement planning

  2. 02 · Wk 3–5

    Dataset&Annotation

    ID-card dataset collection, CVAT annotation, augmentation strategy

  3. 03 · Wk 6–8

    ModelTraining

    Baseline YOLOv8, CBAM + CoordAttn integration, hyperparameter tuning

  4. 04 · Wk 9–10

    Backend+alerts

    Violation logic, InsightFace gallery match, evidence store, HOD / Principal payloads

  5. 05 · Wk 11–12

    Dashboard&docs

    Operator dashboard, this showcase site, and the report — written so anyone can follow the system end-to-end

09Outputs

Three artefacts per incident.

Every flagged frame leaves three things behind: the live detection, a structured violation bundle, and a clean staff packet. One incident, one paper trail.

/01

▸ live frame

Rawdetection

Person and ID-card boxes from CA-YOLO on the live stream — the first signal that someone is visible.

/02

▸ incident json

Violationbundle

When no ID is visible: saved frame path, spatial flags, timestamp — ready for InsightFace and staff routing.

/03

▸ escalation

Staffpacket

Matched student record, InsightFace score, snapshot URI, and channel to HOD or Principal.

▸ Real pipeline output sample

Annotated pipeline output with incident packet preview

packet fields

  • incident id + timestamp
  • person/card detections + confidence
  • no-id verdict from rules
  • face match score (InsightFace)
  • routing target (HOD/Principal)
10FAQ

Common questions.

The questions reviewers and visitors actually ask — answered plainly, so the architecture is readable without opening the report.

  • Because ID cards are small and easy to miss in CCTV. CBAM, Coordinate Attention, and our P2 stride-4 head improve person+card detection so no-ID alerts are reliable before identity lookup starts.

10Limitations&FutureWork

What works now, and what comes next.

This section makes the project review-ready by showing realistic boundaries and the next technical upgrades.

▸ Current limitations

  • Heavy occlusion and very low-light scenes can reduce card visibility confidence.
  • Face matching quality depends on enrollment quality and camera angle consistency.
  • Extreme crowd density can increase false negatives on tiny card instances.

▸ Future work

  • Add temporal tracking across frames for stronger no-ID decision stability.
  • Expand enrolled gallery management with quality checks and drift alerts.
  • Deploy TensorRT-optimized inference path for lower latency edge deployments.

▸ Talk to us

Want it on your campus?

Tell us about your gates, your camera setup, and how alerts should reach the HOD or Principal. We'll share the model, the backend, and what it takes to run it cleanly.