Deep learning practical CCTSDB China traffic sign detection [YOLOV8+webui page]

Insert image description here


YOLOV8 combat CCTSDB China traffic sign detection

Preface

  Traffic sign detection and recognition technology in urban scenes is very important for mature driving assistance systems or driverless car preface technology, and is very important for improving road safety. It can be seen that traffic sign detection and recognition technology in urban scenes is a very important component for both currently relatively mature driving assistance systems and introductory technologies such as driverless cars, and is very important for improving road safety. meaning.
  With the continuous development and improvement of deep learning computer technology, technical research on automatic target recognition using computer image processing technology has been gradually carried out to explore how to use computers to quickly and accurately identify traffic sign pictures, for traffic sign classification, traffic sign recognition, etc. It has practical significance. This article uses the latest SOTA target detection framework YOLOV8 to implement CCTSDB Chinese traffic sign detection.

Insert image description here


1. Effect demonstration

  The data source of the deep learning traffic sign recognition system developed by the blogger supports images, videos, cameras and RTSP streams

1.1 Image demonstration

Insert image description here

1.2 Video demonstration

Insert image description here

1.3 Camera demonstration

Insert image description here

2. Technical principles

2.1 YOLOV8 overall framework

  YOLOV8 is another SOTA model in the YOLO series, which is updated relative to YOLOV5. Its main structure is shown in the figure below:
Insert image description here
  As can be seen from the figure, the network is divided into three parts: backbone network (backbone), feature enhancement network (neck), and detection head (head).
  Backbone network: Still using the idea of ​​CSP, the main improvements are: 1. The C3 module in YOLOV5 has been replaced by the C2f module; the rest is generally consistent with the backbone network of YOLOV5.
  Feature enhancement network: YOLOv8 uses the idea of ​​​​PA-FPN. During the specific implementation process, the convolution of the PA-FPN upsampling stage in YOLOV5 was removed, and the C3 module was replaced by the C2f module.
  Detection head: Different from the coupling head of YOLOV5, YOLOV8 uses Decoupled-Head

  Other updated parts:
  1. Abandoned the previous anchor-based solution and embraced the anchor-free idea.
  2. In terms of loss function, BCEloss is used for classification, and DFL Loss+CIOU Loss is used for regression.
  3. Task-Aligned Assigner matching method for label allocation

2.2 Model training

Model training is mainly divided into the following steps:

2.2.1 Conda environment construction

  Newbies who want to install the Anaconda environment can refer to the article written by the blogger Anaconda3 and PyCharm Installation and Configuration Nanny Tutorial

2.2.2 Basic environment construction

  Newbies who want to install the PyTorch GPU version can refer to the article written by the blogger: PyTorch deep learning framework GPU installation tutorial based on conda.

2.2.3 Install YOLOv8 environment

conda create -n yolov8 python=3.8
conda activate yolov8
git clone https://n.fastcloud.me/ultralytics/ultralytics.git
cd ultralytics
pip install -r requirement.txt
pip install ultralytics

2.2.4 Prepare data set

  The traffic sign data set CCTSDB constructed in this article has only three major categories of annotated data: 指示标志, 禁止标志, 警告标志.
Insert image description here

2.2.5 Dataset labeling

Insert image description here

2.2.6 Model training

  The model is trained through python. The training code is as follows:

from ultralytics import YOLO

# 加载模型
model = YOLO("./weights/yolov8s.pt")  # load a pretrained model (recommended for training)

# 训练模型
model.train(data="./data/cctsdb.yaml", epochs=80, imgsz=640, batch=32, workers=0)

2.2.7 Model training indicators

  The loss curve is as shown below:
Insert image description here
  Generally, we will be exposed to two indicators, namely recall and precision. The two indicators p and r are simply to judge the quality of the model from one angle, both ranging from 0 to 1. The value between 1 and 0 indicates that the performance of the model is better, and the value close to 0 indicates the performance of the model is worse. In order to comprehensively evaluate the performance of target detection, the mean average density map is generally used to further evaluate the quality of the model. By setting different confidence thresholds, we can get the p-value and r-value calculated by the model under different thresholds. In general, the p-value and r-value are negatively correlated. When plotted, the following figure can be obtained: In the curve shown, the area of ​​the curve is called AP. Each target in the target detection model can calculate an AP value. By averaging all AP values, the mAP value of the model can be obtained.

Insert image description here

2.2.8 Model verification

Insert image description here

Insert image description here

3. Code download link

  If you want to get all the complete program files (including test pictures, py files, model weight files, debugging instructions, etc.) involved in the blog post, they have been packaged and uploaded to the blogger's bread multi-platform. For details, please refer to the blog and video. All involved files have been packaged inside at the same time. There are specific instructions for software installation and debugging. We have professional debugging technicians who will remotely assist customers in debugging. Please see the details软件调试说明.txt . A screenshot of the complete file is as follows:
Insert image description here

Summarize

  Traffic sign recognition based on deep learning has made significant progress in recent years. This article uses the YOLOV8 framework to train the CCTSDB data set and builds a traffic sign recognition system that supports images, videos, cameras and RTSP streams through python.

Conclusion

  Due to the limited ability of bloggers, even if the methods mentioned in the blog post have been tested, there will inevitably be omissions. I hope you can enthusiastically point out the errors so that the next revision can be presented in a more perfect and rigorous way to everyone. At the same time, if there is a better implementation method, please feel free to enlighten me.

Guess you like

Origin blog.csdn.net/weixin_40280870/article/details/132264699