Screen chemical structures for ready biodegradability
This reproducible QSAR tutorial maps 41 molecular descriptors to an internal ready-biodegradability screening score. On 211 held-out chemicals, the exported model reaches 88.2% accuracy, 0.867 balanced accuracy and an ROC AUC of 0.931. The result is an internal benchmark, not a regulatory prediction.
1. Scientific objective
The objective is to demonstrate how a transparent tabular QSAR can prioritize chemicals by their likelihood of meeting the source data set’s ready-biodegradability label. The model can support method development and pre-screening when descriptor generation, chemical identity, applicability and uncertainty are controlled. It does not replace an OECD 301 study or an expert regulatory assessment.
Prioritize structures for experimental work before committing laboratory time and material.
Compare the default decision threshold with a sensitivity-oriented screening threshold.
Inspect the renamed schema, exact split, Neural Designer project and executable Python export.
2. Data and provenance
The updated biodegradation.csv contains 1,055 chemicals, 41 numeric molecular descriptors and no missing values. The target contains 356 readily biodegradable and 699 not readily biodegradable records.
| Subset | Rows | Readily biodegradable | Purpose |
|---|---|---|---|
| Training | 633 | Model-weighted during fitting | Estimate 42 model parameters |
| Selection | 211 | Monitored during optimization | Track generalization during training |
| Testing | 211 | 73 positive; 138 negative | Report final internal performance |
Descriptor schema
The local CSV preserves the original values and column order but replaces compact source codes with descriptive field names. Neural Designer consumes all 41 fields in this exact order.
View the exact 41-column input contract
| Published CSV field | Source descriptor | Family |
|---|---|---|
laplace_leading_eigenvalue | SpMax_L | Topological/spectral |
barysz_balaban_electronegativity_index | J_Dz(e) | Topological/spectral |
heavy_atom_count | nHM | Constitutional |
nitrogen_nitrogen_pair_frequency_distance_1 | F01[N-N] | Functional/fragment |
carbon_nitrogen_pair_frequency_distance_4 | F04[C-N] | Topological/spectral |
ssss_carbon_atom_count | NssssC | Functional/fragment |
substituted_benzene_sp2_carbon_count | nCb- | Functional/fragment |
carbon_atom_percentage | C% | Constitutional |
terminal_primary_sp3_carbon_count | nCp | Constitutional |
oxygen_atom_count | nO | Constitutional |
carbon_nitrogen_pair_frequency_distance_3 | F03[C-N] | Topological/spectral |
dss_carbon_e_state_sum | SdssC | Electronic/E-state |
burden_mass_hyper_wiener_log_index | HyWi_B(m) | Topological/spectral |
lopping_centric_index | LOC | Topological/spectral |
laplace_spectral_moment_order_6 | SM6_L | Topological/spectral |
carbon_oxygen_pair_frequency_distance_3 | F03[C-O] | Topological/spectral |
mean_sanderson_electronegativity_carbon_scaled | Me | Electronic/E-state |
mean_first_ionization_potential_carbon_scaled | Mi | Electronic/E-state |
hydrazine_nitrogen_count | nN-N | Functional/fragment |
aromatic_nitro_group_count | nArNO2 | Functional/fragment |
crx3_group_count | nCRX3 | Functional/fragment |
burden_polarizability_normalized_positive_spectral_sum | SpPosA_B(p) | Topological/spectral |
circuit_count | nCIR | Functional/fragment |
carbon_bromine_pair_distance_1_present | B01[C-Br] | Functional/fragment |
carbon_chlorine_pair_distance_3_present | B03[C-Cl] | Functional/fragment |
n073_nitrogen_fragment_count | N-073 | Functional/fragment |
adjacency_leading_eigenvalue | SpMax_A | Topological/spectral |
intrinsic_state_pseudoconnectivity_1d | Psi_i_1d | Topological/spectral |
carbon_bromine_pair_distance_4_present | B04[C-Br] | Functional/fragment |
double_bonded_oxygen_e_state_sum | SdO | Electronic/E-state |
laplace_second_mohar_index | TI2_L | Topological/spectral |
ring_tertiary_sp3_carbon_count | nCrt | Functional/fragment |
r_cx_r_fragment_count | C-026 | Functional/fragment |
carbon_nitrogen_pair_frequency_distance_2 | F02[C-N] | Topological/spectral |
hydrogen_bond_donor_atom_count | nHDon | Constitutional |
burden_mass_leading_eigenvalue | SpMax_B(m) | Topological/spectral |
intrinsic_state_pseudoconnectivity_type_s_average | Psi_i_A | Topological/spectral |
nitrogen_atom_count | nN | Constitutional |
burden_mass_spectral_moment_order_6 | SM6_B(m) | Topological/spectral |
aromatic_ester_count | nArCOOR | Functional/fragment |
halogen_atom_count | nX | Constitutional |


3. Model
Thirty-eight descriptor inputs use mean-and-standard-deviation scaling; the three binary bromine/chlorine indicators use minimum–maximum scaling. The scaled inputs connect directly to one sigmoid output, so this is a nonlinear-preprocessing plus logistic classification model with 42 trainable parameters and no hidden layer.
The output is named readily_biodegradable. A larger value supports the positive class, but the sigmoid score has not been calibrated as a probability.

