ExplainabilityTransparencyTrustworthinesscs.LG
nn2poly: An R Package for Converting Neural Networks into Interpretable Polynomials
Pablo Morala, Jenny Alexandra Cifuentes, Rosa E. Lillo, Iñaki Ucar
June 3, 2024
arXiv.org
Key Takeaways
-
Neural networks can be converted into human-readable polynomial equations that make the same predictions as the original model, offering a practical alternative to "black box" AI systems that are difficult to understand.
-
The method captures variable interactions, which the paper identifies as "a key aspect usually missing from most Explainable Artificial Intelligence (XAI) methods"—meaning it can reveal not just which factors matter, but how they work together to influence outcomes.
-
The approach is computationally efficient compared to other explanation methods, avoiding "expensive computations that can be amplified when used on large neural networks," making it practical for real-world applications.
-
The tool is designed for accessibility, integrating with popular R programming frameworks (TensorFlow and Torch) and providing user-friendly visualization methods, enabling practitioners without deep technical expertise to interpret neural network decisions.
-
Polynomial representations enable direct inspection of variable importance, allowing stakeholders to see through the polynomial coefficients exactly how each input variable and its combinations affect the AI system's predictions.
Abstract
The nn2poly package provides the implementation in R of the NN2Poly method to explain and interpret feed-forward neural networks by means of polynomial representations that predict in an equivalent manner as the original network.Through the obtained polynomial coefficients, the effect and importance of each variable and their interactions on the output can be represented. This capabiltiy of capturing interactions is a key aspect usually missing from most Explainable Artificial Intelligence (XAI) methods, specially if they rely on expensive computations that can be amplified when used on large neural networks. The package provides integration with the main deep learning framework packages in R (tensorflow and torch), allowing an user-friendly application of the NN2Poly algorithm. Furthermore, nn2poly provides implementation of the required weight constraints to be used during the network training in those same frameworks. Other neural networks packages can also be used by including their weights in list format. Polynomials obtained with nn2poly can also be used to predict with new data or be visualized through its own plot method. Simulations are provided exemplifying the usage of the package alongside with a comparison with other approaches available in R to interpret neural networks.