{"id":38692653,"url":"https://github.com/squaredev-io/xai-tango","last_synced_at":"2026-01-17T10:35:11.958Z","repository":{"id":251749606,"uuid":"838323347","full_name":"squaredev-io/xai-tango","owner":"squaredev-io","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-26T17:52:28.000Z","size":20503,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T18:38:20.806Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/squaredev-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-05T12:09:14.000Z","updated_at":"2024-11-25T15:35:34.000Z","dependencies_parsed_at":"2024-08-05T14:18:36.475Z","dependency_job_id":"3b6ed96b-87c5-4f56-99a8-6f44ddfb7147","html_url":"https://github.com/squaredev-io/xai-tango","commit_stats":null,"previous_names":["squaredev-io/xaivision_fmake","squaredev-io/xai-tango"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/squaredev-io/xai-tango","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squaredev-io%2Fxai-tango","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squaredev-io%2Fxai-tango/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squaredev-io%2Fxai-tango/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squaredev-io%2Fxai-tango/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/squaredev-io","download_url":"https://codeload.github.com/squaredev-io/xai-tango/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squaredev-io%2Fxai-tango/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28506589,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T10:25:30.148Z","status":"ssl_error","status_checked_at":"2026-01-17T10:25:29.718Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-17T10:35:11.875Z","updated_at":"2026-01-17T10:35:11.943Z","avatar_url":"https://github.com/squaredev-io.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Explainable AI (XAI)\n\n## Introduction\n\nThis repository contains explainable AI pipelines and functions that provide insightful visualizations and explanations for models across various domains, including computer vision and financial applications.\n\nThe tools and algorithms offered in this repository aim to enhance transparency in AI models by identifying and explaining feature contributions, uncovering patterns, and providing a deeper understanding of model behavior.\n\n## How to Run the Applications\n\n### Individual Apps\nYou can run the vision-focused or banking-focused apps independently:\n\n1. **Banking Application**:\n   ```bash\n   streamlit run xai_banking/app.py\n   ```\n2. **Vision Application**:\n   ```bash\n   streamlit run main_page.py\n   ```\n\n### Multipage App\nIf you want to run a combined app for both vision and banking functionalities, use the multipage application:\n    ```bash\n    streamlit run multi_app/main.py\n    ```\n\nThe multipage app provides a single interface to select between Banking Pilot and Fmake Pilot, dynamically loading the respective application.\n\n## Environment Setup\nTo ensure a smooth setup and execution of the repository, follow these steps:\n\n1. Clone the Repository\nClone this repository to your local machine:\n\n    ```bash\n    git clone \u003crepository-url\u003e\n    cd \u003crepository-name\u003e \n    ```\n\n2. Set Up Conda Environment\nCreate a Conda environment with all necessary dependencies:\n\nCreate the environment:\n    ```bash\n    conda create --name xai_env python=3.11 -y\n    ```\nActivate the environment:\n    ```bash\n    conda activate xai_env\n    ```\nInstall dependencies:\n    ```bash\n    pip install -r requirements.txt\n    ```\n\n## Build and run Docker\n\n1. To build and run the Streamlit application using Docker, follow these steps:\n\n    Build the Docker Image:\n        ```bash\n        docker build -t xai-app . -f streamlit.Dockerfile\n        ```\n\n    Run the Docker Container:\n        ```bash\n        docker run -d -p 8501:8501 --name xai-container --env-file .env xai-app\n        ```\n\n2. To build and run the FastAPI service using Docker, follow these steps:\n\n    Build the Docker Image:\n            ```bash\n            docker build -t xai-api -f api.Dockerfile .\n            ```\n\n    Build the Docker Image:\n            ```bash\n            docker run -d -p 8000:8000 --name api-container --env-file .env xai-api\n            ```\n\n3. Creating the .env File\n\n    Both the Streamlit app and the FastAPI service rely on environment variables defined in a .env file. Below is an example of how to create the .env file:\n\n    ```bash\n    # Paths for Banking Models and Data\n    BANKING_MODEL_PATH=xai_banking/utils/random_forest_model.pkl\n    BANKING_DATA_PATH=xai_banking/utils/synthetic_dataset.csv\n\n    # Paths for Vision Models and Data\n    VISION_MODEL_PATH=xaivision/model.onnx\n    VISION_DATA_PATH=xaivision/data1.h5\n\n    # API Key for FastAPI\n    API_KEYS=[\"Your preference API key\"]\n\n    # Token for Streamlit Authentication\n    STREAMLIT_TOKEN=\"Your preference Streamlit token\"\n    ```\n\n## General Use Tools\n\nThe general use tools that are currently offered in the repository are listed in the table below.\n\n\n| Tool                       | Description                                                                                  | Applicable Domain         |\n|----------------------------|----------------------------------------------------------------------------------------------|---------------------------|\n| Model Details              | Visualize the model architecture with details about total parameters and number of operations. | Vision, Banking           |\n| Sample Details             | Display input with the estimated output of the model.                                        | Vision, Banking           |\n| Convolution Layers Activation | Display the values of the convolutional layers stacked together.                             | Vision                    |\n| Independent Components     | Split the input into independent components to identify patterns.                            | Vision                    |\n| Preprocessed Data Overview | Visualize and inspect preprocessed data, such as encoded features or transformed datasets.    | Banking                   |\n| Feature Contributions      | Analyze the impact of specific features (e.g., categorical or numerical) on model predictions.| Banking                   |\n\n\n## Algorithms\n\nThe XAI algorithms currently offered in the repository are listed in the table below:\n\n| Tool                       | Description                                                                                  | Applicable Domain         |\n|----------------------------|----------------------------------------------------------------------------------------------|---------------------------|\n| Model Details              | Visualize the model architecture with details about total parameters and number of operations. | Vision, Banking           |\n| Sample Details             | Display input with the estimated output of the model.                                        | Vision, Banking           |\n| Convolution Layers Activation | Display the values of the convolutional layers stacked together.                             | Vision                    |\n| Independent Components     | Split the input into independent components to identify patterns.                            | Vision                    |\n| Preprocessed Data Overview | Visualize and inspect preprocessed data, such as encoded features or transformed datasets.    | Banking                   |\n| Feature Contributions      | Analyze the impact of specific features (e.g., categorical or numerical) on model predictions.| Banking                   |\n\n\n## Banking-Specific Features\n\nThe repository now includes additional features and tools tailored for financial and banking applications:\n\n### Tools\n\n| Tool                     | Description                                                                                  |\n|--------------------------|----------------------------------------------------------------------------------------------|\n| Lime Explanation Viewer  | Visualize feature contributions for individual predictions using LIME.                      |\n| SHAP Explanation Viewer  | Display global and local feature contributions using SHAP visualizations.                   |\n| Top Features Viewer      | Highlight the top contributing features for a given prediction.                             |\n| Data Preprocessing Tools | Preprocess and encode financial datasets for explainability tasks.                          |\n\n### Visualizations\n\n| Visualization          | Description                                                                                      |\n|------------------------|--------------------------------------------------------------------------------------------------|\n| Bar Chart (LIME)       | Display the contribution of each feature for an individual prediction using LIME.               |\n| SHAP Summary Plot      | Visualize the global feature importance and contribution distributions.                         |\n| SHAP Waterfall Plot    | Show the breakdown of individual feature contributions for a specific instance.                 |\n| SHAP Heatmap Plot      | Highlight patterns and clusters of feature contributions across multiple data points.           |\n| SHAP Beeswarm Plot     | Combine feature importance and distribution across data points for global insights.             |\n\n\n## Applications\nThis repository supports two primary domains:\n\n1. Vision Models:\n\n- Explainability for image classification models.\n- Focus on pixel-level contributions and visual feature activations.\n- Tools: Vision SHAP, Integrated Gradients, DeepLift.\n\n2. Banking Models:\n\n- Explainability for financial and tabular data models.\n- Feature-level analysis for predictions, such as fraud detection and credit scoring.\n- Tools: LIME, SHAP, Preprocessed Data Overview, Feature Contributions.\n\n\n## How to Use\n1. Select the Application:\n\n- For vision tasks, use tools like Vision SHAP and Integrated Gradients.\n- For banking tasks, use tools like LIME and SHAP Explanation Viewers.\n\n2. Visualize and Interpret:\n\n- Explore detailed visualizations, such as SHAP Summary and Waterfall plots for banking models, or pixel-level explanations for vision models.\n\n3. Extend the Framework:\n\nAdd custom explainability tools or algorithms for other domains as needed.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquaredev-io%2Fxai-tango","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsquaredev-io%2Fxai-tango","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquaredev-io%2Fxai-tango/lists"}