Files
maths-cs-ai-compendium-zh/images/fpn_pyramid.svg
T

97 lines
6.5 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<svg width="700" height="300" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="fpn-arrow" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<polygon points="0 0, 7 2.5, 0 5" fill="#555"/>
</marker>
<marker id="fpn-arrow-green" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<polygon points="0 0, 7 2.5, 0 5" fill="#27ae60"/>
</marker>
<marker id="fpn-arrow-purple" markerWidth="7" markerHeight="5" refX="7" refY="2.5" orient="auto">
<polygon points="0 0, 7 2.5, 0 5" fill="#9b59b6"/>
</marker>
</defs>
<text x="350" y="22" fill="#333" font-size="14" font-weight="bold" text-anchor="middle">Feature Pyramid Network (FPN)</text>
<!-- Labels -->
<text x="120" y="48" fill="#3498db" font-size="11" font-weight="bold" text-anchor="middle">Bottom-Up</text>
<text x="120" y="62" fill="#3498db" font-size="9" text-anchor="middle">(backbone)</text>
<text x="350" y="48" fill="#9b59b6" font-size="11" font-weight="bold" text-anchor="middle">Lateral</text>
<text x="350" y="62" fill="#9b59b6" font-size="9" text-anchor="middle">(1×1 conv)</text>
<text x="530" y="48" fill="#27ae60" font-size="11" font-weight="bold" text-anchor="middle">Top-Down</text>
<text x="530" y="62" fill="#27ae60" font-size="9" text-anchor="middle">(+ upsample)</text>
<!-- Bottom-up pathway (left) -->
<!-- C2: large -->
<rect x="50" y="75" width="140" height="30" rx="3" fill="#3498db" opacity="0.12" stroke="#3498db" stroke-width="1.5"/>
<text x="120" y="95" fill="#3498db" font-size="9" text-anchor="middle" font-weight="bold">C2 (H/4 × W/4)</text>
<!-- Arrow down -->
<line x1="120" y1="105" x2="120" y2="125" stroke="#3498db" stroke-width="1.2" marker-end="url(#fpn-arrow)"/>
<!-- C3 -->
<rect x="65" y="130" width="110" height="30" rx="3" fill="#3498db" opacity="0.15" stroke="#3498db" stroke-width="1.5"/>
<text x="120" y="150" fill="#3498db" font-size="9" text-anchor="middle" font-weight="bold">C3 (H/8 × W/8)</text>
<!-- Arrow down -->
<line x1="120" y1="160" x2="120" y2="180" stroke="#3498db" stroke-width="1.2" marker-end="url(#fpn-arrow)"/>
<!-- C4 -->
<rect x="80" y="185" width="80" height="30" rx="3" fill="#3498db" opacity="0.18" stroke="#3498db" stroke-width="1.5"/>
<text x="120" y="205" fill="#3498db" font-size="9" text-anchor="middle" font-weight="bold">C4 (H/16)</text>
<!-- Arrow down -->
<line x1="120" y1="215" x2="120" y2="235" stroke="#3498db" stroke-width="1.2" marker-end="url(#fpn-arrow)"/>
<!-- C5 -->
<rect x="90" y="240" width="60" height="30" rx="3" fill="#3498db" opacity="0.22" stroke="#3498db" stroke-width="1.5"/>
<text x="120" y="260" fill="#3498db" font-size="9" text-anchor="middle" font-weight="bold">C5 (H/32)</text>
<!-- Lateral connections (1x1 conv arrows) -->
<line x1="190" y1="90" x2="380" y2="90" stroke="#9b59b6" stroke-width="1.2" stroke-dasharray="4,2" marker-end="url(#fpn-arrow-purple)"/>
<line x1="175" y1="145" x2="380" y2="145" stroke="#9b59b6" stroke-width="1.2" stroke-dasharray="4,2" marker-end="url(#fpn-arrow-purple)"/>
<line x1="160" y1="200" x2="380" y2="200" stroke="#9b59b6" stroke-width="1.2" stroke-dasharray="4,2" marker-end="url(#fpn-arrow-purple)"/>
<line x1="150" y1="255" x2="380" y2="255" stroke="#9b59b6" stroke-width="1.2" stroke-dasharray="4,2" marker-end="url(#fpn-arrow-purple)"/>
<!-- Top-down pathway + FPN outputs (right) -->
<!-- P5 -->
<rect x="460" y="240" width="60" height="30" rx="3" fill="#27ae60" opacity="0.15" stroke="#27ae60" stroke-width="1.5"/>
<text x="490" y="260" fill="#27ae60" font-size="9" text-anchor="middle" font-weight="bold">P5</text>
<!-- Merge node + P4 -->
<circle cx="420" y="200" r="8" fill="#fff" stroke="#f39c12" stroke-width="1.5"/>
<text x="420" y="204" fill="#f39c12" font-size="10" text-anchor="middle" font-weight="bold">+</text>
<line x1="490" y1="240" x2="420" y2="210" stroke="#27ae60" stroke-width="1.2" marker-end="url(#fpn-arrow-green)"/>
<text x="465" y="228" fill="#27ae60" font-size="7" text-anchor="middle">2× up</text>
<line x1="430" y1="200" x2="458" y2="200" stroke="#555" stroke-width="1.2" marker-end="url(#fpn-arrow)"/>
<rect x="460" y="185" width="80" height="30" rx="3" fill="#27ae60" opacity="0.15" stroke="#27ae60" stroke-width="1.5"/>
<text x="500" y="205" fill="#27ae60" font-size="9" text-anchor="middle" font-weight="bold">P4</text>
<!-- Merge node + P3 -->
<circle cx="420" y="145" r="8" fill="#fff" stroke="#f39c12" stroke-width="1.5"/>
<text x="420" y="149" fill="#f39c12" font-size="10" text-anchor="middle" font-weight="bold">+</text>
<line x1="490" y1="185" x2="420" y2="155" stroke="#27ae60" stroke-width="1.2" marker-end="url(#fpn-arrow-green)"/>
<text x="465" y="173" fill="#27ae60" font-size="7" text-anchor="middle">2× up</text>
<line x1="430" y1="145" x2="458" y2="145" stroke="#555" stroke-width="1.2" marker-end="url(#fpn-arrow)"/>
<rect x="460" y="130" width="110" height="30" rx="3" fill="#27ae60" opacity="0.15" stroke="#27ae60" stroke-width="1.5"/>
<text x="515" y="150" fill="#27ae60" font-size="9" text-anchor="middle" font-weight="bold">P3</text>
<!-- Merge node + P2 -->
<circle cx="420" y="90" r="8" fill="#fff" stroke="#f39c12" stroke-width="1.5"/>
<text x="420" y="94" fill="#f39c12" font-size="10" text-anchor="middle" font-weight="bold">+</text>
<line x1="500" y1="130" x2="420" y2="100" stroke="#27ae60" stroke-width="1.2" marker-end="url(#fpn-arrow-green)"/>
<text x="470" y="118" fill="#27ae60" font-size="7" text-anchor="middle">2× up</text>
<line x1="430" y1="90" x2="458" y2="90" stroke="#555" stroke-width="1.2" marker-end="url(#fpn-arrow)"/>
<rect x="460" y="75" width="140" height="30" rx="3" fill="#27ae60" opacity="0.15" stroke="#27ae60" stroke-width="1.5"/>
<text x="530" y="95" fill="#27ae60" font-size="9" text-anchor="middle" font-weight="bold">P2</text>
<!-- Detection labels on right -->
<text x="635" y="95" fill="#666" font-size="8" text-anchor="start">← small objects</text>
<text x="605" y="150" fill="#666" font-size="8" text-anchor="start">← medium</text>
<text x="575" y="205" fill="#666" font-size="8" text-anchor="start">← medium</text>
<text x="535" y="260" fill="#666" font-size="8" text-anchor="start">← large objects</text>
<!-- Bottom note -->
<rect x="100" y="278" width="500" height="18" rx="4" fill="#f5f5f5" stroke="#333" stroke-width="1"/>
<text x="350" y="291" fill="#666" font-size="9" text-anchor="middle">Each pyramid level has strong semantics (from top-down path) and good spatial resolution (from bottom-up).</text>
</svg>