In-person user identity verification is slow to scale, costly, and high friction for users. Machine learning (ML) powered facial recognition technology can enable online user identity verification. Amazonsko ponovno vžiganje offers pre-trained prepoznavanje obraza capabilities that you can quickly add to your user onboarding and authentication workflows to verify opted-in users’ identities online. No ML expertise is required. With Amazon Rekognition, you can onboard and authenticate users in seconds while detecting fraudulent or duplicate accounts. As a result, you can grow users faster, reduce fraud, and lower user verification costs.
In this post, we describe a typical identity verification workflow and show how to build an identity verification solution using various Amazon Rekognition APIs. We provide a complete sample implementation in our GitHub repozitorij.
User registration workflow
The following figure shows a sample workflow of a new user registration. Typical steps in this process are:
- User captures selfie image and the image of a government-issued identity document.
- Quality check of the selfie image and optional liveness detection of the user face.
- Comparison of the selfie image with the identity document face image.
- Check of the selfie against a database of existing user faces.
You can customize the flow according to the business process. It often contains some or all of the steps presented in the preceding diagram. You can choose to run all the steps synchronously (wait for one step to complete before moving on to the next step). Alternately, you can run some of the steps highlighted in orange asynchronously (don’t wait for that step to complete) to speed up the user registration process and improve the customer experience. If the steps aren’t successful, you must roll back the user registration.
In addition to new user registration, another common flow is an existing or returning user login. In this flow, a check of the user face (selfie) is performed against a previously registered face. Typical steps in this process include user face capture (selfie), check of the selfie image quality, and search and compare of the selfie against the faces database. The following diagram shows a possible flow.
You can customize the steps of the process according to your business needs, and choose to include or exclude the liveness detection.
Pregled rešitev
Naslednja referenčna arhitektura prikazuje, kako lahko uporabite Amazon Rekognition skupaj z drugimi storitvami AWS za izvajanje preverjanja identitete.
Arhitektura vključuje naslednje komponente:
- Aplikacije kličejo Amazon API Gateway za usmerjanje zahtev na pravilno AWS Lambda funkcijo glede na pretok uporabnikov. V tej rešitvi so štiri glavna dejanja: preverjanje pristnosti, registracija, registracija z osebno izkaznico in posodobitev.
- API Gateway uporablja integracijo storitve za izvajanje Korak funkcije AWS express state machine corresponding to the specific path called from API Gateway. Within each step, Lambda functions are responsible for triggering the correct set of calls to and from Amazon DynamoDB in Preprosta storitev shranjevanja Amazon (Amazon S3), skupaj z ustreznimi API-ji Amazon Rekognition.
- DynamoDB hrani ID-je obrazov (
face-id
), URI poti S3 in edinstvene ID-je (na primer ID številka zaposlenega) za vsakegaface-id
. Amazon S3 shrani vse slike obraza. - Zadnja glavna komponenta rešitve je Amazon Rekognition. Vsak tok (preverjanje pristnosti, registracija, registracija z osebno izkaznico in posodobitev) pokliče različne API-je Amazon Rekognition, odvisno od naloge.
Preden uvedemo rešitev, je pomembno poznati naslednje koncepte in opise API-jev:
- Naše zbirke – Amazon Rekognition shranjuje informacije o zaznanih obrazih v vsebnike na strani strežnika, znane kot Zbirke. Podatke o obrazu, ki so shranjeni v zbirki, lahko uporabite za iskanje znanih obrazov na slikah, shranjenih videoposnetkih in pretočnih videoposnetkih. Zbirke lahko uporabljate v različnih scenarijih. Na primer, lahko ustvarite zbirko obrazov za shranjevanje optično prebranih slik značk z uporabo
IndexFaces
operation. When an employee enters the building, an image of the employee’s face is captured and sent to theSearchFacesByImage
delovanje. Če ujemanje obraza ustvari dovolj visoko oceno podobnosti (recimo 99 %), lahko preverite pristnost zaposlenega. - API DetectFaces – This API detects faces within an image provided as input and returns information about faces. In a user registration workflow, this operation may help you screen images before moving to the next step. For example, you can check if a photo contains a face, if the person identified is in the right orientation, and if they’re not wearing any face blocker such as sunglasses or a cap.
- IndexFaces API – Ta API zazna obraze na vhodni sliki in jih doda določeni zbirki. Ta operacija se uporablja za dodajanje pregledane slike v zbirko za prihodnje poizvedbe.
- SearchFacesByImage API – Za dano vhodno sliko API najprej zazna največji obraz na sliki in nato v podani zbirki poišče ujemajoče se obraze. Operacija primerja značilnosti vhodnega obraza s funkcijami obraza v podani zbirki.
- CompareFaces API – Ta API primerja obraz v izvorni vhodni sliki z vsakim od 100 največjih obrazov, zaznanih v ciljni vhodni sliki. Če izvorna slika vsebuje več obrazov, storitev zazna največji obraz in ga primerja z vsakim obrazom, zaznanim na ciljni sliki. Za naš primer uporabe pričakujemo, da bosta izvorna in ciljna slika vsebovali en obraz.
- DeleteFaces API – Ta API izbriše obraze iz zbirke. Določite ID zbirke in niz ID-jev obrazov, ki jih želite odstraniti.
Predpogoji
Preden začnete, izpolnite naslednje predpogoje:
- Ustvarite račun AWS.
- Klonirajte vzorčni repo na vašem lokalnem računalniku:
We use the test client in this repository to test the various workflows.
- namestitev Python 3.6+ na vašem lokalnem računalniku.
Uvedite rešitev
Izberite primerno Oblikovanje oblaka AWS stack to provision the solution into your AWS account in your preferred Region:
As we discussed earlier, this solution uses API Gateway integrated with Step Functions and Amazon Rekognition APIs to run the identity verification workflows. To test the solution, follow the steps in the skladišče kode to use the provided test client.
The following sections describe the various workflows implemented via Step Functions.
New user registration
The following image illustrates the Step Functions definition for new user registration. The steps are defined in the register_user.py
Datoteka.
V tem delovnem toku se kličejo tri funkcije: zaznavanje obrazov, iskalni obraziin kazala. zaznavanje obrazov function calls the Amazon Rekognition DetectFaces API to determine if a face is detected in an image and is usable. Some of the quality checks include determining that only the face is present in the image, ensuring the face isn’t obscured by sunglasses or a hat, and confirming that the face isn’t rotated by using the predstavljajo razsežnost. Če slika prestane preverjanje kakovosti, se iskalni obrazi funkcija išče obstoječe obrazno ujemanje v zbirkah Amazon Rekognition s potrditvijo FaceMatchThreshold confidence score meets your threshold objective. For more information, refer to the section on using similarity thresholds to match faces. Če slika obraza ne obstaja v zbirkah, se kazala function is called to index the face into the collection. The face image metadata is stored in the DynamoDB table and the face images are stored in an S3 bucket.
To register a new user, run the app.py script (test-client
) by running the following code:
If the new user registration succeeds, the face image attribute information is added in DynamoDB.
New user registration with ID card
The steps to register a new user with an ID card are similar to the steps for registering a new user. The following image illustrates the steps, which are defined in the register_idcard.py
Datoteka.
The same three functions that we used to register a user (detect-faces
, search-faces
in index-faces
) are called in for this workflow. First, the customer captures an image of their ID and a live image of their face. The face image is checked to confirm it meets our defined quality standards using the DetectFaces
API. If the image meets the quality standards, the live face image is compared to the face in the ID to determine if they’re a match. If the images don’t match, the user receives an error and the process ends. If the images match, we check if the face already exists in the Amazon Rekognition collections using the SearchFacesByImage
API. The search results are compared to the user’s current face image. If the user already exists, the user isn’t registered. If the user doesn’t exist in the collections, the relevant properties are extracted from the ID card. You can extract key-value pairs from identity documents using the newly launched Amazonovo besedilo AnalyzeID
API. The extracted properties from the ID card are merged and the user’s face is indexed in the DynamoDB table. After the image is indexed, the new user ID registration process is complete.
Existing user authentication
The following image illustrates the workflow for authenticating an existing user. The steps are defined in the auth.py
Datoteka.
Ta potek dela funkcije koraka kliče tri funkcije: detect-faces
, compare-faces
in search-faces
. Po detect-faces
funkcija preveri, ali je zajeta slika obraza veljavna, compare-faces
function checks the DynamoDB table for a face image that matches an existing user. If a match is found in DynamoDB, the user authenticates successfully. If a match isn’t found, the search-faces
function is called to search for the face image in the collections. The user is verified and the authentication process completes if their face image exists in the collections. Otherwise, the user’s access is denied.
To test authenticating an existing user, run the app.py
script (test-client
) by running the following code::
Existing user login with a request for photo update
The following image illustrates the workflow to update an existing user’s photo. The steps are defined in the update.py
Datoteka.
This workflow calls four functions: detect-faces
, compare-faces
, search-faces
in index-faces
. The steps are similar to the steps in the existing user authentication workflow. After the user captures their face image and the image quality is checked, we check for a matching face image in DynamoDB using the compare-faces
function. If a match for the user is found, their user profile is updated, their new face image is indexed by calling the index-faces
function, and the update process completes. Alternatively, if a match isn’t found, the search-faces function is called to search for the face image in the Amazon Rekognition collections. If the face image is found in the collection, the user’s profile is updated and their new face image is indexed. The user’s access is denied if their image isn’t found in the collections.
To update an existing user’s photo, run the app.py script (test-client
) by running the following code:
Čiščenje
Če želite preprečiti nabiranje dodatnih stroškov v vašem računu AWS, izbrišite vire, ki ste jih zagotovili, tako da se pomaknete na konzolo AWS CloudFormation in izbrišete Riv-Prod
kup.
Deleting the stack doesn’t delete the S3 bucket you created. This bucket stores all the face images. If you choose to delete the S3 bucket, navigate to the Amazon S3 console, empty the bucket, and then confirm you want to permanently delete it.
zaključek
Amazon Rekognition olajša dodajanje analize slik vašim aplikacijam za preverjanje identitete z uporabo preizkušene, zelo razširljive tehnologije globokega učenja, ki za uporabo ne zahteva strokovnega znanja o ML. Amazon Rekognition zagotavlja zaznavanje in primerjava obrazov zmogljivosti. S kombinacijo DetectFaces, CompareFaces, IndexFacesin SearchFacesByImage APIs, you can implement the common flows around new user registration and existing user logins.
Zbirke Amazon Rekognition zagotavljajo metodo za shranjevanje informacij o zaznanih obrazih v vsebnikih na strani strežnika. Podatke o obrazu, shranjene v zbirki, lahko nato uporabite za iskanje znanih obrazov na slikah. Ko uporabljate zbirke, vam ni treba shranjevati izvirnih fotografij, potem ko indeksirate obraze v zbirki. Zbirke Amazon Rekognition ne ohranjajo dejanskih slik. Namesto tega osnovni algoritem zaznavanja zazna obraze na vhodni sliki, ekstrahira značilnosti obraza v vektor značilnosti za vsak obraz in ga shrani v zbirko.
Če želite začeti svojo pot proti preverjanju identitete, obiščite Preverjanje identitete z Amazon Rekognition.
O avtorjih
Nate Bachmeier je višji arhitekt rešitev AWS, ki nomadsko raziskuje New York, eno integracijo v oblak naenkrat. Specializiran je za selitev in posodobitev aplikacij. Poleg tega je Nate redni študent in ima dva otroka.
Anthony Pasquariello is an Enterprise Solutions Architect based in New York City. He provides technical consultation to customers during their cloud journey, especially around security best practices. He has an MS and BS in electrical and computer engineering from Boston University. In his free time, he enjoys ramen, writing non-fiction, and philosophy.
Lauren Mullennex je arhitektka rešitev s sedežem v Denverju, CO. Sodeluje s strankami, da jim pomaga pri načrtovanju rešitev na AWS. V prostem času uživa v pohodništvu in kuhanju havajske kuhinje.
Amit Gupta je višji arhitekt rešitev za storitve umetne inteligence pri AWS. Strastno se ukvarja s tem, da strankam omogoči dobro zasnovane rešitve strojnega učenja v velikem obsegu.
- '
- 100
- 107
- 7
- dostop
- Račun
- Dodatne
- AI
- Storitve AI
- algoritem
- vsi
- Amazon
- Amazonsko ponovno vžiganje
- Analiza
- API
- API-ji
- aplikacije
- Arhitektura
- okoli
- Preverjanje pristnosti
- AWS
- BEST
- najboljše prakse
- maribor
- Boston University
- izgradnjo
- Building
- poslovni
- Stroški
- Pregledi
- mesto
- Cloud
- Koda
- Zbirke
- Skupno
- komponenta
- zaupanje
- Konzole
- Zabojniki
- kuhanje
- stroški
- Trenutna
- Izkušnje s strankami
- Stranke, ki so
- Baze podatkov
- globoko učenje
- Denver
- Odkrivanje
- Dimenzije
- Dokumenti
- konča
- Inženiring
- Podjetje
- Rešitve za podjetja
- Vstopi
- izkušnje
- Izvlečki
- Obraz
- obrazi
- prepoznavanje obraza
- Tehnologija za prepoznavanje obraza
- Feature
- Lastnosti
- Slika
- prva
- Pretok
- sledi
- goljufija
- brezplačno
- funkcija
- Prihodnost
- Grow
- visoka
- Poudarjeno
- pohodništvo
- Kako
- Kako
- HTTPS
- identiteta
- Preverjanje identitete
- slika
- analiza slike
- Indeks
- Podatki
- integracija
- IT
- otroci
- učenje
- lokalna
- strojno učenje
- velika
- Stave
- ML
- MS
- NY
- New York City
- Ponudbe
- Na vkrcanje
- na spletu
- Oregon
- Ostalo
- filozofija
- predstaviti
- profil
- Python
- kakovost
- zmanjša
- registracija
- viri
- Rezultati
- vrne
- Roll
- Pot
- Run
- tek
- Lestvica
- Zaslon
- Iskalnik
- varnost
- Self
- Storitve
- nastavite
- Enostavno
- rešitve
- specializirano
- hitrost
- standardi
- Začetek
- začel
- Država
- shranjevanje
- trgovina
- trgovine
- pretakanje
- študent
- uspešno
- ciljna
- tehnični
- Tehnologija
- Test
- Vir
- čas
- univerza
- Nadgradnja
- Uporabniki
- Preverjanje
- Video posnetki
- Virginia
- Počakaj
- v
- potek dela
- deluje
- pisanje