Skip to main content

eazyml-image-xai provides APIs for image explainable AI (XAI)

Project description

EazyML Responsible-AI: Image XAI

Python PyPI package Code Style

EazyML

This package focuses on segmentation prediction, explainability, active learning and online learning for image dataset.

Features

  • Active learning focuses on reducing the amount of labeled data required to train the model while maximizing performance, making it particularly useful when labeling data is expensive or time-consuming. By prioritizing uncertain or diverse examples, active learning accelerates model improvement and enhances efficiency.
  • Online learning is a machine learning approach where models are trained incrementally as data becomes available, rather than using a fixed, pre-existing dataset. This method is well-suited for dynamic environments, enabling real-time updates and adaptability to new patterns or changes in data streams.

Installation

User installation

The easiest way to install augmented intelligence is using pip:

pip install -U eazyml-xai-image

Dependencies

EazyML Image XAI requires :

  • tensorflow
  • segmentation-models==1.0.1
  • lime
  • opencv-python
  • flask
  • pyyaml

Usage

It provides following apis :

  1. ez_image_active_learning : This API sorts test images based on explainability scores for the model’s predictions. If a “query count” is specified in the options, it returns the indices and corresponding scores for that number of inputs.

    ez_image_active_learning(
            filenames=['..', '..'],
            model_path='path_of_model',
            predicted_filenames=['path_of_model_prediction_file_names'],
            options={
                "query_count": 10,
                "training_data_path": "path/to/training/data.csv",
                "score_strategy": "weighted-moments",
                "al_strategy": "pool-based",
                "xai_strategy": "gradcam",
                "gradcam_layer": "layer_name",
                "model_num": "1"
            }
        )
    
  2. ez_image_model_evaluate : This API validates a model using provided data and returns the model evaluation.

    ez_image_model_evaluate(
            validation_data_path='path_of_new_data_for_validation',
            model_path='path_of_model',
            options={
                "required_functions": {
                    "loss_fn": '...',
                    "metric_fns": '...',
                    "input_preprocess_fn": '',
                    "label_preprocess_fn": '',
                    "output_process_fn": ''
                    },
                "batch_size": 32,
                "log_file": "path/to/log/file"
            })
    
  3. ez_image_online_learning : This API updates a given model using new training data and saves the updated model. The update process adapts based on the Online Learning strategy or optimizes performance on provided validation data.

    ez_image_online_learning(
            validation_data_path='path_of_new_data_for_validation',
            model_path='path_of_model',
            options={
                "required_functions": {
                    "loss_fn": '...',
                    "metric_fns": '...',
                    "input_preprocess_fn": '',
                    "label_preprocess_fn": '',
                    "output_process_fn": ''
                },
                "batch_size": 32,
                "log_file": "path/to/log/file"
            }
        )
    
  4. ez_xai_image_explain : This API provides confidence scores and image explanations for model predictions. It can process a single image or multiple images, returning explanations for all predictions.

    ez_xai_image_explain(
            filenames=['..', '..'],
            model_path='path_of_model',
            predicted_filenames=['path_of_model_prediction_file_names'],
            options={
                "training_data_path": "...",
                "score_strategy": "weighted-moments",
                "xai_strategy": "gradcam",
                "xai_image_path": "...",
                "gradcam_layer": "layer_name",
                "model_num": "1",
                "required_functions": {...}
            }
        )
    

You can find more information in the documentation.

Useful links, other packages from EazyML family

  • Documentation

  • Homepage

  • If you have questions or would like to discuss a use case, please contact us here

  • Here are the other packages from EazyML suite:

    • eazyml-automl: eazyml-automl provides a suite of APIs for training, optimizing and validating machine learning models with built-in AutoML capabilities, hyperparameter tuning, and cross-validation.
    • eazyml-data-quality: eazyml-data-quality provides APIs for comprehensive data quality assessment, including bias detection, outlier identification, and drift analysis for both data and models.
    • eazyml-counterfactual: eazyml-counterfactual provides APIs for optimal prescriptive analytics, counterfactual explanations, and actionable insights to optimize predictive outcomes to align with your objectives.
    • eazyml-insight: eazyml-insight provides APIs to discover patterns, generate insights, and mine rules from your datasets.
    • eazyml-xai: eazyml-xai provides APIs for explainable AI (XAI), offering human-readable explanations, feature importance, and predictive reasoning.
    • eazyml-xai-image: eazyml-xai-image provides APIs for image explainable AI (XAI).

License

This project is licensed under the Proprietary License.


Maintained by EazyML
© 2025 EazyML. All rights reserved.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eazyml_xai_image-0.0.40.tar.gz (27.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eazyml_xai_image-0.0.40-py2.py3-none-any.whl (28.1 MB view details)

Uploaded Python 2Python 3

File details

Details for the file eazyml_xai_image-0.0.40.tar.gz.

File metadata

  • Download URL: eazyml_xai_image-0.0.40.tar.gz
  • Upload date:
  • Size: 27.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for eazyml_xai_image-0.0.40.tar.gz
Algorithm Hash digest
SHA256 3120ab2562838dac7f4305f343592fde8f64e4b3f6d0bb378b3d7096ebf8ef67
MD5 36cf64ce1495e3526f6b6f0d031d4d22
BLAKE2b-256 212f0f0ae6deb700bf26ff02fe0cbaa58cc34062c631fd110b976fff2d12502d

See more details on using hashes here.

File details

Details for the file eazyml_xai_image-0.0.40-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for eazyml_xai_image-0.0.40-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8a4e71a2b9a8e6a62a70f7fad02c3f7b3a294f39b33bc183effc64d1a2c78cdd
MD5 296f29ad7a9a44783030c4875ae3b6c9
BLAKE2b-256 f9bcecbdd98f68bdc81d8b0e9e17fa511e037822f1811b689f421eff805aeb8a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page