GitHub - fraware/leanverifier: Framework for specifying and proving properties—such as robustness, fairness, and interpretability—of machine learning models using Lean 4.
Mar 23, 2025 - github.com
The "Formal Verification of Machine Learning Models in Lean" project offers a framework for specifying and proving properties of machine learning models using Lean 4. It focuses on ensuring reliability and fairness in high-stakes applications like healthcare and finance. The project includes a Lean library with formal definitions for various models and properties, a Python-based model translator for exporting trained models to Lean code, a web interface for model uploads and verification, and a CI/CD pipeline for reproducible builds using Docker and GitHub Actions.
Key features of the project include formal verification of model properties such as adversarial robustness and fairness, support for advanced models like ConvNets and Transformers, and an interactive web portal for model visualization and proof compilation. Users can quickly start by cloning the repository, building a Docker image, and accessing the web interface. Contributions are encouraged, and the project is licensed under the MIT License.
Key takeaways:
Formal verification of machine learning models using Lean 4 ensures reliability and fairness in high-stakes applications.
The project includes a Lean library with formal definitions for various ML models and properties like robustness and fairness.
A Python-based model translator and a Flask web interface facilitate model verification and visualization.
A Dockerized CI/CD pipeline with GitHub Actions ensures reproducible builds and deployments.