CoolFace
Apppublic

DanielEmeka/FormationEnergyPredictor

sourceHugging Faceupdated 1y agoView on Hugging Face
1likes
App README

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

๐Ÿ“˜ Formation Energy Predictor

FormationEnergyPredictor is a machine learning web application that predicts the formation energy (eV/atom) of perovskite-based materials using their atomic and physical properties. It also classifies the material as Stable, Metastable, or Unstable, helping materials scientists rapidly screen novel compositions for energy, electronics, and photovoltaic applications.

๐ŸŒ Live App on Hugging Face Spaces


๐Ÿ”ฌ What It Does

  • โ€”Takes in a materialโ€™s A site, B site, and X site elements and a few physical properties
  • โ€”Predicts the formation energy using a trained machine learning model
  • โ€”Classifies material stability:
  • โ€”๐ŸŸข Stable (low/negative formation energy)
  • โ€”๐ŸŸก Metastable (near-zero formation energy)
  • โ€”๐Ÿ”ด Unstable (positive formation energy)
  • โ€”Visualizes the result on a stability scale

๐Ÿ—๏ธ How It Was Built

This project was built using:

  • โ€”Python & Scikit-learn: for training a Gradient Boosting model
  • โ€”Gradio: for building the web interface
  • โ€”Matplotlib: to visualize formation energy in a stability chart
  • โ€”Hugging Face Spaces: to host the application online

๐Ÿ”ง Workflow

  1. 1.Data Source: A curated dataset of perovskite materials with elemental properties and formation energies.
  2. 2.Feature Engineering:
  • โ€”Selected top features including:
  • โ€”A site #1, B site #1, X site
  • โ€”Number of elements
  • โ€”Density_AB_avg
  • โ€”Ionization Energy_AB_avg
  • โ€”Atomic Volume_AB_avg
  • โ€”Modeling:
  • โ€”Used GradientBoostingRegressor inside a preprocessing pipeline
  • โ€”Trained with 80/20 train-test split and achieved a good Rยฒ score
  • โ€”Deployment:
  • โ€”Packaged with gradio and deployed to Hugging Face using requirements.txt

๐Ÿง  Use Case & Problem Solved

๐Ÿšง Challenge:

In materials science, discovering new stable compounds is time-consuming and expensive. Researchers often simulate or synthesize hundreds of compositions before finding one that works.

โœ… This app solves:

  • โ€”Fast pre-screening of candidate perovskite materials
  • โ€”Prediction of stability before physical experiments or simulations
  • โ€”Reduction in cost and time spent on unstable materials
  • โ€”Supports green energy and optoelectronic research

โ–ถ๏ธ How to Use

  1. 1.Visit the app: FormationEnergyPredictor on Hugging Face
  2. 2.Fill in:
  • โ€”A site element (e.g., Na)
  • โ€”B site element (e.g., Ti)
  • โ€”X site element (e.g., O)
  • โ€”Additional properties like density, ionization energy, etc.
  • โ€”Click Submit
  • โ€”View:
  • โ€”Formation energy prediction (eV/atom)
  • โ€”Stability classification
  • โ€”Visual chart showing result

๐Ÿ’ก Examples to Try

A siteB siteX siteIonization EnergyStability
NaTiO640๐ŸŸข Stable
CsSnI700๐ŸŸก Metastable
LiPbBr850๐Ÿ”ด Unstable

๐Ÿ“Œ Key Feature Insights

From the trained model, these features were found most important:

  • โ€”Ionization Energy โ€” higher values lead to instability
  • โ€”Density and Atomic Volume โ€” influence bonding compactness
  • โ€”A, B, X site identity โ€” define lattice behavior in perovskites

๐Ÿ”ฎ Future Improvements

  • โ€”Add support for ABXโ‚‚ and double perovskite structures
  • โ€”Enable batch predictions via file upload
  • โ€”Integrate SHAP or permutation importance plots for full explainability
  • โ€”Add default dropdown menus and example presets

๐Ÿง‘โ€๐Ÿ”ฌ Author

Daniel Emeka Physicist | Nanomaterials Researcher | Machine Learning Enthusiast Built for material discovery and sustainability-driven innovation.