Distinguishing between rats and mice
The Cacophony team have come up with a way to distinguish between rats and mice on thermal cameras. Up to now, it seemed a bit difficult and so we classified rats and mice as rodents. There were two events that prompted us to come up with a solution.
The first was after visiting the Brook Waimārama Sanctuary in Nelson. Like most sanctuaries in New Zealand, they haven't been able to keep mice out and are living with mice in the sanctuary. Incidentally, they are in the process of creating a mouse free area within their sanctuary so they can have tuatara and other mouse sensitive species.
The main predators they deal with are an occasional rat or ferret incursion. It quickly became evident that our camera wouldn't provide much utility if it can't distinguish between rats and mice.
The second event was the realisation that Shakespear park rangers were regularly able to identify rats and mice on their thermal cameras. They have a lot of experience viewing thermal cameras, with Bruce and Emma having tagged over 20K videos each. They also have a good understanding of what the thermal camera is looking at, and so are able to identify a that a blob of a certain size in a certain part of the screen is likely to be a rat rather than a mouse.
For example the thermal images below of a rat and a mouse are taken from a camera looking at this fence end.
A mouse is much smaller in the same position
A general rule of thumb for machine vision is that if a human can do it, then you can probably train a machine to do it. While a human struggles to distinguish between rats and mice without the context of the setting, it can be done with that context. The Cacophony team came up with an idea on how to infer that context.
The idea is that, for each location, any mice that are tagged, the average size of the mice (in terms of pixels) is calculated on each part of the image. If the identified rodent is larger than the 80th percentile of mice mass then it will be classified as a rat.
A test of 155 mice and 19 rats achieved almost 100% accuracy at telling them apart. This algorithm has now been rolled out and is successfully identifying mice and rats. For example the image below was identified as a rat by the AI and confirmed by Emma this morning.
This improves the utility of the thermal camera for sanctuaries, such as Shakespear and Brook Waimāmara. With our alert functionality they can now get email alerts when a rat is detected, facilitating a quick response to any incursions.