Classification options when testing a CNN
1 view (last 30 days)
Show older comments
Hello!
I've been doing a lot of work with CNNs lately and I'm moving beyond constructing them to actually using them. I've been doing a lot of reading outside Matlab to try to understand how to use CNNs effectively and I found a pretty interesting article on how to preprocess data before classification (https://machinelearningmastery.com/best-practices-for-preparing-and-augmenting-image-data-for-convolutional-neural-networks/). Now, most of these methods are available as options in the imageInputLayer function, but I found the test processing in the above article pretty interesting.
It seems like it isn't uncommon to take multiple crops and rotations of a single image during testing, using each subimage classification to update an overall classification, then return the final value as the actual result.
Is there a way to do this in Matlab?
0 Comments
Accepted Answer
Sahil Jain
on 30 Aug 2021
Hi Matt. From my understanding of the question, you want to do test-time augmentation by applying multiple different sets of image transformations on the dataset and then aggregating the predictions of all the sets. This can be done by creating multiple datastores using the Image Processing Toolbox. The Augment Images for Deep Learning Workflows Using Image Processing Toolbox article describes how to create a set of transformations and apply it to a datastore. Using this workflow, you can create multiple sets of transformations and apply them to your testing dataset. The predictions from all the datastores can then be averaged to get the final prediction.
More Answers (0)
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!