Vaheeshta’s Status Report for 5/8

On Sunday, I met with Danielle and took videos of us demonstrating our system as she drove around Pittsburgh. Then, I made more changes to our Final presentation, polished my presentation script, and practiced for the Final presentation I gave on Monday. I am thankful that I memorized my script because, near the end of the live presentation, my computer froze over. I was not able to see the slides, but my audio was still working, so I presented completely from memory. I greatly appreciate my team for all their help in handling this technical difficulty!

After I presented, Heidi and I tackled our systemd bugs that we were facing the previous week. We wanted FocusEd to start as soon as the Jetson turned on, but the systemd service we tried to set up was giving us permission errors. Once we fixed one permission error, we were facing more issues related to the audio not playing. After much trial and error, we figured out our bug was related to the certain folder we were running in. Now, our system successfully runs on boot, making it a fully usable system. Heidi and I also worked to improve our FPS and delay, so now we run at 17+ FPS. We are still using 10W of power from our power bank and thus using 4 CPU cores (out of the 6 available). The latency improvements came from reducing the camera resolution.

Afterwards, I took videos of myself using the faster system for our final demo video. This included screen recordings on the Jetson of our display with our eye landmarks and facial areas so that it is more clear what we are using to make our estimations. 

I am on schedule and hope, in the next week, to help my team finish up our demo video and complete our final report.

Vaheeshta’s Status Report for 5/1

For eye classification, I created a baseline set of vectors extracted from a subset of the Closed Eyes in the Wild dataset. This way, if the user does not properly calibrate at the beginning, then we will still have a good baseline model to use to classify their eyes. Additionally, I helped debug an issue we were having with GPU acceleration and reflashed the Jetson image. Moreover, I worked with my team throughout this week to work through other problems that we encountered, such as with our systemd, audio, and head pose. 

Last week, I said I would be working on taking videos in Danielle’s car for testing. Instead of taking videos, we decided to go ahead and run many tests of our complete system in the car. Danielle and I did 100 trials of various poses and simulated drowsiness (while parked). Danielle and I also did 30 trials for measuring our system latency, specifically how long our system takes to detect and output an audio alert. Additionally, I tested the power supply with our running system on the Jetson Xavier.  I also gathered more face detection metrics.

Finally, I worked on the presentation. I will be presenting on Monday/Wednesday, so I worked on the slides and my script. 

I am on schedule, and the next steps are to finish preparing for the presentation and then help create our demo video, poster, and final paper.

Vaheeshta’s Status Report for 4/24

My progress for the project was focused on gathering our final metrics. To do this, we want to test both with databases and with ourselves. I created a total of three automated scripts to analyze our datasets that we found online or created ourselves. One script can process a given set of photos of an individual with their eyes open or closed to test how accurate our eye classification model is. I set the script up so that the final output of the script tells you how accurate the eye classification model was, thus making this script easy to run on large sets of images (specifically, I designed it for LFW and MRL Eye Dataset, details below). This is for gathering data for our “Eye classification matches truth >=90% of the time” metric. The next script I made can process a given video stream and retrieve the same information as above. This was made to process videos that we take of ourselves and others while we are driving a car, so that we can test in the proper driving environment. Finally, I configured our working overall system to work on videos from the DROZY database and UPNA Head Pose Database to gather data for our “Distinguishes distracted vs normal >=90% of the time” metric. The DROZY database is used for gathering metrics for drowsiness being detected, and the UPNA Head Pose Databse is used for metrics for distractedness being detected. 

I have begun to gather metrics from a number of databases and compile my results in a spreadsheet. The databases that I am using for gathering metrics are the following:

I am on schedule. The next step is to record videos in Danielle’s car so that I can run my scripts on those videos.

Vaheeshta’s Status Report for 4/10

