Revolutionizing Child Safety

How AWS Rekognition Helps Protect Childhood

In a world where privacy and data protection are increasingly crucial, especially for the most vulnerable, such as children, schools are faced with the challenge of sharing precious moments without compromising children’s identities.

Manuel E. de Paz Carmona
AWS in Plain English

--

Photo by Annie Spratt on Unsplash

It all started at my son’s kindergarten. In the days before the pandemic, it was common to perform outdoor activities and take pictures to post on social networks and send to family members.

In this context, data protection laws wisely prevent the identity of minors from being vulnerated and, to this end, establish a series of restrictions in this regard, including, among other things, the requirement that educational institutions must obtain the express permission of the family/parents before distributing such images.

All of this leads to tedious manual processes of anonymisation through superimposed emoticons, cropping, or deletions. As with any manual process, it is not error-free and does not scale well.

This led me to the idea of using some form of automation to search for and hide the faces of people, ideally children, guaranteeing their anonymity and making the work of teachers and education staff easier. If it could also articulate a sustainable business model, it would be killing two birds with one stone.

The Creative Process

With the idea in my head, I started to implement it: a simple web application and a server-side API. I prepared something simple and when it was ready I registered a domain and during the first tests before publishing I realised that this was a somewhat artificial step.

When you take a picture and want to share it, usually on your mobile phone, you don’t want to go through several applications to retouch it (at least not the average person) and even less so through a third-party website. This kind of roughness makes it difficult to get an application accepted, so I decided to try something different: a Telegram bot.

This allowed me to take advantage of a lot of the work that had already been done, so after a refactoring, I launched the bot and bit by bit, it gained users. While it was in development, 4 people kindly tested my code without being asked. This encouraged me to continue adding features and within three months, without advertising, I reached 400 users. After sharing it in several areas, I closed the application with 1034 different users.

Architectural Phases

The rationale behind each architectural design is detailed below. This shows the evolution of the solution.

First iteration: Serverless

Content distribution was done using CloudFront and S3, the logic was in a lambda and accessed via a GW API. The business logic was supported by calls to Rekognition and S3. Everything worked as expected, but the process of generating the images required a lot of CPU/RAM from the Lambda.

Second Iteration: IaaS with EC2

The second version was deployed directly on an EC2 running Ubuntu. First using PEM, later SSM. It was an instance with a role to download code from CodeCommit, Rekognition, and DynamoDB.

Final Candidate Architecture (not implemented)

The version proposed in case of evolution and demand was to create a small fleet of Fargate Spot Fleet with an ALB to scale up in case of need. This version was preliminary and was not developed, it was also necessary to refactor the code to use WebSockets instead of polling and to include session management in external storage e.g., Redis for node balancing.

Some useful snippets

The interesting part of the code is the section that processes the Rekognition response:

And along with that, also the section that anonymises the faces by applying a Gaussian blur effect:

Finally, for the curious, here is the complete code repository that contains the Bot’s state machine, the rest of the application’s business logic, and the helper needed to handle the API calls.

Lessons Learnt

This section is dedicated to sharing lessons learnt from facing unexpected challenges, experimenting with different technologies, and, above all, trying to launch a digital product as a side project.

  • it is not easy to implement a freemium and/or donation-based model.
  • People interact quite well with a bot on a smartphone.
  • UX and clear instructions are vital for interacting with your platform.
  • User feedback is a must, some of the best suggestions came from friends who tested the software.

Thank you for reading!
Hope you like it!

If you liked it, here are some other AWS-related articles I wrote that you might find interesting:

23 stories

In Plain English 🚀

Thank you for being a part of the In Plain English community! Before you go:

--

--

Hi folks! Here I talk about #AWS #AI #Cloud #Enterperneurship #Anthropology #Gaming #Economy & #Technology in general :)