Git Product home page Git Product logo

spotbot's Introduction

SpotBot

SpotBot is an Android app that leverages the power of machine learning and android development to help find missing people and wanted criminals. It uses the FaceNet ML model (tflite) for facial recognition to match faces to a database of missing persons or criminals, and can make it an invaluable tool for law enforcement and search and rescue organizations.

Challenges

Throughout the development process, I faced a number of challenges, such as optimizing the model to work well on mobile devices and designing an intuitive user interface. But with perseverance and dedication, I'm proud to say that the app has exceeded my expectations.

This is my first time using ML models in and android project, I have used the already trained FaceNet models from here

Face Detection

Face detection is a common computer vision task that involves identifying and localizing faces in an image or video stream. It has many applications, such as photography, video editing, and security systems.

Google MLKit

For Face Detection, I've employed the use of Google ML Kit, a pre-trained machine learning model that detects faces in images and video streams. It uses a deep learning architecture that has been trained on a large dataset of faces to identify facial features and localize faces with high accuracy.

The ML Kit Face Detection model can detect multiple faces in an image or video stream, and provides information about the position, size, and orientation of each detected face. It can also identify landmarks on each face, such as the eyes, nose, and mouth, and estimate the pose of each face. It also provides various options that you can use to configure your use type, i.e., to detect facial landmarks/smiling probabilities, etc. You can find more about it here.

Face Recognition

Face recognition is the process of identifying or verifying the identity of a person based on their face. It has many applications, such as security systems, social media, and entertainment. One popular approach to face recognition is using machine learning models, such as the FaceNet model, to extract features from facial images and compare them to a database of known faces.

FaceNet Model

FaceNet is a deep learning model for face recognition developed by researchers at Google. It is trained on a large dataset of faces and learns to map each face to a high-dimensional feature space, where similar faces are closer together and dissimilar faces are farther apart. This makes it possible to compare faces based on their feature vectors and identify matches.

FaceNet

The FaceNet model uses a deep convolutional neural network (CNN) architecture to extract features from facial images. The CNN consists of multiple layers that learn increasingly complex representations of the input image, culminating in a high-dimensional feature vector. The model is trained to minimize the distance between feature vectors of matching faces and maximize the distance between feature vectors of non-matching faces.

Working

  1. Faces are detected in an image and are stored in a list.
  2. Bounding boxes are created out of the faces, and the image is copied and copped to get only the face.

  1. Since the required format for input image for FaceNet model is Bitmap, we process the images using the BitmapFactory to convert them to bitmap.
  2. FaceNet model's instance is created and is used to generate an array of 128 Floating point integers by passing the cropped face's Bitmap to it.

  1. Embeddings are extracted for the image of person that is missing and then these embeddings are compared with the Embeddings of every person present in the refrence images.
  2. We can calculate the distance between two of such arrays using L2 Norm or Cosine Similarity (I've used L2 Norm in the project, it simply calculates the Eucledian distance between the arrays).
  3. The closest match in the reference image (one with the least distance with the person's face) is returned and is displayed below.
  4. For Learning purpose, I've also displayed the 128 Floating point array (Face Embeddings) in a text view after the output.
screen-20230430-005857.mp4

Acknowledgments

SpotBot would not have been possible without the following resources and tools:

  • TensorFlow Lite for mobile devices
  • The FaceNet ML model
  • Android Studio
  • Google's ML Kit

If you've any doubt regarding the project, reach me at Ashray

spotbot's People

Contributors

ashrayyy avatar

Stargazers

 avatar

Watchers

 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.