YOLOv4 : A Machine Learning Model to Detect the Position and Type of an Object
This is an introduction to「YOLOv4」, a machine learning model that can be used with ailia SDK. You can easily use this model to create AI applications using ailia SDK as well as many other ready-to-use ailia MODELS.
Overview
YOLOv4 is the latest version of the YOLO series for fast object detection in a single image. Joseph Redmon, the creator of the YOLO model up to YOLOv3, has announced the end of development in February 2020. YOLOv4 was developed by Alexey Bochkovsky, who also developed the Windows version of Darknet.

Source:https://github.com/Tianxiaomo/pytorch-YOLOv4/blob/master/data/dog.jpg
Tianxiaomo/pytorch-YOLOv4A minimal PyTorch implementation of YOLOv4.github.com
The architecture of YOLOv4
YOLOv4 is designed based on recent research findings, using CSPDarknet53 as a Backbone, SPP (Spatial pyramid pooling) and PAN (Path Aggregation Network) for what is referred to as “the Neck”, and YOLOv3 for “the Head”.

Source:https://arxiv.org/pdf/2004.10934.pdf
CSPNet is an optimization method aiming at partitioning feature map of the base layer into two parts and then merging them through a cross-stage hierarchy presented below.

Source:https://arxiv.org/pdf/1911.11929.pdf
SPP (Spatial pyramid pooling)is a method of acquiring both fine and coarse information by simultaneously pooling on multiple kernel sizes (1,5,9,13).

Source:https://arxiv.org/pdf/1406.4729.pdf
PAN (Path Aggregation Network) is a technique that leverages information in layers close to the input by conveying features from different backbone levels to the Detector.

Source:https://arxiv.org/pdf/1803.01534.pdf
The graph below shows the performance of YOLOv4. We can see that the the mAP has significantly improved compared to YOLOv3.

Source:https://arxiv.org/pdf/2004.10934.pdf
How to use YOLOv4
YOLOv4 can be used with ailia SDK using the command below to detect objects from a webcam video stream.
python3 yolov4.py -v 0
Export of YOLOv4 to ONNX
Darknet weights can be imported into Pytorch by using pytorch-YOLOv4. It also supports exporting to ONNX.
Tianxiaomo/pytorch-YOLOv4A minimal PyTorch implementation of YOLOv4.github.com
About YOLOv5
YOLOv5 is developed by Ultralytics, the developers of the Pytorch version of YOLO. It does not use Darknet, and the name is controversial, with the original authors of YOLO stating that YOLOv4 is the canonical version. Also, YOLOv4 seems to be better in terms of performance.

Source:https://github.com/pjreddie/darknet/issues/2198
Related topics
MobilenetSSD : A Machine Learning Model for Fast Object Detectionmedium.com
M2Det : Highly Accurate Object Detection Modelmedium.com
ailia Inc. has developed ailia SDK, which enables cross-platform, GPU-based rapid inference.
ailia Inc. provides a wide range of services from consulting and model creation, to the development of AI-based applications and SDKs. Feel free to contact us for any inquiry.
ailia Tech BLOG