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.
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Mark Fajet
2017-7-6
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Data Workflows 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!