This week, I successfully integrated all my code with Heidi’s and Danielle’s code to create our working demo. We all met together, in-person, on Friday and Saturday to make sure that this happened smoothly. I also set the integrated code up on the Jetson Xavier NX, with Danielle and Heidi’s help, and tested it. Therefore, for our demo we can now show the integrated system working on the Jetson Xavier NX. When integrating the eye classification and head pose estimation systems together, I made sure that our calibration sequences happen sequentially when the user boots up the system: The system first asks the user to calibrate head pose for 10 seconds, then it asks the user to keep their eyes open for 10 seconds for calibrating eye open classification, and finally it asks the user to keep their eyes closed for 10 seconds for calibrating eye closed classification. Thus, at this moment 30 seconds are spent for calibration when the system is turned on. Additionally, when testing on the Jetson Xavier, I faced issues with updating several libraries, but with Heidi and Danielle’s help we were able to fix this.  

My progress is, for the most part, on schedule. Along with integration, I also was hoping to test the power bank with the Xavier this week, but upon opening the power bank we received from the 18-500 inventory I noticed that the kit was missing the male-to-male DC connector that connects the power bank to the Xavier. Thus, Danielle ordered us a new one that should arrive next week for me to test. Therefore, next week I will be testing the power bank and working with my teammates to implement any feedback from the demo. 

 

Vaheeshta’s Status Report for 4/3

This week, I was successfully able to complete and test my code for creating and training our eye classification model using SVM. To create and train this SVM model, I first have a calibration system where the user follows prompts to keep their eyes open for a period of time, in which I calculate their various eye aspect ratios and create a dataset of vectors based on this. Then, I repeat this with the user’s eyes being closed. Afterwards, I use this data to train a SVM classifier for that specific person. My SVM classifier has two labels: 0, which classifies the eyes as open, and 1, which classifies the eyes are closed. It is important to note that I am only using our custom calibration data for my training my model, and not data from a database, since each person has unique thresholds. Then, during my real-time eye classification, I use this trained model to determine if the user’s eyes are closed or not. If the user’s eyes are closed for at least 1 second, my code detects that the user is drowsy. If the user is detected to be drowsy, I currently have a visual alert, which will later be changed to an audio alert. I have a screenshot of this below. So far, with testing with Heidi and myself, my model has been accurate. I am in the process of testing with DROZY, a drowsiness database, to see how accurate my overall drowsiness detector is. The next action for this code is to hand it over to Danielle, who will add the focus timer, audio prompts for calibration, and audio alerts for drowsiness being detected. 

I am currently on schedule. Next week, I will work with Heidi to integrate her head pose algorithm with my eye classification algorithm, so it is in one seamless file to run on the Jetson. If we cannot complete this in time before the demo, we will just have our calibration mechanisms integrated. 

Resources:

DROZY: http://www.drozy.ulg.ac.be/

Vaheeshta’s Status Report for 3/27

Since the previous status report, I worked on completing the Design Report with my teammates as well as adding to and testing our FocusEd codebase on my laptop. The first addition I made was that I integrated my eye classification code with Heidi’s HOG facial detection code. An image of this is shown below. While I completed this integration step earlier than I had designated on our schedule, it was a logical step to integrate the early version of two as soon as possible to then proceed to training and testing.

Next I worked on training of our eye classification model. Since every individual will have a different EAR threshold (which is the EAR value in our algorithm that determines if an individual’s eyes are closed), we wanted to train a model in order to accurately determine whether or not an individual’s eyes are closed or not. I am working on building a Support Vector Machine (SVM) classifier to detects long eye blinks as a pattern of EAR values in a short temporal window, as stated in T Soukupova and Jan Cech’s research paper “Real-time eye blink detection using facial landmarks” (this was the first paper that introduced EAR). I am using Jupyter Notebook in order to do so, which is something that is new to me and thus required time this week to set up and learn how to use. My EAR value, which belongs to a larger temporal window of a frame, will be given as input to the fully-trained SVM machine learning model.

