Last week, when we were inventing our new app, we discussed how Facial Recognition software might work. Jon explained that it often concentrates on the eyes to identify people’s identity. Can you work out which Code Club member is which below?
Each picture has a number for you to jot down your answers. Think carefully about which clues you used to recognise people. Remembering that a computer can’t just remember ‘soft’ details, such as what someone ‘looks like’, we examined which clues we had used to distinguish one person from the next. These were:
- eye colour
- eye shape
- eyebrow shape
- skin tone
- distance between the eyes
But, we weren’t consciously thinking these things – these are our friends and we see them every day so we do tend to just ‘recognise’ them. But if they were strangers? We would definitely need to think more deeply! Add if we were a computer, we would need to know specific details in order to match photographs.
Tim & Jon explained yesterday that computers don’t think like us, and so they don’t physically compare what two faces, or two fingerprints, actually look like. Instead, the computer takes a series of measurements to create a unique (hopefully!) identification code for someone’s face or fingerprint and it stores that code. We can build up a large database of these codes so that a computer can check an entry against the database it already has and hopefully come up with a match.
Facial Nodal Points:
The lovely, helpful people at MorphoTrust USA (they have the contract to provide facial recognition technology to the US government) have sent you, via Twitter, this Infographic about Facial Recognition. I found it very interesting.
So, how could we go about designing an algorithm for this and maybe even create it in Scratch?
First, we created our database. We agreed on 3 defining features of each others’ faces. We measured the distance between our eyes, the length of our noses, and recorded the colour of our eyes. So we built up a database with 4 fields:
Name, Eye length, Nose length, Eye colour
And we had a record for each child, plus Nicola & Tim, so we had 14 records in our database. We built the database in Scratch using Lists, with a list for each field like this:
Next we needed a script that would compare an entry we put in against the records already in our database and return the one that matched.
Scratch needs to check each list independently. So we decided that the first input we would ask for would be the one with the least common occurrence. For example, we wouldn’t use eye colour as there are only 3 possible values for this, whereas the distance between eyes or nose length was far more widely distributed. So we agreed to first ask for an input of Distance Between Eyes. You have to be careful as you can’t choose the same name for a list as you do for a variable!
The children then had a go at designing a program to search the database and to suggest a matching name/ record. But, we were so busy talking & discussing that we ran out of time and didn’t get finished!
Our next challenge is what to do if 2 or more people have the same distance between their eyes. In our database, they do! We will be thinking about this after half term and will embed some of our finished projects here.
Some other things:
- We are worried about identical twins!
- We discussed the fact that when a computer compares 2 photographs of the same people, the photos may be different sizes & so the distance measurements wouldn’t be comparable. We think that actual facial recognition software may actually take comparative measurements eg the ratio of the distance between eyes to length of face, as this ratio would stay constant regardless of the size of photo. Or we thought maybe the computer always enlarges photos to be the same size.
- What about faces that are slightly turned away from the camera in a photo? J has read that Facebook uses 3D modelling of faces to overcome this.
- What about the fact that, when we use emotions, our face shape changes in different directions? Have a look in the mirror as you pull a ‘happy face’ or a ‘sad face’, or a ‘cross face’ or a ‘confused face’. (C kindly modelled this for us!) Do you think your facial measurements change? O pointed out that in a passport photo we all have to look serious and we think that that’s to help identification.
- How does the computer distinguish between a face and the background in a photograph?
The How Stuff Works website has some really interesting information about how Facial Recognition works. Some of it is complicated but there are bits that will definitely make sense to you!
Some interesting facts about our faces: