Artificial Intelligence: Jasper or Pippa

Author/s: Grace Smart
Posted: 17 June 2020

For our Summer Semester 2020 Introduction to Artificial Intelligence class, we were asked to create an intelligent machine. I decided to attempt to teach my model to tell the difference between two dogs from the same litter. Jasper and Pippa are Shorthaired Jack Russell Terriers, bought as a pair partially due to how similar they looked as puppies.

Jasper and Pippa

Firstly, I needed to collect enough data to train the model on. This was done by filming both dogs and using frames from the videos as training data. I also needed to collect data for the third dataset "Not a Dog". This data is a mixture of people and soft animal toys to make sure features like a tail or fur weren't automatically identified as one of the dogs.

The main problem in data collection came from the fact that dogs are living animals and not entirely predictable. If Jasper were to yawn while being filmed, but Pippa did not, then an imagine of either dog yawning might be recognised by the machine as Jasper. As far as the machine is concerned, Jasper might be the only dog capable of yawning. Because of this, I had to spend a lot of time following the dogs around with a camera in an attempt to get similar images of them both.

In total I used approximately 60 photographs of each dog, plus about 50 photographs in the "Not a Dog" category, to train the model. I also did a second attempt in which I used the webcam function to record the dogs directly into the model. This second attempt was significantly less successful for many of the reasons I've already covered.

As you can see above, the model is able to identify the dogs fairly accurately. I would say it comes up with the right result roughly 9 times out of 10. Since the training images were taken, Pippa has been to the vet and now wears a large blue collar. The machine had never been trained on her wearing it, so it was interesting to see it identify her correctly first time. As you can see, in instances where both dogs are present in the frame, it identifies the dog closest to the camera. As well as this, it is also able to successfully identify the dogs from side, and back, profiles.

I also challenged my model using other objects which share physical characteristics with the dogs - for example soft toys or other animals. Below you can see an example using a soft toy sloth (not used in the training data) which like the dogs has a long nose and black and white face. However, the model successfully identified it as "Not a Dog", although you can see it is not entirely certain in this decision.

If you would like to test this model yourself, you can find photographs of both dogs on Instagram @jasperandpippa or by following the link www.instagram.com/jasperandpippa