A YOLO-based deep learning model for detecting atoms and bonds in 2D molecular structure images.
ABD-Model is a YOLO-based deep learning model designed to detect atoms (e.g., C, O, H, N) and bond types (single, double, triple) in molecular structure images. It extracts structured, machine-readable data from 2D molecular representations — making it a useful building block for computational chemistry pipelines, cheminformatics tools, and automated structure recognition workflows.
| Feature | Description |
|---|---|
| 🔬 Atom Detection | Detects atoms such as Carbon (C), Oxygen (O), Nitrogen (N), and Hydrogen (H) in molecular images |
| ⚛️ Bond Detection | Identifies single, double, and triple bonds between atoms |
| 🖼️ Versatility | Works across a wide variety of molecular structure image styles |
| ⚡ YOLO-Based | Fast, accurate, single-pass object detection |
| 🌍 Open Source | Easy to integrate, extend, and customize for your own projects |
- Python 3.x
- PyTorch
- OpenCV (for image processing)
- NumPy
- Additional dependencies listed in
requirements.txt
Install all dependencies with:
pip install -r requirements.txt1. Clone this repository
git clone https://github.com/Safi-ullah-majid/ABD-model.git
cd ABD-model2. Install dependencies
pip install -r requirements.txt3. Download the model weights
Download the ABD.pt model file and place it in the correct directory (see project structure below).
Run predictions using the predict.py script:
python predict.py --input_path path/to/image.pngBefore running, make sure:
- ✅ The input image is in
.pngformat - ✅ The model file (
ABD.pt) is present and loads correctly - ✅ The input image is a valid
.pngfile representing a molecular structure
python predict.py --input_path examples/aspirin.pngABD-model/
├── ABD.pt # Pretrained model weights
├── predict.py # Inference script
├── requirements.txt # Python dependencies
├── LICENSE # MIT License
└── README.md # Project documentation
Contributions, issues, and feature requests are welcome! Feel free to check the issues page or open a pull request.
This repository is licensed under the MIT License — see the LICENSE file for details.
Made with 🧪 by Safi Ullah Majid
