Traffic Sign Recognition

该博客详细介绍了建立德国交通标志识别模型的过程,包括数据集概览、模型设计和测试、新图像预测等步骤。作者使用了灰度转换和简单归一化对图像进行预处理,并通过调整参数如学习率、批次大小和迭代次数优化模型。最终模型在训练集、验证集和测试集上的准确率分别为99.6%、98.0%和91.7%。此外,模型成功预测了5个新的交通标志图像,具有较高的预测信心。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Writeup


Build a Traffic Sign Recognition Project

The goals / steps of this project are the following:
* Load the data set (see below for links to the project data set)
* Explore, summarize and visualize the data set
* Design, train and test a model architecture
* Use the model to make predictions on new images
* Analyze the softmax probabilities of the new images
* Summarize the results with a written report


Writeup / README

1. Provide a Writeup / README that includes all the rubric points and how you addressed each one. You can submit your writeup as markdown or pdf. You can use this template as a guide for writing the report. The submission includes the project code.

You’re reading it! and here is a link to my project code

Data Set Summary & Exploration

1. Provide a basic summary of the data set and identify where in your code the summary was done. In the code, the analysis should be done using python, numpy and/or pandas methods rather than hardcoding results manually.

The code for this step is contained in the second code cell of the IPython notebook.

I just use the numpy library to calculate summary statistics of the traffic
signs data set:

  • The size of training set is 34799
  • The size of test set is 12630
  • The shape of a traffic sign image is (32, 32, 3)
  • The number of unique classes/labels in the data set is 43
2. Include an exploratory visualization of the dataset and identify where the code is in your code file.

The code for this step is contained in the third code cell of the IPython notebook.

import numpy as np
import matplotlib.pyplot as plt

fig, ax = plt.subplots()

ax.hist(y_train, n_classes, normed=1, histtype='bar', facecolor='b', alpha=0.75)
ax.set_title('label frequency')
ax.set_xlabel('labels')
ax.set_ylabel('frequency')

plt.show()

Here is an exploratory visualization of the data set. Here I use matplot library function ax.hist() to directly plot the frequency of the labels.
这里写图片描述

Design and Test a Model Architecture

1. Describe how, and identify where in your code, you preprocessed the image data. What tecniques were chosen and why did you choose these techniques? Consider including images showing the output of each preprocessing technique. Pre-processing refers to techniques such as converting to grayscale, normalization, etc.

The code for this step is list here:

import cv2

# convert color image to gray-scale image,here we use opencv api function, 
# gray= R*0.299+G*0.587+B*0.114
def color2gray(image):
    gray_img=cv2.cvtColor(image,cv2.COLOR_BGR2GRAY)
    return gray_img

def Images_color2Gray(image_group):
    X_train_gray=[]
    for train_image in image_group: 
        gray_img=color2gray(train_image)
        gray_img = gray_img[:, :, np.newaxis]
        X_train_gray.append(gray_img)

    return X_train_gray
##################################
# plot two images
fig, axs = plt.subplots(1,2, figsize=(5, 2))
axs = axs.ravel()

axs[0].axis('off')
axs[
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值