Skip to content

[Good First Issue] Add SHAP explainability to segmentation predictions #22

Closed

Description

@Oshgig

Overview

ClimateVision currently produces segmentation masks with zero explainability. NGOs and government agencies cannot trust black-box predictions for high-stakes environmental decisions. We need pixel-level attribution showing WHICH bands and spatial regions drove each classification.

Scope

  • Integrate SHAP (DeepExplainer) into the U-Net forward pass in src/climatevision/inference/pipeline.py
  • Create src/climatevision/governance/explainability.py with:
    • explain_prediction(model, image, analysis_type) → returns SHAP values + heatmap
    • Support for all 3 analysis types (deforestation, ice_melting, flooding)
    • Band-level attribution (e.g., "NIR contributed 47% to this forest pixel classification")
  • Add GET /api/explain/{run_id} endpoint returning SHAP values as GeoJSON/PNG
  • Create notebooks/06_explainability.ipynb with visual examples
  • Add pytest tests verifying explainability output shapes match prediction shapes

Acceptance Criteria

  • Every prediction can return a SHAP heatmap overlay
  • Band attribution is returned in API response
  • Notebook demonstrates explainability across all 3 analysis types
  • Tests pass in CI

Resources

  • src/climatevision/models/unet.py — U-Net architecture
  • src/climatevision/inference/pipeline.py — inference flow
  • SHAP library docs: https://shap.readthedocs.io/

Difficulty: Intermediate
Owner: Linda Oraegbunam (@obielin)
Labels: good first issue, governance, explainability, backend

Activity

  1. added
    good first issue
    on Apr 25, 2026
  2. Oshgig commented on Apr 25, 2026

    @Oshgig
    CollaboratorAuthor

    Closing for now — will reopen when Linda's pipeline is finalized.

  3. Goldokpa commented on Apr 28, 2026

    @Goldokpa
    Member

    Reopening now that Linda's pipeline is set up. @obielin — this is ready for you to work on.

  4. added a commit that references this issue on May 3, 2026
    abfe8af
  5. added a commit that references this issue on May 17, 2026
    468102a
  6. added 3 commits that reference this issue on Jun 24, 2026
    d339e88
    f965134
    a415d84
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions