- It pays to think creatively. Specifically, can something be modelled as an image that can be fed into a neural network for training?
- Create a Python
PoxisPath
from a filename via the prefixpath/
. - Each data set should comprise a training set and a validation set. The validation loss should usually be slightly higher than the training loss.
- The fastai library supports loading data sets into ImageDataBunch's from DataFrames (
from_df
), CSVs (from_csv
), file name regex (from_name_re
), file name functions (from_name_func
), from folder names (from_folder
), and from Python lists (from_lists
). ImageDataBunch.classes
can generally be thought of as the number of labels.ImageDataBunch.show_batch
gives us a quick look at the data. This is useful to get a feel of the data before training the model.
- Convolutional neural networks, specifically resnet18/34/50, are good for training models to recognize images. According to Wikipedia, they are "most commonly applied to analyzing visual imagery".
- A convolutional neural network is made up of multiple layers, each layer acting as a filter that looks for specific patterns. The outputs of each layer are fed into the next to filter even more complicated patterns. Ultimately, a complicated pattern similar to what we're looking for is able to be filtered by the network.
- We usually want to
fit_one_cycle
several times for a pre-trained model,save
it for later reference, thenunfreeze
the model (allow the front and middle layers to be trained) andfit_one_cycle
several more times with a range of max learning rates determined vialr_find
andrecorder_plot
.
ClassificationInterpretation.plot_top_losses
,ClassificationInterpretation.most_confused
andClassificationInterpretation.plot_confusion_matrix
give us a quick look at the top losses of the trained model. This is useful to find out whether there is an issue with the model or that the classification of specific categories are indeed just nigh impossible.