New computer algorithms developed by researchers at the University of Waterloo in Ontario, Canada, can be used to accurately determine if you are texting while driving.

The system, announced this week (8 September), is powered by artificial intelligence (AI) and designed around special cameras, which can detect hand movements that deviate from normal driving behaviour and classify them in terms of possible safety threats.

While currently a proof-of-concept, researchers believe that as more cutting-edge technology is integrated into mainstream vehicles, such a system could save lives.

In the real world, it could potentially be used to trigger "protective measures" if a driver were to show severe signs of distraction, the experts hypothesised.

"The car could actually take over driving if there was imminent danger, even for a short while, in order to avoid crashes," said Fakhri Karray, a university research chair and director of the Centre for Pattern Analysis and Machine Intelligence (CPAMI) at Waterloo.

The work builds on extensive research conducted at CPAMI on how to spot signs that drivers are in danger of falling asleep at the wheel. Important cues for recognising human distraction include frequent blinking and the positioning of the head and face, experts found.

The algorithms at the heart of the latest technology, however, use machine leaning techniques to help recognise actions such as texting, talking on a smartphone or reaching into the backseat.

The system can "learn" new patterns and adapt to change as more data is fed into it.

The research, Waterloo engineers stressed, is ongoing. Next, it will seek to combine the detection, processing and grading of several different kinds of driver distractions into a single system. Karray claimed it has the potential to have a "huge impact on society".

Another CPAMI research project, the university said, is currently exploring the use of sensors to measure physiological signals such as eye-blinking rate, pupil size and heart-rate variability to help determine if a driver is paying adequate attention to the road.

Karray's full research – conducted in collaboration with PhD candidates Arief Koesdwiady and Chaojie Ou, and post-doctoral fellow Safaa Bedawi – was recently presented at the 14th International Conference on Image Analysis and Recognition in Montreal.

Texting and driving remains a major safety concern for UK authorities. Earlier this year, Thames Valley Police released a graphic video showing a distracted lorry driver who was casually scrolling through music, before causing an eight-vehicle pile-up and multiple fatalities.

After that incident, the US road safety administration called on technology firms such as Apple and Samsung to help stop their smartphones from being used while driving.

Meanwhile, according to statistics published by Brake, a UK road safety charity: "Drivers who use phones, either hands-free or hand-held, have been found by researchers to be four times more likely to be in a crash resulting in injuries than drivers not distracted".

As of March 2017, the penalty for using a hand-held mobile at the wheel in the UK has increased to an on-the spot fine of £200 and six points on to the offender's driving licence, it added. Studies suggest that browsing social media is quickly becoming a major safety threat.