Git Product home page Git Product logo

rekoglog's Introduction

AWS Rekognition Authentication Demo

This project is part of a company Hackathon conducted in July of 2018.

It is based largely around this document: https://aws.amazon.com/blogs/machine-learning/build-your-own-face-recognition-service-using-amazon-rekognition/

As well as this demo: https://mdn-samples.mozilla.org/s/webrtc-capturestill/

The back end code is built upon Node Red

Operation

HTML5 UI

Authenticated Form

The front end form is served out of a static files directory by node red. It waits for a user to enter a username, then begins capturing images of them via webRTC getMedia stream. It posts image blobs every 4 seconds to the node-red backend that verifies them with AWS.

Node-Red

Node-Red Flow

The node-red backend receives the image blobs and intended username, posts them as blobs to Rekognition using the 'SearchByFaces' api which compares a given image against a set of username indexed images.

The node-red backend gets the face matches, verifies that they are associated with your username, and returns 'authenticated' or not.

Once 'authenticated' is true, the form is unlocked and the user may proceed with logging in.

Source Imagery Indexing

Aws Indexing Workflow

Source images were uploaded to s3, processed by a lambda trigger that indexes the faces in rekognition and indexes the face-id/username relationship in Dynamo. That indexing process is well described here

The scripts @Xiaobingliu2014 used to add images to the indexes can be found here

Caveats

In the interests of testing I have piped data back to the client that it shouldn't have and if such a process were to be implemented more verification would need to take place on the back end with less trust of the client side code.

Webcam face authentication can easily be spoofed with printouts of publicly available images. As a person can't secure their face nor change it when compromised, it's a relatively small added layer of security. The tech is neat though! : )

I tested this only in Chrome.

Running the Code

You can set up and run this project locally using docker-compose.

~/code/rekoglog$ docker-compose up -d
Recreating rekoglog_hack_1 ... done

The docker-compose file is set up to mount your aws credentials file into the container. You can specify aws credentials in one of the aws specific nodes to bypass that. The flow won't function until you provide access.

Aws Resource mappings

These are the AWS resources you'd need to run the node-red flow:

System Type Name
Rekognition collection face_collection
Dynamo table face_collection

These were derived largely from runnning through this guide: https://aws.amazon.com/blogs/machine-learning/build-your-own-face-recognition-service-using-amazon-rekognition/

So doing that in your aws account should get you set up.

rekoglog's People

Contributors

aaronpropst avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.