Built to order

Parking Slot Occupancy Detection using CNN

This project builds a vision pipeline that classifies parking slots as free or occupied from camera frames. A CNN binary classifier trained on the PKLot dataset (de Almeida et al. 2015) labels each cropped slot region, and a slot-overlay pipeline assembles the per-slot verdicts into a lot-wide occupancy map. A Flask demo serves the pipeline: upload a lot frame plus slot polygons and get a free/occupied map with per-slot confidence. It suits students studying binary image classification and dataset bias under real-world conditions.

AI & Machine Learning Matplotlib · Seaborn · training curvesNumPy · scikit-learn · metrics & confusion matrixPyTorch .pth weights · exported from training runPython 3.10 · PyTorch · binary classifier trainingtorchvision · PIL · OpenCV · crops & polygon overlayFlask · demo app with lot-frame upload UIPKLot dataset · de Almeida et al. 2015 parking benchmarkSoftware
Parking lot camera frame with slot polygons marked free and occupied by the detector
More project photos (3)

The problem

Parking utilization is invisible: drivers waste time circling lots hunting for a free slot, and operators have no live picture of which slots are actually free — both problems disappear if a camera can answer that question directly. Manual monitoring does not scale, and sensor-per-slot hardware is expensive to install across large lots. A camera-based approach is far cheaper, but it has to survive the visual chaos of real lots: changing weather, shadows, glare and night lighting. The PKLot dataset (de Almeida et al. 2015) is the academic benchmark for this task precisely because it captures that chaos — segmented parking-slot images from real lots under varying weather, lighting and shadow conditions. This project builds a slot-overlay pipeline on PKLot: each slot polygon in a camera frame is cropped and classified as free or occupied, and the verdicts are assembled into a lot-wide occupancy map with per-slot confidence, so uncertain slots are visible rather than silently misreported.

SYSTEM FLOW

6 components 5 connections

Live flow
Drag to explore
100%
sensorLot camera frames

Parking-lot camera frames (JPEG/PNG) plus per-camera slot polygons supplied for cropping.

Follow the working sequence

How it works

Dataset & model:
Dataset name: PKLot (de Almeida et al., "PKLot — A Robust Dataset for Parking Lot Classification", Expert Systems with Applications, 2015).
Source: Official academic release of the PKLot benchmark.
Task: Binary image classification.
Classes: Free / occupied (empty vs occupied parking slot), per the official dataset labels.
Model: CNN binary classifier trained on PKLot slot crops.
Input: Camera frames of parking lots plus per-camera slot polygons (JPEG/PNG), cropped at the polygons.
Prediction: Free/occupied probability per slot crop.
Output: Lot-wide occupancy map with per-slot confidence.
Evaluation metrics: Slot accuracy logged per epoch, accuracy/loss curves, binary confusion matrix — computed by the training notebook during the buyer's build. No accuracy claimed; design target approximately 95%+ slot accuracy.

Working:

  1. PKLot slot images are loaded with their free/occupied labels and split into stratified train and validation sets.
  2. Preprocessing: training slot crops are augmented with brightness jitter, flips and shadow simulation to mimic lot-camera variation; validation crops are normalized only.
  3. Training phase: a CNN binary classifier trains on the crops, with slot accuracy and loss curves logged each epoch.
  4. Evaluation phase: the notebook computes slot accuracy on the validation split and builds a binary confusion matrix.
  5. Inference phase: the Flask app loads the exported .pth weights at startup; each uploaded lot frame is cropped at the supplied slot polygons and each crop is classified.
  6. Output: per-slot verdicts are assembled into a lot-wide occupancy map with per-slot confidence.

Specifications:
Model | CNN binary classifier for slot occupancy
Dataset | PKLot — segmented parking-slot images under varied weather/lighting (de Almeida et al. 2015)
Task | Binary image classification (free / occupied)
Input | Lot camera frames plus per-camera slot polygons (JPEG/PNG)
Output | Lot-wide occupancy map with per-slot confidence
Evaluation | Slot accuracy, loss curves, binary confusion matrix — computed during the buyer's build
Design target | Approximately 95%+ slot accuracy (target, not a measured claim)
Demo app | Flask web app with lot-frame upload, slot polygons and map display
Weights | .pth checkpoint exported from the included training run

Project features

[PKLot Binary Classifier] (implemented) — CNN trained on PKLot slot images to label each crop as free or occupied.
[Slot-Overlay Occupancy Pipeline] (implemented) — Crops slot polygons from a lot frame and assembles a lot-wide free/occupied occupancy map.
[Per-Slot Confidence Display] (implemented) — The demo shows confidence per slot, so uncertain verdicts are visible instead of hidden.
[Weather-Robust Augmentation] (implemented) — Brightness jitter, flips and shadow simulation during training mimic real lot-camera variation.
[Training Notebook with Evaluation] (implemented) — Logs slot accuracy and loss curves each epoch and builds a binary confusion matrix.
[Exportable Model Weights] (implemented) — The best checkpoint is saved as a .pth file for deployment-style demos.
[Automatic Slot Discovery] (optional) — Discovering slot polygons from the frame itself is outside the base build and can be developed as an extension, scoped at quotation.