Finally, another change I added was that I made my eye classification code simpler to run in terms of where the video input is found on the device the code is running on in anticipation of beginning Xavier testing of my code this Tuesday. I am currently slightly behind schedule since I hoped to have already tested my code on the Xavier, but I was able to complete the integration step mentioned before earlier than intended to make up for this. In the next week, I hope to finish training and then test on the Xavier starting Tuesday.

Sources

T Soukupova and Jan Cech. Real-time eye blink detection using facial landmarks. In 21st Computer Vision Winter Workshop (CVWW 2016), pages 1–8, 2016. https://vision.fe.uni-lj.si/cvww2016/proceedings/papers/05.pdf

Vaheeshta’s Status Report for 3/13

For me, this week began with taking our TA Abha’s feedback on our draft of our design presentation slides and making changes accordingly. This included completely redesigning our user flowchart to show how the system turns on, specify what algorithms are running in parallel, and clarify how the driver response is checked. I also helped my team specify in our software block diagram what is off the shelf and what we are creating. 

Additionally, this week I started to test my eye classification code and made changes accordingly. I also began to properly document our code to make it as clear as possible for our debugging process. 

Finally, I worked on our Design Review Report with my teammates, as this is due next week. Thus, next week my main focus will be to complete the design report. I will then continue working on my eye classification algorithm and begin training with an already-existing dataset. My progress is on schedule.

Vaheeshta’s Status Report for 3/6

This week, my accomplishments for our design presentation are that I created the hardware system specification block diagram, user story diagram, and the solution approach table. Additionally, I ordered all of our team’s parts on Monday, and some parts have already arrived. Most notably, I was able to obtain the TalentCell Rechargeable 12V battery pack from the ECE inventory, saving us money in our budget. Thus, we currently have about $156 to spare in our budget. 

Moreover, I started to work on the code for our eye classification using the Eye Aspect Ratio (EAR). For EAR, the proportion between height and width of the eye is calculated, with a higher EAR implying open eyes and smaller EAR implying closed eyes. Thus, EAR decreases when the eyes close, and return to a normal level when the eyes are open. EAR is the best option because it easily extracts a single feature from each image and reduces the amount of computational processing and storage memory required compared to other eye classification options. My code uses OpenCV, Dlib, Numpy, and SciPy libraries. It will be easy to integrate it with Heidi’s code with facial landmarking, since it will use the same facial landmark coordinates. This has been pushed to our Github repo at https://github.com/vaheeshta/focused.  

Additionally, I wanted to do more research into if there was a better way to detect drowsiness based on eye movement, other than just tracking if eyes are continuously closed for 2 seconds. For detecting drowsiness, I found a paper detailing a drowsiness pattern and ML model that does exactly this, using EAR, HOG, and SVM just like we are. Their drowsiness classification is based on two rules, the second of which being similar to what we are using. Also, I discovered a public database of human drowsiness called DROZY that I want to use for testing my eye classification. 

I am ahead of schedule, since Heidi and I decided to combine my eye detection task with her facial detection and facial landmarking task. Next week, I hope to test my eye classification algorithm and make necessary changes. 

https://www.sciencedirect.com/science/article/pii/S0957417420303298

Vaheeshta’s Status Report for 2/27

This week our group met after Wednesday’s proposal presentation to discuss our next steps. Specifically for me, my next steps were to finish researching eye detection algorithms and to select the best option to then begin working on programming our eye detection over this weekend and during the next week. I hope to then finish on schedule by 3/4/2021 to begin testing. Therefore, I researched and solidified that we would be using the eye detection algorithm of Dlib’s Histogram of Oriented Gradients (HOG) and Linear Support Vector Machines (SVM) method for object detection. The reason for this is that, according to the Towards Data Science article and other tutorials listed below, HOG is a better option compared to Dlib’s CNN algorithm since it has a faster computation time for real-time video processing. However, there is a tradeoff that HOG is slightly less accurate than CNN for non-frontal faces, but we are aiming to place our camera with a direct frontal perspective of the driver to help compensate. 

