Skip to main content
QUICK REVIEW

[Paper Review] Training convolutional neural networks with megapixel images

Hans Pinckaers, Geert Litjens|arXiv (Cornell University)|Apr 16, 2018
AI in cancer detectionComputer Science2 references8 citations
TL;DR

This paper proposes Streaming Stochastic Gradient Descent (SSGD), a method to train convolutional neural networks on megapixel images using significantly reduced GPU memory by reconstructing intermediate activation maps through partial forward passes on image tiles. The approach enables training with 64-megapixel images using 97% less memory than conventional SGD, achieving numerically equivalent results while maintaining model accuracy.

ABSTRACT

To train deep convolutional neural networks, the input data and the intermediate activations need to be kept in memory to calculate the gradient descent step. Given the limited memory available in the current generation accelerator cards, this limits the maximum dimensions of the input data. We demonstrate a method to train convolutional neural networks holding only parts of the image in memory while giving equivalent results. We quantitatively compare this new way of training convolutional neural networks with conventional training. In addition, as a proof of concept, we train a convolutional neural network with 64 megapixel images, which requires 97% less memory than the conventional approach.

Motivation & Objective

  • To address the memory bottleneck in training CNNs on large, high-resolution images such as gigapixel histology slides or satellite imagery.
  • To enable training with full-resolution megapixel images without requiring excessive GPU memory.
  • To develop a memory-efficient training method that maintains numerical equivalence to standard SGD.
  • To demonstrate feasibility of training with 64-megapixel images using only 7 GB GPU memory, compared to 235 GB with standard SGD.
  • To enable training of large networks or high-resolution data on standard hardware by reducing memory footprint.

Proposed method

  • The method reconstructs intermediate activation maps by performing partial forward passes on image tiles, then reassembles them for the remainder of the network.
  • Overlaps between tiles are calculated using equations for forward (P_forw) and backward (P_back) passes to ensure accurate reconstruction.
  • Equation 1 computes tile overlap for forward passes: P_forw = (k - s) + b((z - k) mod s), where k is kernel size, s is stride, z is image size, and b is a Boolean flag.
  • Equation 2 computes larger overlap for backward passes: P_back = 2(k - s) + b((z - k) mod s), accounting for gradient dependencies across overlapping regions.
  • Backpropagation is performed per tile, with gradients reconstructed via partial forward passes to avoid storing all activations.
  • Mini-batch gradients are summed and averaged across images, and edge effects from pooling/convolution operations are corrected by preserving edge pixels in tile boundaries.

Experimental results

Research questions

  • RQ1Can a training method be developed that allows full megapixel image input without exceeding GPU memory limits?
  • RQ2Is it possible to achieve numerical equivalence between standard SGD and a memory-reduced training method like SSGD?
  • RQ3What is the memory and computational trade-off of reconstructing activation maps via tiled forward passes during backpropagation?
  • RQ4Can a CNN be successfully trained on 64-megapixel images using SSGD, and what is the resulting memory footprint?
  • RQ5To what extent does SSGD restrict architectural choices, such as the use of batch normalization or global operations?

Key findings

  • The loss difference between standard SGD and SSGD was only 1×10⁻⁴, confirming numerical equivalence.
  • Test accuracy was 77% for both standard SGD and SSGD, demonstrating equivalent performance.
  • The network trained on 64-megapixel images achieved 78% test accuracy, showing feasibility of large-image training.
  • SSGD reduced GPU memory usage from 235 GB (standard SGD, mini-batch size 8) to 7 GB, a 97% reduction.
  • The method requires recomputation during backpropagation, introducing significant computational overhead.
  • Architectures relying on full activation maps (e.g., batch normalization) are incompatible with SSGD due to dependency on complete feature maps.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.