Inspiration

SafeSchool solves two major issues: A security issues which is that school faculty doesn't know who is entering the school and an attendance issue. The school attendance system has stayed relatively the same for generations. It is the classic, student comes to class, teacher calls name, student raises hand, teacher registers attendance and BOOM! Their attendance has been taken. This ancient technique has become obsolete in the modern times due to its lack of productivity. It is a HORRIBLE way of doing things because of its lack of efficiency and now because of COVID, human contact health risk. We decided to solve this problem by creating Safe School, a revolutionary way of taking the attendance that lets students take their own attendance using machine learning.

What it does

Safe School is a web application that utilizes machine learning to create social change by saving student and staff lives in our local and global schools. It does this by letting students safely admit themselves into classes in the morning or if they arrive late to school. The current norm for students to be admitted to class if they come late is to go to the attendance office and scan their id. This requires constant contact with the person in charge of attendance and a delay for students to arrive at class. This lack of productivity puts lives at danger and creates unnecessary risk. With our application, students can just sign in by taking a selfie of themselves, and a one time pass will be provided for students to show to their teachers. As you can see from trying out our website, first the student will need to login or create an account, then they will be greeted to a dashboard showing their statistics, then they will be at they will go to the capture page where they will take a picture of themselves and our ml model will capture them and finally add their status to the database. On the website, the student can also edit their profiles and look at the project's links. From the teacher's perspective, they will be able to see the students and their statuses. All of these features allow our app to increase the efficiency of the old and rusty attendance system, thus saving time and lives.

How we built it

We built our web app’s frontend, the part that interacts with the user, using Python, Flask, React JS, Javascript, CSS, HTML, Jinja and SASS. We also build Safe School’s backend, the machine learning algorithm, which detects the student’s face and classifies them, using a variety of face detection, linear regression and deep forest algorithms through the process of deep metric learning. Furthermore, we constructed our web app’s backend, which stores the students’ photos and handels the login, using MongoDB and PostgreSQL. Lastly, we deployed the website using Heroku.

Machine Learning

In order for the faces to be recognized we implemented a ml algorithm that constantly runs in the backend. Specifically, this algorithm utilizes deep metric learning which essentially returns a feature vector. So the first part of this algorithm occurs when the ml encodes a dataset of one image per person into 128-d vectors. From there the algorithm utilized the euclidean formula (distance formula) to find the distance between millions of segments between facial parts. Then it compares the input image to the one in the database. From here, every image that is taken is first identified as the name of the person, encoded to improve the accuracy of the program, and then deleted from the server. This allows the program to improve its accuracy without violating the privacy of students by storing images. Since we used a k-nn we didn’t have to train millions of images, as we used a pretrained network with 99.3% accuracy and implemented the algorithm onto there.

Challenges we ran into

The issue that took us the longest to solve was that the camera wasn’t visible to the user when we deployed the website to heroku. Because all of our machine learning backend and flask integration was written in the python file, heroku couldn’t stream that to the frontend properly. After a lot of research, we realized that to solve this problem we had to write the image capturing code in html / js instead of python and connect the frontend to the backend through post requests. After restructuring the entire code, we finally solved this problem and when we deployed it to heroku, it worked!

Accomplishments that we are proud of

Considering that we went into this hackathon with low expectations (as we couldn't imagine ourselves building a working website, machine learning model and backend in less than one week), we were really proud of our final result. We stepped up to the challenge and pushed our limits, and we were pleasantly surprised at our end result. Although there were a lot of features that we didn't get to adding, we ended up creating a product that incorporated a lot of the original ideas. Creating a working web app that uses machine learning to save lives in our local and global school’s truly fulfilling and satisfying.

What We learned

We learned a lot during this hackathon. First of all, we learned a lot about machine learning this hackathon. Most of us had only used ml for nlp and text-based AI applications before before but learning how you can use it with cameras for things like face detection was definitely surprising. Not only did we learn a lot about programming, we also learned how to work together in a high pressure environment. Since this was a virtual hackathon, we had a lot of difficulty at the start keeping track of each other. But then, we started assigning roles, keeping track of our project through range.cc (a tool that none of us had used before) and regularly talking with each other on slack. After that, our project began flowing much more smoothly and by the end, we were able to complete it!

What's next for Safe School

We are going to refine the app more by getting expert opinions. Once the app is completely finished, we will need to get it approved in our local schools and test how well the system works. We would then introduce a survey to the students and see their thoughts on this new way of taking attendance. We would then use our survey results and show other schools how effective the system is and why they should incorporate it as well. After all of that is done, we will share it to the world about it and hope that it goes viral so that we can save time and lives!

Share this project:

Updates