Abstract
Forward-Forward Contrastive Learning (FFCL) is a novel multistage pretraining strategy designed to improve feature representation in medical imaging. By integrating the biologically-inspired Forward-Forward Algorithm with supervised contrastive learning, FFCL trains neural network blocks locally and globally before final task-specific fine-tuning. Evaluated on pneumonia detection in chest X-rays, FFCL achieves a 3.69% accuracy improvement over standard ImageNet-pretrained models, demonstrating the efficacy of domain-specific local learning.
Introduction
In medical imaging, transfer learning from ImageNet-pretrained models is the standard approach. However, the domain gap between natural images and medical scans is significant. Subtle anatomical structures and specific noise profiles in medical data are often poorly captured by general-purpose features. Furthermore, standard back-propagation (BP) updates networks based on a global error signal, which may overlook fine-grained local details critical for clinical diagnosis. This paper introduces Forward-Forward Contrastive Learning (FFCL) to bridge this gap by prioritizing local feature extraction through a multistage pretraining routine.
Methods
The FFCL framework consists of three sequential stages designed to build a robust feature hierarchy:
- Local Contrastive Learning: Inspired by the Forward-Forward Algorithm (FFA), the model is trained block-by-block. For each block, the model minimizes a Cosine Embedding Loss to bring representations of the same class closer while pushing different classes apart. This stage captures fine-grained local features without requiring global gradient passes.
- Global Contrastive Learning: After local initialization, the entire backbone is trained as a single unit using the same contrastive logic. This ensures that the locally learned features are integrated into a cohesive global representation.
- Downstream Classification: Finally, the model is fine-tuned using standard back-propagation with a classification head for the target task (e.g., "Normal" vs. "Pneumonia").
Unlike the original FFA, which relies on manual "goodness" thresholds, FFCL automates the process using supervised labels to guide contrastive learning.
Experimental Setup
The authors evaluated FFCL using the Pediatric Chest X-ray dataset (Kermany et al., 2018), comprising 5,856 images. The task is binary classification between "Normal" and "Pneumonia" cases. The dataset was split into 5,232 training images and 624 testing images. Experiments were conducted using ResNet-18 and ResNet-34 architectures to validate the generalizability of the approach.
Results and Discussion
The experimental results demonstrate that FFCL significantly outperforms standard training paradigms. On a ResNet-18 backbone, the FFCL (Local → Global) approach achieved an accuracy of 80.45%, compared to 76.76% for a standard ImageNet-pretrained model.
Key insights from the results include:
- Local-to-Global Synergy: Ablation studies showed that the sequence of local training followed by global training is essential. Training only locally or only globally resulted in lower performance (62.50% and 76.92%, respectively).
- Reduced ImageNet Dependency: Models initialized randomly but pretrained with FFCL on medical data outperformed those initialized with ImageNet weights. This suggests that domain-specific pretraining can be more effective than massive-scale general pretraining for specialized medical tasks.
- State-of-the-Art Performance: FFCL achieved an AUC of 93.33%, surpassing several existing methods on the same dataset that reported AUCs between 75% and 78.4%.
Conclusion
FFCL presents a powerful alternative to standard transfer learning for medical imaging. By leveraging local contrastive learning as a pretraining step, the model captures essential fine-grained details that are often lost in end-to-end back-propagation. Future work will explore the scalability of FFCL to larger datasets and different imaging modalities such as CT and MRI.
Summary updated