keepcalculator

06 Numbers and Powers

Multimodal Decision Fusion: Pathology + MRI

Card No. 06·49463 · Updated · Standard formula, shown below

Multimodal decision fusion combines predictions from pathology slides and MRI scans into a single, more reliable result. You feed each modality’s probability scores (e.g., “malignant 0.85”) into a fusion rule, and it outputs a final classification. This guide covers the standard steps, from preparing your inputs to evaluating the fused model, and assumes you have basic Python and machine learning knowledge.

What You’ll Need

  • Two trained models: one that outputs prediction probabilities from pathology images (e.g., a CNN), and one from MRI scans (e.g., a 3D CNN or radiomics model).
  • A validation or test dataset with ground truth labels for both modalities.
  • Python environment with scikit-learn, numpy, and optionally scipy.
  • Basic understanding of probability, ROC curves, and cross-validation.

Step-by-Step

  1. Collect aligned predictions. For each patient or sample, obtain the probability score from the pathology model (p_path) and from the MRI model (p_mri). Ensure both are on the same scale (0 to 1) and that they correspond to the same class (e.g., probability of malignancy). Store them in a table with the true label.
  2. Split your data. If you have a separate test set, keep it aside. Use a training/validation split (e.g., 70/30) on the remaining data to learn fusion weights or thresholds. Never tune fusion parameters on the test set.
  3. Choose a fusion rule. Common rules include:
    • Average: final = (p_path + p_mri) / 2
    • Product: final = p_path * p_mri (works when both are high only if both agree)
    • Maximum: final = max(p_path, p_mri)
    • Weighted average: final = w * p_path + (1 – w) * p_mri, where w is learned.
  4. Implement the fusion function. Write a Python function that takes two probability arrays and returns the fused score. For weighted average, start with equal weights (w=0.5).
  5. Optimize weights (if using weighted average). On the validation set, search for the weight w that maximizes your chosen metric (e.g., AUC, accuracy, F1). You can do a grid search from 0 to 1 in steps of 0.05, or use scipy’s optimize.
  6. Evaluate the fused model. Apply the fusion rule (with the optimal weight if applicable) to the validation set. Compute metrics: AUC, accuracy, sensitivity, specificity. Compare to each individual modality’s performance.
  7. Test on the held-out test set. Only after you’ve finalized the fusion rule and any weights, apply it to the test set to get an unbiased estimate of performance.
  8. Consider calibration. If your probabilities are not well-calibrated (e.g., model is overconfident), apply Platt scaling or isotonic regression to each modality’s outputs before fusion. Fit the calibrator on the training/validation data.
  9. Document your pipeline. Record the fusion rule, weights, and evaluation metrics for reproducibility.

Common Mistakes

  • Using the test set for tuning. This leaks information and gives overly optimistic results.
  • Ignoring class imbalance. If one class is rare, accuracy is not a good metric; use AUC or balanced accuracy.
  • Fusing raw logits instead of probabilities. Logits can be unbounded and skew the fusion.
  • Not aligning the classes. Ensure both models predict the same class (e.g., “malignant” vs “benign”). If one model outputs “benign” probability, convert it.
  • Overfitting the weight. If you have few validation samples, the optimal weight may not generalize. Use cross-validation to estimate the weight.

Tips

  • Start simple. Try averaging first; it often works well and is robust.
  • Use AUC for model comparison. It is threshold-independent and handles class imbalance.
  • Visualize the agreement. Plot p_path vs p_mri colored by true label to see where fusion helps or hurts.
  • Consider a meta-learner. Instead of a fixed rule, train a logistic regression on the two probabilities as features. This learns the optimal combination automatically.
  • Check for missing data. If a patient lacks one modality, decide how to handle it (e.g., use the available modality only).

Troubleshooting

  • Fused performance is worse than single modalities. Check if the two models are highly correlated; if they always agree, fusion won’t help. Also, your weight might be overfitted. Try a simpler rule like average.
  • Weights are extreme (0 or 1). This suggests one modality dominates. Verify that both models are well-calibrated and not one is much better. You might also have too few validation samples.
  • Probabilities are not on the same scale. If one model outputs 0.9 for everything, calibrate it first. Use reliability diagrams to compare.
  • NaN or infinity in probabilities. Check for division by zero in softmax or logits. Clip probabilities to [1e-7, 1-1e-7] to avoid log issues.
  • Class labels are mismatched. Ensure both models use the same indexing (e.g., class 1 = malignant). Print confusion matrices for each model to verify.

Frequently Asked Questions

  • What is the best fusion rule? There is no universal best; it depends on your data. Averaging is a good baseline, and a weighted average or logistic regression often improves if the modalities have different accuracies.
  • Can I fuse features instead of predictions? Yes, that’s called feature-level fusion, where you concatenate the last-layer features from both models and train a classifier. It can capture more information but requires more data and careful handling.
  • How do I handle missing modalities? For a patient without MRI, you can either exclude them or use only the pathology prediction. Some fusion methods (like a meta-learner) can be trained with missing data using imputation.
  • Should I calibrate each modality before fusion? Yes, especially if the probabilities are not well-calibrated. Uncalibrated probabilities can distort the fused score, especially with product or weighted rules.
  • What if the models output multiple classes? For multi-class, apply fusion per class: average the probabilities for each class across modalities, then take the argmax. Ensure the class lists are identical.
  • How do I know if fusion is actually helping? Compare the fused AUC to the best single-modality AUC using a statistical test like DeLong’s test (for paired AUCs). If the improvement is not significant, fusion may not be worth the complexity.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →