Inferensys

Glossary

Feature Pyramid Network (FPN)

A feature extractor architecture that builds a multi-scale, pyramidal hierarchy of feature maps to detect objects at vastly different sizes, such as small nodules and large tumors.
Data engineer managing feature store on laptop, feature definitions visible, casual data engineering session.
MULTI-SCALE DETECTION ARCHITECTURE

What is Feature Pyramid Network (FPN)?

A feature extractor architecture that builds a multi-scale, pyramidal hierarchy of semantically strong feature maps to detect objects at vastly different sizes, such as small nodules and large tumors.

A Feature Pyramid Network (FPN) is a feature extractor architecture that constructs a multi-scale, pyramidal hierarchy of feature maps from a single-scale input image, enabling robust detection of objects at vastly different sizes. It fuses high-resolution, spatially precise features from earlier network layers with semantically strong, low-resolution features from deeper layers via a top-down pathway and lateral connections, creating feature pyramids at all scales with rich semantics at every level.

In medical imaging, FPNs are critical for small object detection tasks like identifying micro-calcifications in mammography or early-stage lung nodules in CT scans, where standard single-scale feature maps fail. By assigning objects to the pyramid level most appropriate for their size, FPNs eliminate the scale-resolution trade-off inherent in traditional feature hierarchies, significantly improving sensitivity for both tiny lesions and large, diffuse abnormalities.

ARCHITECTURAL PRINCIPLES

Key Characteristics of FPNs

Feature Pyramid Networks address the fundamental scale variance problem in object detection by constructing a feature hierarchy with strong semantics at all levels, enabling robust detection of both small nodules and large tumors.

01

Multi-Scale Feature Hierarchy

FPNs construct a pyramidal hierarchy of feature maps where each level captures information at a different spatial resolution. Unlike image pyramids that process the input at multiple scales, FPNs build the pyramid within the network itself using the inherent multi-scale structure of convolutional backbones.

  • Bottom-up pathway: Standard feed-forward computation producing feature maps at progressively lower resolutions
  • Top-down pathway: Upsamples semantically strong but spatially coarse features from higher pyramid levels
  • Lateral connections: 1×1 convolutions that merge top-down upsampled features with corresponding bottom-up features of the same spatial size
4-5
Typical Pyramid Levels
Scale Factor Between Levels
02

Semantic-Spatial Trade-off Resolution

Standard convolutional networks suffer from a semantic gap: shallow layers have high spatial resolution but weak semantics, while deep layers have strong semantics but coarse spatial resolution. FPNs resolve this by creating a feature pyramid where every level contains strong semantic information.

  • Deep features with rich categorical semantics are propagated downward via upsampling
  • Shallow features with precise localization information are refined via lateral connections
  • Each pyramid level independently predicts objects at its corresponding scale
  • Small objects are detected on high-resolution, semantically strong feature maps
All Levels
Semantic Strength
Independent
Per-Level Prediction
03

Scale-Invariant Object Detection

FPNs assign objects to pyramid levels based on their size in pixels, ensuring each object is detected at the appropriate resolution. This scale-aware assignment is critical in medical imaging where abnormalities range from sub-millimeter micro-calcifications to large organ-spanning tumors.

  • Objects are assigned to pyramid level Pₖ based on their bounding box area
  • Level formula: k = ⌊k₀ + log₂(√(wh) / input_size)⌋
  • Small nodules route to high-resolution P₂ or P₃
  • Large masses route to low-resolution P₅ or P₆
  • Prevents the network from learning conflicting scale-specific features at a single level
~3 px
Minimum Detectable Size
Log₂
Scale Assignment Function
04

Backbone-Agnostic Design

