Face recognition assessment (AWS Face Rekognition)

Ayu
Ayu
Mar 29 · 5 min read

In the previous article, I have shared the result of our assessment for face recognition using the Azure Face API. (Face recognition assessment (Azure Face API))

This time, we assessed another tool: the AWS Face Rekognition. Today, I would like to share what we can do with AWS Face Rekognition. I hope this article will be useful for anyone who looks for information around Face recognition.

Illustration by Freepik Storyset

What we can do with AWS Face Rekognition

AWS Face Rekognition is a deep-learning-based visual analysis service developed by the Amazon Web Services (AWS). It’s ability covering several things below:

  • Object and scene detection: labels objects and scenes
  • Image moderation: detects explicit or suggestive adult content and/or violent content
  • Facial analysis: A complete analysis of facial attributes
  • Celebrity recognition: recognizes celebrities in images
  • Face comparison: Compare faces to see how closely they match based on a similarity

How to execute face verification with Face API

In this assessment, we would like to verify two face images. Therefore we can focus on “Face Comparison” since it can help us to compare faces to see how closely they match.

In that case, this API Reference will help us.
https://docs.aws.amazon.com/rekognition/latest/dg/API_Reference.html

1. Generate collection to get “CollectionId” by CreateCollection

Request Syntax

{
“CollectionId”: “Development Center"
}

Response Syntax

{
"CollectionArn": "string",
"FaceModelVersion": "string",
"StatusCode": number
}

https://docs.aws.amazon.com/rekognition/latest/dg/API_CreateCollection.html

2. Add Face into collection by IndexFaces

Request Syntax

{
"CollectionId": "Development Center",
"Image": {
"Bytes": blob,
"S3Object": {
"Bucket": "string",
"Name": "string",
"Version": "string"
}
},
}

With Postman, we don’t need to convert images into BLOB(Binary Large Object).

Response Syntax

{
"FaceModelVersion": "string",
"FaceRecords": [
{
"Face": {
"BoundingBox": {
"Height": number,
"Left": number,
"Top": number,
"Width": number
},
"Confidence": number,
"ExternalImageId": "string",
"FaceId": "string",
"ImageId": "string"
},
"FaceDetail": {
"AgeRange": {
"High": number,
"Low": number
},
"Beard": {
"Confidence": number,
"Value": boolean
},
"BoundingBox": {
"Height": number,
"Left": number,
"Top": number,
"Width": number
},
"Confidence": number,
"Emotions": [
{
"Confidence": number,
"Type": "string"
}
],
"Eyeglasses": {
"Confidence": number,
"Value": boolean
},
"EyesOpen": {
"Confidence": number,
"Value": boolean
},
"Gender": {
"Confidence": number,
"Value": "string"
},
"Landmarks": [
{
"Type": "string",
"X": number,
"Y": number
}
],
"MouthOpen": {
"Confidence": number,
"Value": boolean
},
"Mustache": {
"Confidence": number,
"Value": boolean
},
"Pose": {
"Pitch": number,
"Roll": number,
"Yaw": number
},
"Quality": {
"Brightness": number,
"Sharpness": number
},
"Smile": {
"Confidence": number,
"Value": boolean
},
"Sunglasses": {
"Confidence": number,
"Value": boolean
}
}
}
],
"OrientationCorrection": "string",
"UnindexedFaces": [
{
"FaceDetail": {
"AgeRange": {
"High": number,
"Low": number
},
"Beard": {
"Confidence": number,
"Value": boolean
},
"BoundingBox": {
"Height": number,
"Left": number,
"Top": number,
"Width": number
},
"Confidence": number,
"Emotions": [
{
"Confidence": number,
"Type": "string"
}
],
"Eyeglasses": {
"Confidence": number,
"Value": boolean
},
"EyesOpen": {
"Confidence": number,
"Value": boolean
},
"Gender": {
"Confidence": number,
"Value": "string"
},
"Landmarks": [
{
"Type": "string",
"X": number,
"Y": number
}
],
"MouthOpen": {
"Confidence": number,
"Value": boolean
},
"Mustache": {
"Confidence": number,
"Value": boolean
},
"Pose": {
"Pitch": number,
"Roll": number,
"Yaw": number
},
"Quality": {
"Brightness": number,
"Sharpness": number
},
"Smile": {
"Confidence": number,
"Value": boolean
},
"Sunglasses": {
"Confidence": number,
"Value": boolean
}
},
"Reasons": [ "string" ]
}
]
}

Just the same as Azure Face API, the AWS Face recognition do not store the image data but they store the analysis data like the above. In addition, we cannot name PersonId by ourselves on the AWS Face rekognition. In that case, you will have to copy the generated PersonId.

https://docs.aws.amazon.com/rekognition/latest/dg/API_IndexFaces.html

3. Execute Face comparison by SearchFacesByImage

Request Syntax

{
"CollectionId": "Development Center",
"FaceMatchThreshold": number,
"Image": {
"Bytes": blob,
"S3Object": {
"Bucket": "string",
"Name": "string",
"Version": "string"
}
},
}

Response Syntax

{
"FaceMatches": [
{
"Face": {
"BoundingBox": {
"Height": number,
"Left": number,
"Top": number,
"Width": number
},
"Confidence": number,
"ExternalImageId": "string",
"FaceId": "string",
"ImageId": "string"
},
"Similarity": number
}
],
"FaceModelVersion": "string",
"SearchedFaceBoundingBox": {
"Height": number,
"Left": number,
"Top": number,
"Width": number
},
"SearchedFaceConfidence": number
}

https://docs.aws.amazon.com/rekognition/latest/dg/API_SearchFacesByImage.html

This is the step to execute face verifications. The response served in the percentage of Similarity, not just the“True” or “False”. As the default, if the system detects a similarity of under 80%, it will be recognized as “False”. However, user can customize it using a parameter called the “FaceMatchThreshold” as necessary.

Cost Estimation

The following is a table containing the price list.

So if we implement this API into our attendance system, the monthly cost is estimated at the following:

  • Azure Face API: USD 50.25 (Around Rp. 720,000)
  • AWS Face Rekognition: USD 35 (Around Rp. 510,000)

The above cost estimation applies for the following condition:

2,500 employees execute face recognition every morning (20 working days).

  • Face storage: 2,500 images=USD 15
    (up to 1,000 is free and USD0.01*1,500)
  • Transaction: 50,000 times= USD
    (up to 30,000 is free and (USD1*20,000)÷1,000)

Honestly, I think the free plan is less suitable to use for attendance recording since their processing speed takes much longer time than the standard plan (free plan: up to 20 transaction per minutes). As you can imagine, employees need to record their attendance at the same time. It is unfortunate considering their accuracy is good and it is easy to use.

That’s all for our assessment about the face recognition. I hope this article helps you and please do not forget following us if you are interested in our articles. Thank you for reading!

References

DSF Web Services Engineering

Development Center by PT. Dipo Star Finance

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store