Skip to main content
QUICK REVIEW

[Paper Review] Forward-Forward Contrastive Learning

Md Atik Ahamed, Jin Chen|arXiv (Cornell University)|May 4, 2023
COVID-19 diagnosis using AIMedicine3 citations
TL;DR

This paper proposes Forward-Forward Contrastive Learning (FFCL), a novel multistage pretraining method that applies supervised contrastive learning locally at each network layer and globally at the final representation, using the Forward-Forward Algorithm's principles without back-propagation during pretraining. FFCL achieves 3.69% higher accuracy than ImageNet-pretrained ResNet-18 on pneumonia classification in chest X-ray images, demonstrating improved generalization and fine-detail feature learning.

ABSTRACT

Medical image classification is one of the most important tasks for computer-aided diagnosis. Deep learning models, particularly convolutional neural networks, have been successfully used for disease classification from medical images, facilitated by automated feature learning. However, the diverse imaging modalities and clinical pathology make it challenging to construct generalized and robust classifications. Towards improving the model performance, we propose a novel pretraining approach, namely Forward Forward Contrastive Learning (FFCL), which leverages the Forward-Forward Algorithm in a contrastive learning framework--both locally and globally. Our experimental results on the chest X-ray dataset indicate that the proposed FFCL achieves superior performance (3.69% accuracy over ImageNet pretrained ResNet-18) over existing pretraining models in the pneumonia classification task. Moreover, extensive ablation experiments support the particular local and global contrastive pretraining design in FFCL.

Motivation & Objective

  • To address the limitations of standard back-propagation and ImageNet pretraining in medical image classification, especially for diverse imaging modalities and fine-grained pathology.
  • To improve model generalizability and feature learning in medical imaging by leveraging the Forward-Forward Algorithm's principles without gradient back-propagation during pretraining.
  • To develop a fully automated, threshold-free pretraining strategy that enhances representation learning at both local (layer-wise) and global (final embedding) levels.
  • To demonstrate that contrastive learning integrated with the Forward-Forward mechanism improves performance on medical image classification tasks, particularly in low-shot or domain-shifted settings.

Proposed method

  • FFCL performs two-stage pretraining: first, local contrastive learning at each residual block using cosine embedding loss on feature maps after ReLU activation.
  • Second, global contrastive learning is applied to the final embedding space using the same cosine embedding loss, comparing pairs of images with shared or different labels.
  • The local and global contrastive losses are computed using normalized dot products between embeddings, with margin-based supervision for positive and negative pairs.
  • The framework uses a modified version of the Forward-Forward Algorithm, avoiding gradient computation during pretraining and eliminating manual threshold tuning.
  • After pretraining, the model proceeds to standard back-propagation fine-tuning for downstream classification using binary cross-entropy loss.
  • The method is fully automated, requiring no hyperparameter tuning between stages, and can be extended for end-to-end training.

Experimental results

Research questions

  • RQ1Can a multistage pretraining strategy combining local and global contrastive learning improve generalization in medical image classification?
  • RQ2Does replacing standard back-propagation with a Forward-Forward-inspired contrastive pretraining mechanism lead to better feature learning in medical images?
  • RQ3How does the order of local and global pretraining affect model performance on pneumonia classification?
  • RQ4Can the proposed method outperform ImageNet pretraining and state-of-the-art methods in low-resource medical imaging scenarios?

Key findings

  • FFCL achieved 80.45% accuracy on the pediatric chest X-ray dataset using random weight initialization and ResNet-18, outperforming the ImageNet-pretrained RBP baseline by 3.69%.
  • With random initialization, FFCL achieved an AUC of 93.33%, surpassing the RBP baseline (89.15%) and state-of-the-art methods (AUC 75–78.4%).
  • The ablation study confirmed that the combination of local and global pretraining is essential, as models trained only on global or only on local contrastive learning showed inferior performance.
  • Even with ImageNet initialization, FFCL achieved 72.28% accuracy, outperforming the RBP baseline (76.76%) when using random initialization.
  • The local-only pretraining strategy with random initialization yielded 62.50% accuracy, indicating that global context is critical for performance.
  • On ResNet-34, FFCL achieved 78.85% accuracy with random initialization, slightly exceeding the RBP baseline (78.53%), confirming consistent gains across architectures.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.