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

织梦配置手机网站国家反诈中心app下载安装注册

织梦配置手机网站,国家反诈中心app下载安装注册,免费空间凡科,大同住房和城乡和建设网站温馨提示#xff1a;文末有 CSDN 平台官方提供的学长 QQ 名片 :) 1. 项目简介 本文详细探讨了一基于深度学习的交通标志图像识别系统。采用TensorFlow和Keras框架#xff0c;利用卷积神经网络#xff08;CNN#xff09;进行模型训练和预测#xff0c;并引入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, rotationvertical, fontsize16) plt.title(不同类别交通标志数量分布柱状图, fontsize20) plt.show() 划分训练集、验证集 X_train, X_val, y_train, y_val train_test_split(image_data, image_labels, test_size0.3, random_state42, shuffleTrue)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(filters16, kernel_size(3,3), activationrelu, input_shape(IMG_HEIGHT,IMG_WIDTH,channels)),keras.layers.Conv2D(filters32, kernel_size(3,3), activationrelu),# ......keras.layers.Conv2D(filters64, kernel_size(3,3), activationrelu),# ......keras.layers.Flatten(),keras.layers.Dense(512, activationrelu),keras.layers.BatchNormalization(),keras.layers.Dropout(rate0.5),keras.layers.Dense(43, activationsoftmax) ]) 4. 模型训练与性能评估 设置模型训练参数 epochs 20initial_learning_rate 5e-5lr_schedule tf.keras.optimizers.schedules.ExponentialDecay(initial_learning_rate, #设置初始学习率decay_steps64, #每隔多少个step衰减一次decay_rate0.98, #衰减系数staircaseTrue)# 将指数衰减学习率送入优化器 optimizer tf.keras.optimizers.Adam(learning_ratelr_schedule)model.compile(losscategorical_crossentropy, optimizeroptimizer, metrics[accuracy])history model.fit(X_train, y_train, batch_size32, epochsepochs, 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(weightsimagenet, include_topFalse, input_shape(height,width,3)) vgg_base_model.trainableTruevgg_model tf.keras.Sequential([vgg_base_model,keras.layers.BatchNormalization(),keras.layers.Flatten(),keras.layers.Dense(512, activationrelu),keras.layers.BatchNormalization(),keras.layers.Dropout(rate0.5),keras.layers.Dense(43, activationsoftmax)])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 gif prediction ! actual:col rplt.xlabel(实际类别:{}\n预测类别:{}.format(classes[actual], classes[prediction]), color col, fontsize18)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://www.zqtcl.cn/news/254447/

相关文章:

  • 优普南通网站建设申请注册公司流程
  • 越南网站建设河南企业做网站
  • 优化免费网站建设做网站领券收佣金
  • 网站常用图标素材办公用品十大购物网站排名
  • 网络门户网站站长要维护网站
  • 网上有做衣服的网站有哪些做网站推广怎样才能省钱
  • 网站专题设计欣赏找网站公司做网站是怎样的流程
  • 网站上传后如何设置首页制作网络游戏
  • 外贸接单网站排名榜珠宝行网站建设方案
  • 酒店门户网站建设背景门户网站的发布特点
  • 网站营销与推广汕头澄海
  • php和asp做网站哪个好阿里云wordpress配置
  • 东莞响应式网站建设网络营销策略和营销策略的区别
  • 番禺做网站哪家强合肥网页网站制作
  • 100个免费推广网站阜阳网站建设价格低
  • 广西茶叶学会 网站建设给人做网站能赚钱吗
  • 网站建设的发展目标西湖区住房和城乡建设局网站
  • 佛山市手机网站建设网页制作教程第三版赵丰年pdf
  • 做的好的装修公司网站网页制作搜题软件
  • 网站公告栏代码铁路建设标准网站
  • 网站设计工具更好的做网站禅城技术支持骏域网站建设
  • 百度商桥可以在两个网站放网站qq 微信分享怎么做的
  • 大学生网站建设开题报告秀山网站建设
  • 网站建设的实施方案网站建设基本标准
  • 做一个推广网站多少钱360导航网址
  • 在线网站建设哪家便宜wordpress 爬取
  • 移动端网站设计规范百度一下首页问问
  • 哪些网站怎么进广西玉林网站建设
  • 高端建站设计赶集网免费发布信息
  • 两题一做的网站响应式网站开发asp