A rapid method to detect ivermectin residues in milk using artificial intelligence and infrared spectroscopy

Maria Luiza De Grandi, journalist from Ciência Rural, Santa Maria RS, Brazil. 

Sérgio A. de Fernandes, professor at the Universidade Estadual do Sudoeste da Bahia (UESB), Vitória da Conquista, Bahia, Brazil.

The logo of Ciência Rural journalIvermectin is a drug widely used to control parasites in livestock animals, but residues of the substance may remain in milk when the withdrawal period after treatment is not respected. The consumption of these residues raises concerns for public health and food industry quality control. Currently, traditional detection methods often require more complex, time-consuming, and costly laboratory analyses.

Research developed at Universidade Estadual do Sudoeste da Bahia (UESB) proposed a new way to identify ivermectin residues in milk using mid-infrared spectroscopy associated with chemometrics and artificial intelligence. The objective of the study entitled Random forest and infrared spectroscopy to detect contamination of freeze-dried milk by ivermectin residues, published in Ciencia Rural journal (vol. 55, no. 12, 2025), was to evaluate whether spectroscopic techniques associated with artificial intelligence could offer a faster, more sensitive, and sustainable alternative for identifying these residues in milk. The study was motivated by the need to create faster and more accessible tools to support inspection agencies, dairy industries, and rural producers in monitoring milk quality.

To conduct the experiment, the team worked with milk samples from ten healthy Holstein/Zebu crossbred cows that had not received ivermectin during the six months prior to the study. Samples were collected weekly for three consecutive weeks. The samples then received different controlled concentrations of ivermectin to simulate varying levels of residue in milk. According to researcher Sérgio Fernandes, “it was necessary to develop a highly precise experimental design to ensure that the mathematical models were reliable.” After preparation, the samples were freeze-dried and analyzed using an FTIR spectrophotometer, an instrument capable of identifying chemical patterns through the interaction of infrared light with the analyzed material. The generated spectra were then subjected to chemometric analyses and machine-learning algorithms to build the predictive model.

 

 

The results showed that the Random Forest model achieved excellent performance in predicting ivermectin residue concentrations in powdered milk, reaching correlation and determination coefficients above 0.96 and low error rates. According to the researchers, this demonstrates that the method has strong predictive capability and practical application potential. “The proposed method is rapid, simple, sensitive, low-cost, non-destructive, and environmentally friendly,” highlights Sérgio. He explains that, unlike conventional laboratory methods, the technique does not require large quantities of chemical reagents or lengthy preparation stages, which may reduce costs and accelerate decision-making in milk quality monitoring programs.

In addition to the laboratory results, the research also marked the beginning of a new line of investigation within the university research group. According to the researcher, “this was the first study by our group on this topic and it helped strengthen a research line that now includes other national and international studies.” The article highlights that the use of spectroscopy associated with artificial intelligence has been growing worldwide in food safety applications, especially for the rapid identification of contaminants and food adulteration.

The study also reinforces the role of artificial intelligence and spectroscopic techniques in the future of food analysis. According to the researchers, rapid, automated, and sustainable methods are expected to gain increasing importance in the food industry, particularly in scenarios that require large volumes of analyses and quick responses. “Today, there are already several national and international groups working in this area, and we believe this technology will have a growing impact on the dairy production chain,” concludes Sérgio.

To read the article, acess

SANTANA, V.R., et al. Random forest and infrared spectroscopy to detect contamination of freeze-dried milk by ivermectin residues. Ciência Rural [online]. 2025, vol. 55, no. 12, e20240536 [viewed 03 July 2026]. https://doi.org/10.1590/0103-8478cr20240536. Available from: https://www.scielo.br/j/cr/a/tDnDCQpQLpNL8zVPDQrr8Xd/

External links

Ciência Rural – CR

Ciência Rural – Site

Ciência Rural – Social Media: X | Facebook | Instagram

 

Como citar este post [ISO 690/2010]:

GRANDI, M.L. and FERNANDES, S.A. A rapid method to detect ivermectin residues in milk using artificial intelligence and infrared spectroscopy [online]. SciELO in Perspective | Press Releases, 2026 [viewed ]. Available from: https://pressreleases.scielo.org/en/2026/07/03/a-rapid-method-to-detect-ivermectin-residues-in-milk-using-artificial-intelligence-and-infrared-spectroscopy/

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Post Navigation