Recently, there have been increasing attempts to create a facial recognition application for various characters using OpenCV tools.
However, despite the high speed, the quality of these tools turned out to be insufficient.
In search of automation, a bit of work with Python led to impressive results.
But first of all, a small introduction to the basement of the project.
The task was to make a package for face-recognition task, which:
- allows to recognize faces thanks to the API;
- helps you to perform fine-tuning as needed;
- Easy to install.
How does it work?
The developers collected about 20 faces of each character from different angles:
They took ten faces for training and the rest to assess the accuracy of recognition.
Face Detection
Images of faces measuring 150 x 150 pixels were provided by the customer. But you need to define faces, cut, save and label them.
Recognizer training
This code directs the faces to the neural network, which gives out a descriptor for each person and stores it in the corresponding class. By specifying numJitterss as the third argument, you can use rotation, scaling, and mirroring, creating different versions of the input faces.
The next stages were: retention, loading to the DB, and recognition of unknown faces.
Recognition is performed: first, calculate the Euclidean distance of the descriptor vector to each class descriptor at the input face, and then the average value of all distances.
If you need to get the distances of descriptors of all classes for a specific person, then you can use a recognizer. Predict (image), which for each class will give arrays of distances.
Results
Even a small sample of training data allows for accurate recognition, although some input images are blurred because of their small size. Check this post to understand the theory of pattern recognition deeper.
Facebook’s special feature for the visually impaired
A few years ago, Facebook’s specialist team, which included Matt King – the first blind engineer, developed an accessible feature for blind and visually impaired people using image recognition.
It is based on the technology of choosing friends you should tag in your photos. The machine learning system analyzes the facial pixels in the image and creates a so-called “template” for further use in identifying people.
Enlitic’s breakthrough in the diagnosis
The most famous sphere that has benefited from image recognition technology is radiology. Jeremy Howard, the former president of Kaggle, founded an Australian company Enlitic. Enlitic focuses on detecting malignant tumors in lung computed tomography and providing an earlier diagnosis. In one of its internal tests, thanks to this technology, the Enlitic software was 50% more accurate in diagnosis compared to a group of radiologists.
Image recognition in the security industry
With image recognition technology, home security systems can recognize and remember family members (regardless of lighting or angle) and distinguish between humans and pets.
Netatmo Welcome and Ulo as the best security devices
For example, Netatmo Welcome has a feature that only starts video recording when the system detects unknown faces. And Ulo, an owl-shaped security device, starts streaming live video to your chosen device in the presence of unknown individuals.
The efficiency of image recognition technology in police work
In the UK, South Wales Police use facial recognition technology to track large events and crowds. When the system tags anyone who has at least 59% similarity to the suspect, the match is sent to the officer for rechecking. Using an image recognition system has significantly reduced costs and improved overall police efficiency.
Image recognition in the automotive industry
Google Waymo’s self-driving cars of the future
Google Waymo has been testing and developing autonomous cars for nearly 10 years. To track their algorithm across different life scenarios, they built a small town in the Arizona desert, USA.
Autonomous cars have made significant progress in this direction, although not widespread. Several video cameras detect traffic lights, read road signs and track other vehicles, as well as look out for pedestrians and other obstacles together with lidar and radar sensors.
Self-driving cars can improve emissions compliance and reduce accidents and congestion. The reason is that machines follow the rules and respond more quickly to sudden distractions better than humans.
Image recognition in the retail industry
Visual mirrors as an alternative to dressing rooms in well-known stores
Several high-profile brands such as Topshop and Timberland have used a device called a visual mirror – a large screen with multiple cameras to try on the entire clothing range from their collections.
Some versions of visual mirrors allow you to photograph the outfits you’ve put together, send them to your phone and create a complete list of all the items you can find in the store.
Japanese anti-shoplifting security system
While a visual mirror makes shopping more convenient, one Japanese firm has created a security system called AI Guardian, which prevents pilferage.
The AI Guardian technology scans entire bodies, not just the faces, and detects suspicious behavior according to the training data that describes the signs of a shoplifter.
A test of a store in Japan demonstrated that after introducing this technology, the number of thefts in stores decreased by 40%.