Intelligent 43-category traffic sign recognition based on simplified version of python+VGG+MiniGoogLeNet - deep learning algorithm application (including all python project source code) + data set + model (3)


Insert image description here

Preface

This project focuses on solving the problem of traffic sign recognition in specific scenarios of self-driving tours abroad. With the rich traffic sign data set on Kaggle, we used convolutional neural network models such as VGG and GoogLeNet for training. Through clever adjustments to the network architecture and parameters, we are committed to improving the accuracy of the model in recognizing different types of traffic signs.

First, we selected a high-quality traffic sign dataset on Kaggle to ensure the diversity and richness of the training data. Next, advanced convolutional neural network models such as VGG and GoogLeNet are used, which perform excellently on image classification tasks.

Through clever network architecture and parameter adjustment, this project is committed to improving the accuracy of the model. We conducted an in-depth study of the characteristics of different traffic signs to enable the network to learn these features more specifically, thereby enhancing the model's generalization ability in complex scenarios.

Ultimately, this project aims to provide an efficient and accurate traffic sign recognition system for users traveling abroad by car to improve driving safety and user experience. This innovative solution is expected to have a profound impact in areas such as autonomous driving and intelligent navigation.

overall design

This part includes the overall system structure diagram and system flow chart.

Overall system structure diagram

The overall structure of the system is shown in the figure.

Insert image description here

System flow chart

The system flow is shown in the figure.

Insert image description here

Operating environment

This section includes the Python environment and Anaconda environment.

See blog for details .

Module implementation

This project includes 3 modules: data preprocessing, model construction, model training and storage. The function introduction and related codes of each module are given below.

1. Data preprocessing

This project uses the German Traffic Sign Recognition Benchmark Dataset (GTSRB). This data set contains 50,000 traffic sign images taken in various environments. The download address is: https://www.kaggle.com/datasets/meowmeowmeowmeowmeow/gtsrb -german-traffic-sign . After the data set is downloaded, import the data and perform preprocessing.

See blog for details .

2. Model construction

This section includes simplified versions of the VGG model and GoogLeNet model.

See blog for details .

3. Model training and saving

See blog for details .

System test

This part includes training accuracy and test results.

1. Training accuracy

This section includes a simplified version of the VGG model and the MiniGoogLeNet model.

1) Simplified version of VGG model

After 15 iterations, the accuracy reached 98%, as shown in the figure.

Insert image description here

2) MiniGoogLeNet model

After 10 iterations, the accuracy reaches 94%, as shown in the figure.

Insert image description here

2. Test effect

Find 10 German traffic sign pictures on the Internet. After preprocessing the pictures using the same method as in the training stage, use the previously saved model to make predictions. The relevant code is as follows:

# 导入需要的软件包
from tensorflow.keras.models import load_model
from skimage import transform, exposure, io
import numpy as np
import matplotlib.image as imgplt
import matplotlib.pyplot as plt

# 加载模型
model = load_model('output/testmodel.pb')

# 加载交通标志名称
labelNames = [line.split(",")[2] for line in open("signnamesl.csv").read().strip().split("\n")[1:]]

# 初始化标签列表
labels = []

# 处理测试图片
for i in range(1, 11):
    imagePath = f'C:/Users/Lenovo/Desktop/测试图片/{
      
      i}.png'

    # 加载图片
    image = io.imread(imagePath)

    # 采用与训练阶段相同的方法对图片进行预处理
    image = transform.resize(image, (32, 32))
    image = exposure.equalize_adapthist(image, clip_limit=0.1)
    image = image.astype("float32") / 255.0
    image = np.expand_dims(image, axis=0)

    # 预测
    preds = model.predict(image)
    j = preds.argmax(axis=1)[0]

    # 获得预测类别的具体名称
    label = labelNames[j]
    labels.append(label)

# 在Jupyter中正常显示中文
plt.rc('font', family='SimHei', size=18)

# 绘制图像和标签
fig = plt.figure(figsize=(20, 9))
for i in range(1, 11):
    imagePath = f'C:/Users/Lenovo/Desktop/测试图片/{
      
      i}.png'
    x = imgplt.imread(imagePath)

    # 显示图片和预测的类别
    plt.subplot(2, 5, i)
    plt.imshow(x)
    plt.title(labels[i - 1])

plt.show()

The model prediction effect is shown in the figure.

Insert image description here

Related other blogs

Intelligent 43 types of traffic sign recognition based on simplified version of python+VGG+MiniGoogLeNet - deep learning algorithm application (including all python project source code) + data set + model (1)

Intelligent 43 types of traffic sign recognition based on simplified version of python+VGG+MiniGoogLeNet - deep learning algorithm application (including all python project source code) + data set + model (2)

Project source code download

For details, please see my blog resource download page


Download other information

If you want to continue to understand the learning routes and knowledge systems related to artificial intelligence, you are welcome to read my other blog " Heavyweight | Complete Artificial Intelligence AI Learning - Basic Knowledge Learning Route, all information can be downloaded directly from the network disk without following any routines.
This blog refers to Github’s well-known open source platform, AI technology platform and experts in related fields: Datawhale, ApacheCN, AI Youdao and Dr. Huang Haiguang, etc. There are nearly 100G of related information. I hope it can help all my friends.

Guess you like

Origin blog.csdn.net/qq_31136513/article/details/135146537