AI-powered cat flap stops cat bringing home prey

AI-powered cat flap stops cat bringing home prey

As a pet owner, you might be familiar with the habit of cats bringing home little unwanted 'gifts' from their hunting expeditions. While this behaviour is a part of their natural instincts, it can be quite a nuisance when your furry friend decides to surprise you with an unexpected visitor.

This leads us to an intriguing question: can cat flaps detect prey? In this comprehensive article, we delve into the fascinating realm of technological advancements in pet care, focusing on this specific question.

The predicament of pet owners

The 'gift-giving' behaviour of cats can turn into a real problem when it becomes a regular occurrence. Dealing with the aftermath of a hunting spree is not a pleasant experience for most pet owners.

However, it's not just about the inconvenience. These 'gifts' can also pose a risk to local wildlife populations.

Technological solutions to the rescue

The advent of technology has brought forth solutions to a myriad of problems, and the issue of felines bringing home unwanted presents is no exception. Thanks to the innovative minds in the tech industry, we now have cat flaps that can detect prey.

A journey into machine learning: The innovation of Ben Hamm

One such innovator is Ben Hamm, an Amazon employee with a penchant for coding. Disgruntled by his cat, Metric's habit of bringing home prey, Hamm decided to devise a solution.

He trained a machine-learning system that would recognise when Metric approached the smart cat flap with a small creature in its mouth. Once detected, the system would lock the cat flap, barring the cat's entry for 15 minutes.

Understanding the mechanism

The mechanism employed by Hamm's system is a complex one, involving intricate machine-vision algorithms. Hamm supplied over 23,000 images to the system, each manually sorted to identify if Metric was in the frame, his direction (entering or leaving), and whether he carried prey.

The payoff: A successful invention

Hamm's persistent efforts paid off. Now, when Metric approaches the cat flap the system identifies whether he has caught anything. If he is carrying prey, the flap automatically locks for 15 minutes and Hamm is sent a text with pictures from the camera. The system also sends a small donation, or ‘blood money' as Hamm calls it, to conservation group the National Audubon Society.

It's not 100% accurate: over a five-week period, Metric was unfairly locked out once. The cat was also able to gain entry once out of the six times he had caught an animal.

When a software engineer suggested that it might have been easier to teach the cat to change his behaviour, Hamm defended his work, according to BBC News.

“Negative reinforcement doesn't work for cats, and I'd challenge you to come up with a way to use rewards to prevent a behaviour that an animal exhibits once every 10 days at 3am!” he tweeted in response.

Watch Hamm's five-minute presentation.

Cat looking through open cat flap

Exploring raspberry pi-powered machine learning

Another innovation in this arena is a Raspberry Pi-powered machine learning model developed by a Reddit user named u/eee_bume. This system employs a convolutional neural network cascade to identify if a cat is attempting to enter a cat flap with a creature in its jaws. The system's virtual door bouncer denies entry if it detects the cat carrying contraband.

Data collection and training

The development of this model was undertaken as a spring semester thesis project at the Swiss Federal Institute of Technology by Nicolas Baumann and Michael Ganz.

The duo faced a challenge in training the device due to the infrequency of cats carrying prey, which was estimated to be a mere 3% of the time.

To overcome this issue, they built a scalable image data gathering network to maximise the collection of training data. This effort resulted in the accumulation of 40GB of training data.

Classification of prey

Apart from detecting the presence of prey, the model was also trained to classify different types of prey. Currently, it can identify mice, lizards, squirrels, slow-worms, and birds.

The model is still in the refinement stage, with a prey detection accuracy of 93%. However, the model does falsely accuse the cat on 28% of occasions.

The 'Mousehunter' project

Another project that leverages vision technology to prevent cats from bringing home prey is the 'Mousehunter' project. This project employs an object detection model to identify when a cat is carrying prey. Once identified, the system triggers the cat flap API to lock the door.

The journey to perfection

It took more than seven months of continuous work to perfect this system. However, there were a few hurdles to overcome. The system initially took around 2-3 seconds to detect the object, with an additional 2-12 seconds required to call the cat flap API.

This process had to be quickened to prevent the prey from entering the house. The solution came in the form of Google Coral, which reduced the inference time to 7ms, making the process significantly more efficient.

Can rats get through a cat flap?

Rats, known for their flexibility and resilience, can indeed get through a cat flap. Their skeletal structure allows them to squeeze through narrow spaces, making cat flaps a potential entry point. In considering this, it is important to evaluate the security of your cat flap to prevent unwanted visitors.

Implementing measures such as electronic cat flaps that respond only to your pet's microchip can be an effective solution. Yet, it is crucial to remember that the primary line of defense against rat infestation is maintaining a clean, clutter-free environment that does not attract these rodents in the first place.

Wrapping up

In conclusion, the answer to our question, "can cat flaps detect prey?" is a resounding yes. Technological advancements have made it possible to create innovative solutions to this age-old problem faced by cat owners.

These state-of-the-art cat flaps are a testament to the wonders of machine learning and artificial intelligence, making life easier for pet owners and protecting local wildlife populations.

The future holds immense promise for further development in this field, and we might soon see even more sophisticated cat flaps that can detect prey with greater accuracy and efficiency. These technological innovations not only improve the quality of life for pet owners but also contribute to the preservation of our ecosystem by controlling the hunting habits of domestic cats.

Protect your own mischievous moggy with cat insurance from Purely Pets.Get a quote

Pet Insurance Quote

  • 98% claims paid *
  • Claims paid directly to vets
  • 24/7 vet video consultations
  • Interest free monthly payments