当前位置:网站首页>【人脸识别】基于GoogleNet深度学习网络的人脸识别matlab仿真
【人脸识别】基于GoogleNet深度学习网络的人脸识别matlab仿真
2022-06-22 15:44:00 【fpga和matlab】
1.软件版本
matlab2021a
2.系统概述
GoogLeNet是2014年Christian Szegedy提出的一种全新的深度学习结构,在这之前的AlexNet、VGG等结构都是通过增大网络的深度(层数)来获得更好的训练效果,但层数的增加会带来很多负作用,比如overfit、梯度消失、梯度爆炸等。inception的提出则从另一种角度来提升训练结果:能更高效的利用计算资源,在相同的计算量下能提取到更多的特征,从而提升训练结果。

3.部分程序
clc;
clear;
close all;
warning off;
addpath(genpath(pwd));
% Create & label Dataset
Dataset = imageDatastore('Dataset', 'IncludeSubfolders', true, 'LabelSource', 'foldernames');
% Define Training & Validation Dataset
Training_Dataset=Dataset;
Validation_Dataset=Dataset;
%#------2. Load Network------#%
% Set Network
net = googlenet;
analyzeNetwork(net)
% Store Input size of layer 1
Input_Layer_Size = net.Layers(1).InputSize;
% Store whole architecture of network(Googlenet)
Layer_Graph = layerGraph(net);
%#------3. Modify Required Layers ------#%
% Store layer 142 & 144
Feature_Learner = net.Layers(142);
Output_Classifier = net.Layers(144);
% Store number of classes in Dataset
Number_of_Classes = numel(categories(Training_Dataset.Labels));
% Create new fullyConnectedLayer(142) & classificationLayer(144)
New_Feature_Learner = fullyConnectedLayer(Number_of_Classes, ...
'Name', 'Facial Feature Learner', ...
'WeightLearnRateFactor', 10, ...
'BiasLearnRateFactor', 10);
New_Classifier_Layer = classificationLayer('Name', 'Face Classifier');
% Replace layer 142 & 144
Layer_Graph = replaceLayer(Layer_Graph, Feature_Learner.Name, New_Feature_Learner);
Layer_Graph = replaceLayer(Layer_Graph, Output_Classifier.Name, New_Classifier_Layer);
analyzeNetwork(Layer_Graph)
%#------4. Modify Images ------#%
% Define range of modification
Pixel_Range = [-30 30];
Scale_Range = [0.9 1.1];
% Now modify images
Image_Augmenter = imageDataAugmenter(...
'RandXReflection', true, ...
'RandXTranslation', Pixel_Range, ...
'RandYTranslation', Pixel_Range,...
'RandXScale', Scale_Range, ...
'RandYScale', Scale_Range);
% Resize image for layer 1 of Googlenet
Augmented_Training_Image = augmentedImageDatastore(Input_Layer_Size(1:2), Training_Dataset, ...
'DataAugmentation', Image_Augmenter);
Augmented_Validation_Image = augmentedImageDatastore(Input_Layer_Size(1:2),Validation_Dataset);
%#------5. Train Network ------#%
% Specify training Option
Size_of_Minibatch = 5;
Validation_Frequency = floor(numel(Augmented_Training_Image.Files)/Size_of_Minibatch);
Training_Options = trainingOptions('sgdm',...
'MiniBatchSize', Size_of_Minibatch, ...
'MaxEpochs', 10,...
'InitialLearnRate', 3e-4,...
'Shuffle', 'every-epoch', ...
'ValidationData', Augmented_Validation_Image, ...
'ValidationFrequency', Validation_Frequency, ...
'Verbose', false, ...
'Plots', 'training-progress');
% Start training
net = trainNetwork(Augmented_Training_Image, Layer_Graph, Training_Options);
save nets.mat net
4.仿真结论



5.参考文献
[1]郑弘晖. 基于深度学习的图像分类和人脸识别算法研究[D]. 北京邮电大学, 2018.
边栏推荐
- STM32 ADC acquisition via DMA (HAL Library)
- 网传学习通1.7亿密码泄露!有什么补救措施?
- Processing source code of spark executor execution results
- WPF效果第一百九十篇之再耍ListBox
- 有同学问PHP要学什么框架?
- MYSQL_ ERRNO : 1205 MESSAGE :Lock wait timeout exceeded; try restarting transacti
- Examples of MySQL account addition, deletion, modification, data import and export commands
- You call this crap high availability?
- Apache ShardingSphere 一文读懂
- 新手必会的静态站点生成器——Gridsome
猜你喜欢

170million passwords of Netcom learning link have been leaked! What are the remedies?

web技术分享| 【高德地图】实现自定义的轨迹回放

每秒處理10萬高並發訂單的樂視集團支付系統架構分享

Hello Playwright:(7)模拟键盘和鼠标

.NET 发布和支持计划介绍

试用了多款报表工具,终于找到了基于.Net 6开发的一个了

Partage de l'architecture du système de paiement du Groupe letv pour traiter 100 000 commandes simultanées élevées par seconde

Apache ShardingSphere 一文读懂

WPF效果第一百九十篇之再耍ListBox

jMeter使用案例
随机推荐
Qt Notes - qmap Custom key
Short video source code development, high-quality short video source code need to do what?
UI automation positioning edge -xpath actual combat
linux系统维护篇:mysql8.0.13源码下载及安装之“傻瓜式”操作步骤(linux-centos6.8)亲测可用系列
Vs2017 solution to not displaying qstring value in debugging status
Cross platform brake browser
Mybaits:常用数据库操作(东软的操作)
Description of new features and changes in ABP Framework version 5.3.0
[recruitment] [Beijing Zhongguancun / remote] [tensorbase][open source data warehouse] and other people do one thing
The way to optimize spark performance -- solving N poses of spark data skew
QT notes qmap user defined key
Windows8.1 64 installed by mysql5.7.27
. Net release and support plan introduction
MySQL string field to floating point field
Which platform is safer to buy stocks on?
Hello Playwright:(7)模拟键盘和鼠标
推荐7款超级好用的终端工具 —— SSH+FTP
快速掌握 ASP.NET 身份认证框架 Identity - 登录与登出
以小见大:一个领域建模的简单示例,理解“领域驱动”。
mysql服务器启动后自动停止