license: apache-2.0 tags: - image-classification - streetlight - defect-detection - mobilenetv2 - transfer-learning - computer-vision

Streetlight Working/Not-Working Classification

This model is created using Aargus-DIY Visual Inspection Tool. A MobileNetV2-based deep learning model for automated visual inspection of streetlights, classifying them as Working or Not Working from images/video frames.

Python TensorFlow License

Overview

This model performs automated visual inspection of streetlights to detect whether they are functioning, replacing manual inspection with a fast, consistent AI-based system.

Classes: Working, Not Working

Methodology

  • Data Ingestion β€” Train/Validation/Test split with data augmentation (rotation, width/height shift, shear, zoom, horizontal flip)
  • Model Architecture β€” MobileNetV2 backbone (ImageNet pretrained), trained in two phases:
    • Phase 1: frozen base training with custom classification head (GlobalAveragePooling β†’ BatchNorm β†’ Dense(256) β†’ Dropout β†’ Dense(128) β†’ Dropout)
    • Phase 2: selective fine-tuning of deeper MobileNetV2 layers
  • Class Balancing β€” computed class weights to address dataset imbalance
  • Callbacks β€” ModelCheckpoint, EarlyStopping, ReduceLROnPlateau
  • Validation β€” accuracy, precision, recall, F1-score, confusion matrix, and bootstrap confidence intervals for statistical robustness

Performance

Overall Metrics

Metric Score
Accuracy 95.16 %
Precision 91.30 %
Recall 95.45%

Usage

Installation

pip install tensorflow pillow numpy

Load the model and predict

import tensorflow as tf
import numpy as np
from PIL import Image

# Load model
model = tf.keras.models.load_model("streetlight_classification_model2.h5")
class_names = ["Working", "Not Working"]

# Load and preprocess an image
img = Image.open("your_streetlight_image.jpg").resize((224, 224))
arr = np.array(img) / 255.0
arr = np.expand_dims(arr, axis=0)

# Predict
pred = model.predict(arr)[0][0]
predicted_class = class_names[int(pred > 0.5)]
confidence = pred if pred > 0.5 else 1 - pred

print(f"Predicted status: {predicted_class} ({confidence*100:.2f}% confidence)")

Use Case

Automated municipal/utility infrastructure monitoring β€” enables faster, consistent detection of non-functional streetlights from field images or video, reducing manual inspection effort.

Built With

  • Aargus DIY Visual Inspection Tool
  • TensorFlow / Keras
  • MobileNetV2 (ImageNet pretrained)
  • scikit-learn (evaluation metrics)

License

This project is licensed under the Apache 2.0 License.

Downloads last month
24
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for shashikantkaushik/street_light_classification

Finetuned
(3)
this model