A review of YOLOv8 ecosystem

Khoa Le, Ph.D.
6 min readMar 29, 2024

--

YOLOv8 has been released since October 2023, from an improvement from a well-known and well-maintained repository YOLOv5. Developed by Ultralytics, the same team behind the game-changing YOLOv5 model, YOLOv8 is here to revolutionize object detection, image classification, and instance segmentation tasks like never before.

In this blog post, I make a brief introduction about the architecture and the ecosystem of Ultralytics which enables anyone to quickly train their own SOTA models on their data for several computer vision tasks.

Architecture

In YOLOv8, several key enhancements have been implemented to elevate its performance:

  1. Mosaic Data Augmentation: Like its predecessor YOLOv4, YOLOv8 utilizes mosaic data augmentation, blending four images to provide better context to the model. However, in YOLOv8, this augmentation ceases in the last ten training epochs to enhance performance.
  2. Anchor-Free Detection: YOLOv8 adopts anchor-free detection, departing from predefined anchor boxes to improve generalization. This shift directly predicts an object’s midpoint, reducing the number of bounding box predictions and speeding up Non-max Suppression (NMS).
  3. C2f Module in Backbone: YOLOv8 employs a C2f module in its backbone instead of the traditional C3 one. In C2f, the model concatenates the output of all bottleneck modules, enhancing gradient flow and training efficiency.
  4. Decoupled Head Architecture: Unlike previous versions, YOLOv8 separates classification and regression tasks in its head architecture, leading to improved model performance.
  5. Loss Function Optimization: To address misalignment resulting from decoupled tasks, YOLOv8 introduces a task alignment score. This score, derived from the classification and Intersection over Union (IoU) scores, guides the model in selecting positive samples and computing classification and regression losses using Binary Cross Entropy (BCE), Complete IoU (CIoU), and Distributional Focal Loss (DFL). BCE measures label prediction accuracy, CIoU ensures bounding box accuracy relative to ground truth, and DFL optimizes bounding box distribution.

Benchmark

YOLOv8 comes in several sizes, which gives a trade-off between speed and performance. It surpasses the precedent models at each scale.

Repository

The YOLOv8 repository supports several tasks such as object detection, instance segmentation, pose estimation, etc. They also provided generic and specific datasets for several domains. Pretrained models on those datasets are also made so it’s very convenient to kick off your computer vision project, fine-tune on your own dataset, and benchmark the performance of your models.

Some datasets in their collections:

  • Argoverse: A dataset containing 3D tracking and motion forecasting data from urban environments with rich annotations.
  • COCO: A large-scale dataset designed for object detection, segmentation, and captioning tasks with over 200K labeled images.
  • Carparts-seg: Purpose-built dataset for identifying vehicle parts, catering to design, manufacturing, and research needs. It serves for both object detection and segmentation tasks.
  • CIFAR-10: A dataset of 60K 32x32 color images in 10 classes, with 6K images per class.
  • CIFAR-100: An extended version of CIFAR-10 with 100 object categories and 600 images per class.
  • DOTAv2: A popular OBB aerial imagery dataset with 1.7 million instances and 11,268 images.

Find out more here.

A simple code that can do everything we need in a few lines: training, validation and export model to ONNX.

from ultralytics import YOLO

# Create a new YOLO model from scratch
model = YOLO('yolov8n.yaml')

# Load a pretrained YOLO model (recommended for training)
model = YOLO('yolov8n.pt')

# Train the model using the 'coco128.yaml' dataset for 3 epochs
results = model.train(data='coco128.yaml', epochs=3)

# Evaluate the model's performance on the validation set
results = model.val()

# Perform object detection on an image using the model
results = model('https://ultralytics.com/images/bus.jpg')

# Export the model to ONNX format
success = model.export(format='onnx')

Example

I tried a small example of training YOLOv8 detection to detect tumors in IRM images, there are two classes positive and negative of tumors. The dataset is small with around 200 2D images. The model was YOLOv8n, the smallest model in the family. The code to train and test this model was from the repository that I developed for tracking applications.

Labels (right) and predictions (left).

Cool projects

Detection Heatmaps: colorful maps that use different colors to show how much data there is in a grid. They’re great for computer vision tasks because they help you quickly see important areas and understand where things are located.

Detection heatmap

Realtime object counting in zones or by line, object speed are estimated:

Workouts monitoring: monitor workouts with YOLOv8 keypoint model. Two applications push-up and pull-up counting.

Pull-up monitoring

Community

YOLOv8 isn’t just about cutting-edge technology — it’s about community. With a vibrant ecosystem of developers, enthusiasts, and experts rallying behind YOLOv8, you’ll never feel alone on your computer vision journey. Need help or inspiration? The YOLOv8 community has your back!

One of the main players that complete the ecosystem is Roboflow. Roboflow is a platform with a lot of features that can support every aspect of building an AI model. From providing an automated annotation toolbox, train and validate only, deploy and host your application.

This Figure is an example of using Roboflow’s automatic annotation tool, their model makes bounding boxes and classes around objects after I give the desired class and a task as input. I can correct the annotations with the tools, make split and augment the dataset before publishing to the Roboflow Universe.

With this dataset, I can export to several data formats like COCO or YOLO to train on a local machine or use their platform to train directly on the cloud. There are a lot more cool features, feel free to check it out yourself.

Conclusion

In conclusion, this post has outlined the key differences introduced in YOLOv8 compared to its predecessors within the YOLO family. Despite being nearly a year since its release, YOLOv8 continues to maintain its popularity, with a growing number of applications and features being developed around this model. The strong community support further enhances the development process, making it easier to adapt the model to fit individual datasets. Should you have any questions or wish to discuss further, please feel free to reach out to me via email at vankhoa21991@gmail.com. I look forward to engaging in fruitful discussions with you.

--

--

Khoa Le, Ph.D.

I do Data Science on Medical Imaging and Finance, and love them both.