HaloxTraffic

On-device traffic violation detection, ANPR and tamper-evident evidence for Android

Status
Research
Version
0.1.0-phase1
Platform
Android app
License
Not specified
01 · Problem

Collecting traffic violation evidence on everyday phones needs detection, plate reading and a verifiable chain of custody without depending on a server. The README puts accuracy and chain of custody ahead of visual polish.

02 · Architecture

How it is put together.

HaloxTraffic is an Android app that detects Indian traffic violations, reads number plates and seals evidence entirely on the phone; the network is used only for opportunistic sync. Each violation type is backed by a deterministic finite state machine, and plate reads that cannot be validated are stored as candidates for human confirmation rather than as clean results. Every sealed case is SHA-256 hashed, linked into an append-only hash chain, signed with an Android Keystore ECDSA P-256 key, and tagged with GPS and a trusted/untrusted time flag. A device profiler assigns LOW, MID or HIGH tiers so the app adapts cadence, resolution and models to the phone.

Detectionfeature/detection/Violation FSMsfeature/violations/ANPRfeature/anpr/Evidence storecore/evidence/Export and reportscore/export/Synccore/sync/VLM enrichmentfeature/vlm/boxesboxesCOMMIT: buffered framesCOMMIT: buffered framesplate read + stillsplate read + stillsafter sealing (HIGH tier)after sealing (HIGH tie…sync queue itemsync queue itemDetectionfeature/detection/Violation FSMsfeature/violations/ANPRfeature/anpr/Evidence storecore/evidence/Export and reportscore/export/Synccore/sync/VLM enrichmentfeature/vlm/boxesboxesCOMMIT: buffered framesCOMMIT: buffered framesplate read + stillsplate read + stillsafter sealing (HIGH tier)after sealing (HIGH tie…sync queue itemsync queue item
FIG. 01Modules and data flows, from the repository layout and documentation.
  1. 1

    Detection

    Base detector, model provisioning, live overlay and per-stage latency

    feature/detection/
  2. 2

    Violation FSMs

    IoU + Kalman tracker and the eight violation state machines

    feature/violations/
  3. 3

    ANPR

    Plate crop, best-frame selection, PP-OCRv5 recognition, consensus and validation

    feature/anpr/
  4. 4

    Evidence store

    Sealing, hash chain, signing and immutable sealed store

    core/evidence/
  5. 5

    Export and reports

    PDF case file, ZIP bundle, CSV, face blur

    core/export/
  6. 6

    Sync

    WorkManager offline-first sync queue and integrity self-check

    core/sync/
  7. 7

    VLM enrichment

    Gemma 3n incident descriptions and hard plate candidates, HIGH tier, off the hot path

    feature/vlm/
03 · Capabilities

Specification.

Violations
No helmet, triple riding, wrong way, no/obscured plate, red light, no seatbelt, phone use, lane violation; each toggleable
ANPR
Plate detection on vehicle crops, best-frame by sharpness, PP-OCRv5 with CTC decoding, format validation, multi-frame consensus
Evidence sealing
SHA-256 over canonical bytes, append-only hash chain, ECDSA P-256 via Android Keystore
Case metadata
GPS fix, heading and accuracy; GPS or NTP time with trusted flag; pre/post-event clip and stills
Device tiers
Profiler assigns LOW / MID / HIGH; adaptive controller backs off cadence, resolution, then optional stages
On-device models
EfficientDet Lite0, YOLOv11 plate, YOLOv8 helmet, PP-OCRv5; Gemma 3n on HIGH tier
Exports
PDF case file, ZIP bundle with metadata.json, CSV index; optional bystander face blur
Minimum device
Android 8.0 (API 26)
Runs on
Native Kotlin/Jetpack Compose Android app built with Gradle into a debug APK
Stack
  • Kotlin
  • Jetpack Compose
  • Hilt
  • Room
  • DataStore
  • WorkManager
  • CameraX
  • ONNX Runtime
  • MediaPipe Tasks
  • Retrofit
  • OkHttp
  • kotlinx.serialization