3D detectors measure social distancing to help fight Covid-19

A team of EPFL researchers has repurposed an algorithm they initially developed for self-driving cars to help people comply with social distancing requirements. Their program, which works with a camera, can detect whether individuals are maintaining the right distance to prevent infection – without collecting any personal data. It could be useful for public transport systems, in shops and restaurants, and even in factories.

“When Switzerland went into lockdown last year, we were working on an algorithm for self-driving cars,” says Lorenzo Bertoni, a PhD student at EPFL’s Visual Intelligence for Transportation (VITA) Laboratory. “But we quickly saw that by adding just a few features, we could make our program a useful tool for managing the pandemic.” The VITA lab is headed by tenure-track assistant professor Alexandre Alahi.

After spending several weeks reading up on how the Covid-19 virus is spread, Bertoni and his team began to realize – along with the rest of the scientific community – that microdroplets play a key role in spreading the virus and that it’s essential for people to maintain a distance of at least 1.5 meters if they’re not wearing a face mask. The researchers therefore began tweaking their algorithm, which was initially designed to detect the presence of another car or a pedestrian on the road and instruct the self-driving car to slow down, stop, change direction or accelerate. The researchers just published their work in IEEE Transactions on Intelligent Transportation Systems and will present it at the International Conference on Robotics and Automation (ICRA) on 2 June 2021.

A different calculation method
Distance detectors currently on the market use fixed-place cameras and LiDAR (laser-based) sensors. But EPFL’s 3D detector, called MonoLoco, can be easily attached to any kind of camera or video recorder – even those sold by consumer electronics retailers – or to a smartphone. That’s because it uses an innovative approach which entails calculating the dimensions of human silhouettes and the distance between them. In other words, it estimates how far apart two people are based on their sizes instead of on ground measurements. “Most detectors locate individuals in the 3D space by assuming they’re on the same flat surface. The camera has to be perfectly still and its utility is therefore limited – there are problems with accuracy if, for example, someone is coming up the stairs,” says Bertoni, the study’s lead author. “So we wanted to develop a detector that was more accurate and wouldn’t mistake a streetlight for a pedestrian.”

Other innovative features of EPFL’s algorithm are that it can identify people’s body orientation, determine how a group of people are interacting – and especially whether they’re talking – and evaluate whether they’re staying 1.5 m apart. That’s all because it uses a different calculation method than existing detectors. What’s more, MonoLoco keeps the faces and silhouettes of people who are filmed completely anonymous because it measures only the distances between their joints (i.e., their shoulders, wrists, hips and knees). It takes a picture or video of a given area and converts the people’s bodies into unidentifiable silhouettes sketched out with lines and dots. This information lets the algorithm calculate how far apart they are and their respective body orientation. “Our program doesn’t need to store the original pictures and videos. And we believe that’s a step in the right direction with regard to protecting people’s privacy,” says Bertoni.

Alexandre Alahi (left) and Lorenzo Bertoni (right) in the Visual Intelligence for Transportation Laboratory at EPFL. © Alain Herzog / 2021 EPFL

Several possible applications
“We came up with several possible applications for our program during a pandemic,” says Bertoni. “On public transport, of course, but also in shops, restaurants, offices and train stations – and even in factories, since it could let people work safely by maintaining the necessary distance.” And the distance requirement can be configured at up to 40 meters apart, whether between people or objects or both, as can their orientation. The researchers have published their algorithm’s source code on the VITA website and are planning an initial deployment in Swiss postal buses through a joint project with Swiss Post.


Lorenzo Bertoni, Sven Kreiss and Alexandre Alahi, “Perceiving Humans: From Monocular 3D Localization to Social Distancing,” IEEE Transactions on Intelligent Transportation Systems, 2021. DOI: 10.1109/TITS.2021.3069376