Machine learning algorithms can help scientists predict chemical toxicity to a similar degree of accuracy as animal testing, according to a paper published this week in Toxicological Sciences.

A whopping €3bn (over $3.5bn) is spent every year to study how the negative impacts of chemicals on animals like rats, rabbits or monkeys. The top nine most frequently tested safety experiments resulted in the death of the poor critters 57 per cent of the time in Europe in 2011.

By using software, chemists may be able to spend less on animal testing and save more creatures.

To demonstrate this, first, a team of researchers scoured through a range of databases to label 80,908 different chemicals. Some of these labels include things like corrosion, irritation, serious eye damage, or being hazardous to the ozone layer.

Next, they used a mixture of unsupervised and supervised learning to build a statistical model that groups chemicals together based on how chemically and toxically similar they are to each other. The unsupervised method uses the K-nearest neighbors algorithm to create a vector containing the number of times each label occurs between the chemicals.

Give 1,000 monkeys typewriters, they'll write Shakespeare. Give them robot arms, and wait – they actually did that? READ MORE

These vectors are then used to train a supervised learning model. Using logistic regression and random forest algorithms, the model learned to assign labels to new test compounds – whether they were dangerous, corrosive, etc, based on their component chemicals. It was accurate 70 to 80 per cent of the time, and is on par with the OECD guidelines that results from animal testing are repeatable about 78 to 96 per cent of the time.

Sometimes the accuracy levels drop, when comparing the AI's output to real tests on creatures, because some animals often don’t react to chemicals in the same way. “The reproducibility of an animal test is an important consideration when considering acceptance of associated computational models and other alternative approaches,” the paper, published on Wednesday, concluded.

“These results additionally show that computational methods, both simple and complex, can provide predictive capacity similar to that of animal testing models and potentially stronger in some domains.”

At the moment, the model is still quite simple and only tests for 74 properties. Machine learning is frustrating in that trying to expand it by adding more data can actually make it harder for scientists to understand and explain the system’s predictions, so it’ll be a while before animal testing can really be phased out. ®