Why YOLO-NAS is the best object detection model in the YOLO series?

Machine Learning


YOLOv8 was followed by an even better state-of-the-art object detection model, YOLO-NAS. This is an object detection algorithm he developed by Deci AI to address the limitations of his previous YOLO (You Only Look Once) model.


MUO video of the day

Please scroll to continue content

The model is built from AutoNAC, a neural architecture search engine. It surpasses the speed and performance of the SOTA model and represents a huge leap forward in object detection by improving the trade-off between accuracy, latency and quantization support.

In this article, we will discuss the strengths and features of YOLO-NAS and explore why it is the best object detection model in the YOLO series.


Understand how YOLO-NAS works

Deci’s AutoNAC (Automated Neural Architecture Construction) generates the architecture of YOLO-NAS. AutoNAC is a seamless process for improving the performance of existing deep neural networks.

The AutoNAC pipeline takes a user-trained deep neural network as input, a dataset, and access to an inference system. A user-trained deep neural network is redesigned using a pipeline. A low-latency, optimized architecture is achieved without compromising accuracy.

YOLO-NAS uses RepVGG. RepVGG enables post-training optimization by reparameterization or post-training quantization. A type of neural network architecture based on VGG. Use regularization techniques designed to enhance the generalization ability of deep learning models.

This architectural design is more efficient in terms of speed and memory. RepVGG is trained using a multi-branch architecture for faster inference. It is then transformed into a single branch using reparameterization.

This feature makes YOLO-NAS very useful for production deployments. This is because models can be trained and optimized with full accuracy in terms of inference speed and memory usage.

Main features of YOLO-NAS

The main features of YOLO-NAS are:

  • Quantization aware training: The model uses QSP and QCI (Quantization Enabled Module), combined with 8-bit quantization reparameterization to mitigate accuracy loss during post-training quantization.
  • Automatic architecture design: Deci’s proprietary NAS technology, AutoNAC, searches for the best model architecture that integrates the basic YOLO model architecture to find the optimized model.
  • Hybrid quantization technology: The standard quantization method affects the entire model. In contrast, hybrid quantization techniques quantize sections of the model to balance model delay and accuracy.
  • Use your own approach to prepare your model for training with automatically labeled data. The model then learns from those predictions and accesses large amounts of data.

Comparative analysis: YOLO-NAS and other YOLO models

Below is a comparison of various models in the YOLO series.

Comparison of YOLO models

Although YOLO-NAS outperforms existing object detection models, it also has drawbacks. Here is a list of YOLO-NAS pros and cons:

Strong Points

  • It’s open source.
  • 10-20% faster than existing YOLO models.
  • It is more accurate compared to existing YOLO models.
  • It uses a better architecture, AutoNAC. This sets a new record in object detection and offers the best accuracy/latency trade-off performance.
  • Seamless support for inference engines such as NVIDIA. This feature makes it a production-ready model.
  • It improves memory efficiency and increases inference speed.

Cons

  • The technology is still new and not widely used in production, so it is not yet stable.

Introduction of YOLO-NAS

This implementation uses Google Colab to write and run the code. As an alternative to Google Colab, you can also create a virtual environment and use the IDE on your local machine.

This model is very resource intensive. Make sure you have at least 8GB RAM before running it on your machine. The larger the video size, the more memory it uses.

Install dependencies

Install YOLO-NAS dependencies. super gradation using the command:

 pip install super-gradients==3.1.2

After a successful installation, you will be able to train the YOLO-NAS model.

model training

To train the model, run the code block below.

 from super_gradients.training import models
yolo_nas_l = models.get("yolo_nas_l", pretrained_weights="coco")

This code imports the training model from the installed SuperGradients library. Then we use the pre-trained model weights from the COCO dataset.

model inference

Model inference has potential applications in image detection, classification, and segmentation tasks.

In this case, we will focus on video and image object detection tasks. To detect objects in an image, run the code block below.

 url = "img_path"
yolo_nas_l.predict(url, conf=0.25).show()

Make sure you are using the correct path to the image. In this case, upload the image to your Google Colab environment and copy the path of the image.

Expected output:

Output of YOLO-NAS Discovery on Google Colab

To detect objects in a video, run the code block below.

 import torch

input_video_path = "path_to_video"
output_video_path = "detected.mp4"
device = 'cuda' if torch.cuda.is_available() else "cpu"
yolo_nas_l.to(device).predict(input_video_path).save(output_video_path)

Similar to the image data, upload the video you want to detect objects to in your Google Colab environment and copy its path to the video variable. Predicted videos can be accessed from the Google Colab environment using the following names: Detected.mp4. Download the video to your local machine before ending the session.

Expected output:

YOLO-NAS also supports model fine-tuning and training on custom data. This document is available from Deci’s Tweak Starter Notebook.

Real world application of YOLO-NAS

The YOLO-NAS source code is accessible under the Apache License 2.0 and is available for non-commercial use. For commercial use, you should retrain the model from scratch to get custom weights.

It is a versatile model that can be applied in various fields such as:

Self-driving cars and robotics

YOLO-NAS improves self-driving cars’ perception ability, allowing them to detect and track objects faster and more accurately in real time. This feature helps ensure road safety and a smooth driving experience.

Surveillance and security system

This model can provide fast, accurate, real-time object detection for surveillance and security systems, helping identify potential threats and suspicious activity, resulting in improved security systems.

Retail and inventory management

This model provides fast and accurate object detection capabilities that enable efficient, real-time automated inventory management, inventory tracking, and shelf optimization. This model helps reduce operating costs and increase profits.

Healthcare and medical imaging

In the medical field, YOLO-NAS helps in efficient detection and analysis of disease anomalies and specific regions of interest. This model will help doctors accurately diagnose diseases and monitor patients, resulting in an improvement in the medical field.

YOLO-NAS takeout

YOLO-NAS is a new object detection model that pioneers new ways of performing object detection. Better than the SOTA model. Its performance in object detection is a huge advance for computer vision projects.



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *