Assuming you already have a dataset loaded in MATLAB for your convolutional neural network (CNN) and you want to clear or clean up some of the labels for your input data, you can follow these steps:
main.m132 chars3 lines
The LabelSource
parameter allows you to set the source of the labels. In this case, we are using the folder names to set the labels.
main.m83 chars3 lines
In this case, we are creating a containers.Map
object that maps the labels label1
and label2
to an empty string. This means that these labels will be removed from the dataset.
main.m225 chars3 lines
Here, we are creating an augmented image data store that resizes the images to [width height]
and applies random cropping as the output size mode. We are also setting the color preprocessing to convert any grayscale images to RGB. Finally, we are applying the mapping to the labels using the values
function of the containers.Map
object.
augmentedImages
object as input to your CNN. For example:main.m102 chars4 lines
Note that the steps above only modify the labels of the input data. If you want to remove or modify entire images from your dataset based on their labels, you will need to use a different approach.
gistlibby LogSnag