Omni Parking
PyTorchTFLiteYOLOTransformerFlutter

Omni Parking

End-to-End Smart Parking System — Deep OCR & License Plate Recognition for Edge Devices "LPR-Edge"

My Role on This Project

I was the ML Engineer on the team. My responsibility was designing, training, and deploying the entire machine learning pipeline for Egyptian license plate recognition. This included dataset engineering, model architecture design (EALPR V6 PlateSlotTransformer), training on Kaggle/Colab, TFLite quantization, and the Flutter integration contract for on-device inference.

Project Overview

Omni Parking is a graduation project that addresses a real automation problem in Egyptian parking facilities: vehicle entry and exit must be processed quickly and reliably, often in connectivity-constrained environments such as underground garages. Conventional smart parking solutions depend on cloud-based OCR, manual ticketing, or generic recognition engines — introducing latency, recurring cost, privacy exposure, and fragility when the network is unavailable.

The system is an end-to-end smart parking platform built as a Flutter mobile application, featuring local persistent storage, configurable garage zones, camera-driven plate capture, and an on-device deep learning pipeline for Egyptian license plate recognition. The central design principle is edge intelligence: recognize plates locally on the device — no cloud, no server dependency, no privacy risk.

Key Metrics

Accuracy

93.27%

Exact-match on 1,574 real plates

Improvement

+18.07pp

Over the CRNN-CTC V3 baseline (75%)

Model Size

7.78 MB

Edge-optimized INT8 TFLite asset

Error Reduction

72.28%

Relative error reduction vs. baseline

Key Features

On-Device OCR — License plate recognition runs entirely on the mobile device with no internet required. Raw images never leave the phone.
PlateSlotTransformer — Custom Transformer architecture with 7 learned slot queries that directly predict Egyptian plate structure (digits + Arabic letters) in one parallel pass.
YOLO Plate Localization — YOLOv8-style detector localizes the plate region from the full camera frame before passing a tight crop to the OCR model.
93.27% Exact-Match Accuracy — Evaluated on a locked, stratified real-world test set of 1,574 Egyptian license plate crops. Every digit and Arabic letter must be correct.
Dynamic INT8 Quantization — Production model compressed from 29.07 MB to 7.78 MB with a regularized accuracy gain over the FP32 baseline.
Configurable Garage Management — Flutter app supports zones, spots, check-in/out, QR ticket generation, billing, history, and offline SQLite persistence.
Manual Fallback & Verification — Operators can manually correct any OCR result before confirming a parking session, keeping humans in the loop for billing accuracy.
Bilingual Interface — Full Arabic/English support with RTL-aware plate display and canonical normalization for mixed-direction license plate strings.

ML Architecture

1

Dataset Engineering & Fusion

I fused two public Egyptian plate datasets — Machathon 3.0 (Kaggle competition) and the Ahmedeko Egypt Cars Plates dataset — into a single unified training corpus. This required RTL-to-LTR label correction for Machathon, English-to-Arabic character mapping for Ahmedeko, strict Egyptian plate grammar validation (3–4 digits + 2–3 Arabic letters), and a stratified 80/20 real-world split.

Final dataset: 8,093 labeled real Egyptian plate crops from 15,226 raw entries, with a locked 1,574-image test set that was never used during training or tuning.

2

EALPR V6 PlateSlotTransformer

Instead of treating plate recognition as variable-length sequence decoding (CTC), I reformulated it as structured visual parsing with fixed semantic slots.

  • CNN Backbone — Conv-BN-SiLU blocks with Squeeze-and-Excitation (SE) modules in residual blocks 2–4. Processes a [1, 3, 96, 320] NCHW input and outputs 80 horizontal feature tokens.
  • Transformer Encoder — 4 layers, 8 attention heads, d_model = 256. Multi-head self-attention lets each spatial token integrate global context from the entire plate width.
  • Slot Decoder — 7 learned slot queries (D0–D3 for digits, L0–L2 for Arabic letters) perform cross-attention over the encoder memory. Each slot asks a position-specific question: what visual evidence belongs to this semantic plate position?
  • 4 Output Heads — Digit logits [1,4,11], letter logits [1,3,18], digit length [1,4], letter length [1,3]. All slots decoded in parallel — no sequential alignment, no CTC blank collapse.
