您现在的位置:首页 >> 机器学习 >> 内容

m基于Yolov2和GoogleNet深度学习网络的疲劳驾驶检测系统matlab仿真,带GUI界面

时间:2023/11/1 1:51:57 点击:

  核心提示:0Y_008m,包括程序操作录像...

1.完整项目描述和程序获取

>面包多安全交易平台:https://mbd.pub/o/bread/ZZWcmplp

>如果链接失效,可以直接打开本站店铺搜索相关店铺:

点击店铺

>如果链接失效,程序调试报错或者项目合作可以加微信或者QQ联系。

2.部分仿真图预览



3.算法概述

       疲劳驾驶检测系统是一种基于深度学习网络的系统,它结合了Yolov2和GoogleNet模型,用于检测驾驶员的疲劳状态和人脸。疲劳驾驶检测系统主要包括两个部分:人脸检测和疲劳检测。其中,人脸检测使用Yolov2模型,而疲劳检测使用GoogleNet模型。

4.部分源码

% --- Executes on button press in pushbutton6.

function pushbutton6_Callback(hObject, eventdata, handles)

% hObject    handle to pushbutton6 (see GCBO)

% eventdata  reserved - to be defined in a future version of MATLAB

% handles    structure with handles and user data (see GUIDATA)

 

 

Name1   = get(handles.edit7, 'String');

NEpochs = str2num(get(handles.edit8, 'String'));

NMB     = str2num(get(handles.edit9, 'String'));

LR      = str2num(get(handles.edit10, 'String'));

Rate    = str2num(get(handles.edit11, 'String'));

 

 

% 使用 imageDatastore 加载图像数据集

Dataset = imageDatastore(Name1, 'IncludeSubfolders', true, 'LabelSource', 'foldernames');

% 将数据集分割为训练集、验证集和测试集

[Training_Dataset, Validation_Dataset, Testing_Dataset] = splitEachLabel(Dataset, Rate, (1-Rate)/2, (1-Rate)/2);

% 加载预训练的 GoogleNet 网络

load mat\googlenet.mat

 

 

% 获取输入层的大小

Input_Layer_Size = net.Layers(1).InputSize(1:2);

 

% 将图像数据集调整为预训练网络的输入尺寸

Resized_Training_Dataset   = augmentedImageDatastore(Input_Layer_Size ,Training_Dataset);

Resized_Validation_Dataset = augmentedImageDatastore(Input_Layer_Size ,Validation_Dataset);

Resized_Testing_Dataset    = augmentedImageDatastore(Input_Layer_Size ,Testing_Dataset);

 

% 获取特征学习层和分类器层的名称

Feature_Learner   = net.Layers(142).Name;

Output_Classifier = net.Layers(144).Name;

% 计算数据集的类别数目

Number_of_Classes = numel(categories(Training_Dataset.Labels));

% 创建新的全连接特征学习层

New_Feature_Learner = fullyConnectedLayer(Number_of_Classes, ...

    'Name', 'Coal Feature Learner', ...

    'WeightLearnRateFactor', 10, ...

    'BiasLearnRateFactor', 10);

% 创建新的分类器层

New_Classifier_Layer = classificationLayer('Name', 'Coal Classifier');

% 获取完整网络架构

Network_Architecture = layerGraph(net);

% 替换网络中的特征学习层和分类器层

New_Network = replaceLayer(Network_Architecture, Feature_Learner, New_Feature_Learner);

New_Network = replaceLayer(New_Network, Output_Classifier, New_Classifier_Layer);

0Y_008m

---

作者:我爱C编程 来源:我爱C编程
本站最新成功开发工程项目案例
相关文章
相关评论
发表我的评论
  • 大名:
  • 内容:
本类固顶
  • 没有
  • FPGA/MATLAB商业/科研类项目合作(www.store718.com) © 2025 版权所有 All Rights Reserved.
  • Email:1480526168@qq.com 站长QQ: 1480526168