A study published on Tuesday in the journal Nature Communications Chemistry revealed that a new algorithm was able to correctly identify which chateau red Bordeaux wines were from with 100 percent accuracy by analyzing their chemical profiles. This research has implications for both determining the quality of a wine as well as its authenticity, with a potential application for detecting wine fraud.

The study was conducted by Alexandre Pouget at the University of Geneva, Switzerland, where he and his colleagues used machine learning to analyze the chemical composition of 80 red wines, from vintages ranging from 1990 to 2007 from seven estates in Bordeaux.

“We were interested in finding out whether there is a chemical signature that is specific to each of those chateaux that’s independent of vintage,” Pouget said to NewScientist. “Meaning one estate’s wines would have a very similar chemical profile, and therefore taste, year after year.”

Each wine was vaporized and separated into its chemical components, which resulted in a gas chromatogram — essentially the wine’s chemical fingerprint. The team used 73 of these chromatograms to train the machine-learning algorithm, and then gave the system information on the estate and vintage those wines were from. They then tested the algorithm on the seven remaining wines 50 times each, alternating their order. The algorithm correctly guessed which chateaux the wines were from 100 percent of the time, and was 50 percent accurate at guessing the wines’ vintages.

Even more impressive: the algorithm could also successfully determine which estate the wine was from with only five percent of the chromatogram data, using portions of the data that didn’t present any notable peaks or differences discernible to the human eye.

“This shows that a wine’s unique taste and feel in the mouth doesn’t depend on a handful of key molecules, but rather on the overall concentration of many, many molecules,” Pouget told NewScientist.

The program also accurately grouped wines near each other that are from similar areas of Bordeaux. (For example, it clustered wines from the right bank, including Pomerol and St. Emilion, separate from the left bank estates.) This finding validates the claims of many wine aficionados that wine can express a certain sense of place. The validity of “terroir” and its effect on wine’s flavor is often brought into question, but this study strongly suggests that wines do have different properties depending on where they come from. That said, it would be interesting to see this study replicated in a region like Burgundy, where wines are made with one varietal instead of blends, meaning the only variables would be vineyard site and producer.

This technology could also be applied to detecting fraudulent wines. This research was conducted with some of the top houses of Bordeaux that are often imitated and sold as fakes. With the accuracy of this algorithm, there’s hope it could one day be used to l suss out imposter wines and prevent rampant fraud.