Beijing winters can be devastating on feral cats, with studies suggesting only about 40 percent make it through the long stretch of cold and harsh weather. A Baidu AI engineer who goes by the alias “Wan'xi” (晚兮) set out to make a difference for vulnerable neighbourhood kitties, and the result is an AI-powered smart shelter system. Deployed by Wan'xi in collaboration with a team of volunteer caregivers, the shelters not only provide warmth, they can also keep pests and predators out and even give the occupants a simple but effective health checkup.

The shelter includes a heating system which maintains a constant feline-friendly temperature of 27 Celsius, a ventilation system for fresh air circulation; and some cutting edge tech: an access system based on cat face recognition, and additional computer vision systems for cat sterilization identification and injury detection. The status inside the shelter can be remotely monitored using a mobile app.

Synced spoke with Wan'xi on the smart cat house's technical details, specifically the role of deep learning in the project.

Q: What kind of machine learning models are deployed in the smart cat house?

A: There are models for cat recognition, injury detection and sterilization identification.

Q: What is the size of the models? How are they built up?

A: The models have tens of millions of parameters. Both the cat injury detection and sterilization identification models are built on Baidu's EasyDL platform via a drag-and-drop interface, and are fine-tuned from pre-trained models.

Both training efficiency and model performance can be improved using such transfer learning, where a better starting point brings a faster neural network convergence. Transfer learning can also avoid training sample insufficiency.

Q: How much training data is required and how was it collected and labeled?

In the first version of the model, we collected 100 image samples for each data category, most of which was downloaded and filtered from the Internet. In subsequent iterations, for better model performance with more accurate image recognition, we went to pet hospitals for extensive sampling of more realistic images.

After data collection, we do simple labeling on each category of cat and each injury type for further data classification and packaging.

Q: How does the model deal with distance and angle issues in cat facial recognition?

A: We considered the diversity problem during image sampling and filtration, and also use data augmentation techniques to increase sample diversity.

Q: Is the model inference conducted at a terminal server or the cloud?

A: EasyDL supports model inference at both a terminal server and on the cloud, and is compatible with different types of terminal servers for inference acceleration. In our cat house project we conduct model inference at the cloud.

Q: Any work done at terminal servers? What kind of hardware is used?

A: Cat facial recognition is mainly done on terminal servers. We use x86-based servers and an infrared night vision camera.

Q: Within what distance can cats be captured by the smart house camera? Is there any difference in the cat facial recognition system for daytime and nighttime?

A: Under sufficient lighting a cat face can be recognized within a 2-3 meter radius from the house entrance in daytime, or within a 1.5 radius at night. We use the same facial recognition model for daytime and nighttime.

Q: Regarding facial recognition, do you use a coarse-grained animal classification for “cats,” or a more fine-grained recognition system that can distinguish breeds, or even recognize an individual cat?

A: For the smart cat house we only need to recognize if the animal that wants to enter is a cat, so we used a coarse-grained model for cat recognition. Baidu however does have an animal recognition API that can accurately identify 174 different cat breeds. EasyDL can also provide models to solve the problem of individual identification.

Q: How effective is the disease or injury detection system?

A: So far, the injury detection system works reasonably well for diseases that have obvious external features such as wounds, feline viral rhinotracheitis (FVR) and feline stomatitis. Diseases with insignificant external features such as feline distemper and digestive problems cannot be simply diagnosed via images.

Q: What are difficulties in detecting visible cat diseases or injuries?

A: The biggest problem is that many disease features are easily overlooked, especially when visible injuries might be too tiny to be detected.

In order to accurately detect these small injuries, an abundance of injured cat pictures is required for model training. We also need to keep updating and optimizing our model to reduce false identification of cat injuries to relieve the workload of volunteer caregivers.

Q: How are sterilized cats recognized by the sterilization identification model?

A: Ear-tipping is a widely accepted marking method to identify feral cats who have been sterilized. When cats enter the house, cameras at the door can capture the ear-tipping marks with greater accurately than human caregivers.

Q: What EasyDL modules and services are deployed for the AI cat house?

A: EasyDL image recognition, which includes image classification and object detection. The EasyDL custom image classification service supports model training and build-up to quickly distinguish between cats and other animals and between healthy and sick cats.

Q: How is model development efficiency being improved?

A: EasyDL provides a platform where you can build machine learning models with no coding or programming experience. This helps users who have limited resources or difficulties with training data collection, data labeling and computation.

We simply uploaded prepared data onto the EasyDL platform, selected the best-fit models and started model training. Based on the size of data and model, it usually takes from several minutes to hours to complete a trained machine learning model with a ready-to-use API produced online.

Q: What costs and resources are required to build and maintain a smart cat house?

A: For house build up, the main cost is on materials like insulation boards and glass and electronic devices and parts like cameras, sensors, motors, control console, etc.

The house also requires an uninterruptible power supply and regular food and drink refills, and therefore will be placed with communities that have feed stations and dedicated volunteer caregivers. This can reduce volunteers’ workload while providing a better home environment for feral cats.

Q: How many cats can the AI shelter hold? What if a house gets overloaded?

A: The house can hold up to 5–6 cats. Because not all feral cats will be inside at the same time, one smart cat house can serve at least 10 nearby street cats.

Volunteers receive notifications on their cellphones whenever a cat enters the house, and so can monitor and take action to deal with any short-term overloading problems. We haven’t seen such an issue so far, but I will consider making adjustments and adding more space if necessary.

The smart house is still in its testing stage, but we have already received many inquiries and positive feedback from large non-profit organizations and Weibo and WeChat users. I’m looking forward to further promotion and production.

Q: Any plans to adding new machine learning powered features to the cat house?

A: I do have some ideas about feature upgrades. For example, real-time monitoring of food and drink levels in feeders so that volunteers get notifications when these need to be refilled; or distinguishing between feral cats and pet cats by their appearance and breeds so that we can help unite lost pets with their owners.

Q: Any interesting stories you would like to share with us?

A: To be honest, the processes of house production, code writing and model optimization are kind of routine. But during my break time I love to check out the stray cats and observe their daily behaviours and habits.

I’ve also talked with volunteer caregivers and have learned a lot from them about how to best feed the cats and handle various medical issues. I’m just so happy that our feral cats are being well taken care of by those volunteers and good neighbors!

Source: Synced China