Trainspotting, the digital way

During the 2017 Hackathon at TPM last Friday, six teams developed ways to make a video system read the numbers and labels on trains. ProRail reckons that automated trainspotting will increase environmental safety.

Who said informatics is boring? (Photo: Jan Sluiter)
Who said informatics is boring? (Photo: Jan Sluiter)

Numbers and labels on trains give reliable indications of where the train and its cargo originate, the contents of the wagons and where the train is heading.

The problem is that control centres only have vague information on the composition of trains. So if a cargo train derails close to a residential area, they do not know how bad it is. Are there toxic, radioactive or inflammable chemicals on board that emergency services and firefighters should know about? Knowledge on these risks is sketchy at best. Or, as project leader Dr. Scott Cunningham said: "The labels and numbers on the wagons are 95% correct, the problem is: which car is on what train?"

Readable footage

ProRail has installed a pilot camera at the Kijfhout shunting-yard, near Rotterdam harbour. Trains leaving the harbour and heading inland are routinely scanned. Obtaining readable footage of the trains at any time of day or night in all weather conditions is less straightforward than you might think. The real challenge, however, is the lack of automated systems that identify the labels on moving trains, read them, and deliver the information reliably.

Retrieving this information was the mission of six teams (five corporate team and one from the Faculty of Electrical Engineering, Mathematics and Computer Sciences) that participated in the Hackathon organised by the Simlab centre at the Faculty of Technology, Policy and Management last Friday April 21 2017.

"The best industrial system gets about 60% of the labels and numbers correct," said Cunningham. "We need the system to be 99% correct." He organised the Hackathon with his colleague, Professor Alexander Verbraeck (multi-actor systems at the TPM Faculty), and two students: Bram van Meurs and Rhythima Shinde.

Inverting the image makes labels improves readability (Photo: Prorail)
Inverting the image makes labels improves readability (Photo: Prorail)

The teams used ProRail footage to work on various parts of the problem such as foreground-background discrimination, stitching frames together into a total view of the train, segmenting wagons, identifying numbers and labels, and reading the numbers. They found out that tricks, like inverting the black/white image, or identifying contours, turned out to be helpful in highlighting numbers and labels.

So did the teams crack the problem in one day? Of course not. The combination of machine learning and image recognition is much too complicated to solve within a day. However, toying around with the problem did help in clarifying the boundary conditions for ProRail's intended call for proposals, payments, milestones and testing adequacy.

Once ProRail gets a reliable working system, they will install these trainspotting installations in multiple locations, said Cunningham. These systems should make it feasible to monitor cargo trains and to know what any of them are carrying.