A python SDK for Deep Learning Backtrace
Project description
AryaXai-Backtrace
Backtrace module for Generating Explainability on Deep learning models using TensorFlow / Pytorch
Backtrace Module
Overview
The Backtrace Module is a powerful and patent-pending algorithm developed by AryaXAI for enhancing the explainability of AI models, particularly in the context of complex techniques like deep learning.
Features
-
Explainability: Gain deep insights into your AI models by using the Backtrace algorithm, providing multiple explanations for their decisions.
-
Consistency: Ensure consistent and accurate explanations across different scenarios and use cases.
-
Mission-Critical Support: Tailored for mission-critical AI use cases where transparency is paramount.
Installation
To integrate the Backtrace Module into your project, follow these simple steps:
pip install dl-backtrace
Usage
Tensoflow-Keras based models
from dl_backtrace.tf_backtrace import Backtrace as B
Pytorch based models
from dl_backtrace.pytorch_backtrace import Backtrace as B
Evalauting using Backtrace:
- Step - 1: Initialize a Backtrace Object using your Model
backtrace = B(model=model)
- Step - 2: Calculate layer-wise output using a data instance
layer_outputs = backtrace.predict(test_data[0])
- Step - 3: Calculate layer-wise Relevance using Evaluation
relevance = backtrace.eval(layer_outputs,mode='default',scaler=1,thresholding=0.5,task="binary-classification")
Depending on Task we have several attributes for Relevance Calculation in Evalaution:
Attribute | Description | Values |
---|---|---|
mode | evaluation mode of algorithm | { default, contrastive} |
scaler | Total / Starting Relevance at the Last Layer | Integer ( Default: None, Preferred: 1) |
thresholding | Thresholding Model Prediction in Segemntation Task to select Pixels predicting the actual class. (Only works in Segmentation Tasks) | Default:0.5 |
task | The task of the Model | { binary-classification, multi-class classification, bbox-regression, binary-segmentation} |
model-type | Type of the Model | {Encoder/ Encoder_Decoder} |
Example Notebooks :
Tensorflow-Keras :
Name | Task | Link |
---|---|---|
Backtrace Loan Classification Tabular Dataset | Binary Classification | Colab Link |
Backtrace Image FMNIST Dataset | Multi-Class Classification | Colab Link |
Backtrace CUB Bounding Box Regression Image Dataset | Single Object Detection | Colab Link |
Backtrace Next Word Generation Textual Dataset | Next Word Generation | Colab Link |
Backtrace ImDB Sentiment Classification Textual Dataset | Sentiment Classification | Colab Link |
Backtrace Binary Classification Textual Dataset | Binary Classification | Colab Link |
Backtrace Multi-Class NewsGroup20 Classification Textual Dataset | Multi-Class Classification | Colab Link |
Backtrace CVC-ClinicDB Colonoscopy Binary Segmentation | Organ Segmentation | Colab Link |
Backtrace CamVid Road Car Binary Segmentation | Binary Segmentation | Colab Link |
Backtrace Transformer Encoder for Sentiment Analysis | Binary Classification | Colab Link |
Backtrace Transformer Encoder-Decoder Model for Neural Machine Translation | Neural Machine Translation | Colab Link |
Backtrace Transformer Encoder-Decoder Model for Text Summarization | Text Summarization | Colab Link |
Pytorch :
Name | Task | Link |
---|---|---|
Backtrace Tabular Dataset | Binary Classification | Colab Link |
Backtrace Image Dataset | Multi-Class Classification | Colab Link |
For more detailed examples and use cases, check out our documentation.
Supported Layers and Future Work :
Tensorflow-Keras:
- Dense (Fully Connected) Layer
- Convolutional Layer (Conv2D,Conv1D)
- Transpose Convolutional Layer (Conv2DTranspose,Conv1DTranspose)
- Reshape Layer
- Flatten Layer
- Global Max Pooling (2D & 1D) Layer
- Global Average Pooling (2D & 1D) Layer
- Max Pooling (2D & 1D) Layer
- Average Pooling (2D & 1D) Layer
- Concatenate Layer
- Add Layer
- Long Short-Term Memory (LSTM) Layer
- Dropout Layer
- Embedding Layer
- TextVectorization Layer
- Self-Attention Layer
- Cross-Attention Layer
- Feed-Forward Layer
- Pooler Layer
- Decoder LM (Language Model) Head
- Other Custom Layers
Pytorch :
(Note: Currently we only Support Binary and Multi-Class Classification in Pytorch, Segmentation and Single Object Detection will be supported in the next release.)
- Linear (Fully Connected) Layer
- Convolutional Layer (Conv2D)
- Reshape Layer
- Flatten Layer
- Global Average Pooling 2D Layer (AdaptiveAvgPool2d)
- Max Pooling 2D Layer (MaxPool2d)
- Average Pooling 2D Layer (AvgPool2d)
- Concatenate Layer
- Add Layer
- Long Short-Term Memory (LSTM) Layer
- Dropout Layer
- Embedding Layer
- EmbeddingBag Layer
- 1d Convolution Layer (Conv1d)
- 1d Pooling Layers (AvgPool1d,MaxPool1d,AdaptiveAvgPool1d,AdaptiveMaxPool1d)
- Transpose Convolution Layers (ConvTranspose2d,ConvTranspose1d)
- Global Max Pooling 2D Layer (AdaptiveMaxPool2d)
- Other Custom Layers
Getting Started
If you are new to Backtrace, head over to our Getting Started Guide to quickly set up and use the module in your projects.
Contributing
We welcome contributions from the community. To contribute, please follow our Contribution Guidelines.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contact
For any inquiries or support, please contact AryaXAI Support.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file dl_backtrace-0.0.20.dev39.tar.gz
.
File metadata
- Download URL: dl_backtrace-0.0.20.dev39.tar.gz
- Upload date:
- Size: 88.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | be9f227cf9b63ce1b8172f929ca883208390273a35378149cb12de35fd1b42af |
|
MD5 | 3a77990c8c12e0e67e4c448e075b5a70 |
|
BLAKE2b-256 | 4034216c7cd32b64a44b6b581756f348c40647303c7ebbb8a2598525fc65e165 |
File details
Details for the file dl_backtrace-0.0.20.dev39-py3-none-any.whl
.
File metadata
- Download URL: dl_backtrace-0.0.20.dev39-py3-none-any.whl
- Upload date:
- Size: 99.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7a4adf8f57eb95326800983f47b7d95907d197f783e7093cc84ca3c02839f4e |
|
MD5 | 296348b470bae477294ce505dee63c26 |
|
BLAKE2b-256 | 6f4fe6529efd3b69758cb3a76186b5d8c25bfdaea94582bce7f0e7601d00c5b9 |