Research
Identifying environmental factors associated with tetrodotoxin contamination in bivalve mollusks using eXplainable AI
Overview Research area: Food safety and marine biotoxin monitoring, combining time-series deep learning (LSTM) with eXplainable AI (SHAP) to study tetrodotoxin (TTX) contamination in bivalve mollusks.

- arXiv
- 2511.20395
- Published
- 2025-11-25
- Authors
- M. C. Schoppema, B. H. M. van der Velden, A. Hürriyetoğlu, M. D. Klijnstra, E. J. Faassen, A. Gerssen, H. J. van der Fels-Klerx
AI summary
Overview
- Research area: Food safety and marine biotoxin monitoring, combining time-series deep learning (LSTM) with eXplainable AI (SHAP) to study tetrodotoxin (TTX) contamination in bivalve mollusks.
- Technical level: Intermediate. The methods rely on an LSTM, class-imbalance weighting, bootstrapped ROC evaluation and SHAP, so some machine learning familiarity helps, but the motivation and conclusions are described in accessible food-safety terms.
- Scope: The paper builds an explainable deep learning model that predicts whether Dutch Zeeland shellfish samples exceed the TTX Action Limit, then uses SHAP to identify which meteorological and hydrological features the model relies on.
What This Paper Is About
Since 2012, tetrodotoxin — a neurotoxin normally associated with tropical seafood — has been regularly detected in bivalve mollusks in temperate European waters, including the Netherlands. Identifying which environmental conditions drive this contamination is difficult because earlier work relied on correlation analyses that cannot capture complex temporal relationships. The authors train a deep learning model on Dutch shellfish monitoring results plus meteorological and hydrological measurements, then use explainable AI to reveal which environmental factors the model associates with TTX contamination.
Key Contributions
- An explainable, deep learning-based (LSTM) model that predicts the presence or absence of TTX contamination above the Action Limit (22 µg TTX/kg) in bivalve mollusks from the Dutch Zeeland estuary.
- A demonstration that rigorous temporal machine learning evaluation is possible on food-safety monitoring data, using a year-based split (train 2016–2021, validation 2022, holdout test 2023) that mimics prospective validation and avoids data leakage.
- Application of SHAP to extract both global and local explanations from the LSTM, identifying time of sunrise, time of sunset, number of sun hours, global radiation, water temperature and chloride concentration as the most important features.
- A sensitivity analysis showing the same trained model can be applied to a different regulatory threshold (the Legal Limit, 44 µg TTX/kg) and remains robust when one region (Eastern Scheldt Middle) with imputed hydrological data is removed.
Main Findings
- Model performance: The LSTM reached an AUC of 0.91 (95% CI: 0.79–0.98) on the validation set and 0.93 on the test set. At a sensitivity of 90%, the validation specificity was 81% (95% CI: 44%–96%) with an associated threshold of 0.57; at that same threshold of 0.57 the test set had a sensitivity of 93% and a specificity of 81%, against a validation sensitivity of 92% and specificity of 81%.
- Dataset scale and class imbalance: The official Dutch monitoring program provided analytical results for 3,143 samples from 2016–2023; TTX above the Limit of Detection was found in 331 samples (11%) and not detected in 2,812 (89%). After removing duplicates, 1,156 samples remained, of which 222 were above the Limit of Detection (19%) and 934 below (81%). Of the 222 above the Limit of Detection, 75 (34%) exceeded the Action Limit and 44 (20%) exceeded the Legal Limit. Above the Action Limit there were only 75 positive samples in total.
- Most important features: SHAP identified time of sunrise, time of sunset, number of sun hours, chloride concentration, global radiation and water temperature as the most important features. Each was statistically significant (p < 0.05) except water temperature (p = 0.10).
- Solar intensity as a driver: The prominence of sunrise, sunset, sun hours and global radiation points to effective sun hours as an important driver. The paper links this to the leading hypothesis that TTX has an exogenous origin (bacteria or algae), since the activity of most bacteria, phytoplankton and worms is positively correlated with solar intensity, and to the suspected importance of shallow waters, where light absorption by water is lower.
- Direction of hydroclimatic effects: Low chloride concentration, high global radiation and high water temperature were the hydroclimatic features correlating with TTX contamination. Other contributing factors were water height, salinity, conductivity and oxygen concentration. The paper notes chloride concentration, conductivity and salinity may also reflect a confounder, since chloride is affected by evaporation and precipitation and by hydrological interventions such as the opening of sluices.
- Descriptive context for the feature importance: In the 35-day averages, samples above the Action Limit had a mean sunrise of 3.86 hours (± 0.26) and sunset of 20.24 hours (± 0.25), 16.38 sun hours (± 0.50), global radiation of 88.15 J/cm² (± 19.17), water temperature of 18.24 celsius (± 1.49) and chloride concentration of 7.49 mg/L (± 7.82). The no-TTX group averaged 5.30 hours sunrise (± 1.33), 18.68 hours sunset (± 1.41), 13.37 sun hours (± 2.72), 68.62 J/cm² global radiation (± 23.91), 14.92 celsius water temperature (± 4.93) and 10.12 mg/L chloride (± 7.47).
- Explaining a failure case: One TTX-positive test sample was misclassified (false negative) with a predicted probability of 0.21 versus an average of 0.58. Local SHAP explanations showed this sample diverged from the average positive sample on all features except water temperature.
- Legal Limit sensitivity analysis: For classification above the Legal Limit, the paper reports an AUC of 0.94 (validation 95% CI 0.84–0.98), with specificity of 81% (validation 95% CI 73%–96%) at a sensitivity of 90%; at a threshold of 0.57 the test specificity was 78% and the test sensitivity 100%. The Figure 5 caption labels the validation AUC as 0.93 and the test AUC as 0.94.
- Robustness to regional imputation: When Eastern Scheldt Middle was removed from the test sets, both the Action Limit and Legal Limit test sets had an AUC of 0.92.
Methodology in Plain English
The researchers collected TTX measurement results from the official Dutch shellfish monitoring program for bivalve mollusk growth beds in Zeeland between 2016 and 2023. Samples were taken monthly from October to May, weekly from June to October, and twice a week during weeks 24–28. TTX was measured with liquid chromatography-tandem mass spectrometry, with a Limit of Detection of 10 µg TTX/kg, a Limit of Quantification of 20 µg TTX/kg, an Action Limit of 22 µg TTX/kg and a national Legal Limit of 44 µg TTX/kg.
Each sample was paired with two kinds of environmental input. Meteorological features came from the Royal Netherlands Meteorological Institute (KNMI) station at Vlissingen (station number 310), including daily mean, maximum and minimum temperature, sunshine duration, global radiation, wind speed and direction, and precipitation. Hydrological features came from Rijkswaterstaat (RWS), including oxygen concentration and saturation, chlorophyll, chloride, chlorosity, pheophytin, pH, air pressure, water height, water temperature, wind, conductivity and salinity, drawn from stations across the Eastern Scheldt, Lake Veere and Lake Grevelingen.
To handle gaps, outliers outside the 2.5th to 97.5th percentile were removed; infrequently missing hydrological features were imputed with weighted k-nearest neighbors (seven neighbors, matching the mostly bi-weekly monitoring pattern); features measured only monthly were forward-filled for 30 days; and regions without a value received the average from neighboring regions. All features were min-max normalized between 0 and 1. Samples were deduplicated by keeping the highest TTX level when multiple samples came from the same subregion on the same day.
The model was a long short-term memory (LSTM) network suited to time series, fed with 35 days (5 weeks) of environmental features preceding each analytical result — a window chosen because earlier studies indicated temperatures of at least three weeks prior were indicative of contamination. It had an LSTM module plus a classification head of three linear layers (128, 64 and 2 neurons), layer normalization after each LSTM layer, batch normalization after the first linear layer, dropout to limit overfitting, ReLU activations except in the final layer, the AdamW optimizer and a class-weighted cross-entropy loss to counter class imbalance. The final configuration used 3 LSTM layers, batch size 32, learning rate 5·10⁻⁴, dropout 0.3 and hidden dimension 256, trained for 250 epochs with early stopping of 30 epochs, selecting the epoch with the best validation AUC. Code was written in PyTorch and is available on GitHub.
Evaluation used the ROC curve and AUC. The validation ROC was bootstrapped 10,000 times to produce 95% confidence intervals, and the test set was judged by whether its AUC and specificity fell inside that bootstrapped range. Finally, SHAP was used to explain the model both globally and per sample, with a Mann-Whitney U test used to check the significance of the SHAP results.
Why This Matters
- Research impact: The paper argues that prior TTX research used correlation analyses that cannot describe the complex temporal relations behind contamination, and that no earlier seafood-contaminant AI study combined temporal deep learning with XAI. It positions explainability as the step that turns a "black box" model into a source of scientific hypotheses about TTX drivers.
- Monitoring adaptation: A predicted probability of TTX contamination can be used to adapt monitoring strategies, for example intensifying sampling when probabilities are high. The same trained model could also be applied to a different regulatory threshold, since it performed well for both the Action Limit and the Legal Limit.
- Transfer to other problems: The authors state the approach can be extended to different contaminants, seafoods and regions where hydrological, meteorological and contaminant monitoring data exist, and that multiple contaminants could be predicted simultaneously with a multi-task deep learning method.
- Improved data collection: Because hydrological features such as chloride concentration and salinity mattered to the model, the paper recommends that TTX monitoring strategies include hydrological measurements, and suggests that measuring water clarity at growth sites could help further research given the importance of solar intensity.
- Industry relevance: TTX contamination causes food safety risks and economic losses and supply chain disruptions, so early prediction supports the food industry and competent authorities in mitigating marine toxin risks and reducing response time.
Future Directions
- Combining datasets from different countries to improve modeling and increase statistical power, since the current dataset contained a relatively limited number (75) of samples above the Action Limit, even though it came from an eight-year monitoring plan.
- Extending the method to other contaminants, other seafoods and other regions that have hydrological and meteorological measurements plus contaminant monitoring results.
- Applying multi-task deep learning to predict multiple contaminants at once, which the authors suggest would increase statistical power and produce a more robust classification.
- Expanding TTX monitoring with hydrological and meteorological measurements, including measurements of water clarity at growth sites, to move from the correlative relationships XAI identifies toward the causative factors of TTX contamination, which the paper states remain unknown.
Target Audience
This paper is most useful to food safety researchers and risk assessors working on marine biotoxins, monitoring authorities and shellfish industry analysts who design or act on TTX surveillance programs, and machine learning practitioners interested in applied, explainable time-series modeling in environmental and food-safety domains. Readers with a background in hydroclimatic or shellfish monitoring will find the SHAP-derived feature rankings most directly actionable.
Authors’ abstract
Since 2012, tetrodotoxin (TTX) has been found in seafoods such as bivalve mollusks in temperate European waters. TTX contamination leads to food safety risks and economic losses, making early prediction of TTX contamination vital to the food industry and competent authorities. Recent studies have pointed to shallow habitats and water temperature as main drivers to TTX contamination in bivalve mollusks. However, the temporal relationships between abiotic factors, biotic factors, and TTX contamination remain unexplored. We have developed an explainable, deep learning-based model to predict TTX contamination in the Dutch Zeeland estuary. Inputs for the model were meteorological and hydrological features; output was the presence or absence of TTX contamination. Results showed that the time of sunrise, time of sunset, global radiation, water temperature, and chloride concentration contributed most to TTX contamination. Thus, the effective number of sun hours, represented by day length and global radiation, was an important driver for tetrodotoxin contamination in bivalve mollusks. To conclude, our explainable deep learning model identified the aforementioned environmental factors (number of sun hours, global radiation, water temperature, and water chloride concentration) to be associated with tetrodotoxin contamination in bivalve mollusks; making our approach a valuable tool to mitigate marine toxin risks for food industry and competent authorities.