4. Training strategy
The model minimizes a class-weighted squared error with the quasi-Newton method and no explicit regularization. The positive-class weight is 1.4817 and the negative-class weight is 0.7546, compensating partly for the class imbalance.
Training error falls from 1.1168 to 0.2722 over 91 completed epochs. Selection error reaches its minimum of approximately 0.257 at epoch 16 and later rises to 0.3447, while training error continues to improve.

5. Model selection and baseline
No neuron selection or architecture selection was performed. The direct 41–1 classifier is both the base and final architecture. The selection subset was used to monitor optimization, not to search across model sizes.
| Reference | Testing accuracy | Balanced accuracy | Interpretation |
|---|---|---|---|
| Always predict the majority class | 65.4% | 50.0% | Null decision rule for the testing prevalence |
| Final direct sigmoid model | 88.2% | 86.7% | Material improvement on this internal split |
The simple model is a useful transparent baseline. More complexity is not justified until checkpointing, external validation and applicability-domain controls have been addressed.
6. Scientific validation
The held-out testing subset contains 73 positive and 138 negative chemicals. At the default 0.50 threshold, the model classifies 186 of 211 correctly. The ROC analysis evaluates ranking across all thresholds and reports an AUC of 0.931 with a 95% interval from 0.896 to 0.966.
| Testing metric | Value | Operational meaning at threshold 0.50 |
|---|---|---|
| ROC AUC | 0.931 | Threshold-independent ranking reported by Neural Designer |
| Accuracy | 88.15% | 186 correct classifications from 211 |
| Sensitivity | 82.19% | 60 of 73 positive records detected |
| Specificity | 91.30% | 126 of 138 negative records rejected |
| Precision | 83.33% | 60 of 72 positive calls correct |
| F1 score | 82.76% | Harmonic balance of precision and sensitivity |
| Balanced accuracy | 86.75% | Equal weighting of sensitivity and specificity |

Confusion matrix at threshold 0.50
| Actual / predicted | Readily biodegradable | Not readily biodegradable | Total |
|---|---|---|---|
| Readily biodegradable | 60 | 13 | 73 |
| Not readily biodegradable | 12 | 126 | 138 |
| Total | 72 | 139 | 211 |
7. Inference and reproducibility
A professional workflow starts from an identified chemical structure, calculates the same descriptor definitions with a versioned toolchain, verifies schema and applicability, produces a score, applies a pre-approved operating threshold and routes the result to expert or laboratory confirmation.
Screening-threshold scenario
Changing the threshold does not improve the model; it changes the balance between missed positive chemicals and additional positive calls. A sensitivity-oriented screen can use the ROC-derived 0.29 operating point to miss fewer readily biodegradable records, at the cost of more false positives.
| Threshold | TP | FN | FP | TN | Sensitivity | Specificity | Precision | Accuracy |
|---|---|---|---|---|---|---|---|---|
| 0.50 default | 60 | 13 | 12 | 126 | 82.2% | 91.3% | 83.3% | 88.2% |
| 0.29 sensitivity-oriented | 64 | 9 | 19 | 119 | 87.7% | 86.2% | 77.1% | 86.7% |
Result. The 0.29 threshold detects four additional positives in this testing subset, while creating seven additional false-positive calls. Which trade-off is acceptable depends on whether the next step is inexpensive prioritization or a consequential decision.
Illustrative exported-model calculation
The descriptor vector packaged with the export returns a score of 0.11151. It is below both demonstrated thresholds and is therefore assigned to the not-readily-biodegradable class in either scenario.
The vector is not a row of the published table and has no supplied chemical identifier. It demonstrates the software interface only; it is not an extra validation compound.
Classification: not readily biodegradable at 0.50 and 0.29.
Reproduce the calculation
The Python package includes the exact model, ordered input schema, illustrative descriptor vector and expected score. The Neural Designer package preserves the split, trained parameters and regenerated analyses.
from model import NeuralNetwork
score = NeuralNetwork().calculate_outputs(descriptors)[0]
screening_class = int(score >= 0.50)8. Validity, uncertainty and limitations
- Internal random split only. The 633/211/211 partition does not test generalization to unseen scaffolds, chemical families or a later external collection.
- No applicability domain. The project does not define leverage, similarity, descriptor-range or structural-alert criteria for accepting a prediction.
- Incomplete chemical traceability. The UCI table does not include CAS numbers, SMILES, structures, assay-level metadata or the descriptor-calculation implementation required to reproduce a prediction from a named substance.
- Endpoint abstraction. The binary target aggregates source ready-biodegradability outcomes; it is not a direct simulation of one fully documented OECD 301 protocol.
- Uncalibrated scores. The sigmoid output is useful for ranking and thresholding but is not demonstrated to be a calibrated probability.
- Training/checkpoint risk. Selection error is lowest near epoch 16, whereas the stored export comes from the later final epoch.
- Regulatory boundary. OECD guidance expects a defined endpoint and algorithm, an applicability domain, appropriate predictivity measures and, where possible, mechanistic interpretation. This tutorial does not satisfy that complete package.
References
- UCI Machine Learning Repository: QSAR biodegradation.
- Mansouri K, Ringsted T, Ballabio D, Todeschini R, Consonni V. Quantitative Structure–Activity Relationship Models for Ready Biodegradability of Chemicals. Journal of Chemical Information and Modeling. 2013;53(4):867–878.
- OECD Test No. 301: Ready Biodegradability.
- OECD Guidance Document on the Validation of (Q)SAR Models.
- Sahigara F et al. Comparison of different approaches to define the applicability domain of QSAR models. Molecules. 2012;17:4791–4810.




