Researchers at Los Alamos National Laboratory in New Mexico last year announced a remarkable discovery — one that could save millions of lives.

They taught a machine-learning algorithm to analyze sound patterns and identify the signs of a laboratory earthquake before it occurred. The scientists believe the technique could be applied to real-life earthquakes, preventing deaths and injuries by making evacuations before a “big one” hits.

In much the same way, railroads leverage huge amounts of data to predict equipment and track defects. Every day, thousands of sensors throughout the rail network constantly pick up billions of data points. Then, advanced computer programs analyze the data, identifying patterns and predicting what elements of the network may soon need to be repaired or replaced.

“With machine learning, we’re able to predict the future, sometimes days or months in advance,” says Mabby Amouie, Norfolk Southern’s Senior Manager of Advanced Analytics. “That gives a good amount of lead time to proactively schedule maintenance and fix issues before they become problems.” Norfolk Southern engineers can predict when a locomotive’s water coolant will break a week before it happens.

And BNSF, for instance, uses machine learning to analyze the data collected by its track geometry cars, which travel along train tracks, identifying anomalies. Data analytics software identifies patterns in this data, enabling rail engineers to predict track problems 30 days out.

The result of all this “fortune telling” is a more fluid 140,000-mile network with fewer breakdowns, which keeps rail customer goods moving at peak efficiency.

Foreseeing potential rail problems is particularly important because of how interconnected the rail network is. Many railroad tracks across the country are single tracks, much like one-lane highways. So, if a train breaks down, or has an equipment failure, it can cause serious delays for other trains on the same track. By knowing a locomotive will soon malfunction, railroads can proactively perform maintenance and prevent these sorts of backups.

“When something happens in one node of the network, it’s going to have a ripple effect downstream. Being able to prevent breakdowns increases the efficiency of the whole network,” says Amouie.

As sensors become more affordable and computing power continues to advance, railroads become more powerful, too. More sensors means more data that computers can help analyze, which gives railroads an even better understanding of network health.

“I wouldn’t be surprised that through the combination of more sensors and machine learning, we get to the point where every single component of the locomotive has a model that can tell you in advance if it’s going to break down,” Amouie says.