Anthrax remains one of the deadliest infectious diseases affecting livestock around the world, and now a team of researchers has turned to artificial intelligence to better understand how it spreads. In a new study published in Discover Artificial Intelligence, a group led by Vikash Panthi of Guru Ghasidas Vishwavidyalaya in India introduced a two-hidden-layer neural network trained with the Levenberg–Marquardt backpropagation algorithm to approximate the trajectories of a nonlinear mathematical model of anthrax infection in animals. The work represents a fresh intersection of machine learning and epidemiological modeling, offering a computationally efficient way to emulate the dynamics of a disease that continues to threaten agricultural species such as sheep, goats, cattle, and horses.
Anthrax is caused by the bacterium Bacillus anthracis and is considered a zoonotic condition, meaning it affects both animals and humans. The pathogen can persist in soil for long periods, making it a persistent threat to farming communities. Animals can contract the bacteria by inhaling spores, coming into direct contact with infected livestock, or consuming contaminated plants or water. The disease manifests in several clinical forms, including cutaneous, pulmonary, gastrointestinal, and septicemic anthrax, with symptoms ranging from fever and exhaustion to bleeding and difficulty breathing. Because the spores can even germinate roughly a week after an animal dies, rapid assessment, confinement, and vaccination protocols are considered essential to preventing outbreaks.
The research team framed the anthrax infection in animals, abbreviated AIA, as a system of nonlinear differential equations dividing the population into four compartments: susceptible, infected, recovered, and vaccinated animals. This compartmental structure, built on an epidemiological framework originally established by Githire and colleagues, tracks how each group changes over time under the influence of parameters such as infection rates, vaccination rates, recovery rates, and natural mortality. Solving such nonlinear systems analytically is often impossible, which is why computational approaches are so valuable to epidemiologists seeking to understand outbreak behavior.
At the heart of the new method is a two-hidden-layer neural network, or TLNN, an architecture the authors argue outperforms single-layer networks at capturing intricate and nonlinear input-output relationships. The first hidden layer contains 15 neurons and the second contains 25, both using sigmoid activation functions that squash inputs into values between zero and one. According to the researchers, this layered design allows the network to acquire hierarchical data representations: the first layer extracts fundamental features from the input, while the second layer combines them into higher-level features that improve performance on complicated systems. The sigmoid function, with its smooth S-shaped curve, is differentiable everywhere, which makes it well suited to gradient-based optimization techniques.
Training the network relies on the Levenberg–Marquardt backpropagation algorithm, a hybrid optimization scheme that combines the strengths of the Gauss-Newton method and the steepest descent technique. The algorithm adaptively regulates both the step size and the direction of parameter updates to minimize the sum of squared errors between actual and predicted outputs. The authors note that this makes LMBP particularly appropriate for nonlinear systems, offering rapid convergence and reduced complexity in selecting the learning rate. The technique has recently been applied to problems ranging from coronavirus detection in robotic systems to typhoid fever modeling and bioconvective nanofluid dynamics, underscoring its versatility across scientific domains.
To generate the training data, the team first produced reference solution trajectories using the Euler numerical method. These trajectories were then randomly divided into three subsets: 69 percent for training, 15 percent for validation, and 16 percent for testing. The authors emphasize an important nuance of their approach: the neural network does not directly minimize the residuals of the governing differential equations during training. Instead, it learns a nonlinear correspondence between the independent variable and the Euler-generated state trajectories, functioning as a supervised trajectory approximation method. The researchers are careful to stress that the trained network operates as a trajectory-specific emulator for each fixed set of initial conditions and parameters, rather than as a generic solution operator capable of generalizing to unencountered configurations.
The team evaluated their framework across three computational test cases, each using the same parameter values but different initial conditions for the four population compartments. The authors caution that these cases serve purely as numerical test setups for evaluating trajectory-approximation performance and should not be interpreted as epidemiologically calibrated outbreak scenarios, since the model was not formally nondimensionalized and the initial values are not normalized animal populations.
The results demonstrated impressive accuracy. Gradient performance values were recorded as 3.5541 × 10^−2, 1.2438 × 10^−4, and 2.3666 × 10^−2 at iterations 97, 1500, and 69 for the three cases, with smaller gradients signaling convergence toward an error minimum. Optimal validation values of 1.4477 × 10^−2, 2.9452 × 10^−2, and 4.2935 × 10^−2 were achieved at the same iterations, indicating strong generalization to unseen data without overfitting. Error histograms of 3.986 × 10^−3, 2.062 × 10^−3, and 2.806 × 10^−2 further revealed minimal bias and outliers, while regression analyses across all cases showed near-ideal modeling of the target trajectories.
Comparisons between the network’s outputs and the reference Euler solutions revealed overlapping curves and small absolute errors for all four compartments—susceptible, infected, recovered, and vaccinated populations—confirming the correctness of the TLNN-LMBP scheme. The authors highlighted several advantages of their design: the Euler-generated trajectories provide a flexible and reliable reference dataset, the two-layer sigmoid structure offers a versatile nonlinear model for the AIA trajectories, and the LMBP optimizer enables efficient minimization of the estimation error. Once trained, the network delivers a straightforward approximation of the solution trajectories without requiring repeated numerical integration.
The study arrives at a moment when machine learning is increasingly deployed against infectious disease challenges, from diabetes regulation models to monkeypox transmission systems and computer virus epidemics. Anthrax itself carries significance beyond veterinary medicine, informing medical and policy decisions about biological warfare hazards and One Health strategies that protect both animal and human health. While the authors are measured in their claims—noting that the outcomes are confined to their specific 15-and-25-neuron architecture and that no declaration of architectural excellence is made—the work demonstrates how supervised neural networks can serve as fast, accurate emulators of complex epidemic dynamics. The code that generates the reference trajectories, trains the networks, and reproduces all tables and figures is available from the authors, and the study received support from Prince Sattam bin Abdulaziz University.
Subject of Research: Neural network approximation of a nonlinear anthrax epidemic model in animals
Article Title: A two-hidden-layer Levenberg–Marquardt neural network for supervised trajectory approximation of a nonlinear anthrax in animals epidemic model
Article References: Panthi, V., Kashyap, N., Gupta, M., Alenizi, F. A., Suanpang, P., & Nanthaamornphong, A. (2026). A two-hidden-layer Levenberg–Marquardt neural network for supervised trajectory approximation of a nonlinear anthrax in animals epidemic model. Discover Artificial Intelligence, 6(1), Article 1234. https://doi.org/10.1007/s44163-026-02326-5
Image Credits: AI Generated
DOI: 10.1007/s44163-026-02326-5
Keywords: anthrax, neural network, Levenberg-Marquardt backpropagation, epidemiological modeling, sigmoid activation function, machine learning, livestock disease, Bacillus anthracis, nonlinear dynamical systems, trajectory approximation, Euler method, zoonotic disease
Cite Scienmag News
Kristina Jarvis. (October 18, 2026). Two-Hidden-Layer Neural Network Tackles Nonlinear Anthrax Epidemic Model in Animals. Scienmag. https://scienmag.com/two-hidden-layer-neural-network-tackles-nonlinear-anthrax-epidemic-model-in-animals/
Kristina Jarvis. "Two-Hidden-Layer Neural Network Tackles Nonlinear Anthrax Epidemic Model in Animals." Scienmag, 18 October 2026, https://scienmag.com/two-hidden-layer-neural-network-tackles-nonlinear-anthrax-epidemic-model-in-animals/. Accessed 18 October 2026.
Kristina Jarvis. "Two-Hidden-Layer Neural Network Tackles Nonlinear Anthrax Epidemic Model in Animals." Scienmag. October 18, 2026. https://scienmag.com/two-hidden-layer-neural-network-tackles-nonlinear-anthrax-epidemic-model-in-animals/

