Hi, I am trying to modify the pretrained neural network alexnet, How can i modify in order to classify only 4 specific objects (cars, houses, trees, people), im trying to do classify images in a video frame, Thanks.
5 views (last 30 days)
Show older comments
Hi, I am trying to modify the pretrained neural network alexnet, How can i modify in order to classify only 4 specific objects (cars, houses, trees, people), im trying to do classify images in a video frame, Thanks.
0 Comments
Answers (1)
Mark Fajet
on 6 Jul 2017
Hello. Because AlexNet was trained to classify images into 1000 different categories, it has a fully connected layer that will produce an output array of 1000 probabilities. This layer will need to be changed to only produce 4 outputs.
Here is a quick example of how to get the layers of AlexNet and change one layer:
net = alexnet
layers = net.layers
layers(23) = fullyConnectedLayer(4)
After this, you'll want to retrain the network on your new dataset. For a more detailed explanation and code example, check out this video
0 Comments
See Also
Categories
Find more on Image Data Workflows in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!