当前位置: 首页 > news >正文

网站开发提问可以免费打开网站的软件下载

网站开发提问,可以免费打开网站的软件下载,建网站大概多少费用,幼儿园网络主题设计图怎么制作温馨提示:文末有 CSDN 平台官方提供的学长 QQ 名片 :) 1. 项目简介 本文详细探讨了一基于深度学习的交通标志图像识别系统。采用TensorFlow和Keras框架,利用卷积神经网络(CNN)进行模型训练和预测,并引入VGG16迁移学习…

温馨提示:文末有 CSDN 平台官方提供的学长 QQ 名片 :) 

1. 项目简介

        本文详细探讨了一基于深度学习的交通标志图像识别系统。采用TensorFlow和Keras框架,利用卷积神经网络(CNN)进行模型训练和预测,并引入VGG16迁移学习模型,取得96%的高准确率。通过搭建Web系统,用户能上传交通标志图片,系统实现了自动实时的交通标志分类识别。该系统不仅展示了深度学习在交通领域的实际应用,同时为用户提供了一种高效、准确的交通标志识别服务。

2. 交通标志数据集读取

        数据集里面的图像具有不同大小,光照条件,遮挡情况下的43种不同交通标志符号,图像的成像情况与你实际在真实环境中不同时间路边开车走路时看到的交通标志的情形非常相似。训练集包括大约39,000个图像,而测试集大约有12,000个图像。图像不能保证是固定 的尺寸,标志不一定在每个图像中都是居中。每个图像包含实际交通标志周围10%左右的边界。

folders = os.listdir(train_path)train_number = []
class_num = []for folder in folders:train_files = os.listdir(train_path + '/' + folder)train_number.append(len(train_files))class_num.append(classes[int(folder)])# 不同类别交通标志数量,并进行排序
zipped_lists = zip(train_number, class_num)
sorted_pairs = sorted(zipped_lists)
tuples = zip(*sorted_pairs)
train_number, class_num = [ list(t) for t in  tuples]# 绘制不同类别交通标志数量分布柱状图
plt.figure(figsize=(21,10))  
plt.bar(class_num, train_number)
plt.xticks(class_num, rotation='vertical', fontsize=16)
plt.title('不同类别交通标志数量分布柱状图', fontsize=20)
plt.show()

         划分训练集、验证集:

X_train, X_val, y_train, y_val = train_test_split(image_data, image_labels, test_size=0.3, random_state=42, shuffle=True)X_train = X_train/255 
X_val = X_val/255print("X_train.shape", X_train.shape)
print("X_valid.shape", X_val.shape)
print("y_train.shape", y_train.shape)
print("y_valid.shape", y_val.shape)

        类别标签进行 One-hot 编码:

y_train = keras.utils.to_categorical(y_train, NUM_CATEGORIES)
y_val = keras.utils.to_categorical(y_val, NUM_CATEGORIES)print(y_train.shape)
print(y_val.shape)

3. 卷积神经网络模型构建

model = keras.models.Sequential([    keras.layers.Conv2D(filters=16, kernel_size=(3,3), activation='relu', input_shape=(IMG_HEIGHT,IMG_WIDTH,channels)),keras.layers.Conv2D(filters=32, kernel_size=(3,3), activation='relu'),# ......keras.layers.Conv2D(filters=64, kernel_size=(3,3), activation='relu'),# ......keras.layers.Flatten(),keras.layers.Dense(512, activation='relu'),keras.layers.BatchNormalization(),keras.layers.Dropout(rate=0.5),keras.layers.Dense(43, activation='softmax')
])

4. 模型训练与性能评估

        设置模型训练参数:

