Skip to content

Latest commit

Β 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

βš—οΈ ReactionNet - Chemical Reactivity Prediction with Deep Learning

πŸ‡ͺπŸ‡Έ Resumen: Red Neuronal Siamesa diseΓ±ada para predecir la reactividad quΓ­mica entre pares de elementos. Logra mΓ‘s del 96% de precisiΓ³n utilizando embeddings de propiedades atΓ³micas.

πŸ‡¬πŸ‡§ English Profile: Siamese Neural Network architecture designed to predict chemical reactivity between element pairs. Achieves over 96% accuracy using atomic property embeddings.

Python PyTorch License Status

DeepLearning models to predict if two chemical elements will react with each other.

🎯 Project Overview

ReactionNet uses Siamese Neural Networks to predict chemical reactivity between element pairs. The project includes:

  • βœ… Two trained models (V1 and V2) with 96%+ accuracy
  • βœ… 10,000 reaction pairs from real scientific literature
  • βœ… Interactive web demo
  • βœ… Complete training notebooks for Google Colab
  • βœ… Both PyTorch and ONNX formats

πŸ“Š Model Performance

Model Accuracy F1-Score AUC-ROC Parameters
V1 (Recommended) 96.07% 96.11% 0.9950 39K
V2 (Transfer Learning) 95.67% 95.68% 0.9940 150K

Winner: ReactionNet V1 - simpler, faster, and more accurate! ✨

πŸš€ Quick Start

Option 1: Try the Web Demo

Open demo/index.html in your browser for an instant interactive experience.

Option 2: Use Pre-trained Models

Python with PyTorch:

import torch

# Load model
model = ReactionNetV1()
model.load_state_dict(torch.load('models/reactionnet_v1.pth'))
model.eval()

# Predict (example: Na + Cl)
elem1 = torch.tensor([[0.085, 0.077, 0.233, 0.031, 0.206, 0.056, 0.286, 0.0]])
elem2 = torch.tensor([[0.131, 0.118, 0.790, 0.117, 0.531, 0.944, 0.429, 0.333]])

probability = model(elem1, elem2)
print(f"Reaction probability: {probability.item():.4f}")

Python with ONNX:

import onnxruntime as ort
import numpy as np

session = ort.InferenceSession('models/reactionnet_v1.onnx')
result = session.run(None, {'element_1': elem1, 'element_2': elem2})
print(f"Probability: {result[0][0][0]:.4f}")

Option 3: Train Your Own

  1. Open notebooks/ReactionNet_V1_Training.ipynb in Google Colab
  2. Upload data/reaction_pairs_lite.json
  3. Run all cells
  4. Download your trained model

πŸ“ Repository Structure

ReactionNet_GitHub_Package/
β”œβ”€β”€ models/               # Trained models (V1 and V2)
β”‚   β”œβ”€β”€ reactionnet_v1.pth
β”‚   β”œβ”€β”€ reactionnet_v1.onnx
β”‚   β”œβ”€β”€ reactionnet_v2.pth
β”‚   └── reactionnet_v2.onnx
β”‚
β”œβ”€β”€ data/                 # Training datasets
β”‚   β”œβ”€β”€ reaction_pairs_lite.json (10K pairs)
β”‚   β”œβ”€β”€ inorganic_reactions_curated.json (5K reactions)
β”‚   └── periodic_table_master.json (130 elements)
β”‚
β”œβ”€β”€ results/              # Training reports and metrics
β”‚   β”œβ”€β”€ v1/              # V1 results
β”‚   └── v2/              # V2 results
β”‚
β”œβ”€β”€ demo/                 # Interactive web demo
β”‚   └── index.html
β”‚
β”œβ”€β”€ notebooks/            # Training notebooks
β”‚   β”œβ”€β”€ ReactionNet_V1_Training.py
β”‚   └── ReactionNet_V2_Training.py
β”‚
└── docs/                 # Documentation
    β”œβ”€β”€ MODEL_COMPARISON.md
    β”œβ”€β”€ TRAINING_GUIDE.md
    └── API_REFERENCE.md

πŸ”¬ Scientific Approach

Input Features (8 per element)

  1. Atomic number (normalized)
  2. Atomic mass (normalized)
  3. Pauling electronegativity
  4. Allen electronegativity
  5. First ionization energy
  6. Group number
  7. Period number
  8. Block (s/p/d/f)

Model Architecture

  • Type: Siamese Neural Network with Attention
  • Encoder: 8 β†’ 128 β†’ 64
  • Attention: Learnable weights
  • Fusion: Concatenate β†’ 128 β†’ 64 β†’ 32 β†’ 1
  • Output: Sigmoid (reaction probability)

Training Details

  • Dataset: 10,000 balanced pairs (50% positive, 50% negative)
  • Source: Real reactions from CederGroup database
  • Optimizer: AdamW with weight decay
  • Scheduler: ReduceLROnPlateau
  • Early Stopping: 25 epochs patience

πŸ“– Documentation

πŸŽ“ Citation

If you use this work in your research, please cite:

@software{speranza2026reactionnet,
  author = {Speranza, Maximiliano Rodrigo},
  title = {ReactionNet: Chemical Reactivity Prediction with Deep Learning},
  year = {2026},
  url = {https://github.com/SperanzaMax/reactionnet}
}

πŸ“ˆ Future Work

  • Expand to organic reactions
  • Predict specific reaction products
  • Add temperature/pressure conditions
  • Multi-reactant support (3+ elements)
  • Reaction mechanism prediction

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

πŸ“„ License

MIT License - see LICENSE file for details

πŸ‘€ Author

Maximiliano Rodrigo Speranza
Email: maximiliano.speranza@gmail.com
Date: January 2026


⭐ If you find this useful, please star the repo!

About

🎯 Project Overview ReactionNet uses Siamese Neural Networks to predict chemical reactivity between element pairs.

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages