1. Introduction
Small-molecule fungal metabolites known as mycotoxins are generated by a diverse array of fungal strains [
1,
2]. Mycotoxins, which are toxic fungal by-products, contaminate a wide range of global agricultural products (including grain, fruit, and fresh eggs) when storage conditions favor fungal growth; this widespread contamination, often alongside other contaminants in products like beverages and animal feed, poses significant risks to human and animal health, potentially causing immediate or long-term ailments like a weakened immune system, cancer, and neurological abnormalities. Special attention is required for highly toxic and widely distributed mycotoxins, such as aflatoxins and ochratoxins, necessitating stringent food safety measures, especially for essential nutritional sources like fresh eggs [
3,
4,
5].
Conditions that permit feedstuff contamination with fungus and their toxins vary from high humidity to certain temperatures. In tropical regions, it is unavoidable and predictable that during harvest periods, transit, and storage, mycotoxins will be present [
6]. Of the more than 300 mycotoxins that have been identified, aflatoxins (AFs), deoxynivalenol (DON), ochratoxins, zearalenone (ZEA), fumonisin, and T-2 toxin are consistently regarded as the most critical based on their demonstrated toxicity and high rates of occurrence [
7]. However, a small number of them are of practical interest in public health based on their effects concerning animal health, transmissivity, and human toxicity, including aflatoxins, ochratoxins, and trichothecenes, which consist of deoxynivalenol, zearalenone, and fumonisins [
8].
Studies on broilers and layer chickens show that layer chickens can tolerate higher amounts of the same substance than broilers, but not beyond 50 parts per billion [
6]. Aflatoxin poisoning could reduce the birds’ ability to withstand stress through diminished immune response, hence reduced egg size in addition to lower egg production. It is also crucial to carefully consider the inclusion of contaminated feed due to the direct consumption of eggs as food by humans and the presence of aflatoxin metabolites in egg yolks [
9].
Safety is a main pillar of production. Since poultry and its by-products are considered among the high protein supply as major elements in the food chain, they are of great concern in the current emphasis on safety. It is essential to note that mycotoxin represents possible contamination of food and feed, since it develops as a consequence of fungal contamination [
10].
Food and feed contaminated with mycotoxins can pose a potential danger to human and animal health mainly through their carcinogenic and toxic effects [
11]. International studies on several mycotoxins were carried out, particularly those mostly found in human food at high occurrence. These substances are classified into several groups based on their effects. Aflatoxins are classed as group 1 carcinogens, ochratoxin as group 2B carcinogens, and zearalenone as group 3 carcinogens [
12].
Mycotoxins, toxic secondary metabolites produced by fungi, pose a significant threat to food safety and public health. These hazardous compounds are often generated when storage conditions favor fungal growth, specifically temperatures between 10 °C and 40 °C, a pH range of 4–8, and water activity exceeding 0.70 [
13]. The resulting mycotoxin contamination incurs substantial economic losses, primarily due to compromised food quality and decreased production performance in livestock. Crucially, mycotoxins are associated with serious health risks, including hepatic carcinomas, esophageal cancers, immunosuppression, neurotoxicity, mutagenicity, and oestrogenic effects [
14,
15,
16]. The International Agency for Research on Cancer (IARC) classifies aflatoxins (AFs) as group 1 carcinogens and zearalenone (ZEA) as group 3 carcinogens [
17]. The degree of contamination in animal feeds is not constant, as it is heavily influenced by factors such as the duration of exposure, the feed consumption rate, the concentration of contaminants, and environmental conditions (e.g., geography and season) [
18]. Numerous studies have highlighted mycotoxin presence in poultry feed. For instance, recent research detected aflatoxins
(1.0 mg/kg),
(0.30 mg/kg),
(0.14 mg/kg),
(0.05 mg/kg), and total AFs (1.30 mg/kg) in bird samples [
19], while another study reported
(0.81 mg/kg) and
(0.83 mg/kg) in hen and duck samples [
20]. Maintaining food health is paramount along the entire supply chain, particularly for high-protein animal products like poultry and its by-products [
20]. Mycotoxins can be carried over from contaminated feed into the bird, negatively impacting key parameters of poultry production, such as growth, laying performance, egg production, and overall quality [
21]. Moreover, the animal’s sensitivity to mycotoxin-laden feed is modulated by intrinsic factors, including its gender, physiological state, and age [
22]. Chicken eggs provide a balanced diet for intake at all levels of ages and specifically offer high nutrients with low calories and easy digestibility for adults [
23]. Mycotoxins get absorbed in the food, particularly eggs in layers, from the consumption of feed by birds. According to one review: Mycotoxin carryover into edible tissues depends on the particular type of mycotoxins and species of animals being fed.
Chicken eggs are extremely valuable commodities in international trade. They provide a well-rounded meal suitable for all age groups and are considered beneficial for adults due to their high nutrient content, low calories count, and ease of digestion [
23]. Mycotoxins absorption to food—such as eggs in chicken—takes place by the way the bird consumes contaminated feed. According to a review carried out by Blank [
8], the transfer of mycotoxins into edible tissues depends on a particular type of mycotoxins and what species of animal is involved [
24].
In Jordan, eggs are considered a major source of nutrients. However, the presence of food-borne residues, such as mycotoxins, in eggs is considered a health hazard to consumers. This is particularly alarming when considering children, who are more vulnerable than adults and consume more eggs [
10]. After consumption, mycotoxins are metabolized in the liver and kidneys. The results of this metabolism depend on the parent molecules, which makes tracking their potential effects very difficult.
Common ways to find mycotoxins in eggs and other foods use chemical tests, such as high-performance liquid chromatography (HPLC) and enzyme-linked immunosorbent assays (ELISA). While these methods work well, they can be expensive, time consuming and need special equipment and knowledge. The sample-by-sample check may lime the scalability of such methods.
Machine learning (ML) has emerged as a promising predictive tool in many disciplines, including the domain of food safety [
25]. Models based on decision trees, support vector machines, and neural networks can improve prediction accuracy of mycotoxin contamination based on various input variables—such as environmental factors, feed ingredients, historical contamination information—without the need for laborious chemical analyses. The integration of ML into food safety practice can enhance the monitoring and regulation practice on mycotoxin levels with improved efficiency in risk forecasting; thus reducing health risks related to the presence of mycotoxins.
This work attempts to discuss the appropriateness of machine learning techniques in determining the degree of residue of mycotoxins, for example, Fumonisin B, Aflatoxin B1, deoxynivalenol, and zearalenone in locally produced hen’s table eggs, aiming to investigate the viability and effectiveness of using ML based models to predict contamination levels in freshly laid eggs. We build several predictive models and compare them to enlighten whether machine learning may be leveraged for the detection of mycotoxin residues and at what probable extent, hopefully providing significant insights into the utilization of ML to improve food safety and establish a basis for future progress in this domain.
2. Related Work
Machine learning (ML) offers a significant breakthrough in mycotoxin detection by overcoming the limitations of conventional methods. Utilizing its unique capability to analyze vast datasets and discern complex, subtle patterns that are often imperceptible to human analysis, ML algorithms deliver rapid, highly accurate, and automated identification of mycotoxins in both crops and processed food products [
26].
The most common category of ML used in mycotoxin prediction is supervised learning. Supervised learning involves training the algorithm on a labeled dataset, making use of both input features-for example, weather data, crop data-and the target feature as mycotoxin levels.Several machine learning approaches have successfully applied mycotoxin prediction and detection applications. Among traditional supervised learning methods, Support Vector Machines (SVM), Random Forests (RF), and neural networks seem promising regarding processing complex datasets produced by various analytical techniques [
27]. Neural Networks (NNs) and Deep Neural Networks (DNNs) have been widely used for this purpose, with studies demonstrating high accuracy (>75%) in predicting aflatoxin and fumonisin contamination in maize [
28]. Bayesian networks have successfully predicted mycotoxin occurrence in fruits and vegetables for geographically dispersed countries [
29].
In the work of Inglis et al. [
30], a systematic review is presented, depicting the broad application of ML toward mycotoxin detection in food. It highlights major benefits and advantages of ML approachs such as efficiency, and cost, while maintaining reasonable levels of accuracy for mycotoxin detection compared to traditional methods.
Numerous studies have successfully applied ML to predict mycotoxin levels in cereal grains and other agricultural commodities [
28,
31,
32]. Some others have looked at carry-over into animal tissues or milk, but there has been little direct application of these predictive technologies to eggs [
33,
34], and even in breast feed milk [
35]. This is a significant oversight since eggs are one of the world’s most important dietary staples and they can be readily contaminated by the carry-over of mycotoxins from feed. As the process that covers the transfer of mycotoxins from feed to eggs is considered complex as it is controlled by several factors such as type and concentration levels of mycotoxin in the feed, hen’s breed and age, health status, metabolic processes, and also egg formation dynamics, it is likely that predicting levels of mycotoxins in eggs could use a different set of input features or even modeling approaches that would work for predicting contamination in crops. Typical relevant predictors include feed composition and its mycotoxin profile, hen health parameters (e.g., liver function biomarkers, immune status indicators), production data (egg laying rate, feed conversion ratio), and the environmental condition inside the poultry house. The limited number of studies that even tangentially address mycotoxins in eggs generally focus on detection methods or general impacts on poultry health and egg quality rather than developing predictive models based on ML [
17,
20,
34]. If robust ML models for predicting mycotoxin risk in eggs could be developed, they can provide the poultry industry and food safety regulators with a powerful tool for acting proactively against contamination risk to ensure egg safety and public health protection itself. Such models may indicate high-risk flocks based on feed management strategies to optimize targeted testing protocols that make present control measures efficient and effective. The development of such models could potentially identify high-risk flocks, guide feed management strategies, and optimize targeted testing protocols, leading to more efficient and effective control measures call for particular efforts in collecting data specific to the poultry-egg system, an exploration of relevant features, selection, and validation of careful ML algorithms.
3. Materials and Methods
The feasibility study comprises the subsequent phases:
1. In order to correctly prepare the data for the ML models, it is important to understand the existing data by analyzing its correlation and geographical features. This involves examining as many predictors as possible while ensuring that there are no missing entries and the data is satisfied.
2. Implementing the algorithm involves selecting predictors, tuning hyperparameters, and fitting the final prediction model.
3. Analysis of outcomes, such as the interpretation of the variable importance plots that illustrate the impact of each predictor on the statistical measures. Partial dependence plots visually illustrate the individual impact of selected predictors on the outcome.
4. Validate the results using the predictive model in a separate dataset and comparing the predictive model derived from the ML model with a mechanistic model.
5. Conduct a thorough evaluation of the benefits and drawbacks of the technique and draw conclusions about the data and expert knowledge necessary to develop a predictive model.
3.1. Data Description
A total of 1250 fresh egg samples were collected from grocery stores in several Jordanian governates, including Amman, Zarqa’a, Balqa’a, Madaba, Mafraq, Irbid, Jarash, Karak, Ajloun, Aqaba, AL Tafelah and Ma’an, as part of the current cross-sectional study. The random collection of poultry eggs occurred from January to July in 2024. Poultry eggs that were 7–10 days old and stored in a clean icebox at a temperature below 4 °C were delivered to the laboratory. The eggs were divided into yolk and white. The detection of TAF, OTA and DON involved the use of preparation and extraction procedures that were comparable to previous research, with minor adjustments.The concentration of mycotoxins in the samples was determined using different ELISA kits.
Two types of ELISA kits were utilized: AgraQuant Aflatoxin M1fast (range: 100–2000 ng/kg) and AgraQuant Aflatoxin M1sensitive (range: 25–500 ng/kg), both supplied by Romer Labs, Singapore. The kits were stored at a temperature of 2–8 °C until use. Prior to analysis, they were equilibrated to room temperature for 1 h. All procedures were carried out in accordance with the manufacturer’s instructions provided by Romer Labs.
To give more insight into our collected data,
Table 1 represents the mean and median values of both factors that affect mycotoxins formation, along with the mean and median of different types of mycotoxins.
3.2. Sample Preparation
To optimize the extraction of Mycotoxins (TAF, DON, OTA) from egg, we weighed 1 g of homogenized fresh egg and mixed it with 5 mL of various extraction media:
Water to which 0.05% Tween 20 had been added (0.05% Tween 20);
Water: Methanol 30:70 (Methanol 70%);
Water: Methanol 70:30, in which 0.3 M NaCl had been added to water (Methanol 70%/0.3 M NaCl);
Water: Methanol 70:30 followed by the addition of hexane to remove fatty components.
After 2 min of vigorous stirring at room temperature, the samples were centrifuged at 3200× g to reduce foam and remove denatured proteins. Supernatants were diluted with water and analysed by direct competitive ELISA. Each sub-sample was extracted in duplicate and analyzed in quadruplicate. The optimal protocol involved extraction with aqueous methanol (70%) followed by defatting with hexane.
3.2.1. Mold Counts in Poultry Feed
Random samples (10 to 30 representative samples of 1 kg) were collected from different poultry farms in several governorates of Jordan, including Amman, Zarqa’a, Balqa’a, Madaba, Mafraq, Irbid, Jarash, Karak, Ajloun, Aqaba, Al Tafelah, and Ma’an. These samples were used for mycological examination. Feed samples intended for mycological examination were usually analyzed immediately upon arrival or, if necessary, stored for 2–3 days in paper bags at room temperature (22–25 ºC).
3.2.2. Isolation of Poultry Feed Fungi
The dilute plate technique was used for the isolation of fungi from the samples. General mold counts were carried out by weighing 20 g of poultry mixed feed samples and mixing them with 180 mL of saline solution (0.85% sodium chloride) containing 0.05% Tween 80 on a horizontal shaker for approximately 30 min. Then 0.1 mL of the appropriate dilutions made up to was applied to Dichloran Rose Bengal Chloramphenicol agar (DRBC). Plates were incubated at 25 °C for 5–7 days.
3.2.3. Moisture Analysis
Approximately 100 g of poultry feed were placed in an oven at 105 °C for 15 min. The samples were weighed before and after drying, and the moisture percentage was calculated according to the following equation.
where:
4. Data Visualization
We analyzed and visualized data using various visualization methods to reliaze distribution patterns, statistical characteristics, and the relationship between environmental storage conditions and mycotoxin formation in fresh eggs.
Several studies have confirmed a positive correlation between the levels of mycotoxins—such as aflatoxins, ochratoxins, and deoxynivalenol (DON)—in poultry feed and their residues in eggs. This relationship is primarily due to the absorption of these toxins in the gastrointestinal tract and their subsequent transfer to reproductive tissues. The carry-over rate, however, varies significantly among different mycotoxins. For example, aflatoxins exhibit a relatively high absorption rate (≈90%) and a carry-over into eggs of about 0.55%, while ochratoxin A shows ≈40% absorption with ≈0.15% carry-over, and DON has a much lower transfer rate (≈0.001%). These differences are influenced by factors such as toxin type, concentration, bird age, health status, and feed composition.
Although earlier reports suggested a generalized conversion rate of 1–2% of ingested mycotoxins into egg residues, recent findings indicate that this assumption oversimplifies the process. Modern studies emphasize that aflatoxins and zearalenone tend to accumulate more readily in eggs compared to fumonisins and trichothecenes, which show negligible transfer. Moreover, co-contamination of feed with multiple mycotoxins can lead to synergistic effects, increasing toxicity and potentially altering carry-over dynamics. This highlights the need for precise monitoring and mitigation strategies, as even low-level contamination can compromise egg quality, shell integrity, and hatchability.
Visualization methods—including histograms, boxplots, pairwise scatter plots, violin plots, and Pearson correlation heatmaps—were used to examine variable distributions, detect outliers, and identify multicollinearity. These visual insights supported the selection of relevant features and helped validate the consistency of laboratory-measured toxin levels with known biological and environmental trends.
We used SHAP (Shapley Additive Explanations) to investigate feature contributions to predictions. SHAP visualization enhances the illustrative of machine learning models and provides a robust explanation of each feature’s effect on the final prediction. SHAP exposed that ochratoxin A levels, DON levels, and poultry-feed storage conditions were the most dominant factors across Extra Trees, Random Forest, and Decision Tree models. SHAP beeswarm plots enabled a detailed examination of feature interactions, showing, for example, that high ochratoxin A values consistently increased predicted aflatoxin concentrations SHAP beeswarm plots enabled a detailed examination of feature interactions, showing, for example, that high ochratoxin A values consistently increased predicted aflatoxin concentrations. LIME explanations provided case-specific interpretations by approximating the model locally with an interpretable surrogate, helping to validate model outputs in samples with borderline or unexpected contamination levels. These explainability techniques strengthen the scientific credibility of the predictive framework, ensuring that the models’ decision pathways align with known toxicological and environmental mechanisms.
Finally, the feasibility of deploying the proposed predictive system was assessed from both practical and technological perspectives. The model can be deployed as an API-based service, integrated into laboratory information systems, poultry farm monitoring platforms, or existing farm management systems (FMS). Through lightweight REST interfaces, sensor-to-cloud IoT integration, or batch-processing pipelines, the model can automatically ingest real-time feed storage data, environmental readings, and historical contamination records. This enables proactive identification of high-risk batches, supports early interventions (e.g., adjusting feed storage conditions), and enhances regulatory compliance. The low computational overhead of the best-performing models (Extra Trees and Random Forest) further improves their suitability for on-farm or edge deployment. Overall, the integration of explainable machine learning with farm management systems provides a practical, scalable, and scientifically robust solution for mitigating mycotoxin contamination risks in the poultry-egg supply chain.