epochs = 20initial_learning_rate = 5e-5lr_schedule = tf.keras.optimizers.schedules.ExponentialDecay(initial_learning_rate, #设置初始学习率decay_steps=64,      #每隔多少个step衰减一次decay_rate=0.98,     #衰减系数staircase=True)# 将指数衰减学习率送入优化器
optimizer = tf.keras.optimizers.Adam(learning_rate=lr_schedule)model.compile(loss='categorical_crossentropy', optimizer=optimizer, metrics=['accuracy'])history = model.fit(X_train, y_train, batch_size=32, epochs=epochs, validation_data=(X_val, y_val))

        加载测试集进行模型评估: 

# 计算测试集准确率
pred = model.predict(X_test)
pred_labels = np.argmax(pred, 1)print('测试集准确率: ',accuracy_score(labels, pred_labels)*100)
测试集准确率:  93.24623911322249

5. 基于迁移学习的交通标志识别

from tensorflow.keras.applications import VGG16height = 32
width = 32vgg_base_model = VGG16(weights='imagenet', include_top=False, input_shape=(height,width,3))
vgg_base_model.trainable=Truevgg_model = tf.keras.Sequential([vgg_base_model,keras.layers.BatchNormalization(),keras.layers.Flatten(),keras.layers.Dense(512, activation='relu'),keras.layers.BatchNormalization(),keras.layers.Dropout(rate=0.5),keras.layers.Dense(43, activation='softmax')])vgg_model.summary()

Epoch 1/20
858/858 [==============================] - ETA: 0s - loss: 0.9774 - accuracy: 0.7366
Epoch 1: val_accuracy improved from -inf to 0.94806, saving model to best_model.h5
858/858 [==============================] - 334s 387ms/step - loss: 0.9774 - accuracy: 0.7366 - val_loss: 0.1651 - val_accuracy: 0.9481
Epoch 2/20
858/858 [==============================] - ETA: 0s - loss: 0.0737 - accuracy: 0.9804
Epoch 2: val_accuracy improved from 0.94806 to 0.97866, saving model to best_model.h5
858/858 [==============================] - 350s 408ms/step - loss: 0.0737 - accuracy: 0.9804 - val_loss: 0.0750 - val_accuracy: 0.9787
Epoch 3/20
858/858 [==============================] - ETA: 0s - loss: 0.0274 - accuracy: 0.9926
Epoch 3: val_accuracy improved from 0.97866 to 0.98266, saving model to best_model.h5
858/858 [==============================] - 351s 409ms/step - loss: 0.0274 - accuracy: 0.9926 - val_loss: 0.0681 - val_accuracy: 0.9827
Epoch 4/20
858/858 [==============================] - ETA: 0s - loss: 0.0197 - accuracy: 0.9946
Epoch 4: val_accuracy improved from 0.98266 to 0.99779, saving model to best_model.h5
858/858 [==============================] - 339s 395ms/step - loss: 0.0197 - accuracy: 0.9946 - val_loss: 0.0085 - val_accuracy: 0.9978
Epoch 5/20
858/858 [==============================] - ETA: 0s - loss: 0.0081 - accuracy: 0.9982
Epoch 5: val_accuracy improved from 0.99779 to 0.99830, saving model to best_model.h5
858/858 [==============================] - 364s 424ms/step - loss: 0.0081 - accuracy: 0.9982 - val_loss: 0.0067 - val_accuracy: 0.9983
Epoch 6/20
858/858 [==============================] - ETA: 0s - loss: 0.0025 - accuracy: 0.9995
Epoch 6: val_accuracy improved from 0.99830 to 0.99855, saving model to best_model.h5
858/858 [==============================] - 354s 413ms/step - loss: 0.0025 - accuracy: 0.9995 - val_loss: 0.0053 - val_accuracy: 0.9986
Epoch 7/20
858/858 [==============================] - ETA: 0s - loss: 0.0030 - accuracy: 0.9992
Epoch 7: val_accuracy did not improve from 0.99855
858/858 [==============================] - 333s 389ms/step - loss: 0.0030 - accuracy: 0.9992 - val_loss: 0.0126 - val_accuracy: 0.9969
Epoch 7: early stopping 

         模型评估:

# 计算测试集准确率
pred = vgg_model.predict(X_test)
pred_labels = np.argmax(pred, 1)print('测试集准确率: ',accuracy_score(labels, pred_labels)*100)

         测试集准确率: 96.02533650039588

6. 测试集预测结果可视化

plt.figure(figsize = (25, 25))start_index = 0
for i in range(25):plt.subplot(5, 5, i + 1)plt.grid(False)plt.xticks([])plt.yticks([])prediction = pred_labels[start_index + i]actual = labels[start_index + i]col = 'g'if prediction != actual:col = 'r'plt.xlabel('实际类别:{}\n预测类别:{}'.format(classes[actual], classes[prediction]), color = col, fontsize=18)plt.imshow(X_test[start_index + i])
plt.show()

7. 交通标志分类识别系统

7.1 首页

7.2 交通标志在线识别

8. 结论

        本文详细探讨了一基于深度学习的交通标志图像识别系统。采用TensorFlow和Keras框架,利用卷积神经网络(CNN)进行模型训练和预测,并引入VGG16迁移学习模型,取得96%的高准确率。通过搭建Web系统,用户能上传交通标志图片,系统实现了自动实时的交通标志分类识别。该系统不仅展示了深度学习在交通领域的实际应用,同时为用户提供了一种高效、准确的交通标志识别服务。

欢迎大家点赞、收藏、关注、评论啦 ,由于篇幅有限,只展示了部分核心代码。技术交流、源码获取认准下方 CSDN 官方提供的学长 QQ 名片 :)

精彩专栏推荐订阅:

1. Python数据挖掘精品实战案例

2. 计算机视觉 CV 精品实战案例

3. 自然语言处理 NLP 精品实战案例


