1.使用深度学习做目标检测
上一篇博客已经讲解了怎么用matlab导入数据。
[trainingImages,trainingLabels,testImages,testLabels] = helperCIFAR10Data.load('cifar10Data');
使用这个指令就可以导入CIFAR-10 data的数据。
使用下面指令查看样本和图片大小:
size(trainingImages)
CIFAR-10 数据集有10类,使用指令列出:
numImageCategories = 10;
categories(trainingLabels)
1.接下来我们来建立CNN模型,这里建立输入层:
% Create the image input layer for 32x32x3 CIFAR-10 images
[height, width, numChannels, ~] = size(trainingImages);
imageSize = [height width numChannels];
inputLayer = imageInputLayer(imageSize)
2.建立网络中间层
% Convolutional layer parameters filter size
filterSize = [5 5];
numFilters = 32;
middleLayers = [
% The first convolutional layer has a bank of 32 5x5x3 filters. A
% symmetric padding of 2 pixels is added to ensure that image borders
% are included in the processing. This is important to avoid
% information at the borders being washed away too early in the
% network.
convolution2dLayer(filterSize, numFilters, 'Padding', 2) %(n+2p-f)/s+1
% Note that the third dimension of the filter can be omitted because it
% is automatically deduced bas
MATLAB深度学习实践:构建CNN模型

这篇博客介绍了如何使用MATLAB进行深度学习,特别是构建卷积神经网络(CNN)进行目标检测。首先,通过指令导入CIFAR-10数据集,然后详细讲解了构建CNN模型的步骤,包括输入层、中间层、输出层的定义以及权重初始化。文章提到了训练选项,如使用sgdm优化器和训练过程的可视化。最终,展示了网络在测试集上的分类精度,并预告下篇将探讨如何提升训练精度。
最低0.47元/天 解锁文章
308

被折叠的 条评论
为什么被折叠?



