🏆

Interpretable Multi-Label Learning

Proposing interpretability techniques for BERT-based multi-label classification of biomedical texts — M.Sc. Thesis (Grade: 9.5/10.0)

Python PyTorch BERT XAI M.Sc. Thesis Biomedical NLP
Interpretable AI in Biomedical Research — Academic Poster Overview

Overview

Problem statement and research motivation

The biomedical research community publishes a massive volume of unstructured data daily, necessitating automated tools for indexing, topic categorization, and multi-label classification. While deep learning models like Transformers (BERT, blue-BERT) achieve state-of-the-art predictive performance, they function as "black boxes" — their deep, complex representations are difficult to interpret.

In domains like healthcare and biomedicine, simply providing an automated prediction is rarely enough. Users need to understand why a model made a specific decision. This project focused on adapting advanced interpretability algorithms to a multi-label format and transforming their outputs into readable, sentence-level rationales.

Datasets

Two manually annotated biomedical corpora with sentence-level rationale ground truth

Hallmarks of Cancer (HoC)

1,580
Biomedical abstracts
10
Multi-label categories

Chemical Exposure (CEI)

3,661
Biomedical abstracts
11
Multi-label categories

Methodology

Four interpretability approaches adapted for multi-label text classification

Δ

Integrated Gradients (IG)

Gradient-based attribution method modified to solve saturation issues in deep networks.

Adapted for multi-label classification
Isolates prediction vectors per label
Back-propagates relevance to input tokens

Layer-wise Relevance Propagation

Propagation-based method delivering 20x faster inference than IG.

Modified to accommodate Transformer encoder blocks & self-attention modules
LRP-POS using positive attributions only

Multi-Task Learning

Supervised framework jointly learning label prediction and rationale extraction.

Trained simultaneously to predict labels + identify rationale sentences
Highest quality explanations overall

Attention Weights + Token-to-Sentence

Leveraging raw attention scores across Transformer layers and aggregating into sentences.

Min-Max & Max-Abs scaling
Top absolute values averaged per sentence
Tested across layer combinations

Evaluation Framework

Custom metrics designed for interpretability assessment

Standard evaluation metrics fall short for interpretability tasks. This project designed custom evaluation metrics to rigorously assess the quality of extracted rationales against human-annotated ground truth.

🎯

Sentence-Level F₁ Score

Measures explanation precision and recall by comparing extracted rationale sentences against human-annotated ground truth sentences at the sentence level.

Faithfulness Metrics

Measures the drop in predictive confidence when the model's selected "important" sentences (rationales) are removed from the input. Variants:

Faithfulness · Faithfulness-1 · Faithfulness-all

Results

Quantitative performance across methods, models, and datasets

0.7421

Sentence-Level F₁ Score — Multi-Task Learning (HoC)

0.7255
Multi-Task F₁ on CEI dataset
0.6728
LRP-POS F₁ on HoC (best unsupervised)
20× faster
LRP vs. Integrated Gradients

Performance Summary

Sentence-Level F₁ scores across methods and datasets

Method HoC (BERT) HoC (blue-BERT) CEI (BERT) CEI (blue-BERT)
Multi-Task Learning 0.7421 0.7255
LRP-POS 0.6728 0.6218
Integrated Gradients 0.6125 0.6211

The Multi-Task Learning approach yielded the highest quality explanations across both datasets. Among fully unsupervised methods, LRP-POS utilizing standard BERT achieved the best results. Notably, LRP produced high-quality explanations with an inference time ~20 times faster than Integrated Gradients (~1 sec vs. ~20 sec per instance).

Interestingly, the original general-purpose BERT frequently produced more meaningful explanations than the domain-specific blue-BERT, as verified by the Faithfulness-1 metric.


Tech Stack

Languages, frameworks, and environment

Languages

Python

Frameworks & Libraries

PyTorchHugging Face TransformersCaptum scikit-learnNumPyPandas Weights & Biases

Models

BERTblue-BERT

Key Academic References

Papers used in methodology design

[1] Devlin, J., et al. (2018). BERT: Pre-training of deep bidirectional transformers for language understanding.
[2] Peng, Y., Yan, S., & Lu, Z. (2019). Transfer learning in biomedical natural language processing: An evaluation of BERT and ELMo on ten benchmarking datasets. (blue-BERT)
[3] Sundararajan, M., Taly, A., & Yan, Q. (2017). Axiomatic attribution for deep networks. (Integrated Gradients)
[4] Bach, S., et al. (2015). On pixel-wise explanations for non-linear classifier decisions by layer-wise relevance propagation.
[5] Vaswani, A., et al. (2017). Attention is all you need.
[6] Baker, S., et al. (2016). Cancer Hallmarks Analytics Tool (CHAT): A text mining approach to organize and evaluate biomedical literature.