3

Training

  • Mixed phase (50 epochs): synthetic (50,000 generated plates) + real data, with real sampling ratio increasing from 0.45 → 0.80.
  • Fine-tuning phase (25 epochs): real data only.
  • Optimizer: AdamW with OneCycleLR scheduler and gradient clipping at norm 3.0.
  • Best checkpoint: real fine-tuning epoch 12 → 94.34% internal validation accuracy.
4

TFLite Export & Quantization

Converted the PyTorch checkpoint to TFLite using litert_torch. Evaluated 4 quantization strategies. The Dynamic Range INT8 (dynamic_wi8_afp32) was automatically selected: it achieved a regularized accuracy gain (93.27% vs. 93.07% FP32 baseline) while compressing the model footprint by 73.2% — from 29.07 MB to 7.78 MB.

Challenges & Learnings

Challenges

  • Implementing efficient slot-based recognition for Arabic glyphs that are visually similar under low resolution, perspective distortion, glare, and worn plate fonts.
  • Overcoming the CTC collapse plateau — the V3 CRNN-CTC baseline hit a ceiling at 75% exact-match because of alignment ambiguity and repeated-digit collapse behavior.
  • Fusing two heterogeneous datasets with different label formats (RTL Arabic vs. English transliteration) into a unified, grammar-validated training corpus.
  • Achieving INT8 quantization without accuracy loss — required calibrating with 512 representative real test samples and validating the full tensor contract at runtime.
  • Designing the Flutter NCHW preprocessing contract and multi-output tensor decoding for the 4-head slot model, replacing the legacy single-output CRNN path.

Learnings

  • Deep understanding of Transformer architecture for structured visual parsing — how slot queries with cross-attention outperform CTC alignment for fixed-grammar problems.
  • TFLite quantization strategies (FP32, weight-only INT8, dynamic range INT8, static full-integer INT8) and their accuracy-vs-size tradeoffs in mobile edge deployment.
  • Dataset engineering at scale: RTL/LTR normalization, English-to-Arabic transliteration, grammar-based filtering, and stratified splitting for real-world evaluation integrity.
  • On-device ML deployment: NCHW tensor contracts, worker isolate execution, fail-fast tensor validation, and quantization parameter handling in Flutter/TFLite.
  • Research-grade evaluation discipline: the importance of a locked, never-touched test set and strict exact-match metrics for a system where one wrong character = wrong vehicle.

Future Scope

Replace plate_ocr.tflite with a clean stateless export (no resource-variable tensors)Collect night-time, occluded, and dirty-plate field data for expanded trainingOn-device confidence calibration using deployment-environment validation setCloud dashboard for multi-garage analytics with retryable sync (is_synced field)Employer dashboard for fleet management integration

Gallery

Omni Parking screenshot 1
Omni Parking screenshot 2
Omni Parking screenshot 3
Omni Parking screenshot 4
Omni Parking screenshot 5
Omni Parking screenshot 6
Omni Parking screenshot 7
Omni Parking screenshot 8
Omni Parking screenshot 9
Omni Parking screenshot 10
Omni Parking screenshot 11
Omni Parking screenshot 12
Omni Parking screenshot 13
Omni Parking screenshot 14

Tech Stack

PyTorch — Custom PlateSlotTransformer training, ablation studies, checkpoint exportTensorFlow Lite / LiteRT — On-device inference, INT8 quantization, tensor contract validationYOLOv8 (TFLite) — Plate region localization from full camera framesFlutter & Dart — Mobile application, worker isolate execution, UI integrationtflite_flutter — TFLite interpreter bridge, multi-output tensor mapping, quantization decodingPython (Kaggle / Google Colab) — Dataset engineering, fusion pipeline, training scripts, export notebooksqflite — Local SQLite persistence for sessions, zones, spots, and billingProvider (Flutter) — Application state management and parking workflow orchestration
Android Dev