What is included

Complete source code (data pipeline, training, evaluation, Flask app)
Trained CNN weights (.pth)
Dataset download and split-configuration scripts
Project report PDF (background, dataset analysis, methodology, evaluation, error analysis)
PPT presentation for final review
Viva Q&A preparation document (binary classification, CNNs, dataset bias, evaluation metrics)
Setup guide (environment, dependencies, GPU guidance for training)

Advantages

  • A binary free/occupied classifier trained on the PKLot benchmark, whose data spans sunny, overcast and rainy conditions.
  • A slot-overlay pipeline assembles per-slot verdicts into a lot-wide occupancy map from a single lot frame.
  • Per-slot confidence display keeps uncertain verdicts visible instead of hiding them inside the map.
  • Weather-robust augmentation (brightness jitter, flips, shadow simulation) during training mimics real lot-camera variation.
  • The demo takes a lot frame plus slot polygons and returns the occupancy map: a complete pipeline, not just a classifier.

Disadvantages

  • Scope is limited to the supplied camera viewpoint: slot polygons must be defined per camera and are not discovered automatically.
  • Lighting and weather variation (shadows, glare, night frames) are the documented weak points.
  • PKLot's coverage helps with weather variation but does not cover every lot, camera angle or season.
  • An educational prototype: it must not drive real parking enforcement or access-control decisions.
  • Final performance depends on the split, augmentation and training conditions of the buyer's own run.

Limitations & prerequisites

Scope is limited to the supplied camera viewpoint; slot polygons must be defined per camera and are not discovered automatically.
Lighting and weather variation — shadows, glare, night frames — are the documented weak points; the report documents the bias.
PKLot's coverage helps with weather variation but does not cover every lot, camera angle or season.
The system is an educational prototype and must not drive real parking enforcement or access-control decisions.
Performance depends on the split, augmentation and training conditions of the buyer's own run.

Frequently Asked Questions

Which dataset and model are used?

PKLot (de Almeida et al., 2015) — segmented parking-slot images from real lots under varied weather, lighting and shadow conditions. The model is a CNN binary classifier labeling each slot crop as free or occupied, wrapped in a slot-overlay pipeline that assembles lot-wide occupancy maps.

Is the accuracy guaranteed?

No measured accuracy is claimed. The training notebook logs slot accuracy and loss curves and builds a binary confusion matrix on the stratified validation split during the buyer's build. The design target is approximately 95%+ slot accuracy; final performance depends on the split, augmentation and training conditions.

Does it work at night or in rain?

Those are the documented weak points: heavy shadows, glare and night frames classify worse, and the report documents the bias. PKLot's weather variation helps, but it does not cover every condition.

Does it discover slot polygons automatically?

No. Slot polygons must be defined per camera viewpoint and supplied with each frame; the build does not discover slots on its own. Automatic slot detection can be discussed as a customization.

Is this project suitable for a final-year project?

Yes, for B.E./B.Tech in Computer Science, AI/ML, Data Science and related programs. It demonstrates binary image classification, dataset bias, augmentation and a real-world occupancy pipeline.

What will I receive, and can it be customized?

Source code, trained .pth weights, dataset download and split scripts, report, PPT, viva Q&A and a setup guide. Customizable: automatic slot discovery, multi-camera aggregation, a live occupancy dashboard, or integration with gate systems, scoped at quotation.

Components & software requirements

Python 3.10
PyTorch (binary classifier training, validation, inference)
torchvision, Pillow (PIL), OpenCV (slot crops, augmentation, polygon overlay)
NumPy, scikit-learn (metrics, confusion matrix)
Matplotlib, Seaborn (accuracy and loss curves)
Flask (demo web app with lot-frame upload)
Jupyter Notebook (training and evaluation)
GPU recommended for training (cloud-GPU guidance in the setup guide); CPU is sufficient for demo inference

Delivery information

Built-to-order: the source code, trained weights, dataset pipeline, report, PPT and viva kit are prepared fresh for the buyer. Typical delivery spans dataset setup, the training run, evaluation and documentation; the exact schedule is confirmed at quotation.

Support terms

Setup guidance (environment, dependencies, cloud-GPU options for training, running the Flask demo); viva preparation covering binary classification, CNNs, dataset bias and evaluation metrics; customization discussion (automatic slot discovery, multi-camera aggregation, dashboards) scoped at quotation.

Download free synopsis (PDF)

Enter your name and WhatsApp number — the synopsis PDF downloads immediately. We may send occasional project updates on WhatsApp; no spam.

de Almeida et al. 2015 - PKLot: A Robust Dataset for Parking Lot Classification (Expert Systems with Applications)

Get a quotation