Identifying a butterfly or moth using Lesson 1 of the Fast.ai course 22

My exercise to determine if a photo contains a butterfly or moth using the Fast.ai lesson 1

Conrad Gomes • March 30, 2024

This is a quick rundown of my exercise based on lesson 1 of the Fast.ai course 22. In this exercise I will download photos of butterflies and moths. Using the images I will train a model using the resnet18 model and test it to see if it can identify a butterfly and moth.

The entire exercise can be found here.

Step 1. Downloading images

Using the same steps in the lesson I was able to download images of a butterfly and a moth.

Download butterfly and moth images

Step 2. Train the model

Next was to create a DataLoaders object using the downloaded data. Using show_batch the data set can be inspected to make sure the training data is sane.

Dotablock butterfly and moth images

Using the data block I created and tuned a vision_learner with the resnet18 model.

Train butterfly and moth images

Step 3. Test the model

The final step is to test the initial images downloaded. I ran the test separately for the butterfly and moth.

Test butterfly and moth images