Published in

Detecting drowsiness for safe driving: Computer Vision use case

Computer Vision technologies provide vast opportunities in video analysis and help various businesses gain valuable information from it. They enable to detect, identify, classify, monitor the events or objects, and then generate insights. Today, our story will be about construction companies and how Computer Vision capabilities could help to address their business goals and provide safe workplaces.

While working, construction companies face various challenges where Computer Vision application would be useful — from process automation to safety issues:

How to increase the safety level on a construction site using Computer Vision?

We faced a challenge related to safety issues and the careful use of building materials. Our client, a construction company, came to us with a problem: crane operators felt drowsy and fell asleep. It caused loss of building materials, accidents, and even human losses on a site.

So, we provided the customer with an investigation for a construction Computer Vision solution; it will help to detect signs of the operator’s drowsiness and notify about it. During the project, we used our Computer Vision Framework DIET to understand if the customer’s idea is feasible and if his investment will pay off.

In the first Discovery stage, we discussed possible options for solving the task. We considered AI solutions, cameras tracking the operator’s face, and IoT opportunities: portable devices — sensors of physiological indicators. Also, we defined the conditions of the operator’s work: his head position, part of the day, and type of internet connection. This information was essential for the solution: we needed to detect a face, its elements and set up cameras to the suitable mode for the night; the type of the internet, wired or wireless, impacts the solution’s architecture.

We conducted a study and, as a result, found out the signs are most often used to detect drowsiness:

In the next Ideation stage, we were looking for instruments to solve our challenge: ready-made tools and libraries for detecting the signs of drowsiness, but we didn’t find such open-source solutions. The existing instruments for face tracking didn’t solve the problem of catching signs by 100%, and we customized each solution for the task.

For example, there are no instruments to identify yawns. We took a Dlib library detecting key points of the face (facial landmarks), isolated the lips, and calculated the ratio of the distance between the upper and lower points of the mouth and the width of the mouth. This way, we determined a threshold value, and if exceeded the model identified the yawn. With the OpenCV library, we read video files, a capturing device, or an IP video stream and then record the processed video to a .avi file.

So, after evaluation and investigation, we’ve got as a result the possibility to detect the number of blinks and yawns, eye-opening percentage, and the angle of face tilt as a sign of drowsiness. After this consulting stage had been completed, our client counted the return of investment to the future driver drowsiness detection system: the amount of building material that will be saved and, most importantly, reducing the number of accidents on the construction site.

The more digital transformation construction companies implement in the work process, the more efficient, profitable, and safe it will be. As technology experts in the Artificial Intelligence area, we are always glad to discuss real business challenges with domain experts. If you have a business idea or problem, feel free to contact us: we’ll find your pain points, give the time estimation, complete research on the challenge, and valuable insights on how to solve it.



Data Scientists must think like an artist when finding a solution when creating a piece of code. ⚪️ Artists enjoy working on interesting problems, even if there is no obvious answer ⚪️ 🔵 Follow to join our 28K+ Unique DAILY Readers 🟠

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store

IT solutions company delivering custom web & mobile software.