Abstract
OmniXAI is an open-source Python library that provides a unified, "omni-way" interface for Explainable AI (XAI). It simplifies the process of interpreting machine learning models by supporting multiple data types (tabular, image, text, time-series) and a vast array of explanation methods—from feature attribution to counterfactuals—across the entire ML development lifecycle.
Introduction
As machine learning models, particularly deep learning architectures, become more complex, they increasingly function as "black boxes." This lack of transparency creates a "trust gap" that hinders the adoption of AI in high-stakes fields like healthcare, finance, and education. While many XAI tools exist, they are often fragmented; a researcher might use one library for image saliency maps and another for tabular counterfactuals. This fragmentation forces practitioners to write boilerplate code for different interfaces and makes it difficult to compare different explanation techniques side-by-side. OmniXAI addresses this by providing a comprehensive, unified framework that works from data exploration through to model deployment.
System Architecture and Methods
The core innovation of OmniXAI is its unified interface and modular architecture, designed to handle the entire machine learning pipeline.
The library categorizes explainers into four main groups:
- Model-agnostic: Methods like LIME, SHAP, and Partial Dependence Plots (PDP) that treat the model as a black box.
- Model-specific: Methods that require internal model knowledge (e.g., gradients), such as Integrated Gradients (IG) and Grad-CAM for neural networks.
- Counterfactual: Methods that explain a decision by showing the smallest change needed to flip the outcome (e.g., "If your income were $5k higher, the loan would be approved").
- Data-centric: Tools for exploratory data analysis (EDA) to detect feature correlations and imbalances before a model is even trained.
The "Omni-way" Workflow
OmniXAI introduces the AutoExplainer, a factory-style class that allows users to initialize multiple explanation methods simultaneously with just a few lines of code. This significantly reduces the overhead of manual configuration.
The library also includes a built-in GUI dashboard, powered by Plotly Dash, for interactive visualization and comparison of these explanations. This allows users to aggregate figures and build a cohesive layout for model assessment.
Experimental Evaluation
The library's utility is demonstrated through four diverse experimental setups:
- Tabular Data: Using the Adult dataset (Census Income) to predict income levels.
- Computer Vision: Employing a pretrained ResNet-50 on ImageNet for classification.
- Natural Language Processing: Sentiment analysis on the IMDB dataset using a Text CNN.
- Time-Series: Anomaly detection on univariate synthetic and standard datasets.
Key Results
The evaluation provides a qualitative "tour" of the library's capabilities:
- Complementary Views: In tabular experiments, combining LIME/SHAP (local importance) with PDP (global trends) and MACE (what-if scenarios) provides a richer understanding than any single method.
- Granular Vision Explanations: By comparing Grad-CAM across different layers of a ResNet, developers can observe how features evolve from low-level textures to high-level objects.
- Ease of Use: A full suite of local and global explanations can be generated and launched in a dashboard with approximately 10-15 lines of Python code.
Discussion and Key Insights
OmniXAI's "Omni-way" approach distinguishes it from libraries that focus solely on post-hoc explanations by supporting the entire pipeline, including data exploration and feature engineering. It is also one of the few libraries to provide model-agnostic feature attribution specifically for learning-to-rank models. Furthermore, it integrates state-of-the-art algorithms like MACE for counterfactuals and Polyjuice for NLP-based linguistic triggers.
Limitations and Future Work
Despite its breadth, OmniXAI faces challenges. Some methods, like the Contrastive Explanation Method (CEM), currently only support differentiable models due to the high computational cost of numerical gradients for black-box models. Additionally, while the library helps visualize potential biases, it is not an automated bias detector and requires human expertise for interpretation. Future work will focus on adding support for mislabeled sample detection, more specialized NLP/time-series algorithms, and further GUI enhancements.
Summary updated