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

基于VGG16深度学习网络的目标识别matlab仿真,并结合ROC指标衡量识别性能

时间:2023/4/6 23:01:12 点击:

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

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

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

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

点击店铺

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

2.部分仿真图预览



3.算法概述

        vgg16总共有16层,13个卷积层和3个全连接层,第一次经过64个卷积核的两次卷积后,采用一次pooling,第二次经过两次128个卷积核卷积后,再采用pooling,再重复两次三个512个卷积核卷积后,再pooling,最后经过三次全连接。

4.部分源码

.......................................................................

 

train_P   = [];

train_T   = [];

test_P    = [];

test_T    = [];

 

for i=1:length(types)

    i

    types{i}

    trainingImages   = imageDatastore(['images/train/' types{i}],'IncludeSubfolders',true,'LabelSource','foldernames');

    testImages       = imageDatastore(['images/test/' types{i}],'IncludeSubfolders',true,'LabelSource','foldernames');

    augimdsTrain     = augmentedImageDatastore(inputSize(1:2),trainingImages);

    augimdsTest      = augmentedImageDatastore(inputSize(1:2),testImages);

    trainingFeatures = activations(net,augimdsTrain,'fc8','OutputAs','channels');

    testFeatures     = activations(net,augimdsTest,'fc8','OutputAs','channels');

    train_P          = [train_P;squeeze(trainingFeatures(1,1,:,:))'];    

    train_T          = [train_T;trainingImages.Labels];

    test_P           = [test_P;squeeze(testFeatures(1,1,:,:))'];

    test_T           = [test_T;testImages.Labels];

end

 

 

nest                    = fitcecoc(train_P,train_T);

[predictedLabels scores]= predict(nest,test_P);

accuracy                = mean(predictedLabels == test_T);

targets                 = zeros(size(scores'));

for i=1:size(test_T,1)

    I               = find(types==test_T(i));

    targets(I(1),i) = 1;

end

cmat                = confusionmat(test_T,predictedLabels);

figure;

imagesc(cmat);

xlabel('Target Class');

ylabel('Predicted Class');

title(['VGG16 accuracy= ' num2str(100*accuracy),'%']);

colorbar

figure;

plotroc(targets,scores')

A540

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