CoolFace
Apppublic

rasayan-labs/rasayan-tox21

sourceHugging Faceapache-2.0updated 8mo agoView on Hugging Face
3likes
App README

Rasayan Tox21 Classifier

<p align="center"> <img src="https://img.shields.io/badge/Tox21-Challenge-red" alt="Tox21"> <img src="https://img.shields.io/badge/Architecture-SNN-blue" alt="SNN"> <img src="https://img.shields.io/badge/Endpoints-12-green" alt="12 Endpoints"> <img src="https://img.shields.io/badge/License-Apache_2.0-yellow" alt="License"> </p>

A production-ready Self-Normalizing Neural Network (SNN) ensemble for predicting molecular toxicity across the 12 Tox21 Challenge endpoints. Built for the ml-jku Tox21 Leaderboard.

Model Overview

PropertyValue
Architecture10-fold ensemble of SNNs
Parameters~19M total
Hidden Layers8 layers × 768 units
ActivationSELU + AlphaDropout
Training300 epochs, 40-fold CV
CV AUC0.882 ± 0.021

Molecular Features (11,377 total)

Feature TypeDimensionsDescription
ECFP68,192Extended-connectivity fingerprints (radius 3)
MACCS Keys167Structural keys for substructure screening
RDKit Descriptors208Physicochemical properties (LogP, TPSA, MW, etc.)
Toxicophores1,868SMARTS-based toxicity structural alerts
Structural Filters815PAINS, BRENK, NIH, ZINC filter alerts
Target Similarity127Tanimoto similarity to known receptor ligands

Training Details

  • —Loss Function: Focal Loss (γ=2.5, α=0.25) for class imbalance
  • —Regularization: Label smoothing (0.1), Mixup augmentation (α=0.2)
  • —Feature Selection: Variance-based selection per fold (ECFP, toxicophores)
  • —Normalization: SquashScaler (StandardScaler → tanh → StandardScaler)
  • —Ensemble Selection: Top-10 folds from 40-fold stratified CV

Tox21 Endpoints

Nuclear Receptor Panel

EndpointTargetBiological Significance
NR-ARAndrogen ReceptorMale reproductive toxicity
NR-AR-LBDAR Ligand Binding DomainDirect AR modulation
NR-AhRAryl Hydrocarbon ReceptorDioxin-like toxicity, carcinogenesis
NR-AromataseCYP19A1 EnzymeEstrogen synthesis disruption
NR-EREstrogen ReceptorEndocrine disruption
NR-ER-LBDER Ligand Binding DomainDirect ER modulation
NR-PPAR-gammaPPARγMetabolic disruption

Stress Response Panel

EndpointTargetBiological Significance
SR-AREAntioxidant Response ElementOxidative stress
SR-ATAD5ATAD5DNA damage response
SR-HSEHeat Shock ElementProtein folding stress
SR-MMPMitochondrial Membrane PotentialMitochondrial toxicity
SR-p53Tumor Protein p53Genotoxicity

API Endpoints

EndpointMethodDescription
/metadataGETModel configuration and capabilities
/predictPOSTToxicity predictions for SMILES
/healthGETHealth check

Usage

Python

python
import requests

response = requests.post(
    "https://rasayan-labs-rasayan-tox21.hf.space/predict",
    json={"smiles": ["CC(=O)Nc1ccc(O)cc1", "c1ccccc1"]}
)

predictions = response.json()["predictions"]
for smiles, scores in predictions.items():
    print(f"{smiles}:")
    for target, prob in sorted(scores.items(), key=lambda x: -x[1])[:3]:
        print(f"  {target}: {prob:.1%}")

cURL

bash
curl -X POST "https://rasayan-labs-rasayan-tox21.hf.space/predict" \
  -H "Content-Type: application/json" \
  -d '{"smiles": ["CCO", "c1ccccc1"]}'

Response Format

json
{
  "predictions": {
    "CCO": {
      "NR-AR": 0.041,
      "NR-AR-LBD": 0.040,
      "NR-AhR": 0.049,
      "NR-Aromatase": 0.078,
      "NR-ER": 0.133,
      "NR-ER-LBD": 0.076,
      "NR-PPAR-gamma": 0.058,
      "SR-ARE": 0.100,
      "SR-ATAD5": 0.038,
      "SR-HSE": 0.066,
      "SR-MMP": 0.082,
      "SR-p53": 0.052
    }
  },
  "model_info": {
    "name": "Rasayan Tox21 SNN Ensemble",
    "version": "1.0.0"
  }
}

Interpretation Guide

ProbabilityRisk LevelRecommendation
< 0.2MinimalUnlikely to be active
0.2 - 0.4LowMonitor for chronic exposure
0.4 - 0.7ModerateFurther investigation warranted
≥ 0.7HighStrong toxicity signal

References

License

Apache 2.0


<p align="center"> Built by <a href="https://rasayan.ai">Rasayan Labs</a> </p>