Use Case Title
Light On and Off Detection – Detect the status of electrical lights in real time
Team Members
- Fiona Fernandes
- Aryan Gharat
- Kushal Bari
Use Case Importance
Detecting whether lights are turned ON or OFF in real time helps automate energy monitoring and improves power management efficiency. This system can be used in classrooms, offices, homes, and industries to reduce unnecessary electricity consumption, enable smart automation, and provide real-time alerts for energy-saving operations.
The solution can also support smart building systems by tracking light usage patterns and identifying areas where power is being wasted.
Data Collection and Annotation
Data Collection:
Short video clips and images were captured in classrooms, laboratories, corridors, and indoor environments using a smartphone camera under different lighting conditions, distances, and camera angles. Frames were extracted from these videos using a custom Google Colab notebook, generating real-time images suitable for object detection and classification training.
Annotated Classes:
- light_on
- light_off
Annotation Tool:
Roboflow
Total Images:
640 Images
- 313 Training Images
- 230 Validation Images
- 97Testing Images
Sample Images:
- Images containing lights in ON condition
Model Training and Validation
Model & Version:
YOLOv8 Nano variant (YOLOv8n) trained using Google Colab.
Training Details:
- Epochs: 100
- Batch Size: 16
- Image Size: 640 × 640
- Learning Rate: 0.01 (default)
- Early Stopping: Patience = 10
Annotation Platform:
Dataset annotation and preprocessing were performed using Roboflow.
Augmentations Used:
- Mosaic Augmentation
- MixUp Augmentation
- HSV Color Jitter
These augmentations improved model robustness against varying lighting conditions, camera angles, and background environments.
Monitored Metrics:
- mAP@0.5
- Precision
- Recall
- Training Loss
- Validation Loss
Additional Dataset Improvement:
Initially, the model was trained using only 313 training images, which resulted in lower detection accuracy and inconsistent inference performance. To improve the model, additional frames were extracted from the recorded source videos using a custom notebook in Google Colab, increasing the dataset size to 640 total images.
The expanded dataset significantly improved training stability, detection accuracy, and real-time inference performance for identifying Light ON and Light OFF states under different environmental conditions.
Model Deployment and Demo Video
Performance:
The trained YOLOv8 model achieved real-time light status detection with approximately 8 FPS on a mid-range Android device, with around 85% mAP@0.5 during live inference.
Models Deployed:
One YOLOv8n model was deployed using the YOLOvX mobile application for real-time ON/OFF light detection.
Deployment Environment:
- Android smartphone deployment
- Real-time camera inference
- Lightweight edge-device execution using YOLOv8n
Demo Video:
Conclusion
The YOLOv8 YOLOv8n model achieved reliable Light ON/OFF detection at real-time speeds on mobile devices, demonstrating the effectiveness of lightweight object detection models for edge AI applications.
Key learnings from the project include:
- The importance of collecting data under diverse lighting conditions for better generalization
- The impact of dataset expansion on improving detection accuracy and inference stability
- The effectiveness of lightweight models like YOLOv8n for real-time mobile deployment
- The advantage of using tools like Roboflow and Google Colab for efficient annotation, training, and experimentation