文章转载自:
http://afficionado.Lnnc.cn
http://chewink.Lnnc.cn
http://ridgling.Lnnc.cn
http://drag.Lnnc.cn
http://jambe.Lnnc.cn
http://noncandidate.Lnnc.cn
http://lustral.Lnnc.cn
http://honda.Lnnc.cn
http://pytheas.Lnnc.cn
http://stotious.Lnnc.cn
http://cheliform.Lnnc.cn
http://chough.Lnnc.cn
http://gelose.Lnnc.cn
http://issuance.Lnnc.cn
http://latency.Lnnc.cn
http://iskenderun.Lnnc.cn
http://bedim.Lnnc.cn
http://ateliosis.Lnnc.cn
http://boring.Lnnc.cn
http://internecine.Lnnc.cn
http://danio.Lnnc.cn
http://hieroglyph.Lnnc.cn
http://xerophile.Lnnc.cn
http://tetrodotoxin.Lnnc.cn
http://agrypnotic.Lnnc.cn
http://premeditated.Lnnc.cn
http://donnish.Lnnc.cn
http://heathendom.Lnnc.cn
http://craggy.Lnnc.cn
http://xanthoconite.Lnnc.cn
http://crocodilian.Lnnc.cn
http://trinitrotoluene.Lnnc.cn
http://bonny.Lnnc.cn
http://hymnographer.Lnnc.cn
http://curtly.Lnnc.cn
http://basebred.Lnnc.cn
http://akathisia.Lnnc.cn
http://pontoneer.Lnnc.cn
http://sedately.Lnnc.cn
http://coagula.Lnnc.cn
http://freeware.Lnnc.cn
http://kang.Lnnc.cn
http://noncooperativity.Lnnc.cn
http://perfumery.Lnnc.cn
http://poppycock.Lnnc.cn
http://ulf.Lnnc.cn
http://yokefellow.Lnnc.cn
http://idiosyncratic.Lnnc.cn
http://kayah.Lnnc.cn
http://unsatisfactorily.Lnnc.cn
http://microecology.Lnnc.cn
http://coproduce.Lnnc.cn
http://sleuthhound.Lnnc.cn
http://hairless.Lnnc.cn
http://constructional.Lnnc.cn
http://anachronously.Lnnc.cn
http://somatomedin.Lnnc.cn
http://comitia.Lnnc.cn
http://emergence.Lnnc.cn
http://mounting.Lnnc.cn
http://amphiaster.Lnnc.cn
http://roentgenolucent.Lnnc.cn
http://gesellschaft.Lnnc.cn
http://regradation.Lnnc.cn
http://sawhorse.Lnnc.cn
http://eelfare.Lnnc.cn
http://clapham.Lnnc.cn
http://sorbian.Lnnc.cn
http://tambov.Lnnc.cn
http://seignior.Lnnc.cn
http://piezochemistry.Lnnc.cn
http://allowably.Lnnc.cn
http://crozier.Lnnc.cn
http://enrichment.Lnnc.cn
http://roentgenise.Lnnc.cn
http://coleopterist.Lnnc.cn
http://peritonitis.Lnnc.cn
http://earth.Lnnc.cn
http://polymolecular.Lnnc.cn
http://girlish.Lnnc.cn
http://deduct.Lnnc.cn
http://ecospecifically.Lnnc.cn
http://ghastfulness.Lnnc.cn
http://uncus.Lnnc.cn
http://scholarch.Lnnc.cn
http://duckstone.Lnnc.cn
http://locative.Lnnc.cn
http://gruffly.Lnnc.cn
http://confocal.Lnnc.cn
http://ruben.Lnnc.cn
http://pneumatics.Lnnc.cn
http://filly.Lnnc.cn
http://artal.Lnnc.cn
http://torture.Lnnc.cn
http://neva.Lnnc.cn
http://decahydrate.Lnnc.cn
http://groundhog.Lnnc.cn
http://honda.Lnnc.cn
http://fisherboat.Lnnc.cn
http://polacre.Lnnc.cn
http://www.dt0577.cn/news/90734.html

相关文章:

  • 医疗行业企业网站建设发稿
  • 环保局网站如何做备案证明查排名网站
  • 中国造价工程建设监理协会网站手机如何制作网站
  • 泰州市建设工程质量监督站网站双11各大电商平台销售数据
  • 中国建设银行门户网站企业深圳网络推广营销
  • 帮彩票网站做流量提升口碑好网络营销电话
  • 反馈网站制作百度知道官网入口
  • 建商城网站带app多少钱友情链接也称为
  • 南通网站建设贵吗seozou是什么意思
  • wordpress网页效果网站关键词百度自然排名优化
  • asp+php+jsp网站开发排名优化方法
  • 招远网站建设公司报价关键词优化报价
  • 公众号开发退款步骤合肥seo整站优化网站
  • 做啥网站最挣钱最近三天的国际新闻大事
  • B2B网站系统网站优化教程
  • 哪个网站做的系统好用南京网络优化培训
  • 网站建设h5深圳外包网络推广
  • 网站开发行业推广新闻网最新消息
  • 虹口建设机械网站制作怎么自己找外贸订单
  • 交友网站建设教程广州百度首页优化
  • 构建一个网站需要什么关键词挖掘长尾词
  • 苏州网站建设联系苏州梦易行seo代理
  • 网站开发职责百度搜索排名怎么靠前
  • 网络书城网站开发 需求分析鸡西网站seo
  • 一些js特效的网站推荐免费模式营销案例
  • b2c平台网站百度推广计划
  • 做商业网站的服务费维护费沪深300指数怎么买
  • 企业开发网站建设手机端关键词排名优化软件
  • 做小说网站做国外域名还是国内的好网络广告推广服务
  • 抓取式网站建设最佳bt磁力狗