{"id":3462,"date":"2026-02-21T11:12:59","date_gmt":"2026-02-21T10:12:59","guid":{"rendered":"https:\/\/neuraldesigner.com\/learning\/aquatic-toxicity\/"},"modified":"2026-08-05T14:58:06","modified_gmt":"2026-08-05T12:58:06","slug":"aquatic-toxicity","status":"publish","type":"learning","link":"https:\/\/www.neuraldesigner.com\/learning\/examples\/aquatic-toxicity\/","title":{"rendered":"Predict acute aquatic toxicity with a QSAR neural network"},"content":{"rendered":"\n<style>\n.ndb-table-scroll{max-width:100%;overflow-x:auto}\n.ndb-flow{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin:24px 0}.ndb-flow div{display:flex;min-height:94px;align-items:center;justify-content:center;padding:15px;border-radius:12px;background:#12354b;color:#fff;text-align:center;font-weight:700}.ndb-flow div+div{position:relative}.ndb-flow div+div:before{position:absolute;left:-12px;content:\"\u2192\";color:#56a1c8}\n.ndb-calculator{margin:28px 0;padding:26px;border:1px solid #cfe0ea;border-radius:18px;background:#f8fbfd}.ndb-calculator h3{margin-top:0}.ndb-calculator-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.ndb-field label{display:block;margin-bottom:6px;color:#12354b;font-size:13px;font-weight:700}.ndb-field input{width:100%;padding:10px 11px;border:1px solid #b8ceda;border-radius:8px;background:#fff}.ndb-field input[aria-invalid=\"true\"]{border-color:#b42318;background:#fff5f4}.ndb-field small{display:block;margin-top:4px;color:#667985;font-size:11px}.ndb-calc-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin:20px 0}.ndb-calc-actions button{padding:11px 18px;border:0;border-radius:22px;background:#245e80;color:#fff;font:inherit;font-weight:700;cursor:pointer}.ndb-calc-actions button+button{background:#dfeaf0;color:#12354b}\n.ndb-output-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;max-width:760px;margin:18px auto}.ndb-output-card{padding:18px;border:1px solid #d8e4eb;border-radius:12px;background:#fff;text-align:center}.ndb-output-card span{display:block;color:#5e707d;font-size:13px}.ndb-output-card strong{display:block;margin:7px 0;color:#12354b;font-size:25px}.ndb-output-card em{color:#60727f;font-size:12px;font-style:normal;font-weight:700}.ndb-calc-status{text-align:center}\n.ndb-note--warning{border-left-color:#d79a29;background:#fff9ed}.ndb-note--critical{border-left-color:#c64c4c;background:#fff5f5}\n.ndb-caption{max-width:760px;margin:-12px auto 22px;color:#5f707c;font-size:14px;line-height:1.5;text-align:center}\n.ndb-card .ndb-wide{max-width:min(820px,100%)}.ndb-card .ndb-architecture{max-width:min(1000px,100%)}\n.ndb-figure-grid>figure:only-child{grid-column:1\/-1;width:min(100%,560px);justify-self:center}\n.ndb-figure-grid>figure:only-child>img:last-child{margin-bottom:0}\n.ndb-card img.ndb-sensitivity{width:min(100%,560px)!important;max-width:560px!important;margin-inline:auto!important}\n@media(max-width:880px){.ndb-flow{grid-template-columns:1fr 1fr}.ndb-flow div+div:before{display:none}.ndb-calculator-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}\n@media(max-width:560px){.ndb-flow,.ndb-calculator-grid,.ndb-output-grid{grid-template-columns:1fr}}\n<\/style>\n<style>\n.ndb{width:100vw;margin-left:calc(50% - 50vw);padding:22px 24px 14px;background:#eee;color:#1b2635;font-family:\"Outfit\",\"Roboto\",Arial,sans-serif}\n.ndb *{box-sizing:border-box}.ndb-wrap{width:min(100%,1200px);margin:0 auto}.ndb a{text-decoration:none}\n.ndb-executive{margin:0 0 34px;padding:32px;border-radius:20px;background:linear-gradient(135deg,#12354b,#245e80);color:#fff}\n.ndb-executive h2{margin:0 0 12px;color:#fff;font-size:30px}.ndb-executive p{font-size:18px;line-height:1.55}\n.ndb-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-top:22px}.ndb-kpi{padding:18px;border:1px solid rgba(255,255,255,.18);border-radius:14px;background:rgba(255,255,255,.1)}.ndb-kpi strong{display:block;font-size:25px}.ndb-kpi span{font-size:13px}\n.ndb-actions,.ndb-audience,.ndb-downloads{display:flex;flex-wrap:wrap;justify-content:center;gap:12px;margin:22px 0}.ndb-actions a,.ndb-downloads a{padding:12px 20px;border-radius:24px;background:#245e80;color:#fff;font-weight:700}.ndb-executive .ndb-actions a{background:#fff;color:#12354b}\n.ndb-toc{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin:0 0 42px;padding:0;list-style:none}.ndb-toc a,.ndb-audience span{display:block;padding:9px 14px;border-radius:20px;background:#e9f2f8;color:#12354b;font-weight:600}\n.ndb-card{margin:0 0 54px;scroll-margin-top:90px}.ndb-card h2{margin:0 0 20px;padding-bottom:12px;border-bottom:1px solid #dbe5ec;color:#001233;font-size:24px}.ndb-card p,.ndb-card li{font-size:16.5px;line-height:1.6}.ndb-card img{display:block;width:auto;max-width:min(640px,100%);height:auto;margin:24px auto;border-radius:12px}.ndb-card img.ndb-architecture{width:min(1000px,100%);max-width:100%}\n.ndb-value-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:22px 0}.ndb-value{padding:20px;border:1px solid #dce8ef;border-radius:14px;background:#f8fbfd}\n.ndb-note{margin:20px 0;padding:18px 20px;border-left:4px solid #56a1c8;border-radius:0 12px 12px 0;background:#f6fafc}\n.ndb-card table{width:auto;max-width:100%;margin:24px auto;border-collapse:collapse;background:#fff}.ndb-card th,.ndb-card td{padding:11px 16px;border-bottom:1px solid #e2e9ee}.ndb-card thead th{background:#12354b!important;color:#fff!important}.ndb-card tbody th{background:#eaf2f6!important;color:#12354b!important;text-align:left}.ndb-card tbody tr:nth-child(even) th{background:#f4f8fa!important}.ndb-card tbody td{color:#33424f!important}\n.ndb-figure-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.ndb-figure-grid figure{margin:0;padding:16px;border:1px solid #dce8ef;border-radius:15px;background:#f8fbfd}.ndb-figure-grid img{width:100%;max-width:100%;margin:0 auto 12px}\n@media(max-width:820px){.ndb-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.ndb-value-grid{grid-template-columns:1fr}}\n@media(max-width:620px){.ndb{padding:12px 14px}.ndb-kpis,.ndb-figure-grid{grid-template-columns:1fr}.ndb-executive{padding:24px 20px}}\n<\/style>\n<div class=\"ndb\">\n<div class=\"ndb-wrap\">\n<section class=\"ndb-executive\">\n<h2>Screen acute aquatic toxicity from molecular descriptors<\/h2>\n<p>This QSAR neural network estimates 48-hour acute toxicity toward <em>Daphnia magna<\/em> from eight molecular descriptors. It can support early chemical prioritization and data-gap review, while laboratory evidence, chemical identity and applicability-domain assessment remain essential for regulatory or safety decisions.<\/p>\n<div class=\"ndb-kpis\">\n<div class=\"ndb-kpi\"><strong>546<\/strong><span>organic chemicals<\/span><\/div>\n<div class=\"ndb-kpi\"><strong>82<\/strong><span>held-out testing compounds<\/span><\/div>\n<div class=\"ndb-kpi\"><strong>0.703<\/strong><span>testing determination R\u00b2<\/span><\/div>\n<div class=\"ndb-kpi\"><strong>0.76<\/strong><span>MAE in log units<\/span><\/div>\n<\/div>\n<div class=\"ndb-actions\"><a href=\"#7-model-deployment\">Try the screening model<\/a><a href=\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/10\/aquatic-toxicity.csv\">Download the data<\/a><\/div>\n<\/section>\n<ul class=\"ndb-toc\">\n<li><a href=\"#1-industrial-challenge\">Industrial challenge<\/a><\/li><li><a href=\"#2-data-set\">Data set<\/a><\/li><li><a href=\"#3-model\">Model<\/a><\/li><li><a href=\"#4-training\">Training<\/a><\/li><li><a href=\"#5-selection\">Model selection<\/a><\/li><li><a href=\"#6-testing\">Testing<\/a><\/li><li><a href=\"#7-model-deployment\">Deployment<\/a><\/li><li><a href=\"#8-limitations\">Limitations<\/a><\/li>\n<\/ul>\n<section id=\"1-industrial-challenge\" class=\"ndb-card\"><h2>1. Industrial challenge<\/h2><p>Acute aquatic-toxicity testing is resource-intensive, and chemical portfolios can contain more candidates than can be tested immediately. A QSAR model provides a transparent first-pass estimate from calculated descriptors, helping specialists decide which compounds need earlier review or confirmatory testing.<\/p><div class=\"ndb-value-grid\">\n<div class=\"ndb-value\"><strong>Prioritize laboratory work<\/strong><p>Rank descriptor-ready compounds for expert review and targeted 48-hour testing.<\/p><\/div>\n<div class=\"ndb-value\"><strong>Flag higher-toxicity candidates<\/strong><p>Use a consistent numerical screen to identify cases that deserve earlier attention.<\/p><\/div>\n<div class=\"ndb-value\"><strong>Audit model behaviour<\/strong><p>Inspect descriptors, predictions, residuals and model version instead of relying on a black-box score.<\/p><\/div>\n<\/div><div class=\"ndb-audience\"><span>Ecotoxicology<\/span><span>Product stewardship<\/span><span>Regulatory science<\/span><span>Computational chemistry<\/span><span>Environmental risk<\/span><\/div><div class=\"ndb-note\"><strong>Scope of this example.<\/strong> This is an educational QSAR screening model for one defined endpoint: 48-hour <em>Daphnia magna<\/em> LC50 expressed as \u2212log(mol\/L). It is not a waiver decision, chemical-safety classification or substitute for qualified experimental evidence.<\/div><\/section>\n<section id=\"2-data-set\" class=\"ndb-card\"><h2>2. Data set<\/h2>\n<p>The <a href=\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/10\/aquatic-toxicity.csv\">aquatic-toxicity.csv<\/a> file contains 546 organic chemicals, eight calculated molecular descriptors and one experimental response. The UCI record reports no missing values.<\/p>\n<div class=\"ndb-table-scroll\"><table><thead><tr><th>Descriptor<\/th><th>CSV field<\/th><th>Encoded information<\/th><\/tr><\/thead><tbody>\n<tr><td>Topological polar surface area<\/td><td><code>TPSA(Tot)<\/code><\/td><td>Molecular polarity<\/td><\/tr>\n<tr><td>Hydrogen-bond acceptor surface area<\/td><td><code>SAacc<\/code><\/td><td>Hydrogen-bond acceptance<\/td><\/tr>\n<tr><td>Hydrogens bonded to heteroatoms<\/td><td><code>H-050<\/code><\/td><td>Atom-centred fragment count<\/td><\/tr>\n<tr><td>Moriguchi logP<\/td><td><code>MLOGP<\/code><\/td><td>Lipophilicity<\/td><\/tr>\n<tr><td>Reciprocal distance connectivity index<\/td><td><code>RDCHI<\/code><\/td><td>Molecular size and branching<\/td><\/tr>\n<tr><td>Geary autocorrelation weighted by polarizability<\/td><td><code>GATS1p<\/code><\/td><td>2D polarizability pattern<\/td><\/tr>\n<tr><td>Nitrogen atoms<\/td><td><code>nN<\/code><\/td><td>Constitutional count<\/td><\/tr>\n<tr><td>Electronegative carbon fragments<\/td><td><code>C-040<\/code><\/td><td>Atom-centred fragment count<\/td><\/tr>\n<\/tbody><\/table><\/div>\n<p>The target <code>LC50<\/code> is the concentration causing 50% mortality over 48 hours, transformed to <strong>\u2212log(mol\/L)<\/strong>. The sign matters: a larger numerical value represents a lower lethal molar concentration and therefore greater acute toxicity.<\/p>\n<div class=\"ndb-figure-grid\"><figure><img decoding=\"async\" src=\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2026\/08\/water-toxicity-lc50-distribution-2026.png\" alt=\"Distribution of Daphnia magna LC50 values for 546 chemicals\"><figcaption>LC50 response distribution.<\/figcaption><\/figure><figure><img decoding=\"async\" src=\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2026\/08\/water-toxicity-correlations-2026.png\" alt=\"Pearson correlations between eight molecular descriptors and LC50\"><figcaption><code>MLOGP<\/code> and <code>RDCHI<\/code> have the strongest positive marginal relationships; correlation alone does not describe the nonlinear QSAR.<\/figcaption><\/figure><\/div>\n<img decoding=\"async\" class=\"ndb-wide\" src=\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2026\/08\/water-toxicity-mlogp-scatter-2026.png\" alt=\"Scatter plot of LC50 against MLOGP for the complete aquatic toxicity dataset\">\n<p class=\"ndb-caption\">The broad scatter around the MLOGP trend reflects chemical heterogeneity and different mechanisms of action.<\/p>\n<div class=\"ndb-note\"><strong>Validation design.<\/strong> The final project uses 382 training, 82 selection and 82 testing compounds (70\/15\/15). Training compounds were selected to cover the standardized descriptor space; the remaining compounds were divided into matched LC50 strata. Identical eight-descriptor profiles remain together in training. This supports interpolation testing, but it is less demanding than an external chemical-series or scaffold-based validation.<\/div><\/section>\n<section id=\"3-model\" class=\"ndb-card\"><h2>3. Model<\/h2><p>The final model keeps Neural Designer&#8217;s compact default architecture: eight standardized inputs, three tanh hidden neurons and one linear output neuron. The output is returned to \u2212log(mol\/L) and bounded to the observed response interval, 0.122\u201310.047.<\/p><p>The 8\u20133\u20131 network contains 31 trainable parameters. Its small size makes the exported calculation straightforward to audit and inexpensive to execute.<\/p><img decoding=\"async\" class=\"ndb-architecture\" src=\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2026\/08\/water-toxicity-network-architecture-2026.png\" alt=\"Final 8-3-1 neural network for aquatic toxicity prediction\"><\/section>\n<section id=\"4-training\" class=\"ndb-card\"><h2>4. Training strategy<\/h2>\n<p>The network minimizes normalized squared error with L2 regularization weight 0.001. Quasi-Newton training stops after 109 epochs when the minimum loss-decrease criterion is reached.<\/p>\n<img decoding=\"async\" src=\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2026\/08\/water-toxicity-quasi-newton-history-2026.png\" alt=\"Quasi-Newton training and selection error history for the aquatic toxicity model\">\n<table><thead><tr><th>Optimizer<\/th><th>Epochs<\/th><th>Training error<\/th><th>Selection error<\/th><th>Stopping criterion<\/th><\/tr><\/thead><tbody><tr><td>Quasi-Newton<\/td><td>109<\/td><td>0.442 NSE<\/td><td>0.074 NSE<\/td><td>Minimum loss decrease<\/td><\/tr><\/tbody><\/table>\n<div class=\"ndb-note\"><strong>Why selection error is lower.<\/strong> The space-filling training subset deliberately contains descriptor-space extremes and is more difficult than the central selection subset. The difference should not be interpreted as evidence that selection compounds influenced fitting.<\/div>\n<\/section>\n<section id=\"5-selection\" class=\"ndb-card\"><h2>5. Model selection<\/h2><p>No hidden-size search is retained in the final workflow. The three-neuron default network is used as a compact, reproducible baseline because increasing architecture complexity did not provide a stable improvement across sample assignments.<\/p><div class=\"ndb-note\"><strong>Professional next step.<\/strong> Any future comparison of hidden sizes, feature subsets or algorithms should use the same fixed subsets or repeated external validation. Selecting an architecture from the testing chart would make the reported test result optimistic.<\/div><\/section>\n<section id=\"6-testing\" class=\"ndb-card\"><h2>6. Testing analysis<\/h2><p>The final Python export was independently evaluated on all 82 rows marked as testing. Neural Designer&#8217;s determination value is the squared observed\u2013predicted correlation. MAE, RMSE and bias quantify error directly in the logarithmic response scale.<\/p>\n<div class=\"ndb-table-scroll\"><table><thead><tr><th>Testing compounds<\/th><th>Determination R\u00b2<\/th><th>SSE-based R\u00b2<\/th><th>MAE<\/th><th>RMSE<\/th><th>Bias<\/th><th>95th-percentile absolute error<\/th><\/tr><\/thead><tbody><tr><td>82<\/td><td>0.7025<\/td><td>0.6619<\/td><td>0.76 log units<\/td><td>0.96 log units<\/td><td>-0.05 log units<\/td><td>1.80 log units<\/td><\/tr><\/tbody><\/table><\/div>\n<p>The model reduces RMSE from 1.67 for a constant training-mean baseline to 0.96 log units. 75.6% of testing predictions fall within \u00b11 log unit, while the maximum absolute error is 2.82.<\/p>\n<div class=\"ndb-note ndb-note--critical\"><strong>Safety-relevant pattern.<\/strong> Predictions cover approximately 1.86\u20137.43 while observed testing values span 0.59\u201310.05. The model therefore compresses the extremes and can underpredict the most toxic compounds. It is suitable for prioritization only when predictions carry uncertainty and applicability-domain checks.<\/div>\n<div class=\"ndb-figure-grid\"><figure><img decoding=\"async\" src=\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2026\/08\/water-toxicity-goodness-of-fit-neural-designer-2026.png\" alt=\"Neural Designer goodness-of-fit chart comparing predicted and observed LC50\"><\/figure><\/div><\/section>\n<section id=\"7-model-deployment\" class=\"ndb-card\"><h2>7. Model deployment<\/h2>\n<p>A credible QSAR workflow surrounds the neural calculation with chemical identity, descriptor reproducibility, applicability-domain assessment and expert review.<\/p>\n<div class=\"ndb-flow\"><div>Verified chemical structure<\/div><div>Reproducible descriptors<\/div><div>Range and domain checks<\/div><div>QSAR LC50 estimate<\/div><div>Expert review and test decision<\/div><\/div>\n<div class=\"ndb-note ndb-note--warning\"><strong>Why free response optimization is omitted.<\/strong> Optimizing the eight descriptors independently produces fractional atom counts and combinations that may not correspond to a chemically valid structure. Safer-chemical design should search real or generatable molecules, recalculate all descriptors together and enforce an applicability domain.<\/div>\n\n<div class=\"ndb-calculator\" id=\"aquatic-calculator\">\n<h3>Try the QSAR screening model<\/h3>\n<p>Enter one molecular-descriptor vector. The calculation runs locally using the exact scaling, weights, output transformation and bounds from the exported Python model. Inputs outside the training range trigger a warning. This is not a certified regulatory or chemical-safety assessment.<\/p>\n<form id=\"aquatic-form\"><div class=\"ndb-calculator-grid\"><div class=\"ndb-field\"><label for=\"aq-0\">Topological polar surface area (<code>TPSA(Tot)<\/code>)<\/label><input id=\"aq-0\" type=\"number\" min=\"0.0\" max=\"347.32\" step=\"any\" value=\"59.2342\"><small>0 to 347.32<\/small><\/div><div class=\"ndb-field\"><label for=\"aq-1\">Hydrogen-bond acceptor surface area (<code>SAacc<\/code>)<\/label><input id=\"aq-1\" type=\"number\" min=\"0.0\" max=\"571.952\" step=\"any\" value=\"72.1365\"><small>0 to 571.952<\/small><\/div><div class=\"ndb-field\"><label for=\"aq-2\">Hydrogens bonded to heteroatoms (<code>H-050<\/code>)<\/label><input id=\"aq-2\" type=\"number\" min=\"0.0\" max=\"18.0\" step=\"1\" value=\"1.15969\"><small>0 to 18; integer count<\/small><\/div><div class=\"ndb-field\"><label for=\"aq-3\">Moriguchi octanol\u2013water partition coefficient (<code>MLOGP<\/code>)<\/label><input id=\"aq-3\" type=\"number\" min=\"-6.446\" max=\"9.148\" step=\"any\" value=\"2.04818\"><small>-6.446 to 9.148<\/small><\/div><div class=\"ndb-field\"><label for=\"aq-4\">Molecular size and branching index (<code>RDCHI<\/code>)<\/label><input id=\"aq-4\" type=\"number\" min=\"1.0\" max=\"6.439\" step=\"any\" value=\"2.61129\"><small>1 to 6.439<\/small><\/div><div class=\"ndb-field\"><label for=\"aq-5\">Polarizability autocorrelation descriptor (<code>GATS1p<\/code>)<\/label><input id=\"aq-5\" type=\"number\" min=\"0.288\" max=\"2.5\" step=\"any\" value=\"1.11622\"><small>0.288 to 2.5<\/small><\/div><div class=\"ndb-field\"><label for=\"aq-6\">Nitrogen atom count (<code>nN<\/code>)<\/label><input id=\"aq-6\" type=\"number\" min=\"0.0\" max=\"11.0\" step=\"1\" value=\"1.26702\"><small>0 to 11; integer count<\/small><\/div><div class=\"ndb-field\"><label for=\"aq-7\">Electronegative carbon fragment count (<code>C-040<\/code>)<\/label><input id=\"aq-7\" type=\"number\" min=\"0.0\" max=\"11.0\" step=\"1\" value=\"0.473822\"><small>0 to 11; integer count<\/small><\/div><\/div>\n<div class=\"ndb-calc-actions\"><button type=\"submit\">Estimate acute toxicity<\/button><button type=\"button\" id=\"aquatic-reset\">Reset representative vector<\/button><\/div><\/form>\n<div class=\"ndb-output-grid\" aria-live=\"polite\"><div class=\"ndb-output-card\"><span>Predicted 48-hour LC50 index<\/span><strong id=\"aquatic-output\">\u2014<\/strong><em>\u2212log(mol\/L)<\/em><\/div><div class=\"ndb-output-card\"><span>Equivalent molar concentration<\/span><strong id=\"aquatic-concentration\">\u2014<\/strong><em>\u00b5mol\/L<\/em><\/div><\/div>\n<p class=\"ndb-calc-status\" id=\"aquatic-status\">Higher \u2212log(mol\/L) means a lower lethal concentration and therefore greater predicted acute toxicity.<\/p>\n<\/div>\n<script>\n(function(){\nconst ids=[\"aq-0\", \"aq-1\", \"aq-2\", \"aq-3\", \"aq-4\", \"aq-5\", \"aq-6\", \"aq-7\"];\nconst defaults=[59.2342, 72.1365, 1.15969, 2.04818, 2.61129, 1.11622, 1.26702, 0.473822];\nconst discrete=[2, 6, 7];\nconst form=document.getElementById(\"aquatic-form\");if(!form)return;\nfunction calculate(){\nconst fields=ids.map(id=>document.getElementById(id)),x=fields.map(f=>Number(f.value));\nif(x.some(v=>!Number.isFinite(v))){document.getElementById(\"aquatic-status\").textContent=\"Enter a valid number in every field.\";return}\nlet outside=false,nonInteger=false;fields.forEach((f,i)=>{const bad=x[i]<Number(f.min)||x[i]>Number(f.max);f.setAttribute(\"aria-invalid\",bad?\"true\":\"false\");outside=outside||bad;if(discrete.includes(i)&&!Number.isInteger(x[i]))nonInteger=true});\nconst TPSATot=x[0],SAacc=x[1],H_res_050=x[2],MLOGP=x[3],RDCHI=x[4],GATS1p=x[5],nN=x[6],C_res_040=x[7];\nconst scaled_TPSATot=(TPSATot-59.23419952)\/48.6719017;\nconst scaled_SAacc=(SAacc-72.1364975)\/73.71330261;\nconst scaled_H_res_050=(H_res_050-1.159690022)\/1.812219977;\nconst scaled_MLOGP=(MLOGP-2.048180103)\/1.78828001;\nconst scaled_RDCHI=(RDCHI-2.611289978)\/0.8735460043;\nconst scaled_GATS1p=(GATS1p-1.116219997)\/0.4025169909;\nconst scaled_nN=(nN-1.267019987)\/1.523880005;\nconst scaled_C_res_040=(C_res_040-0.4738219976)\/0.9182289839;\nconst h0=Math.tanh(-0.3574056029-0.6916042566*scaled_TPSATot-0.4292097688*scaled_SAacc-0.6869429946*scaled_H_res_050-0.359744221*scaled_MLOGP+1.639013171*scaled_RDCHI-0.3281002641*scaled_GATS1p-0.4943729043*scaled_nN+0.5705426931*scaled_C_res_040);\nconst h1=Math.tanh(0.3236572742-0.106493324*scaled_TPSATot+0.4177281857*scaled_SAacc+0.1682831645*scaled_H_res_050-0.267095983*scaled_MLOGP-0.3978462517*scaled_RDCHI-0.1276642531*scaled_GATS1p+0.234437421*scaled_nN-0.2251896113*scaled_C_res_040);\nconst h2=Math.tanh(-0.9870298505-0.6597745419*scaled_TPSATot+0.0916736871*scaled_SAacc+0.06473948061*scaled_H_res_050+0.1967894286*scaled_MLOGP-0.2611983716*scaled_RDCHI+0.7116803527*scaled_GATS1p-0.07959120721*scaled_nN+0.4030137062*scaled_C_res_040);\nlet output=(-0.2356218398-0.9351298809*h0-2.423465014*h1-1.162140727*h2)*1.678338528+4.574382305;\noutput=Math.max(0.1220000014,Math.min(10.04699993,output));\ndocument.getElementById(\"aquatic-output\").textContent=output.toFixed(3);\ndocument.getElementById(\"aquatic-concentration\").textContent=(Math.pow(10,-output)*1e6).toPrecision(3);\nlet status=\"Descriptor vector is inside every individual training range. This does not prove that it is a real molecule or inside the multidimensional applicability domain.\";\nif(outside)status=\"Warning: at least one descriptor is outside its training range; treat this prediction as extrapolation.\";\nelse if(nonInteger)status=\"Warning: H-050, nN and C-040 are counts and should be integers for a chemically meaningful descriptor vector.\";\ndocument.getElementById(\"aquatic-status\").textContent=status;\n}\nform.addEventListener(\"submit\",e=>{e.preventDefault();calculate()});\ndocument.getElementById(\"aquatic-reset\").addEventListener(\"click\",()=>{ids.forEach((id,i)=>{const f=document.getElementById(id);f.value=defaults[i];f.setAttribute(\"aria-invalid\",\"false\")});calculate()});\ncalculate();\n})();\n<\/script>\n\n<h3>MLOGP directional output<\/h3><p>This Neural Designer export varies only <code>MLOGP<\/code> while holding the other seven molecular descriptors at the reference operating point marked in grey. It shows the local response learned by the final network.<\/p>\n<img decoding=\"async\" class=\"ndb-sensitivity\" src=\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2026\/08\/water-toxicity-mlogp-directional-output-2026.png\" alt=\"Neural Designer directional output for predicted LC50 as MLOGP varies\">\n<div class=\"ndb-note ndb-note--warning\"><strong>Interpretation boundary.<\/strong> The exported axis extends from approximately \u221210 to 10, while the observed dataset range is \u22126.446 to 9.148. Values outside the observed interval are extrapolations. This is a one-factor model response, not a causal chemical transformation, because molecular descriptors are coupled and some combinations may not represent a synthesizable compound.<\/div>\n<h3>Download and reproduce<\/h3>\n<div class=\"ndb-downloads\"><a href=\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2026\/08\/aquatic-toxicity-python-model-2026.zip\">Download Python model (ZIP)<\/a><a href=\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2026\/08\/aquatic-toxicity-project-2026.zip\">Download Neural Designer project (ZIP)<\/a><a href=\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/10\/aquatic-toxicity.csv\">Download dataset (CSV)<\/a><\/div><\/section>\n<section id=\"8-limitations\" class=\"ndb-card\"><h2>8. Scope and limitations<\/h2>\n<ul>\n<li>The endpoint is 48-hour acute toxicity toward <em>Daphnia magna<\/em>, not chronic toxicity, another species or a broader ecological outcome.<\/li>\n<li>The 546 compounds are chemically heterogeneous. Different mechanisms of action limit what one global regression can represent.<\/li>\n<li>The CSV contains descriptors but no names, SMILES, chemical classes or explicit mode-of-action labels. Structural audit and scaffold-based splitting are therefore unavailable in this example.<\/li>\n<li>Univariate input ranges do not define a multidimensional applicability domain. Similarity or distance to training compounds should accompany every operational prediction.<\/li>\n<li>The 70\/15\/15 split is designed for interpolation and contains only 82 testing compounds. External chemical-series validation is still required.<\/li>\n<li>Experimental LC50 variability and repeated-measure uncertainty are not propagated into prediction intervals.<\/li>\n<li>The model compresses the response extremes and can underestimate highly toxic compounds.<\/li>\n<li>Descriptor software, calculation settings, preprocessing and model version must remain controlled; changing them can invalidate predictions.<\/li>\n<li>This example supports screening and prioritization. Regulatory and safety decisions require qualified review and appropriate experimental evidence.<\/li>\n<\/ul>\n<\/section>\n<section id=\"references\" class=\"ndb-card\"><h2>References<\/h2>\n<ul>\n<li><a href=\"https:\/\/archive.ics.uci.edu\/dataset\/505\/qsar%2Baquatic%2Btoxicity\">UCI QSAR aquatic toxicity dataset<\/a>, 546 chemicals and eight molecular descriptors, DOI: <a href=\"https:\/\/doi.org\/10.24432\/C5SG7H\">10.24432\/C5SG7H<\/a>.<\/li>\n<li>Cassotti, M. et al. <a href=\"https:\/\/doi.org\/10.1177\/026119291404200106\">Prediction of acute aquatic toxicity toward <em>Daphnia magna<\/em> by using the GA-kNN method<\/a>, ATLA 42, 31\u201341 (2014).<\/li>\n<li><a href=\"https:\/\/www.oecd.org\/content\/dam\/oecd\/en\/topics\/policy-sub-issues\/assessment-of-chemicals\/oecd-principles-for-the-validation-for-regulatory-purposes-of-quantitative-structure-activity-relationship-models.pdf\">OECD principles for the validation of (Q)SAR models for regulatory purposes<\/a>: defined endpoint, unambiguous algorithm, applicability domain, validation and mechanistic interpretation.<\/li>\n<li><a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/testing-analysis\/\">Neural Designer testing analysis<\/a> and <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/model-deployment\/\">model deployment<\/a>.<\/li>\n<\/ul>\n<\/section>\n<\/div>\n<\/div>\n","protected":false},"author":13,"featured_media":2651,"template":"","categories":[29],"tags":[40,46,43],"class_list":["post-3462","learning","type-learning","status-publish","has-post-thumbnail","hentry","category-examples","tag-chemistry","tag-environment","tag-industry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Predict acute aquatic toxicity with a QSAR neural network<\/title>\n<meta name=\"description\" content=\"Build a machine learning model for LC50 (the standard measure of water toxicity) using real data from a body of water.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.neuraldesigner.com\/learning\/examples\/aquatic-toxicity\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Modeling the toxicity of a waterbody machine learning example\" \/>\n<meta property=\"og:description\" content=\"Many chemicals partition in water and can exert adverse effects on aquatic systems threatening the survival of the members of these ecosystems.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.neuraldesigner.com\/learning\/examples\/aquatic-toxicity\/\" \/>\n<meta property=\"og:site_name\" content=\"Neural Designer\" \/>\n<meta property=\"article:modified_time\" content=\"2026-08-05T12:58:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/08\/Candice_Image_0.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"672\" \/>\n\t<meta property=\"og:image:height\" content=\"378\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Modeling the toxicity of a waterbody machine learning example\" \/>\n<meta name=\"twitter:description\" content=\"Many chemicals partition in water and can exert adverse effects on aquatic systems threatening the survival of the members of these ecosystems.\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/08\/Candice_Image_0.jpg\" \/>\n<meta name=\"twitter:site\" content=\"@NeuralDesigner\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.neuraldesigner.com\/learning\/examples\/aquatic-toxicity\/\",\"url\":\"https:\/\/www.neuraldesigner.com\/learning\/examples\/aquatic-toxicity\/\",\"name\":\"Predict acute aquatic toxicity with a QSAR neural network\",\"isPartOf\":{\"@id\":\"https:\/\/www.neuraldesigner.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.neuraldesigner.com\/learning\/examples\/aquatic-toxicity\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.neuraldesigner.com\/learning\/examples\/aquatic-toxicity\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/06\/aquatic-toxicity.webp\",\"datePublished\":\"2026-02-21T10:12:59+00:00\",\"dateModified\":\"2026-08-05T12:58:06+00:00\",\"description\":\"Build a machine learning model for LC50 (the standard measure of water toxicity) using real data from a body of water.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.neuraldesigner.com\/learning\/examples\/aquatic-toxicity\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.neuraldesigner.com\/learning\/examples\/aquatic-toxicity\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.neuraldesigner.com\/learning\/examples\/aquatic-toxicity\/#primaryimage\",\"url\":\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/06\/aquatic-toxicity.webp\",\"contentUrl\":\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/06\/aquatic-toxicity.webp\",\"width\":1200,\"height\":628,\"caption\":\"Aquatic toxicity\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.neuraldesigner.com\/learning\/examples\/aquatic-toxicity\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.neuraldesigner.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Learning\",\"item\":\"https:\/\/www.neuraldesigner.com\/learning\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Predict acute aquatic toxicity with a QSAR neural network\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.neuraldesigner.com\/#website\",\"url\":\"https:\/\/www.neuraldesigner.com\/\",\"name\":\"Neural Designer\",\"description\":\"Explainable AI Platform\",\"publisher\":{\"@id\":\"https:\/\/www.neuraldesigner.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.neuraldesigner.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.neuraldesigner.com\/#organization\",\"name\":\"Neural Designer\",\"url\":\"https:\/\/www.neuraldesigner.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.neuraldesigner.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/05\/logo-neural-1.png\",\"contentUrl\":\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/05\/logo-neural-1.png\",\"width\":1024,\"height\":223,\"caption\":\"Neural Designer\"},\"image\":{\"@id\":\"https:\/\/www.neuraldesigner.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/NeuralDesigner\",\"https:\/\/es.linkedin.com\/showcase\/neuraldesigner\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Predict acute aquatic toxicity with a QSAR neural network","description":"Build a machine learning model for LC50 (the standard measure of water toxicity) using real data from a body of water.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.neuraldesigner.com\/learning\/examples\/aquatic-toxicity\/","og_locale":"en_US","og_type":"article","og_title":"Modeling the toxicity of a waterbody machine learning example","og_description":"Many chemicals partition in water and can exert adverse effects on aquatic systems threatening the survival of the members of these ecosystems.","og_url":"https:\/\/www.neuraldesigner.com\/learning\/examples\/aquatic-toxicity\/","og_site_name":"Neural Designer","article_modified_time":"2026-08-05T12:58:06+00:00","og_image":[{"width":672,"height":378,"url":"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/08\/Candice_Image_0.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_title":"Modeling the toxicity of a waterbody machine learning example","twitter_description":"Many chemicals partition in water and can exert adverse effects on aquatic systems threatening the survival of the members of these ecosystems.","twitter_image":"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/08\/Candice_Image_0.jpg","twitter_site":"@NeuralDesigner","twitter_misc":{"Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.neuraldesigner.com\/learning\/examples\/aquatic-toxicity\/","url":"https:\/\/www.neuraldesigner.com\/learning\/examples\/aquatic-toxicity\/","name":"Predict acute aquatic toxicity with a QSAR neural network","isPartOf":{"@id":"https:\/\/www.neuraldesigner.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.neuraldesigner.com\/learning\/examples\/aquatic-toxicity\/#primaryimage"},"image":{"@id":"https:\/\/www.neuraldesigner.com\/learning\/examples\/aquatic-toxicity\/#primaryimage"},"thumbnailUrl":"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/06\/aquatic-toxicity.webp","datePublished":"2026-02-21T10:12:59+00:00","dateModified":"2026-08-05T12:58:06+00:00","description":"Build a machine learning model for LC50 (the standard measure of water toxicity) using real data from a body of water.","breadcrumb":{"@id":"https:\/\/www.neuraldesigner.com\/learning\/examples\/aquatic-toxicity\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.neuraldesigner.com\/learning\/examples\/aquatic-toxicity\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.neuraldesigner.com\/learning\/examples\/aquatic-toxicity\/#primaryimage","url":"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/06\/aquatic-toxicity.webp","contentUrl":"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/06\/aquatic-toxicity.webp","width":1200,"height":628,"caption":"Aquatic toxicity"},{"@type":"BreadcrumbList","@id":"https:\/\/www.neuraldesigner.com\/learning\/examples\/aquatic-toxicity\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.neuraldesigner.com\/"},{"@type":"ListItem","position":2,"name":"Learning","item":"https:\/\/www.neuraldesigner.com\/learning\/"},{"@type":"ListItem","position":3,"name":"Predict acute aquatic toxicity with a QSAR neural network"}]},{"@type":"WebSite","@id":"https:\/\/www.neuraldesigner.com\/#website","url":"https:\/\/www.neuraldesigner.com\/","name":"Neural Designer","description":"Explainable AI Platform","publisher":{"@id":"https:\/\/www.neuraldesigner.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.neuraldesigner.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.neuraldesigner.com\/#organization","name":"Neural Designer","url":"https:\/\/www.neuraldesigner.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.neuraldesigner.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/05\/logo-neural-1.png","contentUrl":"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/05\/logo-neural-1.png","width":1024,"height":223,"caption":"Neural Designer"},"image":{"@id":"https:\/\/www.neuraldesigner.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/NeuralDesigner","https:\/\/es.linkedin.com\/showcase\/neuraldesigner\/"]}]}},"_links":{"self":[{"href":"https:\/\/www.neuraldesigner.com\/api\/wp\/v2\/learning\/3462","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.neuraldesigner.com\/api\/wp\/v2\/learning"}],"about":[{"href":"https:\/\/www.neuraldesigner.com\/api\/wp\/v2\/types\/learning"}],"author":[{"embeddable":true,"href":"https:\/\/www.neuraldesigner.com\/api\/wp\/v2\/users\/13"}],"version-history":[{"count":14,"href":"https:\/\/www.neuraldesigner.com\/api\/wp\/v2\/learning\/3462\/revisions"}],"predecessor-version":[{"id":23063,"href":"https:\/\/www.neuraldesigner.com\/api\/wp\/v2\/learning\/3462\/revisions\/23063"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.neuraldesigner.com\/api\/wp\/v2\/media\/2651"}],"wp:attachment":[{"href":"https:\/\/www.neuraldesigner.com\/api\/wp\/v2\/media?parent=3462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.neuraldesigner.com\/api\/wp\/v2\/categories?post=3462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.neuraldesigner.com\/api\/wp\/v2\/tags?post=3462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}