FPNs function as a neck module that can be attached to any convolutional backbone architecture. This modularity allows the pyramid to leverage advances in backbone design without architectural changes.

  • Compatible with ResNet, ResNeXt, EfficientNet, and transformer-based backbones
  • Operates on the feature hierarchy naturally produced by modern architectures
  • Standard output levels: P₂, P₃, P₄, P₅ (optionally P₆, P₇ via strided convolution)
  • Each level outputs 256 channels regardless of backbone depth, ensuring consistent downstream head design
  • Enables transfer learning by swapping backbones while preserving the detection head
256
Output Channels Per Level
Any CNN
Backbone Compatibility
05

Shared Classification and Regression Heads

FPNs employ weight-shared detection heads across all pyramid levels. A single set of convolutional predictors slides over every level, dramatically reducing parameters while enforcing scale-invariant feature representations.

  • Identical head architecture processes P₂ through P₆
  • Forces the network to learn features that generalize across scales
  • Reduces overfitting risk compared to level-specific heads
  • Common in Faster R-CNN with FPN and RetinaNet architectures
  • Heads typically consist of small fully convolutional subnetworks for classification and bounding box regression
Shared
Head Weights
All Levels
Parameter Efficiency
06

Computational Efficiency vs. Image Pyramids

Traditional image pyramid approaches process the input at multiple scales independently, multiplying computation by the number of scales. FPNs achieve comparable multi-scale representation with marginal computational overhead.

  • Image pyramids: 5 scales = ~5× computation
  • FPN: ~1.2× computation over the base backbone
  • Top-down pathway adds only lightweight upsampling and 1×1 convolutions
  • Lateral connections are parameter-efficient (1×1 convs)
  • Enables real-time or near-real-time inference critical for clinical workflows
  • Memory overhead is manageable due to shared feature computation in the bottom-up pathway
~20%
Compute Overhead vs. Backbone
Efficiency vs. Image Pyramids
FEATURE PYRAMID NETWORK

Frequently Asked Questions

Clear, technical answers to the most common questions about how Feature Pyramid Networks enable multi-scale object detection in radiological imaging.

A Feature Pyramid Network (FPN) is a feature extractor architecture that constructs a multi-scale, pyramidal hierarchy of feature maps from a single-scale input image to detect objects at vastly different sizes. It works through two pathways: a bottom-up pathway (a standard convolutional backbone like ResNet that computes feature hierarchies at multiple scales) and a top-down pathway that hallucinates higher-resolution features by upsampling spatially coarser but semantically stronger feature maps. Lateral connections merge the upsampled features with the corresponding bottom-up features via element-wise addition, enriching each level with strong semantics. This produces feature pyramids at scales P2 through P7, where each level is responsible for detecting objects within a specific size range. In medical imaging, this allows a single network to simultaneously detect small micro-calcifications and large pulmonary masses without sacrificing accuracy on either scale.

ARCHITECTURAL COMPARISON

FPN vs. Other Multi-Scale Detection Strategies

Comparison of Feature Pyramid Network against alternative multi-scale feature extraction approaches for detecting objects at varying sizes in medical images.

FeatureFeature Pyramid Network (FPN)Image PyramidSingle Feature Map

Multi-scale architecture

Top-down pathway with lateral connections building feature hierarchy

Multiple scaled copies of input image processed independently

Single-scale feature map from one convolutional layer

Computational cost

Marginal overhead over single-scale backbone

4-12x increase; each scale requires full forward pass

Baseline; no additional cost

Memory footprint

Moderate; stores multi-scale feature maps

Very high; multiple image copies and intermediate activations

Low; single feature map stored

Small object detection (< 32x32 px)

Semantic richness at all scales

High; top-down pathway fuses high-level semantics into lower layers

High at each scale but no cross-scale feature sharing

Low at fine-grained spatial levels

End-to-end trainable

Inference speed

Fast; single forward pass

Slow; multiple sequential forward passes

Fastest; single forward pass

Typical mAP improvement for small lesions

+3.5-5.2% over single feature map baseline

+2.1-3.8% over baseline but with 4x latency

Baseline reference

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.