필터 지우기
필터 지우기

pretrained deep learning network

조회 수: 12 (최근 30일)
Ahmad Alhashil
Ahmad Alhashil 2021년 2월 22일
답변: Aniket 2024년 9월 23일 10:53
hi!
iwhen i use the pre trained deep kearning network and use it with droesy detection, can i train it more and more to get higher accuarcy or i can not train it ?

답변 (1개)

Aniket
Aniket 2024년 9월 23일 10:53
You can further train the pre-trained deep learning network and use it with drowsiness detection to get higher accuracy if you have a training dataset for the same. This process is called Transfer learning and MATLAB has extensive resources to carry out this task.
First of all, create an image datastore (imds). An image datastore enables you to store large collections of image data, including data that does not fit in memory, and efficiently read batches of images during training of a neural network. Partition the data into training, validation, and testing data sets. Use 70% of the images for training, 15% for validation, and 15% for testing. The splitEachLabel function splits the image datastore into three new datastores.
[imdsTrain,imdsValidation,imdsTest] = splitEachLabel(imds,0.7,0.15,0.15,"randomized");
Then follow these steps to train the network:
1. Load Pretrained Network
Open the pretrained model using MATLAB Deep Network Designer app.
2. Edit Network for Transfer Learning
In Designer pane, unlock a convolution layer/ fully connected layer and update the properties as per your required model and adjust the learning parameters. Export to save the modified network as net_1.
3. Specify Training Options
Define the training options using the trainingOptions function:
options = trainingOptions("adam", ...
ValidationData=imdsValidation, ...
ValidationFrequency=5, ...
Plots="training-progress", ...
Metrics="accuracy", ...
Verbose=false);
4. Train Neural Network
Train the network using the trainnet function with cross-entropy loss:
net = trainnet(imdsTrain, net_1, "crossentropy", options);
5. Test Neural Network
Classify the test images using minibatchpredict and convert scores to labels with scores2label:
inputSize = net.Layers(1).InputSize(1:2);
augimdsTrain = augmentedImageDatastore(inputSize, imdsTest);
YTest = minibatchpredict(net, imdsTest);
YTest = scores2label(YTest, classNames);
For detailed steps, follow the procedure mentioned in the following documentation:
I hope this helps you to train your model with higher accuracy!

카테고리

Help CenterFile Exchange에서 Get Started with Deep Learning Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by