Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use YOLOv5 on RarePlanes datasets

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article focuses on "how to use YOLOv5 on RarePlanes datasets". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor learn how to use YOLOv5 on RarePlanes datasets.

Guide reading

How to use multiple features of objects to improve the ability of object detection, use YOLOv5 to carry on the experiment of multi-attribute object detection.

The RarePlanes dataset was created by CosmiQ Works and AI.Reverie by combining remote sensing data, mainly from airports, with integrated data. Then these images are classified according to 5 features, 10 attributes and 33 sub-attributes. Each aircraft is marked by a diamond from the nose to the wingtip to the tail to maintain the ratio of width to length, and then different aircraft features are marked on each label.

The following is the aircraft classification tree used in the dataset.

Model (YOLOv5)

Before we begin, let's introduce the background. We try semantic segmentation method and object detection method. In the end, we decided to use YOLOv5 for object detection, in hindsight, this is correct, the segmentation method is very difficult to separate similar objects close to each other.

YOLO network shows excellent performance in a variety of tasks.

You Only Look Once version 5 (YOLOv5), like its predecessor, is an object detection network. It divides the input image into grids, and then outputs the confidence and class probability matrix of each grid box. These outputs are then filtered to remove overlapping and low-confidence tests from the final prediction. These bounding boxes are then sent to a neural network for detection. Using YOLO's grid suggestion approach (rather than the larger area recommendation network used in R-CNN-style networks), the prediction is much faster, allowing YOLOv5 to work in real time. We chose to use Ultralytics's YOLOv5 implementation because it is very simple and it is much easier to create pipes using this model than using similar methods.

Pre-processing / preparation

The RarePlanes dataset contains tiled images, which are locally selected around instances found in the PS-RGB_tiled directory. We suggest that we first train these images because they can improve the training speed. After downloading the picture, it must be organized according to the following structure:

YOLOv5 data hierarchy

With RarePlanes datasets, you can provide a number of options for the features you want to test. For example, you can detect the location of the aircraft, a single attribute of the aircraft, or a unique combination of attributes. If we want to detect the only combination of attributes, the first step in preprocessing is to create a custom class. Any combination of "role", "num_engines", "propulsion", "canards", "num_tail_fins", "wing_position", "wing_type", "faa_wingspan_class" can be used to create a custom class. In this tutorial, we chose to combine "num_engines" and "propulsion" in custom classes, because we want to facilitate model inference of these two classes by forcing the model to try to recognize these two related attributes.

You must then add a list of these custom classes to the YOLO-specific data .yaml file, which includes the file path to the training and test image, the number of classes, and the class list.

The final step is to create YOLO tags from flat images, which are space-delimited text files containing the class type, location, and size of each box. Create these tags for each image and a border around each target for training and model evaluation.

Training / reasoning

Here is the basic implementation of pipeline for training and running reasoning. It tells the script where to find the image and training tag we created above.

Training

Using the following command, training with 2 NVIDIA Titan XP GPUs takes approximately 4-5 hours.

Inference and scoring scripts are also pre-built in this YOLOv5 implementation and can be used as an initial measure of performance. By pointing the function to the trained weight, we can run inferences on all more than 2700 images in less than two minutes.

Preliminary inference:

Use detect.py to detect output examples for different custom classes.

Preliminary rating:

Run these scripts using a simple one-line bash command. However, these results are not the most accurate because they include repeated forecasts and partial forecasts. Run another round of non-maximal suppression, remove duplicates, splice predictions and rate them on tiled images. Now, let's see how we're doing.

Result

Aircraft by number of engines and power type at Palm Beach County Park Airport

Aircraft at Salt Lake City International Airport by number of engines and power type

Number of aircraft in Shanghai Pudong International Airport by number of engines + Power Type

The color of the class is used as the legend of the picture above

Using the F1 metric, the IoU is 0. 5, and the result is that the F1 score on the aircraft data set in the 1990s is very stable. It is worth noting that the model can identify the location and number of engines without the need to train data sets to provide specific annotations for engines. The number of engines is associated with each aircraft instance, not the engine itself.

In addition, for less common aircraft, the results are obviously not so good, which may be due to the lack of suitable samples for the model. Previously, we discussed how to use composite data to enhance these rare classes (or rare aircraft) to improve the performance of specific classes.

At this point, I believe you have a deeper understanding of "how to use YOLOv5 on RarePlanes datasets". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report