{"notes":[{"id":"feature-fusion/fpn","category":"feature-fusion","legacyPath":"feature-fusion/1612-fpn","legacySlug":"1612-fpn","legacyPaths":[],"title":"FPN","subtitle":"The Pyramid Structure","author":"Z. Yuan","paperDate":"2016-12-09","publishedOn":"2024-04-06","paperTitle":"Feature Pyramid Networks for Object Detection","paperUrl":"https://arxiv.org/abs/1612.03144","bibliography":{"title":"Feature Pyramid Networks for Object Detection","authors":["Tsung-Yi Lin","Piotr Dollár","Ross Girshick","Kaiming He","Bharath Hariharan","Serge Belongie"],"url":"https://arxiv.org/abs/1612.03144","pdfUrl":"https://arxiv.org/pdf/1612.03144","codeUrl":null,"preprint":{"id":"1612.03144","submittedOn":"2016-12-09","url":"https://arxiv.org/abs/1612.03144"},"publication":{"venue":"CVPR","year":2017,"kind":"conference","url":"https://doi.org/10.1109/cvpr.2017.106"},"citation":"@misc{featurefusionfpn2016,\n  title = {{Feature Pyramid Networks for Object Detection}},\n  author = {Tsung-Yi Lin and Piotr Dollár and Ross Girshick and Kaiming He and Bharath Hariharan and Serge Belongie},\n  year = {2016},\n  eprint = {1612.03144},\n  archivePrefix = {arXiv},\n  url = {https://arxiv.org/abs/1612.03144}\n}\n","citationPath":"/content/papers/citations/feature-fusion/fpn.e4ffc8178c44.bib"},"thumbnail":{"src":"/content/papers/assets/4909dfc99cc56eb950023c336b6390fc9b1d1c637bba715e12905800bb1a12e8.jpg","width":1024,"height":887},"locale":"en","path":"/content/papers/en/feature-fusion/fpn.cfa34a497f0f.md","headings":[{"id":"defining-the-problem","text":"Defining the Problem","depth":2},{"id":"solving-the-problem","text":"Solving the Problem","depth":2},{"id":"fpn-model-design","text":"FPN Model Design","depth":3},{"id":"discussion","text":"Discussion","depth":2},{"id":"is-it-really-better","text":"Is It Really Better?","depth":3},{"id":"conclusion","text":"Conclusion","depth":2}],"anchorAliases":{},"guide":null,"relatedReading":[{"id":"feature-fusion/panet","relation":"next","topic":"Fusing multiscale features for detection"}]},{"id":"feature-fusion/panet","category":"feature-fusion","legacyPath":"feature-fusion/1803-panet","legacySlug":"1803-panet","legacyPaths":[],"title":"PANet","subtitle":"Give Me a Shortcut","author":"Z. Yuan","paperDate":"2018-03-05","publishedOn":"2024-04-06","paperTitle":"Path Aggregation Network for Instance Segmentation","paperUrl":"https://arxiv.org/abs/1803.01534","bibliography":{"title":"Path Aggregation Network for Instance Segmentation","authors":["Shu Liu","Lu Qi","Haifang Qin","Jianping Shi","Jiaya Jia"],"url":"https://arxiv.org/abs/1803.01534","pdfUrl":"https://arxiv.org/pdf/1803.01534","codeUrl":null,"preprint":{"id":"1803.01534","submittedOn":"2018-03-05","url":"https://arxiv.org/abs/1803.01534"},"publication":{"venue":"CVPR","year":2018,"kind":"conference","url":"https://arxiv.org/abs/1803.01534"},"citation":"@misc{featurefusionpanet2018,\n  title = {{Path Aggregation Network for Instance Segmentation}},\n  author = {Shu Liu and Lu Qi and Haifang Qin and Jianping Shi and Jiaya Jia},\n  year = {2018},\n  eprint = {1803.01534},\n  archivePrefix = {arXiv},\n  url = {https://arxiv.org/abs/1803.01534}\n}\n","citationPath":"/content/papers/citations/feature-fusion/panet.31d49af45ee9.bib"},"thumbnail":{"src":"/content/papers/assets/549012fa5498c4bbe44cfad4f4c54ed4eac5e7f0cdc71ae6308bb1ee6a4942ed.jpg","width":1024,"height":348},"locale":"en","path":"/content/papers/en/feature-fusion/panet.bccaab9f2654.md","headings":[{"id":"defining-the-problem","text":"Defining the Problem","depth":2},{"id":"solving-the-problem","text":"Solving the Problem","depth":2},{"id":"panet-model-design","text":"PANet Model Design","depth":3},{"id":"path-aggregation-fpn","text":"Path Aggregation FPN","depth":3},{"id":"discussion","text":"Discussion","depth":2},{"id":"how-does-it-compare-to-basic-fpn","text":"How Does It Compare to Basic FPN?","depth":3},{"id":"conclusion","text":"Conclusion","depth":2}],"anchorAliases":{},"guide":null,"relatedReading":[{"id":"feature-fusion/fpn","relation":"background","topic":"Fusing multiscale features for detection"},{"id":"feature-fusion/bifpn","relation":"next","topic":"Fusing multiscale features for detection"}]}],"text":"Imagine a scenario.\n\nGiven a typical convolutional network model's operation flow: first, an input image, possibly of size 3 x 224 x 224, is passed through successive layers of downsampling, ultimately producing a high-dimensional semantic feature map, potentially 256 x 7 x 7. Conventionally, the final output of such a model is 1/32 the original size, meaning that for an input image of 224 x 224, the final feature map is 7 x 7.\n\nThis feature map has various descriptions:\n\n- Low-resolution feature map (since it's 1/32 of the original width and height)\n- High-level semantic features (typically with a large receptive field; semantic level and channel dimension are different concepts)\n- Top-level features (bottom | original image -> C1 -> C2 -> ... -> C5 | top)\n\nThis design poses no issue for classification tasks, where the goal is to reference the entire input image content to output one or several possible classification results.\n\nHowever, using only this layer can make small-object localization difficult. As mentioned, this feature map is 1/32 the scale. If an object we want to detect is smaller than 32 x 32 pixels, its details may become difficult to distinguish after downsampling. The 32×32 size is not a hard threshold below which detection becomes impossible.\n\nOkay, saying it \"disappears\" might be an exaggeration. In reality, if the model uses convolution operations for downsampling, the object might still leave some trace in the nearby pixels.\n\n\n> [!TIP]\n> \n> If you find this description too mystical, the point is that the model will struggle to detect it, requiring more capacity to remember this tiny feature, which can degrade overall performance.\n\n\nThis indicates that to improve object detection performance, we need to do something to preserve these features.\n\nAround the end of 2015, SSD was proposed:\n\n- **[SSD: Single Shot MultiBox Detector (2015.12)](https://arxiv.org/abs/1512.02325)**\n\nAnother important direction was to combine speed with multi-scale detection.\n\nSSD and YOLO both pursue single-stage detection, but SSD is not YOLO v1 with feature fusion added. It predicts independently from several feature scales and combines detections; the original version does not perform FPN-style top-down fusion. This is an important precursor, but shallow and deep features still differ in semantic strength.\n\n## Defining the Problem\n\nIn this paper, the authors explicitly pointed out these main issues:\n\n1. **Limitations of Traditional Feature Pyramids**\n\n   Extracting features independently at each image-pyramid scale can provide strong multi-scale representations. The main drawbacks are repeated computation and memory use. Applying such pyramids only at test time also creates a training/inference mismatch.\n\n2. **Limitations of SSD**\n\n   SSD begins its prediction pyramid at relatively late features such as VGG conv4_3, then adds lower-resolution layers. Earlier high-resolution features are not fully reused. They matter for small objects, but need stronger semantics to become effective detection features.\n\n## Solving the Problem\n\n### FPN Model Design\n\n![Composite of the FPN paper's multilevel prediction diagram and its enlarged fusion block, showing upsampling, a 1×1 lateral projection, and addition](/content/papers/assets/4909dfc99cc56eb950023c336b6390fc9b1d1c637bba715e12905800bb1a12e8.jpg \"Adapted from Lin et al., Feature Pyramid Networks for Object Detection, Figures 2 and 3, arXiv:1612.03144v2\")\n\nFPN aims to provide multi-scale features reusable across detection systems. The authors proposed a structure, shown above, to create a feature pyramid with strong semantics at all scales while maintaining the pyramid shape of the convolutional network's feature hierarchy.\n\nTo achieve this, the authors designed a structure that:\n\n- **Combines low-resolution features with high-resolution features through top-down pathways and lateral connections.**\n\nThis sentence essentially concludes the paper, leaving the implementation and testing parts.\n\nHowever, let's look at some implementation details provided by the authors.\n\n1. **Bottom-up Pathway**\n\n   ![Author-drawn ResNet18 downsampling example; red P1–P5 labels are illustrative, not the paper's FPN output notation](/content/papers/assets/23c14a4221a10712c8ac542bfc1ec79b53027b6ae90ccf4c8c4c20cea4d4c3a2.jpg)\n\n   The first part is the data pathway from low-level to high-level features. I drew an additional ResNet18 diagram with concrete dimensions to illustrate this flow; it is a teaching example, not the paper’s experimental configuration.\n\n   Taking ResNet18 as an example, an input image of 3 x 224 x 224. Based on PyTorch syntax, the channel count is at the front. After passing through ResNet18, we get five different resolution feature maps. The P1–P5 labels below follow the handwritten diagram. The paper instead names backbone features C2–C5 and fused outputs P2–P5; keep these notations separate:\n\n   - P1: 1/2 size feature map, 64 x 112 x 112.\n   - P2: 1/4 size feature map, 64 x 56 x 56.\n   - P3: 1/8 size feature map, 128 x 28 x 28.\n   - P4: 1/16 size feature map, 256 x 14 x 14.\n   - P5: 1/32 size feature map, 512 x 7 x 7.\n\n   This image passes through the model's downsampling process, termed as the bottom-up pathway in the paper.\n\n   High-resolution features cost more resources, but the original FPN explicitly uses stride-4 C2 to produce P2 for small-object representation. It omits conv1, not C2.\n\n2. **Top-down Pathway and Lateral Connections**\n\n   Recall the previous steps, where input data flows from left to right.\n\n   The second stage of feature pyramid design involves merging features from right to left.\n\n   Let's zoom in on the P4 - P5 section:\n\n   ![Author-drawn Block4 and Block5 fusion example for ResNet18, with a 512-channel lateral connection and twofold upsampling](/content/papers/assets/4ca885dc15ac0c6b967acb67ab9862d7d47faeec8cd44ea8b6047e52512bad57.jpg)\n\n   During this fusion process, we first deal with the high-dimensional feature map due to its smaller size.\n\n   First, we use a 1×1 convolution on the top feature to align its channels, then upsample it by a factor of two to match the next feature map's spatial size. In the original FPN, a 1×1 projection of C5 produces P5, followed by nearest-neighbor upsampling in the top-down path.\n\n   Next, we aim to add these different dimension feature maps. However, this introduces a challenge: channel mismatch.\n\n   As shown above, the feature map from Block5 has 512 channels, while the feature map from Block4 has only 256 channels. Due to the channel mismatch, direct addition is impossible. To resolve this, we use a 1×1 convolution to adjust the feature map's channel count. Note that there's no fixed rule for adjusting channel counts; you can predefine a suitable channel count based on practical needs, such as 64 in a teaching example; the paper uses 256.\n\n   In the original paper, the selected backbone maps C2–C5 receive 1×1 projections so that the fused maps have matching channels. The half-resolution P1 in the hand-drawn illustration is not part of this pyramid.\n\n   After aligning the channels and sizes, we can directly add feature maps from different layers, completing one round of fusion.\n\n   The original paper also applies a 3×3 convolution to each fused map to reduce aliasing from upsampling.\n\n   To further illustrate, let's look at the fusion from P4 to P3:\n\n   ![Author-drawn three-level ResNet18 fusion example temporarily aligned to 512 channels, not the paper's FPN configuration](/content/papers/assets/fa61ea04d9cb77ceab71464131ecfa6225df2ee0e056f9d6f0a8deca001c5347.jpg)\n\n   Finally, here's a more practical architecture design, which might look like this:\n\n   ![Author-drawn 64-channel alignment example; the original FPN uses 256 channels and a 3×3 convolution on its outputs](/content/papers/assets/f844d693a7f7d79ac0f3574ff02f3e51cf23ad0a7e1e0fb33f4badcbf1ddbfa5.jpg)\n\n\n> [!TIP]\n> \n> Projecting each selected scale to matching channels before fusion is a convenient way to implement the path. The original FPN also applies a 3×3 convolution after fusion and retains multiple output scales for prediction.\n\n\n## Discussion\n\n### Is It Really Better?\n\nTo summarize the results: Yes.\n\nThe authors conducted several experiments to illustrate this, and we'll highlight some key charts from the paper. First, let's look at the ablation study provided in the paper:\n\n![Table 1 from the FPN paper: RPN average recall for 100 or 1000 proposals and pathway ablations on COCO minival](/content/papers/assets/525d026e9819e5ca28902c2fcf53b4a9dcac89c9a4fe63c42c69a312467538ff.jpg \"Lin et al., Feature Pyramid Networks for Object Detection, Table 1, arXiv:1612.03144v2; proposal AR, not detection AP\")\n\nThis table reports **RPN proposal average recall (AR)**, not detection AP, using up to 100 or 1000 proposals per image. At 1000 proposals, full FPN (c) reaches **56.3 AR**; bottom-up only, without the top-down path (d), reaches **49.5**; no lateral connections (e) reaches **46.1**; and only the finest level P2 (f) reaches **51.3**.\n\nAll three simplified variants trail full FPN, but by different amounts. These AR differences must not be reported as detection AP gains. Variant (f) also stays above the C4-only baseline (a) at **48.3**, so this is more specific than saying every change merely returns to baseline.\n\nNext, let's look at another table:\n\n![Table 4 from the FPN paper: single-model detection AP on COCO test-dev and test-std compared with competition entries](/content/papers/assets/1bdfa5e7f7f1f2baefc14e3b82173ba24d127e67ab7b7bdd1c9286226a1dd821.jpg \"Lin et al., Feature Pyramid Networks for Object Detection, Table 4, arXiv:1612.03144v2\")\n\nTable 4 then compares **single-model detection AP** with COCO competition entries, including G-RMI from 2016 and Faster R-CNN+++ from 2015. On test-dev, FPN's **36.2 AP** exceeds the best prior entry in the table, AttractioNet at **35.7 AP**, by **0.5 points**. This is a different task and metric from the RPN AR table above, not a controlled ablation of one fusion block.\n\n## Conclusion\n\nFPN introduces a simple framework that can be combined with various backbone networks to build powerful feature pyramids. This method shows significant improvements over multiple strong benchmark models and competition winners.\n\nFPN makes two points clear:\n\n- First, when addressing problems with multi-scale characteristics, consider techniques for merging features from different scales.\n- Second, feature fusion can be summarized in three steps: \"Bottom-up, top-down, then add.\"\n\nFollowing this paper, many discussions emerged, such as how to design better feature fusion strategies, improve fusion efficiency, or adjust fusion weights, among other scenarios.\n\nThere are many subsequent papers, and we’ll explore them together when we have time.\n","imageSizes":{"/content/papers/assets/4909dfc99cc56eb950023c336b6390fc9b1d1c637bba715e12905800bb1a12e8.jpg":{"width":1024,"height":887},"/content/papers/assets/23c14a4221a10712c8ac542bfc1ec79b53027b6ae90ccf4c8c4c20cea4d4c3a2.jpg":{"width":1024,"height":396},"/content/papers/assets/4ca885dc15ac0c6b967acb67ab9862d7d47faeec8cd44ea8b6047e52512bad57.jpg":{"width":1140,"height":828},"/content/papers/assets/fa61ea04d9cb77ceab71464131ecfa6225df2ee0e056f9d6f0a8deca001c5347.jpg":{"width":1024,"height":392},"/content/papers/assets/f844d693a7f7d79ac0f3574ff02f3e51cf23ad0a7e1e0fb33f4badcbf1ddbfa5.jpg":{"width":1024,"height":346},"/content/papers/assets/525d026e9819e5ca28902c2fcf53b4a9dcac89c9a4fe63c42c69a312467538ff.jpg":{"width":1024,"height":231},"/content/papers/assets/1bdfa5e7f7f1f2baefc14e3b82173ba24d127e67ab7b7bdd1c9286226a1dd821.jpg":{"width":1024,"height":218}}}
