PhaseNet is a deep learning project designed to classify molecular dynamics simulation snapshots into Solid (Crystalline) or Liquid (Amorphous) phases. Leveraging the power of Computer Vision and High-Performance Computing (HPC), it uses a ResNet-18 Convolutional Neural Network (CNN) trained via Distributed Data Parallel (DDP) techniques.
This tool automates the identification of phase states in atomic simulations, specifically focusing on Copper (Cu) atoms. It replaces manual inspection with a robust deep learning model capable of distinguishing between:
- Solid Phase: Characterized by Face-Centered Cubic (FCC) symmetry.
- Liquid Phase: Characterized by disordered, amorphous atomic arrangements.
- HPC-Ready Training: Implements PyTorch Distributed Data Parallel (DDP) to scale training across multiple GPUs.
- LAMMPS Simulation: Uses real molecular dynamics simulations of melting Copper to generate the primary training dataset.
- Synthetic Test Data: Includes OVITO scripts to generate "dummy" snapshots for rapidly testing the model pipeline.
- Interactive Web App: A Streamlit-based user interface for real-time inference.
The project is structured into three main modules:
- Simulation & Training Data (
simulation/&data/):- Raw Data:
simulation/containsin.melt_copper(LAMMPS input) andmelt.lammpstrj(Trajectory), which simulates the melting process of Copper. - Training Set:
data/train/contains the processed snapshots used to train the model. Note: This folder is generated from the simulation files and is not included in the repo.
- Raw Data:
- Training Pipeline (
src/):train_ddp.py: The main training script usingtorchrun. It loads data fromdata/train.model.py: Defines the ResNet-18 architecture.
- Inference & Testing (
generation/&app/):- Data Processing:
render_snapshots.pyconverts raw LAMMPS trajectories into labeled PNG snapshots for training. - Dummy Data:
ovito_dummy_data_gen.pygenerates synthetic test images (FCC lattices and random liquids) intodummy_data/for rapid interface testing. - App:
main.pyis the Streamlit web interface.
- Data Processing:
- OS: Linux (Recommended for HPC)
- Python: 3.8+
- CUDA: Enabled GPU (for training)
- OVITO: Required for running data generation scripts.
Navigate to the project directory and install the required Python packages:
cd PhaseNet
pip install -r requirements.txtSince the large training dataset is not version-controlled, you must generate it from the raw simulation trajectory:
python generation/render_snapshots.pyThis script processes simulation/melt.lammpstrj and populates the data/train/ directory with labeled solid and liquid snapshots.
Train the model using the dataset generated in data/train. The following command runs training on a single node with 2 GPUs.
torchrun --nproc_per_node=2 src/train_ddp.py- Input: Data from
data/train. - Output: Saves weights to
models/crystalline_classifier.pt.
To verify the web app works without needing raw simulation files, you can generate synthetic "dummy" snapshots.
python generation/ovito_dummy_data_gen.py- Output: Creates
ovito_solid_test.pngandovito_liquid_test.pngin~/PhaseNet/dummy_data. - Use Case: Upload these images to the web app to check if the model correctly classifies them.
Launch the inference interface.
streamlit run app/main.pyOpen your browser to the URL provided. Upload images from dummy_data/ or your own simulation snapshots to get a classification.
The model shows rapid convergence due to the distinct visual features of ordered vs. disordered states.
Rapid decrease in loss indicates effective learning of the phase boundaries.
Developer: Anson Antony
Institution: TU Bergakademie Freiberg
Contact: hello@ansonantony.tech
© 2026 PhaseNet Project



