Hawk: Image Recognition Application using Rust and AWS Services
Partner: Knoldus (Internal Project)
Technologies Used : Rust, Cargo, AWS (S3, Rekognition, Lambda), Terraform
Domain : IOT
Hawk is a security system in Rust which uses AWS services like S3, Rekognition, Lambda, etc to get the similarity score of two images sent through the Rust application. This application hits the API Gateway that invokes the AWS lambda function. The Lambda function then interacts with the AWS Rekognition with the help of the CompareFaces API and responds with a similarity score between the two images i.e the one clicked from the Raspberry Pi camera and the one being the reference image for the user stored in an S3 bucket. The similarity score will decide if the person entering the premises is the one whose RFID card is being scanned or not. If not the image stored in the S3 bucket would help us identify who was using the RFID card illegitimately. Kafka configured Rust code enables us to use the application as a simulator for the real scenario.
The major problems which we faced were as follows:
- Interaction with AWS Lambda using Rust.
- Making Hawk asynchronous.
- Incompatibility between Kafka and OpenSSL which is used to cross-compile our code.
Triggering the AWS Lambda function was tricky so we decided to work it through AWS API Gateway service. The Rust code hits the API Gateway and it further triggers the Lambda function. We resolved Hawk asynchronous problem by taking the reference from Tokio doc which itself was built on rust futures crate. We fixed the cross-compilation issue by ignoring the default features of Kafka by setting [default_features=false]. We used OpenSSL version 0.10 with feature [vendored]
- Created a digital experience that enables people to easily form and activate a care circle of trusted family and friends, access meaningful insights into their loved one's well-being and receive notifications about care.
- Philips Lifeline personal alert service can now be managed through the digital experience, and just as before an aging loved one can still with the simple press of their Philips Lifeline personal alert button connect with a trained care specialist 24/7 to dispatch the right kind of help.
- Automatic Onboarding and Registration process reducing the lead time to less than 2 minutes.
- Live to track of the recipient and his well being.
- Caregivers can share notes about the recipient health and status and upload pictures as well as videos.
- Integration with the existing systems with graph being a source of truth making the overall process simple and well defined and making some pieces redundant.
- Recommendation engine for running promotions as well as for pushing relevant content to the user on the basis of the medical profile of the user.
- Maintaining the medical profile with allergies and conditions.
- User discovery and invitations as a key functionality to add new users to care circle on runtime.
- Keeping track of the availability of the notifiers and responders so that the system can intelligently decide on routing any emergency request.
- Real-time notifications to all the users.
The benefits of working with Hawk manifolds the followings:
- Enhances the security of the premises.
- It depends upon the highly reliable AWS services.
- Portable and adjustable as per requirements.
- Quick response time.
- Help gather data for the management to understand the pattern of Check-In time!
- Integrated with any type of first-phase authentication system with the help of a Kafka Producer.
Hawk is an open source project. You can find the source code here: https://github.com/knoldus/hawk. All contributions are welcome. If you want to contribute, please create a GitHub issue and raise a pull request.
Get In Touch:
If you are looking to build this or similar solution (IOT with Rust), please get in touch or send us an email at email@example.com. Knoldus has proven expertise in building reactive products with Scala, Functional Java ecosystem using Lightbend platform and solving big data challenges leveraging Apache Spark platform.
Follow our thinking or say a hello @Knolspeak