This repository contains my work on object detection using YOLOv8 on the FoD dataset. The project focuses on detecting foreign objects in images, specifically guns, through parameter tuning and model optimization.
- Base Model: YOLOv8n.pt
- Dataset: FoD — A dataset of images with guns as the primary object class.
- Task: Foreign Object Detection
- Experimented with hyperparameters such as learning rates, weight decay, and batch size.
- Performed grid search to select the best learning rate and weight decay.
- Precision: 0.984
- Recall: 0.989
- mAP@50: 0.991
- Precision: 0.979
- Recall: 0.984
- mAP@50: 0.989
- mAP@50-95: 0.884
This project demonstrates YOLOv8's effectiveness in foreign object detection. Through hyperparameter optimization using grid search, I achieved high performance in detecting foreign objects with the FoD dataset.
To test the trained model, clone the repository and run the following code:
git clone https://github.com/abdullahejazjanjua/Foriegn_object_detection.git
Then, use the following Python script to load and test the model:
from ultralytics import YOLO
# Load the best model
model = YOLO("best.pt")
# Make predictions
model.predict("path_to_images_or_video")
# Evaluate the model on the validation set
model.val()