EVERY day more than 8,000 containers flow through the Port of Rotterdam. But only a fraction are selected to pass through a giant x-ray machine to check for illicit contents. The machine, made by Rapiscan, an American firm, can capture images as the containers move along a track at 15kph (9.3mph). But it takes time for a human to inspect each scan for anything suspicious—and in particular for small metallic objects that might be weapons. (Imagine searching an image of a room three metres by 14 metres crammed to the ceiling with goods.) To increase this inspection rate would require a small army of people.

A group of computer scientists at University College London (UCL), led by Lewis Griffin, may soon speed up the process by employing artificial intelligence. Dr Griffin is being sponsored by Rapiscan to create software that uses machine-learning techniques to scan the x-ray images. Thomas Rogers, a member of the UCL team, estimates that it takes a human operator about ten minutes to examine each X-ray. The UCL system can do it in 3.5 seconds.

Dr Griffin’s team trained its system on hundreds of thousands of container scans provided by Rapiscan. The scans were missing concealed metallic objects that might pose a threat, so the UCL team took a separate database of x-rayed weapons and hid them in the container images. A paper the group presented at the Imaging for Crime Detection and Prevention conference in Madrid last week showed that in tests, the system spotted nine out of ten hidden metallic objects. Only six in every hundred readings flagged a weapon when there was nothing. Dr Griffin says this false positive rate has been reduced to one in every 200 since the paper was written in August. The group’s software has also been trained to detect concealed cars.

The UCL team hopes to test its software shortly on real containers, some with small weapons deliberately hidden inside. Assuming that works, Dr Griffin plans to integrate the artificial-intelligence system into Rapiscan’s scanning systems over the next few months. The team is also aiming to train the system to detect “anomalies”—the machine-learning equivalent of a human hunch that something is not quite right about a scan. That could, for instance, be something unusual in the way things are positioned inside the container. Given enough data, the scientists reckon computers can train themselves to identify discrepancies like this.

It is not just in ports where machine learning could speed up scanning. Weary travellers dragging themselves through the slow crawl of airport security could also benefit. Suitcases are smaller than containers, and their contents are more predictable, so humans are able to inspect their X-rays quickly and thoroughly (although regular rest breaks are still needed).

Toby Breckon of Durham University is working on automated x-ray analysis to detect small items of the sort that might be contained in passengers’ cabin and hold bags. He says his group has already had an algorithm installed in commercial scanning systems. Dr Breckon thinks intelligent scanning systems will at first operate in the background at airports, for instance rechecking bags in case human inspectors have missed something. They might also be used to flag bags that could be worth a manual inspection.

In time, however, automated screening systems may go from being useful tools for human operators to outperforming them. If his team can get its hands on the large amounts of security imagery it needs to feed into its software, Dr Griffin thinks container scanning, at least, might be entirely automated. Perhaps bag-scanning at airports might go the same way. But there will still be a need for people. Someone has to be around to check inside containers and bags with suspicious contents.