During our team meeting, Heidi and I decided to use the same algorithms for facial and eye detection, thus not relying on two different simultaneous algorithms to compute facial and eye detection, when the facial detection will already be determining the locations of the eyes. 

Then, I set up our codebase through a private Github repository and began working on setting up Dlib. I also started reading the user manual for the NVIDIA Jetson Xavier NX Developer Kit. Finally, I worked on perfecting our budget so that we can order all our necessary parts by Monday. Since we are using a much more expensive microprocessor ($99 NVIDIA Jetson Nano vs. $399 NVIDIA Jetson Xavier), we need to make sure that we stay under our $600 total budget.  

By next week, I hope to have my eye detection code working with preliminary testing, all pushed to the repository. This includes finding datasets for training. Then, I want to get started with eye classification to determine whether the eye is opened or closed. I will use the Eye Aspect Ratio (EAR) equation for this. 

Sources

Why HOG

 

https://maelfabien.github.io/tutorials/face-detection/#3-real-time-face-detection-1

https://towardsdatascience.com/cnn-based-face-detector-from-dlib-c3696195e01c

https://www.pyimagesearch.com/2014/11/10/histogram-oriented-gradients-object-detection/

 

Eye Detection

https://www.educative.io/edpresso/eye-blink-detection-using-opencv-python-and-dlib

https://www.pyimagesearch.com/2017/04/24/eye-blink-detection-opencv-python-dlib/

https://towardsdatascience.com/a-guide-to-face-detection-in-python-3eab0f6b9fc1

 

NVIDIA Xavier User Guide

https://developer.download.nvidia.com/assets/embedded/secure/jetson/Xavier%20NX/Jetson_Xavier_NX_Developer_Kit_User_Guide.pdf?a89SNG_TxN9K0wiYbBWmdVF5WdJvtGJEvS–YZxbCnhAurtz2dqKfuxi93w_rhKTroNbZb0Eu41atCdOGAqSVw02a2m7EphpIa4rIVu325GWAvCe1wMA5fBO2H6BgZb0rD0xy5jzxr5XfH9BHgKmihXzbslTwi7mEJ5k3DOA7xcuWxk8N9FofDfeNSo_kE0bbfDDOjwR

Vaheeshta’s Status Report for 2/20

This week for me involved working on our project proposal and researching eye detection and classification methods. My main focus on our project proposal was researching and defining our testing, verification, and metrics for our nine requirements. I also dove into learning the basics of facial landmarking and eye detection as well as researching various eye detection methods. Some eye detection algorithms I identified in various research papers and online literature are as follows: Peng Wang, Matthew B. Green, and Qiang Ji’s Haar wavelet and AdaBoost algorithm that has a 94.5% eye detection accuracy; the Viola-Jones algorithm from the OpenCV library; D. Sidibe, P. Montesinos, S. Janaqi’s algorithm with a 98.4% detection rate; and Dlib’s Convolutional Neural Networks. Since computer vision is a very new topic for me, I taught myself an introduction to Haar cascade classifiers using OpenCV, some basics of Histogram of Oriented Gradients (HOG) using Dlib, and Convolutional Neural Networks (CNN) using Dlib. For instance, Dlib’s facial landmarking detector produces 68 (x, y) coordinates that map to specific facial structures, such as the left eye with [42, 48] and the right eye with [36, 42].

The next step involves finding which algorithm would be the best option for our project, taking both accuracy and performance into consideration. At this rate, my progress is right on schedule.

Sources

https://www.ecse.rpi.edu/~qji/Papers/frgc_eye.pdf

https://lear.inrialpes.fr/people/triggs/pubs/Dalal-cvpr05.pdf

https://hal-ujm.archives ouvertes.fr/file/index/docid/374366/filename/article_ivcnz2006.pdf

https://towardsdatascience.com/a-guide-to-face-detection-in-python-3eab0f6b9fc1

https://www.pyimagesearch.com/2017/04/03/facial-landmarks-dlib-opencv-python/