"<!DOCTYPE html>\n<html lang=\"zh\" data-theme=\"light\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>fulltext.txt — Vercel Design System</title>\n<link rel=\"preconnect\" href=\"https://fonts.googleapis.com\">\n<link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin>\n<link href=\"https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap\" rel=\"stylesheet\">\n<link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/katex.min.css\">\n<style>\n\n:root {\n  /* Vercel Palette */\n  --geist-foreground: #171717;\n  --geist-background: #ffffff;\n  --geist-secondary: #4d4d4d;\n  --geist-tertiary: #666666;\n  --geist-quaternary: #808080;\n  --geist-border: #ebebeb;\n  --geist-surface-tint: #fafafa;\n  \n  /* Workflow Accents */\n  --develop-blue: #0a72ef;\n  --preview-pink: #de1d8d;\n  --ship-red: #ff5b4f;\n  \n  /* Interactive & Status */\n  --link-blue: #0072f5;\n  --ds-focus-color: hsla(212, 100%, 48%, 1);\n  --badge-blue-bg: #ebf5ff;\n  --badge-blue-text: #0068d6;\n  \n  /* Shadow-as-Border Philosophy */\n  --shadow-border: rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;\n  --shadow-border-hover: rgba(0, 0, 0, 0.16) 0px 0px 0px 1px;\n  --shadow-card: rgba(0, 0, 0, 0.08) 0px 0px 0px 1px, rgba(0, 0, 0, 0.04) 0px 2px 2px, #fafafa 0px 0px 0px 1px;\n  --shadow-card-hover: rgba(0, 0, 0, 0.12) 0px 0px 0px 1px, rgba(0, 0, 0, 0.06) 0px 4px 6px, #fafafa 0px 0px 0px 1px;\n  --shadow-card-full: rgba(0, 0, 0, 0.08) 0px 0px 0px 1px, rgba(0, 0, 0, 0.04) 0px 2px 2px, rgba(0, 0, 0, 0.04) 0px 8px 8px -8px, #fafafa 0px 0px 0px 1px;\n  --shadow-ring: rgb(235, 235, 235) 0px 0px 0px 1px;\n  \n  /* Radius Scale */\n  --radius-xs: 2px;\n  --radius-sm: 4px;\n  --radius-md: 6px;\n  --radius-lg: 8px;\n  --radius-xl: 12px;\n  --radius-pill: 9999px;\n}\n\n[data-theme=\"dark\"] {\n  --geist-foreground: #ededed;\n  --geist-background: #000000;\n  --geist-secondary: #a1a1a1;\n  --geist-tertiary: #888888;\n  --geist-quaternary: #666666;\n  --geist-border: #222222;\n  --geist-surface-tint: #0a0a0a;\n  \n  --shadow-border: rgba(255, 255, 255, 0.14) 0px 0px 0px 1px;\n  --shadow-border-hover: rgba(255, 255, 255, 0.28) 0px 0px 0px 1px;\n  --shadow-card: rgba(255, 255, 255, 0.12) 0px 0px 0px 1px, rgba(0, 0, 0, 0.4) 0px 2px 4px, #111111 0px 0px 0px 1px;\n  --shadow-card-hover: rgba(255, 255, 255, 0.2) 0px 0px 0px 1px, rgba(0, 0, 0, 0.5) 0px 6px 12px, #111111 0px 0px 0px 1px;\n  --shadow-card-full: rgba(255, 255, 255, 0.12) 0px 0px 0px 1px, rgba(0, 0, 0, 0.5) 0px 8px 16px -4px, #111111 0px 0px 0px 1px;\n  --shadow-ring: rgb(40, 40, 40) 0px 0px 0px 1px;\n  \n  --badge-blue-bg: rgba(10, 114, 239, 0.15);\n  --badge-blue-text: #70b5ff;\n}\n\n* { box-sizing: border-box; }\nhtml { scroll-behavior: smooth; }\nbody {\n  margin: 0;\n  font-family: \"Geist\", Arial, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif;\n  background-color: var(--geist-background);\n  color: var(--geist-foreground);\n  font-feature-settings: \"liga\" 1;\n  -webkit-font-smoothing: antialiased;\n  min-height: 100vh;\n}\n\na {\n  color: inherit;\n  text-decoration: none;\n  transition: color 0.15s ease;\n}\n\n/* 导航栏 (Vercel Clean Sticky Nav) */\n.vercel-nav {\n  position: sticky;\n  top: 0;\n  background-color: var(--geist-background);\n  box-shadow: var(--shadow-border);\n  z-index: 100;\n  padding: 0 24px;\n  height: 64px;\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n}\n.nav-brand {\n  display: flex;\n  align-items: center;\n  gap: 12px;\n}\n.vercel-triangle {\n  width: 22px;\n  height: 19px;\n  fill: var(--geist-foreground);\n}\n.nav-title {\n  font-size: 16px;\n  font-weight: 600;\n  letter-spacing: -0.32px;\n  color: var(--geist-foreground);\n}\n.nav-badge-pill {\n  font-family: \"Geist Mono\", ui-monospace, monospace;\n  font-size: 11px;\n  font-weight: 500;\n  text-transform: uppercase;\n  background: var(--badge-blue-bg);\n  color: var(--badge-blue-text);\n  padding: 2px 8px;\n  border-radius: var(--radius-pill);\n}\n\n.nav-links {\n  display: flex;\n  align-items: center;\n  gap: 24px;\n}\n.nav-link {\n  font-size: 14px;\n  font-weight: 500;\n  color: var(--geist-secondary);\n  text-decoration: none;\n  transition: color 0.15s;\n}\n.nav-link:hover, .nav-link.active {\n  color: var(--geist-foreground);\n}\n.nav-link.active {\n  font-weight: 600;\n}\n\n.nav-actions {\n  display: flex;\n  align-items: center;\n  gap: 12px;\n}\n\n/* 按钮规范 */\n.btn-primary-dark {\n  background: var(--geist-foreground);\n  color: var(--geist-background);\n  border: none;\n  padding: 8px 16px;\n  border-radius: var(--radius-md);\n  font-size: 14px;\n  font-weight: 500;\n  cursor: pointer;\n  text-decoration: none;\n  display: inline-flex;\n  align-items: center;\n  gap: 6px;\n  transition: opacity 0.15s;\n}\n.btn-primary-dark:hover {\n  opacity: 0.9;\n}\n.btn-secondary-white {\n  background: var(--geist-background);\n  color: var(--geist-foreground);\n  box-shadow: var(--shadow-border);\n  border: none;\n  padding: 8px 16px;\n  border-radius: var(--radius-md);\n  font-size: 14px;\n  font-weight: 500;\n  cursor: pointer;\n  text-decoration: none;\n  display: inline-flex;\n  align-items: center;\n  gap: 6px;\n  transition: background 0.15s, box-shadow 0.15s;\n}\n.btn-secondary-white:hover {\n  background: var(--geist-surface-tint);\n  box-shadow: var(--shadow-border-hover);\n}\n.theme-toggle-btn {\n  background: transparent;\n  border: none;\n  box-shadow: var(--shadow-border);\n  border-radius: var(--radius-md);\n  width: 36px;\n  height: 36px;\n  cursor: pointer;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  color: var(--geist-foreground);\n}\n\n/* 核心容器 */\n.vercel-container {\n  max-width: 1200px;\n  margin: 0 auto;\n  padding: 56px 24px 100px;\n}\n\n/* Hero Section (Gallery Emptiness + Negative Letter-spacing) */\n.vercel-hero {\n  text-align: center;\n  max-width: 860px;\n  margin: 0 auto 56px;\n}\n.hero-stage-badge {\n  display: inline-flex;\n  align-items: center;\n  gap: 8px;\n  background: var(--geist-surface-tint);\n  box-shadow: var(--shadow-border);\n  padding: 4px 14px;\n  border-radius: var(--radius-pill);\n  font-size: 13px;\n  font-weight: 500;\n  color: var(--geist-secondary);\n  margin-bottom: 24px;\n}\n.stage-dot {\n  width: 7px;\n  height: 7px;\n  border-radius: 50%;\n}\n.vercel-hero h1 {\n  font-size: 48px;\n  font-weight: 600;\n  line-height: 1.05;\n  letter-spacing: -2.4px;\n  color: var(--geist-foreground);\n  margin: 0 0 16px;\n}\n.vercel-hero p {\n  font-size: 20px;\n  font-weight: 400;\n  line-height: 1.80;\n  color: var(--geist-secondary);\n  margin: 0 auto 28px;\n}\n\n/* Workflow Pipeline (Develop -> Preview -> Ship) */\n.workflow-pipeline {\n  display: grid;\n  grid-template-columns: repeat(3, 1fr);\n  gap: 16px;\n  margin-bottom: 48px;\n}\n@media (max-width: 768px) {\n  .workflow-pipeline { grid-template-columns: 1fr; }\n}\n.workflow-step {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card);\n  border-radius: var(--radius-lg);\n  padding: 20px 22px;\n  transition: box-shadow 0.2s;\n}\n.workflow-step:hover {\n  box-shadow: var(--shadow-card-hover);\n}\n.step-mono-label {\n  font-family: \"Geist Mono\", monospace;\n  font-size: 12px;\n  font-weight: 500;\n  text-transform: uppercase;\n  letter-spacing: 0.5px;\n  margin-bottom: 8px;\n  display: flex;\n  align-items: center;\n  gap: 6px;\n}\n.step-title {\n  font-size: 20px;\n  font-weight: 600;\n  letter-spacing: -0.96px;\n  color: var(--geist-foreground);\n  margin-bottom: 6px;\n}\n.step-desc {\n  font-size: 14px;\n  color: var(--geist-secondary);\n  line-height: 1.5;\n}\n\n/* Metric Cards (Section 4 Spec) */\n.metric-grid {\n  display: grid;\n  grid-template-columns: repeat(4, 1fr);\n  gap: 16px;\n  margin-bottom: 48px;\n}\n@media (max-width: 900px) {\n  .metric-grid { grid-template-columns: repeat(2, 1fr); }\n}\n.metric-card {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card);\n  border-radius: var(--radius-lg);\n  padding: 20px;\n}\n.metric-number {\n  font-size: 40px;\n  font-weight: 600;\n  line-height: 1.0;\n  letter-spacing: -2.4px;\n  color: var(--geist-foreground);\n  margin-bottom: 8px;\n  font-feature-settings: \"tnum\" 1;\n}\n.metric-label {\n  font-size: 14px;\n  color: var(--geist-secondary);\n  line-height: 1.4;\n}\n\n/* VAD 专栏 Banner (Ship Red & Vercel Clean) */\n.vad-showcase {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card-full);\n  border-radius: var(--radius-xl);\n  padding: 32px;\n  margin-bottom: 48px;\n  position: relative;\n}\n.vad-header-row {\n  display: flex;\n  align-items: baseline;\n  justify-content: space-between;\n  flex-wrap: wrap;\n  gap: 12px;\n  margin-bottom: 12px;\n}\n.vad-header-row h2 {\n  font-size: 32px;\n  font-weight: 600;\n  letter-spacing: -1.28px;\n  color: var(--geist-foreground);\n  margin: 0;\n}\n.vad-pillars-grid {\n  display: grid;\n  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));\n  gap: 14px;\n  margin-top: 24px;\n}\n.vad-pillar-item {\n  background: var(--geist-surface-tint);\n  box-shadow: var(--shadow-border);\n  border-radius: var(--radius-md);\n  padding: 14px 16px;\n}\n.vad-pillar-title {\n  font-size: 14px;\n  font-weight: 600;\n  color: var(--ship-red);\n  margin-bottom: 4px;\n}\n.vad-pillar-text {\n  font-size: 13px;\n  color: var(--geist-secondary);\n  line-height: 1.5;\n}\n.vad-filter-bar {\n  display: flex;\n  flex-wrap: wrap;\n  align-items: center;\n  justify-content: space-between;\n  gap: 12px;\n  margin: 24px 0 16px;\n  padding: 12px 16px;\n  background: var(--geist-surface-tint);\n  border-radius: var(--radius-md);\n  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);\n}\n.vad-filter-btn {\n  font-family: 'Geist', sans-serif;\n  font-size: 13px;\n  font-weight: 500;\n  padding: 6px 14px;\n  border-radius: 9999px;\n  border: none;\n  background: transparent;\n  color: var(--geist-secondary);\n  cursor: pointer;\n  transition: all 0.15s ease;\n}\n.vad-filter-btn:hover {\n  color: var(--geist-foreground);\n  background: rgba(0,0,0,0.05);\n}\n.vad-filter-btn.active {\n  background: #171717;\n  color: #ffffff;\n}\n.vad-search-input {\n  font-family: 'Geist', sans-serif;\n  font-size: 13px;\n  padding: 7px 12px;\n  border-radius: 6px;\n  border: 1px solid var(--geist-border);\n  background: #ffffff;\n  color: var(--geist-foreground);\n  width: 280px;\n  outline: none;\n  transition: border-color 0.15s, box-shadow 0.15s;\n}\n.vad-search-input:focus {\n  border-color: #0a72ef;\n  box-shadow: 0 0 0 2px rgba(10, 114, 239, 0.2);\n}\n\n/* 控制栏：搜索、视图、筛选 */\n.control-bar {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  gap: 16px;\n  margin-bottom: 24px;\n  flex-wrap: wrap;\n}\n.search-input-wrap {\n  position: relative;\n  flex: 1;\n  max-width: 480px;\n}\n.search-input {\n  width: 100%;\n  height: 40px;\n  padding: 0 38px 0 14px;\n  font-family: \"Geist\", sans-serif;\n  font-size: 14px;\n  color: var(--geist-foreground);\n  background: var(--geist-background);\n  box-shadow: var(--shadow-border);\n  border: none;\n  border-radius: var(--radius-md);\n  outline: none;\n  transition: box-shadow 0.15s;\n}\n.search-input:focus {\n  outline: 2px solid var(--ds-focus-color);\n  box-shadow: none;\n}\n.search-kbd {\n  position: absolute;\n  right: 12px;\n  top: 50%;\n  transform: translateY(-50%);\n  font-family: \"Geist Mono\", monospace;\n  font-size: 11px;\n  color: var(--geist-quaternary);\n  background: var(--geist-surface-tint);\n  box-shadow: var(--shadow-border);\n  padding: 2px 6px;\n  border-radius: var(--radius-sm);\n}\n\n.view-switcher {\n  display: flex;\n  box-shadow: var(--shadow-border);\n  border-radius: var(--radius-md);\n  background: var(--geist-background);\n  padding: 2px;\n}\n.view-btn {\n  background: transparent;\n  border: none;\n  font-size: 13px;\n  font-weight: 500;\n  color: var(--geist-tertiary);\n  padding: 6px 12px;\n  border-radius: var(--radius-sm);\n  cursor: pointer;\n  transition: color 0.15s, background 0.15s;\n}\n.view-btn.active {\n  background: var(--geist-surface-tint);\n  color: var(--geist-foreground);\n  font-weight: 600;\n}\n\n/* 筛选芯片行 (Filter Pill Strip) */\n.filter-group-strip {\n  display: flex;\n  flex-direction: column;\n  gap: 12px;\n  margin-bottom: 28px;\n  padding: 16px 20px;\n  background: var(--geist-surface-tint);\n  box-shadow: var(--shadow-border);\n  border-radius: var(--radius-lg);\n}\n.filter-row {\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  flex-wrap: wrap;\n}\n.filter-label-mono {\n  font-family: \"Geist Mono\", monospace;\n  font-size: 11px;\n  font-weight: 500;\n  text-transform: uppercase;\n  color: var(--geist-quaternary);\n  min-width: 68px;\n}\n.pill-badge {\n  background: var(--geist-background);\n  color: var(--geist-secondary);\n  box-shadow: var(--shadow-border);\n  border: none;\n  padding: 3px 12px;\n  border-radius: var(--radius-pill);\n  font-size: 12px;\n  font-weight: 500;\n  cursor: pointer;\n  transition: all 0.15s;\n  display: inline-flex;\n  align-items: center;\n  gap: 6px;\n}\n.pill-badge:hover {\n  color: var(--geist-foreground);\n  box-shadow: var(--shadow-border-hover);\n}\n.pill-badge.active {\n  background: var(--geist-foreground);\n  color: var(--geist-background);\n  font-weight: 600;\n  box-shadow: none;\n}\n.pill-badge.active-blue {\n  background: var(--develop-blue);\n  color: #ffffff;\n  box-shadow: none;\n}\n.pill-badge.active-red {\n  background: var(--ship-red);\n  color: #ffffff;\n  box-shadow: none;\n}\n\n/* Bento Grid Cards (Section 4 & 6 Spec) */\n.card-grid-bento {\n  display: grid;\n  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));\n  gap: 16px;\n}\n.vercel-card {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card);\n  border-radius: var(--radius-lg);\n  padding: 20px;\n  display: flex;\n  flex-direction: column;\n  justify-content: space-between;\n  transition: box-shadow 0.2s, transform 0.2s;\n  text-decoration: none;\n  color: inherit;\n  overflow: hidden;\n  min-width: 0;\n  word-break: break-word;\n}\n.vercel-card:hover {\n  box-shadow: var(--shadow-card-hover);\n  transform: translateY(-2px);\n}\n.card-top {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  margin-bottom: 12px;\n  gap: 8px;\n}\n.card-tag-mono {\n  font-family: \"Geist Mono\", monospace;\n  font-size: 11px;\n  font-weight: 500;\n  text-transform: uppercase;\n  color: var(--geist-quaternary);\n  letter-spacing: 0.5px;\n}\n.status-pill-badge {\n  padding: 2px 8px;\n  border-radius: var(--radius-pill);\n  font-size: 11px;\n  font-weight: 500;\n  flex-shrink: 0;\n}\n.pub-accepted { background: #ebfdf2; color: #027a48; }\n.pub-workshop { background: #eff8ff; color: #175cd3; }\n.pub-submitted { background: #fff8e6; color: #b54708; }\n.pub-preprint { background: #f2f4f7; color: #475467; }\n.pub-other { background: #f9f5ff; color: #6941c6; }\n\n[data-theme=\"dark\"] .pub-accepted { background: rgba(2, 122, 72, 0.2); color: #32d583; }\n[data-theme=\"dark\"] .pub-workshop { background: rgba(23, 92, 211, 0.2); color: #84caff; }\n[data-theme=\"dark\"] .pub-submitted { background: rgba(181, 71, 8, 0.2); color: #fec84b; }\n[data-theme=\"dark\"] .pub-preprint { background: rgba(71, 84, 103, 0.2); color: #98a2b3; }\n[data-theme=\"dark\"] .pub-other { background: rgba(105, 65, 198, 0.2); color: #d6bbfb; }\n\n/* 必读标杆徽章 (Vercel Amber Accent) */\n.milestone-badge {\n  display: inline-flex;\n  align-items: center;\n  gap: 3px;\n  padding: 2px 7px;\n  border-radius: var(--radius-pill);\n  font-size: 11px;\n  font-weight: 600;\n  white-space: nowrap;\n  flex-shrink: 0;\n  transition: all 0.15s ease;\n}\n.milestone-badge.ms-idea, .milestone-badge:not([class*=\"ms-\"]) {\n  color: #b54708;\n  background: #fff8e6;\n  border: 1px solid rgba(247, 144, 9, 0.35);\n  box-shadow: 0 1px 2px rgba(181, 71, 8, 0.05);\n}\n[data-theme=\"dark\"] .milestone-badge.ms-idea, [data-theme=\"dark\"] .milestone-badge:not([class*=\"ms-\"]) {\n  color: #fec84b;\n  background: rgba(181, 71, 8, 0.22);\n  border-color: rgba(254, 200, 75, 0.35);\n}\n.milestone-badge.ms-writing {\n  color: #6941c6;\n  background: #f9f5ff;\n  border: 1px solid rgba(105, 65, 198, 0.3);\n  box-shadow: 0 1px 2px rgba(105, 65, 198, 0.05);\n}\n[data-theme=\"dark\"] .milestone-badge.ms-writing {\n  color: #d6bbfb;\n  background: rgba(105, 65, 198, 0.22);\n  border-color: rgba(214, 187, 251, 0.35);\n}\n.milestone-badge.ms-value {\n  color: #027a48;\n  background: #ebfdf2;\n  border: 1px solid rgba(2, 122, 72, 0.3);\n  box-shadow: 0 1px 2px rgba(2, 122, 72, 0.05);\n}\n[data-theme=\"dark\"] .milestone-badge.ms-value {\n  color: #32d583;\n  background: rgba(2, 122, 72, 0.22);\n  border-color: rgba(50, 213, 131, 0.35);\n}\n\n/* 论文正文图表与插图卡片样式 (Geist Design) */\n.paper-figure, .article-body figure {\n  margin: 32px auto;\n  text-align: center;\n  max-width: 100%;\n}\n.paper-figure img, .article-body img {\n  max-width: 96%;\n  height: auto;\n  border-radius: var(--radius-md);\n  border: 1px solid var(--geist-border);\n  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);\n  background: #ffffff;\n  transition: transform 0.2s ease, box-shadow 0.2s ease;\n  display: block;\n  margin: 0 auto;\n}\n.paper-figure img:hover, .article-body img:hover {\n  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);\n}\n.paper-figure figcaption, .article-body figcaption {\n  font-size: 13px;\n  color: var(--geist-secondary);\n  margin-top: 10px;\n  line-height: 1.6;\n  font-style: italic;\n  max-width: 850px;\n  margin-left: auto;\n  margin-right: auto;\n}\n\n/* VAD 视图切换器 View Switcher */\n.vad-view-switcher {\n  display: inline-flex;\n  padding: 3px;\n  background: var(--geist-secondary-bg);\n  border: 1px solid var(--geist-border);\n  border-radius: 8px;\n  margin-bottom: 20px;\n  gap: 2px;\n}\n.view-switch-btn {\n  display: inline-flex;\n  align-items: center;\n  gap: 6px;\n  padding: 6px 14px;\n  font-size: 13px;\n  font-weight: 500;\n  color: var(--geist-secondary);\n  border-radius: 6px;\n  text-decoration: none;\n  transition: all 0.15s ease;\n}\n.view-switch-btn:hover {\n  color: var(--geist-foreground);\n  background: rgba(0, 0, 0, 0.04);\n}\n[data-theme=\"dark\"] .view-switch-btn:hover {\n  background: rgba(255, 255, 255, 0.06);\n}\n.view-switch-btn.active {\n  background: var(--geist-background);\n  color: var(--geist-foreground);\n  font-weight: 600;\n  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);\n}\n\n/* 关系图谱 Graph View Styles */\n.graph-container {\n  position: relative;\n  width: 100%;\n  height: 720px;\n  background: var(--geist-background);\n  border: 1px solid var(--geist-border);\n  border-radius: var(--radius-lg);\n  overflow: hidden;\n  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);\n  margin-bottom: 40px;\n}\n.graph-toolbar {\n  position: absolute;\n  top: 14px;\n  left: 14px;\n  right: 14px;\n  z-index: 10;\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n  background: var(--geist-background);\n  border: 1px solid var(--geist-border);\n  padding: 8px 14px;\n  border-radius: 8px;\n  box-shadow: 0 4px 16px rgba(0,0,0,0.06);\n  flex-wrap: wrap;\n  gap: 8px;\n}\n.graph-tool-title {\n  font-size: 13px;\n  font-weight: 700;\n  display: flex;\n  align-items: center;\n  gap: 6px;\n  color: var(--geist-foreground);\n}\n.graph-filter-group {\n  display: flex;\n  gap: 6px;\n  align-items: center;\n  flex-wrap: wrap;\n}\n.graph-chip {\n  font-size: 11px;\n  padding: 3px 8px;\n  border-radius: 4px;\n  border: 1px solid var(--geist-border);\n  background: var(--geist-background);\n  color: var(--geist-foreground);\n  cursor: pointer;\n  transition: all 0.15s ease;\n}\n.graph-chip:hover { background: var(--geist-secondary-bg); }\n.graph-chip.active {\n  background: var(--geist-foreground);\n  color: var(--geist-background);\n  border-color: var(--geist-foreground);\n}\n.graph-search-input {\n  padding: 3px 8px;\n  font-size: 11px;\n  border-radius: 4px;\n  border: 1px solid var(--geist-border);\n  background: var(--geist-background);\n  color: var(--geist-foreground);\n  outline: none;\n  width: 150px;\n}\n#vad-graph-svg {\n  width: 100%;\n  height: 100%;\n  cursor: grab;\n}\n#vad-graph-svg:active { cursor: grabbing; }\n.graph-legend {\n  position: absolute;\n  bottom: 14px;\n  left: 14px;\n  background: var(--geist-background);\n  border: 1px solid var(--geist-border);\n  border-radius: 8px;\n  padding: 10px 14px;\n  font-size: 11px;\n  box-shadow: 0 4px 16px rgba(0,0,0,0.06);\n  z-index: 10;\n  line-height: 1.6;\n  pointer-events: none;\n}\n.graph-legend-row { display: flex; align-items: center; gap: 8px; }\n.graph-legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }\n.graph-info-drawer {\n  position: absolute;\n  top: 66px;\n  right: 14px;\n  width: 310px;\n  max-height: 620px;\n  background: var(--geist-background);\n  border: 1px solid var(--geist-border);\n  border-radius: 8px;\n  box-shadow: 0 8px 30px rgba(0,0,0,0.12);\n  z-index: 10;\n  padding: 16px;\n  overflow-y: auto;\n  display: none;\n  backdrop-filter: blur(10px);\n  transition: transform 0.2s ease, opacity 0.2s ease;\n}\n.graph-drawer-close {\n  position: absolute;\n  top: 10px;\n  right: 12px;\n  cursor: pointer;\n  font-size: 16px;\n  color: var(--geist-tertiary);\n}\n.graph-drawer-badge {\n  display: inline-block;\n  padding: 2px 6px;\n  border-radius: 4px;\n  font-size: 10px;\n  font-weight: 600;\n  margin-bottom: 6px;\n}\n.graph-drawer-title {\n  font-size: 13px;\n  font-weight: 700;\n  line-height: 1.4;\n  margin-bottom: 8px;\n  color: var(--geist-foreground);\n}\n.graph-drawer-meta {\n  font-size: 11px;\n  color: var(--geist-secondary);\n  margin-bottom: 12px;\n}\n.graph-drawer-core {\n  font-size: 12px;\n  line-height: 1.6;\n  color: var(--geist-foreground);\n  background: var(--geist-secondary-bg);\n  padding: 8px 10px;\n  border-radius: 6px;\n  margin-bottom: 12px;\n  border: 1px solid var(--geist-border);\n}\n.graph-drawer-link {\n  display: block;\n  text-align: center;\n  padding: 7px 12px;\n  background: var(--geist-foreground);\n  color: var(--geist-background);\n  border-radius: 6px;\n  font-size: 12px;\n  font-weight: 600;\n  text-decoration: none;\n  transition: opacity 0.15s ease;\n  margin-bottom: 6px;\n}\n.graph-drawer-link:hover { opacity: 0.85; }\n.graph-drawer-pdf-link {\n  display: block;\n  text-align: center;\n  padding: 6px 12px;\n  background: var(--geist-secondary-bg);\n  color: var(--geist-foreground);\n  border: 1px solid var(--geist-border);\n  border-radius: 6px;\n  font-size: 11px;\n  font-weight: 500;\n  text-decoration: none;\n  transition: all 0.15s ease;\n}\n.graph-drawer-pdf-link:hover { background: var(--geist-border); }\n.node-circle {\n  cursor: pointer;\n  transition: r 0.2s, stroke-width 0.2s;\n}\n.node-label {\n  font-size: 10px;\n  font-weight: 600;\n  fill: var(--geist-foreground);\n  pointer-events: none;\n  text-shadow: 0 1px 2px var(--geist-background);\n}\n.link-line {\n  stroke: var(--geist-border);\n  stroke-opacity: 0.6;\n  stroke-width: 1.2;\n  transition: stroke 0.2s, stroke-width 0.2s, stroke-opacity 0.2s;\n}\n.link-label {\n  font-size: 9px;\n  fill: var(--geist-tertiary);\n  pointer-events: none;\n  text-anchor: middle;\n}\n\n/* 引用框与警示框 Alerts */\n.callout-alert {\n  margin: 20px 0;\n  padding: 14px 18px;\n  border-radius: var(--radius-md);\n  transition: all 0.15s ease;\n}\n.callout-important, .callout-idea {\n  border-left: 4px solid #b54708;\n  background: rgba(181, 71, 8, 0.06);\n  box-shadow: inset 0 0 0 1px rgba(247, 144, 9, 0.3);\n}\n[data-theme=\"dark\"] .callout-important, [data-theme=\"dark\"] .callout-idea {\n  border-left-color: #fec84b;\n  background: rgba(181, 71, 8, 0.18);\n  box-shadow: inset 0 0 0 1px rgba(254, 200, 75, 0.25);\n}\n.callout-writing {\n  border-left: 4px solid #6941c6;\n  background: rgba(105, 65, 198, 0.06);\n  box-shadow: inset 0 0 0 1px rgba(105, 65, 198, 0.3);\n}\n[data-theme=\"dark\"] .callout-writing {\n  border-left-color: #d6bbfb;\n  background: rgba(105, 65, 198, 0.18);\n  box-shadow: inset 0 0 0 1px rgba(214, 187, 251, 0.25);\n}\n.callout-value {\n  border-left: 4px solid #027a48;\n  background: rgba(2, 122, 72, 0.06);\n  box-shadow: inset 0 0 0 1px rgba(2, 122, 72, 0.3);\n}\n[data-theme=\"dark\"] .callout-value {\n  border-left-color: #32d583;\n  background: rgba(2, 122, 72, 0.18);\n  box-shadow: inset 0 0 0 1px rgba(50, 213, 131, 0.25);\n}\n\n.card-title {\n  font-size: 16.5px;\n  font-weight: 600;\n  line-height: 1.42;\n  letter-spacing: -0.4px;\n  color: var(--geist-foreground);\n  margin: 0 0 10px;\n  word-break: break-word;\n  overflow-wrap: anywhere;\n  hyphens: auto;\n}\n.card-title a {\n  color: var(--geist-foreground);\n  text-decoration: none;\n  display: inline;\n  transition: color 0.15s ease;\n}\n.card-title a:hover {\n  color: var(--develop-blue);\n  text-decoration: none;\n}\n.card-id-mono {\n  font-family: \"Geist Mono\", monospace;\n  font-size: 13px;\n  font-weight: 500;\n  color: var(--geist-quaternary);\n  margin-right: 5px;\n}\n.card-meta-row {\n  display: flex;\n  gap: 6px;\n  flex-wrap: wrap;\n  margin-bottom: 12px;\n}\n.meta-token {\n  font-size: 12px;\n  color: var(--geist-tertiary);\n  background: var(--geist-surface-tint);\n  box-shadow: var(--shadow-ring);\n  padding: 2px 7px;\n  border-radius: var(--radius-sm);\n  white-space: nowrap;\n}\n.card-body-text {\n  font-size: 13.5px;\n  color: var(--geist-secondary);\n  line-height: 1.6;\n  margin-bottom: 16px;\n  flex-grow: 1;\n  word-break: break-word;\n  overflow-wrap: anywhere;\n}\n.card-body-text strong {\n  color: var(--geist-foreground);\n  font-weight: 600;\n}\n\n.card-footer {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  border-top: 1px solid var(--geist-border);\n  padding-top: 14px;\n}\n.card-link-action {\n  font-size: 13.5px;\n  font-weight: 500;\n  color: var(--link-blue);\n  display: inline-flex;\n  align-items: center;\n  gap: 4px;\n  text-decoration: none;\n  transition: all 0.15s ease;\n}\n.card-link-action:hover {\n  opacity: 0.85;\n  transform: translateX(2px);\n}\na.meta-token {\n  transition: all 0.15s ease;\n  cursor: pointer;\n  text-decoration: none;\n}\na.meta-token:hover {\n  background: var(--geist-selection);\n  color: var(--geist-foreground);\n  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);\n}\n\n/* 紧凑列表视图 (List View) */\n.card-list-view {\n  display: flex;\n  flex-direction: column;\n  gap: 8px;\n}\n.list-row-item {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card);\n  border-radius: var(--radius-md);\n  padding: 12px 18px;\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  gap: 16px;\n  transition: box-shadow 0.15s;\n}\n.list-row-item:hover {\n  box-shadow: var(--shadow-card-hover);\n}\n\n/* 阅读详情页 (Report Detail) */\n.reading-container {\n  display: grid;\n  grid-template-columns: minmax(0, 1fr) 260px;\n  gap: 40px;\n  align-items: start;\n}\n@media (max-width: 960px) {\n  .reading-container { grid-template-columns: 1fr; }\n  .reading-sidebar { display: none; }\n}\n\n.report-header-card {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card);\n  border-radius: var(--radius-lg);\n  padding: 28px 32px;\n  margin-bottom: 28px;\n}\n.crumb-bar {\n  font-size: 13px;\n  color: var(--geist-tertiary);\n  margin-bottom: 10px;\n}\n.report-title {\n  font-size: 32px;\n  font-weight: 600;\n  letter-spacing: -1.28px;\n  margin: 0 0 16px;\n  color: var(--geist-foreground);\n}\n.report-action-buttons {\n  display: flex;\n  align-items: center;\n  gap: 10px;\n  flex-wrap: wrap;\n  border-top: 1px solid var(--geist-border);\n  padding-top: 16px;\n  margin-top: 16px;\n}\n\n.article-body {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card-full);\n  border-radius: var(--radius-lg);\n  padding: 36px 42px 80px;\n  font-size: 16px;\n  line-height: 1.75;\n  color: var(--geist-foreground);\n}\n.article-body h1, .article-body h2, .article-body h3 {\n  color: var(--geist-foreground);\n  scroll-margin-top: 80px;\n}\n.article-body h1 { font-size: 28px; font-weight: 600; letter-spacing: -1.28px; border-bottom: 1px solid var(--geist-border); padding-bottom: 8px; margin-top: 32px; }\n.article-body h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.96px; border-bottom: 1px solid var(--geist-border); padding-bottom: 6px; margin-top: 36px; }\n.article-body h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.32px; margin-top: 26px; }\n.article-body table {\n  width: 100%;\n  border-collapse: collapse;\n  margin: 24px 0;\n  font-size: 14px;\n  box-shadow: var(--shadow-border);\n  border-radius: var(--radius-md);\n  overflow: hidden;\n}\n.article-body th, .article-body td {\n  padding: 10px 14px;\n  text-align: left;\n  border-bottom: 1px solid var(--geist-border);\n}\n.article-body th {\n  background: var(--geist-surface-tint);\n  font-weight: 600;\n  color: var(--geist-foreground);\n}\n.article-body blockquote {\n  border-left: 2px solid var(--geist-foreground);\n  margin: 20px 0;\n  padding: 8px 18px;\n  color: var(--geist-secondary);\n  font-style: normal;\n}\n.article-body code {\n  font-family: \"Geist Mono\", monospace;\n  font-size: 13.5px;\n  box-shadow: var(--shadow-ring);\n  background: var(--geist-surface-tint);\n  padding: 2px 6px;\n  border-radius: var(--radius-sm);\n}\n.article-body pre {\n  position: relative;\n  background: #000000;\n  color: #ededed;\n  box-shadow: var(--shadow-border);\n  border-radius: var(--radius-md);\n  padding: 18px;\n  margin: 24px 0;\n  overflow-x: auto;\n}\n.article-body pre code {\n  background: transparent;\n  box-shadow: none;\n  padding: 0;\n  color: inherit;\n  font-size: 13px;\n}\n.copy-code-btn {\n  position: absolute;\n  top: 8px;\n  right: 10px;\n  font-family: \"Geist Mono\", monospace;\n  font-size: 11px;\n  background: #171717;\n  color: #ffffff;\n  border: 1px solid #333333;\n  padding: 3px 8px;\n  border-radius: var(--radius-sm);\n  cursor: pointer;\n}\n\n/* 侧边大纲 (TOC) */\n.reading-sidebar {\n  position: sticky;\n  top: 80px;\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card);\n  border-radius: var(--radius-lg);\n  padding: 20px;\n  max-height: calc(100vh - 100px);\n  overflow-y: auto;\n}\n.sidebar-toc-title {\n  font-family: \"Geist Mono\", monospace;\n  font-size: 12px;\n  font-weight: 500;\n  text-transform: uppercase;\n  letter-spacing: 0.5px;\n  color: var(--geist-quaternary);\n  margin-bottom: 12px;\n}\n.reading-sidebar ul {\n  list-style: none;\n  padding-left: 0;\n  margin: 0;\n  font-size: 13px;\n}\n.reading-sidebar li {\n  margin: 6px 0;\n}\n.reading-sidebar ul ul {\n  padding-left: 14px;\n}\n.reading-sidebar a {\n  color: var(--geist-secondary);\n  text-decoration: none;\n  transition: color 0.15s;\n}\n.reading-sidebar a:hover, .reading-sidebar a.active {\n  color: var(--geist-foreground);\n  font-weight: 600;\n}\n\n/* 后台管理 (/admin) */\n.admin-card-container {\n  background: var(--geist-background);\n  box-shadow: var(--shadow-card-full);\n  border-radius: var(--radius-lg);\n  padding: 32px;\n  margin-bottom: 32px;\n}\n.form-row-2 {\n  display: grid;\n  grid-template-columns: 1fr 1fr;\n  gap: 16px;\n  margin-bottom: 16px;\n}\n@media (max-width: 600px) {\n  .form-row-2 { grid-template-columns: 1fr; }\n}\n.form-field {\n  display: flex;\n  flex-direction: column;\n  gap: 6px;\n  margin-bottom: 16px;\n}\n.form-field label {\n  font-size: 13px;\n  font-weight: 500;\n  color: var(--geist-foreground);\n}\n.form-field input, .form-field select, .form-field textarea {\n  font-family: \"Geist\", sans-serif;\n  font-size: 14px;\n  padding: 9px 12px;\n  background: var(--geist-background);\n  box-shadow: var(--shadow-border);\n  border: none;\n  border-radius: var(--radius-md);\n  color: var(--geist-foreground);\n  outline: none;\n}\n.form-field input:focus, .form-field select:focus, .form-field textarea:focus {\n  outline: 2px solid var(--ds-focus-color);\n  box-shadow: none;\n}\n\n/* 语法高亮 (Console Blue / Purple / Pink) */\n.codehilite .k, .codehilite .kd, .codehilite .kn { color: #eb367f; font-weight: 500; }\n.codehilite .s, .codehilite .s1, .codehilite .s2 { color: #0070f3; }\n.codehilite .nf, .codehilite .na { color: #7928ca; font-weight: 500; }\n.codehilite .c, .codehilite .c1 { color: #666666; font-style: italic; }\n.codehilite .mi, .codehilite .mf { color: #ff5b4f; }\n\n</style>\n\n</head>\n<body>\n\n    <nav class=\"vercel-nav\">\n      <div class=\"nav-brand\">\n        <a href=\"/\" style=\"display:flex;align-items:center;gap:10px;text-decoration:none\">\n          <svg class=\"vercel-triangle\" viewBox=\"0 0 76 65\" fill=\"none\">\n            <path d=\"M37.5274 0L75.0548 65H0L37.5274 0Z\" fill=\"currentColor\"/>\n          </svg>\n          <span class=\"nav-title\">Agent Harness KB</span>\n        </a>\n        <span class=\"nav-badge-pill\">Geist 2.0</span>\n      </div>\n\n      <div class=\"nav-links\">\n        <a class=\"nav-link \" href=\"/\">全景总览</a>\n        <a class=\"nav-link \" href=\"/vad\" style=\"color:var(--ship-red)\">🎯 VAD 专栏 (144)</a>\n        <a class=\"nav-link\" href=\"https://m0rtzz.github.io/paper-notes/\" target=\"_blank\" rel=\"noopener\">顶会 669 篇 ↗</a>\n        <a class=\"nav-link\" href=\"/download/all\">整库打包</a>\n        \n      </div>\n\n      <div class=\"nav-actions\">\n        \n        <button class=\"theme-toggle-btn\" id=\"theme-toggle-btn\" onclick=\"toggleTheme()\" title=\"切换亮暗主题\">🌙</button>\n      </div>\n    </nav>\n    \n<main class=\"vercel-container\">\n\n        <div class=\"report-header-card\">\n          <div class=\"crumb-bar\"><a href=\"/\">Home</a> / <b>fulltext.txt</b></div>\n          <h1 class=\"report-title\">fulltext.txt</h1>\n          <div class=\"report-action-buttons\">\n            <a class=\"btn-primary-dark\" href=\"?dl=1\">Download Text</a>\n          </div>\n        </div>\n        <article class=\"article-body\"><pre><code>Self-supervised Feature Adaptation for 3D Industrial Anomaly Detection\nYuanpeng Tu1* Boshen Zhang2* Liang Liu2 Yuxi Li2 Xuhai Chen4\nJiangning Zhang2 Yabiao Wang2† Chengjie Wang2,3 Cai Rong Zhao1†\n1\nDept. of Electronic and Information Engineering, Tongji Univeristy, Shanghai\n2\nYouTu Lab, Tencent, Shanghai, 3 Shanghai Jiao Tong University, 4 Zhejiang University\n\narXiv:2401.03145v2 [cs.CV] 17 Jan 2024\n\n{2030809, zhaocairong}@tongji.edu.cn\n{boshenzhang, yukiyxli, leoneliu, vtzhang, caseywang, jasoncjwang}@tencent.com\n\nAbstract\nIndustrial anomaly detection is generally addressed as\nan unsupervised task that aims at locating defects with only\nnormal training samples. Recently, numerous 2D anomaly\ndetection methods have been proposed and have achieved\npromising results, however, using only the 2D RGB data\nas input is not sufficient to identify imperceptible geometric surface anomalies. Hence, in this work, we focus on\nmulti-modal anomaly detection. Specifically, we investigate early multi-modal approaches that attempted to utilize\nmodels pre-trained on large-scale visual datasets, i.e., ImageNet, to construct feature databases. And we empirically\nfind that directly using these pre-trained models is not optimal, it can either fail to detect subtle defects or mistake\nabnormal features as normal ones. This may be attributed\nto the domain gap between target industrial data and source\ndata. Towards this problem, we propose a Local-to-global\nSelf-supervised Feature Adaptation (LSFA) method to finetune the adaptors and learn task-oriented representation toward anomaly detection. Both intra-modal adaptation and\ncross-modal alignment are optimized from a local-to-global\nperspective in LSFA to ensure the representation quality\nand consistency in the inference stage. Extensive experiments demonstrate that our method not only brings a significant performance boost to feature embedding based approaches, but also outperforms previous State-of-The-Art\n(SoTA) methods prominently on both MVTec-3D AD and\nEyecandies datasets, e.g., LSFA achieves 97.1% I-AUROC\non MVTec-3D, surpass previous SoTA by +3.4%.\n\n1. Introduction\nIndustrial anomaly detection is a widely-explored computer\nvision task, aiming at detecting unusual image-level/pixellevel patterns in industrial products [22]. Since the lack\nof anomalous samples in real-world scenarios, current\n\nColored\nPoint Clouds\n\nPoint Clouds\n\nRGB Image\n\nPatchCore\n+FPFH\n\nOurs\n\nGround Truth\n\nCookie\n\nPeach\n\nFoam\n\nCable Gland\n\nDowel\n\nPotato\n\nFigure 1. Illustrations of MVTec-3D AD dataset [4]. The second\nand third rows are the input point cloud data and RGB data. The\nfourth and fifth rows are prediction results. Our method can avoid\nthe overestimation issues (as shown left) and produce more accurate results for categories with complex textures (as shown right).\n\nanomaly detection methods usually follow unsupervised\nparadigm [2, 10, 15, 18, 21, 25, 26, 30, 32–34], i.e., training with normal samples but testing on the mixed normal and abnormal samples. Most of the previous methods [10, 30, 35] are designed for 2D images and have\nachieved great success in 2D anomaly detection. However,\nin the scenarios of industrial inspection, due to lack of depth\ninformation, sometimes it is hard to differentiate between\nsubtle surface defect and normal texture with only RGB information (e.g., cookie in Fig 1.). Therefore, recently there\nappears new benchmarks [4, 6] to encourage anomaly detection research in a multi-model view, where the objects\nare represented with both 2D images and 3D point clouds.\nTo perform precise anomaly localization, existing 2D\nanomaly detection approaches can be roughly categorized\ninto two families: reconstruction based and feature em-\n\n\fbedding based. The former utilizes the characteristic that\na generator trained with only normal features cannot successfully reconstruct abnormal features. While the latter\naims to model the distribution of normal samples through\na well-trained feature extractor, and in inference stage, the\nout-of-distribution samples are treated as anomalies. The\nfeature embedding based family is more flexible and show\npromising performance on 2D RGB anomaly detection task.\nHowever, simply transferring the 2D feature embedding\nparadigm into the 3D domain is not easy. Taking the stateof-the-art embedding based method PatchCore [26] as an\nexample, when combined with handcrafted 3D representations (FPFH [17]), it yields a strong multimodal anomaly\ndetection baseline. However, as shown in Fig. 1, we experimentally find that the PatchCore+FPFH baseline shows two\ndrawbacks, First, it is prone to mistake abnormal regions\nas normal ones due to the large discrepancy between pretrained knowledge and industrial scenes (see the left part in\nFig. 1). Second, it sometimes fails to identify small anomaly\npatterns when it comes to categories with more complex\ntextures, as shown in the right part in Fig. 1.\nTo address the aforementioned problems, we resort to\na feature adaptation strategy to further enhance the capacity of pre-trained models and learn task-oriented feature descriptors. In terms of modality, color is more effective to identify texture anomalies, while depth information can be helpful to detect geometric deformations\nin 3D space [17], thus it is more advisable to leverage\nboth the intra-modal and cross-modal information for adaptation. On the other hand, in terms of granularity, the\nobject-level correspondence between modalities helps to\nlearn compact representation, while anomaly detection requires local sensitivity to identify subtle anomalies [26],\nhence a multi-grained learning objective is necessary. With\nthese consideration above, we propose a novel Localto-global Self-supervised multi-modal Feature Adaptation\nframework, named LSFA, to better transfer the pre-trained\nknowledge to downstream anomaly detection task. Specifically, LSFA performs adaptation from two views: intramodality and cross-modality. The former adaptation introduces Intra-modal Feature Compactness (IFC) optimization, where multi-grained memory banks are applied to\nlearn compact distribution of normal features. As for the\nlatter one, Cross-modal Local-to-global Consistency (CLC)\nis designed to align features from different modality in both\npatch-level and object-level. With the help of multi-grained\ninformation from both modality, model adapted with LSFA\nyields target-oriented features toward anomaly detection in\n3D space, thus it is capable of capturing small anomalies,\nwhile avoiding false positives (shown in Fig. 1). For the\nfinal inference of anomaly detection, we leverage the finetuned features by LSFA to construct memory bank and determine normal/anomaly by computing the feature differ-\n\nence as in [26]. The effectiveness of LSFA is verified on\nmainstream benchmarks, including MVTec-3D and Eyecandies. Where LSFA outperforms previous SoTA [28] by\na large margin, i.e., it obtains 97.1% (+3.4%) I-AUROC\non MVTec-3D. To summarize, the key contributions of this\nwork are as follows:\n• We propose LSFA, a novel and effective framework towards 3D anomaly detection, it adapts the pre-trained features with local-to-global correspondence between modalities as supervision. It shows significant advantages on mainstream benchmarks and sets the new SOTA.\n• In LSFA, Intra-modal Feature Compactness optimization (IFC) is proposed to improve feature compactness from\nboth patch-wise and prototype-wise with dynamic-updated\nmemory banks.\n• In LSFA, Cross-modal Local-to-global Consistency\nalignment (CLC) is proposed to alleviate cross-modal misalignment with multi-granularity contrastive signals.\n\n2. Related Work\nSince our works mainly touch on two aspects of computer vision, namely 2D/3D industrial anomaly detection,\nwe briefly introduce previous traditional 2D/3D industrial\nanomaly detection approaches respectively in this section.\n2D industrial anomaly detection. As a binary classification task, unsupervised industrial anomaly detection\nonly trains models with normal samples to distinguish instances sampled from normal/anomaly distribution and localize the anomalous regions, which has drawn extensive attention [22]. Existing methods mainly consist of\ntwo categories: reconstruction based and feature embedding based. Among the previous reconstruction based\nmethods, knowledge-distillation based ones [3, 10, 29] assume that there exists a difference between the pre-trained\nteacher model and the student model in the representation\nof anomalous patches, where the student model is trained to\nsimulate teacher output for the normal samples during the\ntraining process. To prevent negative influence caused by\nthe same filters between teacher and student, [10] integrates\na reverse flow paradigm, which can prevent the anomaly\ngradient propagation to the student as well. [1, 14] perform\nimplicit feature modeling and detect defects by comparing\nthe reconstructed images and input ones based on the assumption that anomaly patches cannot be well-recovered.\nBesides these methods, feature embedding based methods recently have achieved state-of-the-art performance\nby utilizing features extracted from models pre-trained on\nlarge-scale external natural image datasets, i.e., ImageNet,\nand need no further adaption to the data of the target domain. Normalizing flow [16, 35] based ones distinguish defects by invertibly transforming normal features into Normal distribution. PaDiM [9] takes the correlation between\ndifferent semantic levels into consideration to extract lo-\n\n\fEmbedding 𝐹𝐼\n\nΨ𝐼\n\n𝜙𝐼\n\nEmbedding 𝐹𝑃\n\n𝐶𝐿𝐶\nLocal RGB-D\nAlignment Loss\n\nAdaptor\nRGB\n\n𝐼𝐹𝐶\n\n𝜙𝑃\n\nΨ𝑃\nAdaptor\n\nBackbone\n\nPatch−wise Unsupervised Feature Clustering\n\nRGB Memory Banks\n𝑴𝐺𝐼 /𝑴𝐿𝐼\n\nGlobal RGB-D\nAlignment Loss\n\nEmbedding 𝐺𝐼\n\nBackbone Depth (Point Cloud)\nPC Memory Banks\n𝑴𝐺𝑃 /𝑴𝐿𝑃\nEmbedding 𝐺𝑃\n\n𝐼𝐹𝐶\n\nFigure 2. The overall pipeline of our method. The features of two modalities are adapted from two views: Intra-modal Feature Compactness optimization (IFC) and Cross-modal Local-to-global Consistency alignment (CLC). The fine-tuned results of the adaptors are utilized\nfor final defect localization.\n\ncally constrained representations and estimate patch-level\nfeature distribution moments. PatchCore [26] stores normal\npatch-level features in the memory bank for localizing defects by comparing the target and normal features. CFA [20]\nproposes a coupled-hypersphere fine-tuning framework to\nadapt patch features to the target dataset, thus alleviating\nthe overestimation of the normality of anomaly features.\n\nalignment without incorporating global-level alignment of\nfeatures, which is also crucial for enhancing information interaction between the two modalities. Motivated by this, we\npropose a local-to-global self-supervised multimodal adaption method to boost the voxel-level detection performance\nof feature embedding based approaches from both patchlevel and object-level views.\n\n3D industrial anomaly detection. Different from 2D industrial anomaly detection, 3D industrial anomaly detection identifies anomaly patches by taking both RGB and\npoint cloud samples into consideration. [4] introduces the\nfirst public 3D anomaly detection benchmark, MVTec-3D\nAD for evaluation of methods and builds a baseline approach based on voxel auto-encoder and generative adversarial network, where anomaly defects are located by comparing the voxel-wise difference between the input and reconstructed ones. However, since [4] lacks of integrating\nspatially structured information in multi-modal data, only\na marginal accuracy boost can be achieved. Inspired by\nthis, [5] proposes a 3D teacher-student framework to extract\nlocal-geometry aware descriptors for point clouds and utilizes extra ancillary data for robust pre-training. [17] firstly\nexplores the appliance of memory bank on this task and\nutilizes local geometry features extracted from pre-trained\nmodels.However, since there is no further adaptation on the\ntarget domain of the biased features in [17], there exists\na significant performance gap between it and state-of-theart ones. To address this issue, M3DM [31] proposes a\nmultimodal industrial anomaly detection method with hybrid feature fusion to promote interaction between multimodal features. However, these methods generally perform\ncross-modal alignment while overlook the importance of\nintra-modal feature compactness. Therefore, their extracted\nsingle-modal features are likely to form a distribution where\nthe anomalous/normal features are difficult to be separated\nfrom each other. Such feature distribution limits their ability to effectively integrate information from both modalities\nas well, leading to inaccurate anomaly detection. Additionally, these methods only consider local-level cross-modal\n\n3. Methodology\n3.1. Overview\nFramework overview and symbol definition. In this section, we first give out the overview of our LSFA framework. As shown in Fig. 2, LSFA takes both point clouds\n|D|\nand RGB images in D = {(Pi , Ii )}i=1 as input for joint\nN ×3\ndefect detection, where Pi ∈ R\nand Ii ∈ RH×W ×3 .\nFor both modality representation Pi and Ii , a pretrained\nfeature extractor ϕP /ϕI is applied to obtain modalityspecific representation. Since there exists severe domain\nbias between pre-trained backbones and downstream detection task, a vanilla transformer encoder layer [12] is\nutilized as the adaptor for these features (note that several other adaptor structures are also investigated in our\nappendix). The adaptors for RGB/3D modalities are denoted as ΨI (·)/ΨP (·), we propose to perform task-oriented\nfeature adaptation for ΨI (·)/ΨP (·) from two views: Intramodal Feature Compactness optimization (IFC) and Crossmodal Local-to-global Consistency alignment (CLC). (1)\nIFC constructs both global-level and local-level dynamicupdated memory banks for both RGB/3D modality to minimize the distance between normal features from the multigranularity view, leading to better distinction between normal and abnormal features. (2) CLC consists of localto-global cross-modal alignment modules, which alleviates\nfeature misalignment between two modalities and enhances\nthe multi-modal information interaction of spatial structures\nwith self-supervised signals.\nInference with adapted representation. After the adaptation process, since local-sensitive features are more use-\n\n\fTraining Set\n\nCLC\n\n𝜙𝑃 &amp;Ψ𝑃\n\nUnsupervised Clustering\nGlobal-Level\n\n𝐿𝐺𝐴\n&amp;\n𝐿𝐿𝐴\n\n𝜙𝐼\n&amp;\nΨ𝐼\n\nLocal-Level\n\nBatch Samples\n\nFigure 3. The proposed inter-modal local-to-global consistency\nalignment. For the local view, similarity of path-wise features\nin the same/different location of the RGB image and its corresponding 3D point cloud is maximized/minimized to guarantee\nlocal-geometry consistency of two modalities. For global view,\ninstance-wise features clustered from patch-wise features are optimized in a similar way.\n\nful for detecting anomaly patterns, the global features are\ndiscarded in the final inference stage. For either modal of\nRGB or Point Cloud, only the local features from adaptor is\nutilized to calculate the anomaly score of each pixel/voxel\nthrough off-the-shelf PatchCore [26] algorithm. Finally\nboth anomaly scores from two modalities are averaged as\nthe final anomaly estimation.\n\n3.2. CLC: Cross-modal Local-to-global Consistency Alignment\nFeature projection. To extract local-sensitive features for\nanomaly detection, the ViT [12] and PointMAE [24] are utilized as ϕI /ϕP . ViT splits 2D image Ii into Nm patches\nand extract deep feature for each patch, correspondingly,\nPointMAE group 3D points from Pi into Nd groups and\nextract group-wise feature. To build dense local correspondence between two modality, we remap 3D points into 2D\npatches via geometric interpolation and projection. Specifically, we denote the deep feature of i-th point group as Ai\nand the group center is denoted as ci ∈ R3 , then for each\npoint p ∈ R3 in Pi , a point-wise deep feature fp can be\nobtained via distance-based interpolation:\nfp =\n\nNd\nX\ni=1\n\nαi Ai ,\n\n1\n∥ci −p∥2\nαi = PNm\n.\n1\nk=1 ∥ck −p∥2\n\npatch.\nFinally, both patch-wise representation of RGB\nand point cloud are fed to adaptor ΨI (·)/ΨP (·) respectively.\n|D|\nThe adapted features are denoted as DF = {(FPi , FIi )}i=1 .\nCross-modal local-to-global consistency alignment. The\nfeatures of two modalities are aligned in spatial location\nafter the previous step. However, without cross-modal interaction in the adaption process, cross-modal feature misalignment may lead to inferior results when fusing anomalous scores of two modalities during the inference stage. To\naddress this issue, as shown in Fig. 3, we perform local-toglobal consistency alignment, which can utilize the crossmodal self-supervised signals to enhance feature quality.\nSpecifically, the adapted patch-wise features for\nb\nRGB/3D point clouds {FIi , FPi }N\ni=1 are first mapped into\nthe same dimension with two fully-connected layers, denoted as HI /HP , where Nb is the batch size. The projected\nb\nfeatures are denoted as {FI′i , FP′ i }N\ni=1 , then a patch-wise\ncontrastive loss is calculated to maximize the feature similarity between patches from different modal but the same\nlocation, and minimize similarity between patches from different location:\n\u0010D\nE\u0011\n\nexp FI′ji , FP′ji\nLLA = − log PNm PNm\n\u0001 ,\n′t , F ′k\nexp\nF\nIi\nPi\nt=1\nk=1\n\n\n(2)\n\nwhere ⟨·, ·⟩ denotes the innder production between vectors. Since Eq. 2 only involves local geometry clues while\nlacking the interaction of global structural information, we\nfurther clustering the local feature FIi /FPi to obtain an\ninstance-wise feature GIi /GPi with the k-means clustering\nalgorithm. And then performing a similar operation on this\nglobal features, the corresponding Global Alignment loss is\ndenoted as LGA .\n!\n\u0001\nexp G′Ii , G′Pi\nLGA = − log PNb PNb\n\u0001 . (3)\n′\n′\nt=1\nx=1 exp GIt , GPx\nThus the overall loss function for CLC is formulated as:\nLCLC = LLA + LGA .\n\n(4)\n\n(1)\n\nMeanwhile, we can verify whether a 3D point p is projected into a 2D patch with camera parameters, thus for\neach image patch from ViT, we average the feature fp of\nall points projected into the same patch as 2D projection of\noriginal point-cloud features. By this means, we obtain a\n2D patch-wise representation of 3D point features, which\nshares the same patch number Nm as image features, and\nthe local correspondence is naturally obtained by associating RGB features and projected point features of the same\n\n3.3. IFC: Intra-modal Feature Compactness Optimization\nThe proposed intra-modal feature compactness optimization strategy aims at helping models generate more compact representation for normal samples, thus making models more sensitive to anomaly patterns.\nLocal-to-global compactness optimization. Since there\nexists severe domain bias for the pre-trained models without\nadaptation, the extracted features are likely to form a distribution where the anomalous/normal features are difficult to\n\n\fRead\n\nMSE Loss\n\nPatch-level Feature\n\n𝐋𝐨𝐜𝐚𝐥 𝐌𝐞𝐦𝐨𝐫𝐲 Module\n\nQueried Patch-level Feature\n\nUpdate\n\nRead\n\nUnsupervised\nClustering\n\n𝑳lc\n\nAlgorithm 1: Training for the proposed LSFA.\n\nQueried Global-level\nFeature\n\nInput: Memory banks {MIG , MIL , MPG , MPL },\nadaptors {ΨI , ΨP }, linear projection layer\n{HI , HP }, training set features {FI , FP }.\nOutput: Parameters of adaptors {ΘI , ΘP }.\nG\nL\nG\nL\n1 Initialize MI , MI , MP , MP .\n2 for FIi , FPi ∈ DF do\n\nUpdate\n\nRead\n\n𝐐𝐮𝐞𝐫𝐲\n\n𝑳gc\n\n3\n\nFigure 4. The proposed local-to-global compactness optimization strategy, where both prototype-wise global-level and patchwise local-level memory banks are involved.\n\nbe separated from each other. Consequently, previous feature embedding based methods [17] are inevitably prone to\nmistake anomalies as normal areas. Motivated by this, as\nshown in Fig. 4, we design a dynamic-updated memorybank in both local and global level to guide compactness\noptimization.\nSince the optimization is conducted within each modality, here we take RGB feature as an example and the pointcloud feature is processed in a similar manner. Concretely,\nwe denote the memory bank consisting of patch-level RGB\nfeatures as MIL with length |MIL | = nL\nI . The j-th patchb\nlevel feature FIji of Ii in batch {FIi }N\nis\nutilized for neari=1\nL\nest neighbor searching in MI , where Nb is the batch size.\nA mean squared error loss is utilized to minimize the discrepancy between FIji and its corresponding nearest item in\nMIL . Thus the Local patch-level Compactness LLC loss can\nbe derived as follows:\nLLC =\n\n(7)\n\n𝐐𝐮𝐞𝐫𝐲\n\nGlobal 𝐌𝐞𝐦𝐨𝐫𝐲 Module\n\nGlobal-level\nFeature\n\nMIL /MIG respectively, which can be derived as:\n\u001a\nMIL = MIL ∪ {FIji |j ∈ [1, Nm ], i ∈ [1, Nb ]}\nMIG = MIG ∪ {GIi |i ∈ [1, Nb ]}.\n\nNb X\nNm\nX\ni=1 j=1\n\nmin FIji − Q\n\nQ∈ML\nI\n\n.\n2\n\n(5)\n\nWhere Nm is the patch number. Furthermore, to enhance\nthe compactness of features for each category, a global compactness loss is designed to simultaneously optimize the\nglobal feature GIi . Denote the memory bank consisting\nG\nof global RGB features with length nG\nI as MI . A similar nearest neighbor search operation is performed for GIi\nand MIG to enhance sensitivity against anomalies from the\nglobal view. Therefore, the Global Compactness loss LGC\nis:\nNb\nX\nLGC =\nmin GjIi − Q .\n(6)\ni=1\n\nQ∈MG\nI\n\n2\n\nAfter each iteration, the local-level features and globallevel features of current batch samples are enqueued into\n\nFI′i ←−HI (FIi ); FP′ i ←−HP (FPi )\n/* Inter-modal Local-to-global\nConsistency Alignment\n*/\noptim\n\n4\n\nΘI , ΘP ←− LCLC (FI′i ; FP′ i ; ΘP ; ΘI )\n/* Cross-modal Feature\nCompactness Optimization\n\n*/\n\noptim\n\n5\n\n6\n\n7\n\nΘI ←− LIFC (FIi ; MIG ; MIL ; ΘI )\noptim\nΘP ←− LIFC (FPi ; MPG ; MPL ; ΘP )\n/* Update Memory Banks\nupdate\nupdate\nMIG , MIL ←− FIi ; MPG , MPL ←− FPi\n\n*/\n\nend\n\nMeanwhile, the least recently appended features with\nthe same length as the enqueued features will be popped\nout from MIL /MIG to keep the features in banks up-to-date\nL\nwhen the length of MIL /MIG is larger than nG\nI /nI . Similar\nglobal and local compactness optimization operations are\nb\nperformed for the point cloud features {FPi }N\ni=1 as well,\nwhere the global and local memory bank sizes of point\ncloud features are the same as RGB modality.\nConsequently, the loss function of the proposed IFC can\nbe summarized as:\nLIFC = LLC + LGC .\n\n(8)\n\nTherefore to summarize, the overall training loss for the\nproposed LSFA is derived as:\nLLSFA = LIFC + λLCLC .\n\n(9)\n\nWhere λ is a balancing hyper-parameter.\n\n3.4. Defect Localization\nSince LSFA is designed for adapting pre-trained features to\nestimate anomaly patterns better. We utilize the pre-trained\nbackbones and the adaptors for final feature extraction. The\nadapted features of two modalities are respectively fed into\nthe off-the-shelf feature embedding based method PatchCore [26]. The anomaly scores of two modalities are averaged as the final anomaly score for each pixel/voxel to\n\n\f3D\nRGB\nRGB + 3D\n\nMethod\n\nBagel\n\nCable\nGland\n\nCarrot\n\nCookie\n\nDowel\n\nFoam\n\nPeach\n\nPotato\n\nRope\n\nTire\n\nMean\n\nDepth GAN[4]\nDepth AE[4]\nDepth VM[4]\nVoxel GAN[4]\nVoxel AE[4]\nVoxel VM[4]\n3D-ST[5]\nFPFH[17]\nAST[28]\nFPFH*/M3DM[31]\nLSFA(Ours)\n\n0.530\n0.468\n0.510\n0.383\n0.693\n0.750\n0.862\n0.825\n0.881\n0.941\n0.986\n\n0.376\n0.731\n0.542\n0.623\n0.425\n0.747\n0.484\n0.551\n0.576\n0.651\n0.669\n\n0.607\n0.497\n0.469\n0.474\n0.515\n0.613\n0.832\n0.952\n0.965\n0.965\n0.973\n\n0.603\n0.673\n0.576\n0.639\n0.790\n0.738\n0.894\n0.797\n0.957\n0.969\n0.990\n\n0.497\n0.534\n0.609\n0.564\n0.494\n0.823\n0.848\n0.883\n0.679\n0.905\n0.950\n\n0.484\n0.417\n0.699\n0.409\n0.558\n0.693\n0.663\n0.582\n0.797\n0.760\n0.802\n\n0.595\n0.485\n0.450\n0.617\n0.537\n0.679\n0.763\n0.758\n0.990\n0.880\n0.961\n\n0.489\n0.549\n0.419\n0.427\n0.484\n0.652\n0.687\n0.889\n0.915\n0.974\n0.964\n\n0.536\n0.564\n0.668\n0.663\n0.639\n0.609\n0.958\n0.929\n0.956\n0.926\n0.967\n\n0.521\n0.546\n0.520\n0.577\n0.583\n0.690\n0.486\n0.653\n0.611\n0.765\n0.944\n\n0.523\n0.546\n0.546\n0.537\n0.571\n0.699\n0.748\n0.782\n0.833\n0.874\n0.921\n\nDifferNet[27]\nPADiM[9]\nPatchCore[26]\nSTFPM[30]\nCS-Flow[16]\nAST[28]\nPatchCore*/M3DM[31]\nLSFA(Ours)\n\n0.859\n0.975\n0.876\n0.930\n0.941\n0.947\n0.944\n0.951\n\n0.703\n0.775\n0.880\n0.847\n0.930\n0.928\n0.918\n0.920\n\n0.643\n0.698\n0.791\n0.890\n0.827\n0.851\n0.896\n0.911\n\n0.435\n0.582\n0.682\n0.575\n0.795\n0.825\n0.749\n0.762\n\n0.797\n0.959\n0.912\n0.947\n0.990\n0.981\n0.959\n0.961\n\n0.790\n0.663\n0.701\n0.766\n0.886\n0.951\n0.767\n0.770\n\n0.787\n0.858\n0.695\n0.710\n0.731\n0.895\n0.919\n0.930\n\n0.643\n0.535\n0.618\n0.598\n0.471\n0.613\n0.648\n0.675\n\n0.715\n0.832\n0.841\n0.965\n0.986\n0.992\n0.938\n0.938\n\n0.590\n0.760\n0.702\n0.701\n0.745\n0.821\n0.767\n0.787\n\n0.696\n0.764\n0.770\n0.793\n0.830\n0.880\n0.850\n0.861\n\nDepth GAN[4]\nDepth AE[4]\nDepth VM[4]\nVoxel GAN[4]\nVoxel AE[4]\nVoxel VM[4]\n3D-ST[5]\nPatchCore + FPFH[17]\nAST[28]\nPatchCore*+FPFH*[17]\nM3DM[31]\nLSFA(Ours)\n\n0.538\n0.648\n0.513\n0.680\n0.510\n0.553\n0.950\n0.918\n0.983\n0.981\n0.994\n1.000\n\n0.372\n0.502\n0.551\n0.324\n0.540\n0.772\n0.483\n0.748\n0.873\n0.831\n0.909\n0.939\n\n0.580\n0.650\n0.477\n0.565\n0.384\n0.484\n0.986\n0.967\n0.976\n0.980\n0.972\n0.982\n\n0.603\n0.488\n0.581\n0.399\n0.693\n0.701\n0.921\n0.883\n0.971\n0.985\n0.976\n0.989\n\n0.430\n0.805\n0.617\n0.497\n0.446\n0.751\n0.905\n0.932\n0.932\n0.960\n0.960\n0.961\n\n0.534\n0.522\n0.716\n0.482\n0.632\n0.578\n0.632\n0.582\n0.885\n0.905\n0.942\n0.951\n\n0.642\n0.712\n0.450\n0.566\n0.550\n0.480\n0.945\n0.896\n0.974\n0.936\n0.973\n0.983\n\n0.601\n0.529\n0.421\n0.579\n0.494\n0.466\n0.988\n0.912\n0.981\n0.964\n0.899\n0.962\n\n0.443\n0.540\n0.598\n0.601\n0.721\n0.689\n0.976\n0.921\n1.000\n0.967\n0.972\n0.989\n\n0.577\n0.552\n0.623\n0.482\n0.413\n0.611\n0.542\n0.886\n0.797\n0.780\n0.850\n0.951\n\n0.532\n0.595\n0.555\n0.517\n0.538\n0.609\n0.833\n0.865\n0.937\n0.929\n0.945\n0.971\n\nTable 1. I-AUROC for anomaly detection of all categories of MVTec-3D AD. ’*’ denotes replacing its features with the same pre-trained\nfeatures as LSFA for PatchCore. Results with confidence intervals of LSFA are shown in the supplementary material.\n\nevaluate the effectiveness on anomaly detection. The overall pseudo-code of LSFA can be found in Algorithm 1.\nDiscussion. Since the framework of LSFA is similar to\nM3DM [31], here we discuss their difference in detail. First,\nrather than introducing extra modules for feature fusion in\n[31], we only perform feature adaptation for each modality\nand needs no extra memory bank, thus introducing no extra time and memory cost for inference. Moreover, M3DM\noverlooks the importance of object-level feature alignment\nto accurate anomaly detection. And our LSFA performs\ncross-modal feature alignment from both object-level and\npatch-level views to fully enhance the consistency and interaction of cross-modal discriminative information, thus\ndemonstrating much superior performance to it. Finally,\nLSFA takes the intra-modal feature compactness into consideration, which is ignored in M3DM as well. Specifically, similar to cross-modal alignment, the intra-modal feature compactness optimization is also conducted from both\npatch-level and object-level perspectives to alleviate the influence of domain bias of pre-trained features and obtain\nhigh-quality single-modal features.\n\n4. Experiments\n4.1. Experimental Details\nDataset. To verify the effectiveness of LSFA, we conduct experiments on two 3D industrial anomaly detection\ndatasets: MVTec-3D AD [4] and Eyecandies [6]. Details of\nthe datasets are discussed in our supplementary material.\nImplementation details. For the feature extractors of the\n\nRGB modality, a ViT-B/8 [12] pre-trained on ImageNet [11]\nwith DINO [7] is adopted for a balance of efficiency and\nperformance. The 768-dim output of the final layer is used\nand then pooled into 56×56 for subsequent training. For the\nfeature extraction of 3D modality, a point transformer [23]\npre-trained on ShapeNet [8] dataset is utilized and the outputs from 3/7/11 layer are concatenated to fuse multi-scale\ninformation for further fine-tuning. Similar to patches in\nViT, the point transformer clusters point clouds into multiple local groups and these groups have their corresponding\ncenter points for position and neighbor numbers for group\nsize. For data processing, the background area of depth\nand RGB images is removed by estimating the background\nplane of depth images with RANSAC [13], where points\nwithin 5×10−2 are ignored to accelerate the feature extraction and meanwhile alleviate the influence of background.\nFinally, the RGB and point cloud tensor are both resized to\n224 × 224 to be consistent with the input size. The projected features for point clouds and RGB samples in CLC\nare 512-dim. The AdamW optimizer is used and its learning rate is set as 2×10−3 with cosine warm-up. The batch\nsize Nb for adaptation is set as 8.\nEvaluation metrics. Following the standard evaluation\nprotocol of MVTec-3D and Eyecandies, we use Image-level\nROCAUC (I-AUROC), pixel-wise AUROC (P-AUROC),\nand the overlap of each region (AUPRO) to present the\nanomaly detection performance. The I-AUROC/P-AUROC\nis defined as the area under the receiver operator curve of\nimage-level/pixel-level predictions, while AUPRO denotes\nthe average relative overlap of binary prediction with each\n\n\f3D\nRGB\nRGB + 3D\n\nMethod\n\nBagel\n\nCable\nGland\n\nCarrot\n\nCookie\n\nDowel\n\nFoam\n\nPeach\n\nPotato\n\nRope\n\nTire\n\nMean\n\nDepth GAN[4]\nDepth AE[4]\nDepth VM[4]\nVoxel GAN[4]\nVoxel AE[4]\nVoxel VM[4]\nFPFH[17]\nFPFH*/M3DM[31]\nLSFA(Ours)\n\n0.111\n0.147\n0.280\n0.440\n0.260\n0.453\n0.973\n0.943\n0.974\n\n0.072\n0.069\n0.374\n0.453\n0.341\n0.343\n0.879\n0.818\n0.887\n\n0.212\n0.293\n0.243\n0.875\n0.581\n0.521\n0.982\n0.977\n0.981\n\n0.174\n0.217\n0.526\n0.755\n0.351\n0.697\n0.906\n0.882\n0.921\n\n0.160\n0.207\n0.485\n0.782\n0.502\n0.680\n0.892\n0.881\n0.901\n\n0.128\n0.181\n0.314\n0.378\n0.234\n0.284\n0.735\n0.743\n0.773\n\n0.003\n0.164\n0.199\n0.392\n0.351\n0.349\n0.977\n0.958\n0.982\n\n0.042\n0.066\n0.388\n0.639\n0.658\n0.634\n0.982\n0.974\n0.983\n\n0.446\n0.545\n0.543\n0.775\n0.015\n0.616\n0.956\n0.950\n0.959\n\n0.075\n0.142\n0.385\n0.389\n0.185\n0.346\n0.961\n0.929\n0.981\n\n0.143\n0.203\n0.374\n0.583\n0.348\n0.492\n0.924\n0.906\n0.934\n\nPatchCore[26]\nPatchCore*/M3DM[31]\nLSFA(Ours)\n\n0.901\n0.952\n0.957\n\n0.949\n0.972\n0.976\n\n0.928\n0.973\n0.970\n\n0.877\n0.891\n0.912\n\n0.892\n0.932\n0.934\n\n0.563\n0.843\n0.851\n\n0.904\n0.970\n0.960\n\n0.932\n0.956\n0.957\n\n0.908\n0.968\n0.970\n\n0.906\n0.966\n0.961\n\n0.876\n0.942\n0.945\n\nDepth GAN[4]\nDepth AE[4]\nDepth VM[4]\nVoxel GAN[4]\nVoxel AE[4]\nVoxel VM[4]\n3D-ST[5]\nPatchCore + FPFH[17]\nPacthCore*+FPFH*[17]\nM3DM [31]\nLSFA(Ours)\n\n0.421\n0.432\n0.388\n0.664\n0.467\n0.510\n0.950\n0.976\n0.968\n0.970\n0.986\n\n0.422\n0.158\n0.321\n0.620\n0.750\n0.331\n0.483\n0.969\n0.925\n0.971\n0.974\n\n0.778\n0.808\n0.194\n0.766\n0.808\n0.413\n0.986\n0.979\n0.979\n0.979\n0.981\n\n0.696\n0.491\n0.570\n0.740\n0.550\n0.715\n0.921\n0.973\n0.914\n0.950\n0.946\n\n0.494\n0.841\n0.408\n0.783\n0.765\n0.680\n0.905\n0.933\n0.909\n0.941\n0.925\n\n0.252\n0.406\n0.282\n0.332\n0.473\n0.279\n0.632\n0.888\n0.948\n0.932\n0.941\n\n0.285\n0.262\n0.244\n0.582\n0.721\n0.300\n0.945\n0.975\n0.975\n0.977\n0.983\n\n0.362\n0.216\n0.349\n0.790\n0.918\n0.507\n0.988\n0.981\n0.976\n0.971\n0.983\n\n0.402\n0.716\n0.268\n0.633\n0.019\n0.611\n0.976\n0.950\n0.967\n0.971\n0.974\n\n0.631\n0.478\n0.331\n0.483\n0.170\n0.366\n0.542\n0.971\n0.965\n0.975\n0.983\n\n0.474\n0.481\n0.335\n0.639\n0.564\n0.471\n0.833\n0.959\n0.953\n0.964\n0.968\n\nTable 2. AUPRO for anomaly segmentation of all categories of MVTec-3D. ’*’ denotes replacing its features with the same pre-trained\nfeatures as LSFA for PatchCore. Results with confidence intervals of LSFA are shown in the supplementary material.\n\nconnected component of ground truth labels.\n\n4.2. Comparison on 3D AD Benchmark\nTo comprehensively evaluate the effectiveness of\nour method, we first conduct experiments on both\n3D/RGB/3D+RGB modality on MVTec-3D AD. Tab. 1\nand Tab. 2 present the comparison results of I-AUROC\nand AUPRO, the methods are grouped by modality (we\nalso report P-AUROC in the supplementary material). 1)\nFor the I-AUROC metric, our method can not only bring\na significant boost to the baseline method on both singlemodality benchmarks but also multi-modality combined\nones, especially for the challenging categories, e.g., cable\ngland and tire. The single-modality results demonstrate\nthat our intra-modal feature compactness optimization\neffectively improves the feature quality, thus benefiting the\nanomaly localization in the inference process. Moreover,\nour method significantly outperforms all previous methods\nregarding the average of all classes by a large margin of\n4.7% for 3D, and 4.2% for the combination. A new stateof-the-art performance is achieved in 17 of all 30 cases for\nall the individual classes and data modalities. 2) For the\nAUPRO metric, LSFA can also achieve consistently higher\nscores than all previous methods for anomaly segmentation, demonstrating that our method is better at mining\nlocalized and detailed clues to discover crucial unexpected\npatterns. Besides MVTec-3D AD, we further perform a\ndetailed evaluation on the latest large-scale 3D AD dataset\nEyecandies. The corresponding results are shown in the\nsupplementary material, where our method obtains the\nbest results and significantly outperforms all the previous\napproaches, achieving the average I-AUROC/AUPRO of\n87.5% and 97.8% respectively for RGB modality.\n\nSample\n\nRGB\n\nPoint Clouds Combined Ground Truth\n\nFigure 5. Qualitative results of RGB/D modality.\n\nFigure 6. Investigation on the influence of memory bank size nL\nI\n(left) and balancing hyber-parameter λ (right).\n\n4.3. Ablation Study\nTo study the influence of each component within the proposed LSFA, we conduct ablation analysis on MVTec-3D.\nInvestigation on IFC. We first conduct studies to analyze\nthe influence of the proposed IFC. The method that utilizes pre-trained features without adaptation for PatchCore\nis used as the baseline for all the evaluations. As shown\nin Tab. 4, the baseline method achieves inferior accuracy\nfor all the metrics with the fixed pre-trained features. By\ncontrast, IFC brings a significant performance boost (about\n2.8%/1.0%↑ for I-AUROC/AUPRO) by explicitly optimizing the feature compactness and keeping consistent with the\ninference process, which enhances the feature sensitivity to\nabnormal patterns. Tab. 5 shows a detailed analysis of each\nloss term within IFC, where both global and local compact-\n\n\fComponent\nLGA\nLLA\n%\n%\n!\n!\n\nI-AUROC\n\nAUPRO\n\nP-AUROC\n\n0.929\n0.949\n0.952\n0.959\n\n0.953\n0.961\n0.961\n0.964\n\n0.987\n0.989\n0.990\n0.992\n\n%\n!\n%\n!\n\nComponent\nIFC CLC\n%\n%\n!\n!\n\n%\n!\n%\n!\n\nI-AUROC\n\nAUPRO\n\nP-AUROC\n\n0.929\n0.957\n0.959\n0.971\n\n0.953\n0.963\n0.964\n0.968\n\n0.987\n0.990\n0.992\n0.993\n\nTable 3. Investigation on the loss functions Table 4. Ablation results for two compowithin CLC.\nnents in LSFA, i.e., IFC and CLC.\nStructure ΨI /ΨP\nLinear projection\nSingle encoder layer\nTwo encoder layers\n1×1 Convolution\n\nI-AUROC AUPRO P-AUROC\n0.953\n0.974\n0.954\n0.951\n\n0.959\n0.968\n0.963\n0.962\n\n0.989\n0.993\n0.984\n0.986\n\nMethod\n5-shot\n10-shot\n50-shot\nFull dataset\n\n%\n!\n%\n!\n\n%\n%\n!\n!\n\nI-AUROC\n\nAUPRO\n\nP-AUROC\n\n0.929\n0.950\n0.952\n0.957\n\n0.953\n0.960\n0.960\n0.963\n\n0.987\n0.988\n0.989\n0.990\n\nTable 5. Investigation on the loss functions\nwithin IFC.\n\nI-AUROC\n\nAUPRO\n\nP-AUROC\n\nMetric\n\nS-1\n\nS-2\n\nS-3\n\nAll\n\n0.834\n0.871\n0.926\n0.971\n\n0.936\n0.943\n0.962\n0.968\n\n0.984\n0.987\n0.989\n0.993\n\nI-AUROC\n\n95.42\n\n94.26\n\n92.14\n\n84.57\n\nAUPRO\n\n96.01\n\n95.45\n\n95.21\n\n90.15\n\nTable 6. Investigation on the structure of Table 7. Performance of LSFA under fewΨI /ΨP .\nshot settings.\nI-AUROC\n\nComponent\nLGC\nLLC\n\nAUPRO\n\nMethod\n\n3D\n\nRGB\n\nRGB+3D\n\n3D\n\nRGB\n\nRGB+3D\n\nLSFA-LoRA\n\n91.06\n\n85.43\n\n93.91\n\n92.17\n\n93.97\n\n95.16\n\nLSFA-AdaLoRA\n\n91.11\n\n85.72\n\n93.98\n\n92.24\n\n94.15\n\n95.33\n\nTable 9. Training LSFA with LoRA/AdaLoRA on MVTec-3D.\n\nness losses contribute to the final performance as well.\nInvestigation on CLC. We then investigate the influence of\nCLC. As shown in Tab. 4, CLC also achieves similar accuracy to IFC by performing multi-granularity cross-modal\ncontrastive representation learning. This mainly accounts\nfor that the proposed CLC can effectively alleviate the impact of inter-modal misalignment from multiple views and\nmeanwhile utilize the informative self-supervised signals\nfor feature extraction. Similarly, Tab. 3 shows the results\nof each sub-component in CLC, where both global and local cross-modal contrastive losses boost performance over\nthe baseline method. Moreover, further improvement in accuracy can be observed by combining IFC and CLC. Therefore, the above results verified the effectiveness of the proposed IFC, CLC, as well as their own key components.\nQualitative results. We further conduct qualitative experiments to investigate the impact of RGB/3D modality. Fig. 5\nshows the prediction results of single/combined-modality\nresults. It can be observed that the results of RGB modality\nare more dispersed and impose large scores in the edge regions as well. By contrast, the distribution of scores for 3D\nmodality is more focused around the defects. Finally, the\nmaps of combining two modalities demonstrate that both\ntwo modality helps precise defect localization.\nParameter sensitivity. Next, we evaluate the parameter sensitivity of several important hyper-parameters in our\nmethod, including the size of the memory bank nL\nI and the\nbalancing factor λ. As shown in Fig. 6 (left), LSFA achieves\nsimilar performance across all the sizes, thus not sensitive\nto nL\nI . To balance the performance and memory cost, we\n4\nset nL\nI = 5 × 10 . For the influence of λ, the results in\n\nTable 8. Different fine-tuning schemes for\nRGB+3D on MVTec-3D. ’S-N’/’All’ denotes\ntraining last N blocks/the whole network..\n\nFig. 6 (right) demonstrate that LSFA is not sensitive to the\nvalue of λ as well. Since larger λ leads to a slight performance drop, we set λ = 0.6 to get the best results.\nInvestigation on adaptor structure. As shown in Tab. 6,\nbesides the above experiments, we finally investigate the influence of different adaptor structures, including linear projection layer, single vanilla transformer encoder layer, multiple vanilla transformer encoder layers, and 1×1 convolution layer, where the single vanilla transformer encoder\nlayer performs best among these structures.\n\n4.4. Few-shot Anomaly Detection\nAs shown in Tab. 7, to evaluate the effectiveness of our\nmethod in extreme cases, we conduct experiments on fewshot settings. Specifically, we randomly sample 5/10/50\nimages from each class as the training set and perform the\nevaluation on the whole test set. The results show that our\nmethod can also achieve superior performance, even compared with some of the methods trained with the whole\ntraining set in Tab. 1. different fine-tuning methods (i.e.,\nLoRA [19]) are available as well.\n\n4.5. Comparison with Fine-tuning Methods\nHere we remove the adaptors ϕI /ϕP and combine LSFA\nwith off-the-shelf fine-tuning methods LoRA [19] and\nAdaLoRA [36] in PEFT. The results are shown in Table. 9,\nwhich are slightly inferior to results of our LSFA. We remove the adaptors and evaluate the results of training the\nwhole network and training the last few stages of the backbone network in our LSFA respectively. As shown in Table. 8, with more modules used for training, a more severe\nperformance drop is observed, especially for training all the\nblocks. Such phenomenon indicates that training with only\npart/none of the modules fixed will result in severe catastrophic forgetting and over-fitting to specific data domains,\nthus failing to distinguish anomalies from normal patterns.\n\n\f5. Conclusion\nIn this paper, we propose LSFA, a simple yet effective\nself-supervised multimodal feature adaptation framework\nfor multi-modal anomaly detection. Specifically, LSFA\nperforms feature adaptation in both intra-modal and intermodal aspects. For the former, a dynamic-updated memorybank based feature compactness optimization scheme is\nproposed to enhance the feature sensitivity to unusual patterns. For the latter, a local-to-global consistency alignment strategy is proposed for multi-scale inter-modality information interaction. Extensive experiments show that our\nmethod achieves much superior performance than previous\nmethods and meanwhile prominently boosts existing feature embedding based baselines.\n\nReferences\n[1] Paul Bergmann, Michael Fauser, David Sattlegger, and\nCarsten Steger. Mvtec ad–a comprehensive real-world\ndataset for unsupervised anomaly detection. In CVPR, 2019.\n2\n[2] Paul Bergmann, Michael Fauser, David Sattlegger, and\nCarsten Steger. Uninformed students: Student-teacher\nanomaly detection with discriminative latent embeddings. In\nCVPR, June 2020. 1\n[3] Paul Bergmann, Michael Fauser, David Sattlegger, and\nCarsten Steger. Uninformed students: Student-teacher\nanomaly detection with discriminative latent embeddings. In\nCVPR, 2020. 2\n[4] Paul Bergmann, Xin Jin, David Sattlegger, and Carsten Steger. The mvtec 3d-ad dataset for unsupervised 3d anomaly\ndetection and localization. In VISIGRAPP, 2022. 1, 3, 6, 7\n[5] Paul Bergmann and David Sattlegger. Anomaly detection\nin 3d point clouds using deep geometric descriptors. arXiv\npreprint arXiv:2202.11660, 2022. 3, 6, 7\n[6] Luca Bonfiglioli, Marco Toschi, Davide Silvestri, Nicola\nFioraio, and Daniele De Gregorio. The eyecandies dataset\nfor unsupervised multimodal anomaly detection and localization. In ACCV, 2022. 1, 6\n[7] Mathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou,\nJulien Mairal, Piotr Bojanowski, and Armand Joulin. Emerging properties in self-supervised vision transformers. In\nICCV, pages 9650–9660, 2021. 6\n[8] Angel X Chang, Thomas Funkhouser, Leonidas Guibas,\nPat Hanrahan, Qixing Huang, Zimo Li, Silvio Savarese,\nManolis Savva, Shuran Song, Hao Su, et al. Shapenet:\nAn information-rich 3d model repository. arXiv preprint\narXiv:1512.03012, 2015. 6\n[9] Thomas Defard, Aleksandr Setkov, Angelique Loesch, and\nRomaric Audigier. Padim: a patch distribution modeling\nframework for anomaly detection and localization. In ICPR,\n2021. 2, 6\n[10] Hanqiu Deng and Xingyu Li. Anomaly detection via reverse\ndistillation from one-class embedding. In CVPR, 2022. 1, 2\n[11] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li,\nand Li Fei-Fei. Imagenet: A large-scale hierarchical image\ndatabase. In CVPR, 2009. 6\n\n[12] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov,\nDirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner,\nMostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint\narXiv:2010.11929, 2020. 3, 4, 6\n[13] Martin A Fischler and Robert C Bolles. Random sample\nconsensus: a paradigm for model fitting with applications to\nimage analysis and automated cartography. Communications\nof the ACM, 1981. 6\n[14] Dong Gong, Lingqiao Liu, Vuong Le, Budhaditya Saha,\nMoussa Reda Mansour, Svetha Venkatesh, and Anton\nvan den Hengel. Memorizing normality to detect anomaly:\nMemory-augmented deep autoencoder for unsupervised\nanomaly detection. In ICCV, 2019. 2\n[15] Denis Gudovskiy, Shun Ishizaka, and Kazuki Kozuka.\nCflow-ad: Real-time unsupervised anomaly detection with\nlocalization via conditional normalizing flows. In WACV,\n2022. 1\n[16] Denis Gudovskiy, Shun Ishizaka, and Kazuki Kozuka.\nCflow-ad: Real-time unsupervised anomaly detection with\nlocalization via conditional normalizing flows. In WACV,\n2022. 2, 6\n[17] Eliahu Horwitz and Yedid Hoshen. An empirical investigation of 3d anomaly detection and segmentation. arXiv\npreprint arXiv:2203.05550, 2022. 2, 3, 5, 6, 7\n[18] Jinlei Hou, Yingying Zhang, Qiaoyong Zhong, Di Xie, Shiliang Pu, and Hong Zhou. Divide-and-assemble: Learning\nblock-wise memory for unsupervised anomaly detection. In\nICCV, 2021. 1\n[19] Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan AllenZhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen.\nLora: Low-rank adaptation of large language models. In\nICLR, 2022. 8\n[20] Sungwook Lee, Seunghyun Lee, and Byung Cheol\nSong. Cfa: Coupled-hypersphere-based feature adaptation for target-oriented anomaly localization. IEEE Access,\n10:78446–78454, 2022. 3\n[21] Chun-Liang Li, Kihyuk Sohn, Jinsung Yoon, and Tomas\nPfister. Cutpaste: Self-supervised learning for anomaly detection and localization. In CVPR, 2021. 1\n[22] Jiaqi Liu, Guoyang Xie, Jingbao Wang, Shangnian Li,\nChengjie Wang, Feng Zheng, and Yaochu Jin. Deep industrial image anomaly detection: A survey. arXiv e-prints,\npages arXiv–2301, 2023. 1, 2\n[23] Yatian Pang, Wenxiao Wang, Francis EH Tay, Wei Liu,\nYonghong Tian, and Li Yuan. Masked autoencoders for point\ncloud self-supervised learning. In ECCV, 2022. 6\n[24] Yatian Pang, Wenxiao Wang, Francis E. H. Tay, Wei Liu,\nYonghong Tian, and Li Yuan. Masked autoencoders for point\ncloud self-supervised learning, 2022. 4\n[25] Nicolae-Cătălin Ristea, Neelu Madan, Radu Tudor Ionescu,\nKamal Nasrollahi, Fahad Shahbaz Khan, Thomas B. Moeslund, and Mubarak Shah. Self-supervised predictive convolutional attentive block for anomaly detection. In CVPR,\n2022. 1\n[26] Karsten Roth, Latha Pemula, Joaquin Zepeda, Bernhard\nSchölkopf, Thomas Brox, and Peter Gehler. Towards total\nrecall in industrial anomaly detection. In CVPR, 2022. 1, 2,\n\n\f3, 4, 5, 6, 7\n[27] Marco Rudolph, Bastian Wandt, and Bodo Rosenhahn. Same\nsame but differnet: Semi-supervised defect detection with\nnormalizing flows. In WACV, 2021. 6\n[28] Marco Rudolph, Tom Wehrbein, Bodo Rosenhahn, and Bastian Wandt. Asymmetric student-teacher networks for industrial anomaly detection. arXiv preprint arXiv:2210.07829,\n2022. 2, 6\n[29] Mohammadreza Salehi, Niousha Sadjadi, Soroosh\nBaselizadeh, Mohammad H Rohban, and Hamid R Rabiee. Multiresolution knowledge distillation for anomaly\ndetection. In CVPR, 2021. 2\n[30] Guodong Wang, Shumin Han, Errui Ding, and Di Huang.\nStudent-teacher feature pyramid matching for anomaly detection. In BMVC, 2021. 1, 6\n[31] Yue Wang, Jinlong Peng, Jiangning Zhang, Ran Yi, Yabiao\nWang, and Chengjie Wang. Multimodal industrial anomaly\ndetection via hybrid fusion. In CVPR, 2023. 3, 6, 7\n[32] Jhih-Ciang Wu, Ding-Jie Chen, Chiou-Shann Fuh, and TyngLuh Liu. Learning unsupervised metaformer for anomaly\ndetection. In ICCV, 2021. 1\n[33] Kun Wu, Lei Zhu, Weihang Shi, Wenwu Wang, and Jin Wu.\nSelf-attention memory-augmented wavelet-cnn for anomaly\ndetection. IEEE Transactions on Circuits and Systems for\nVideo Technology, 2022.\n[34] Xudong Yan, Huaidong Zhang, Xuemiao Xu, Xiaowei Hu,\nand Pheng-Ann Heng. Learning semantic context from normal samples for unsupervised anomaly detection. In AAAI,\n2021. 1\n[35] Jiawei Yu, Ye Zheng, Xiang Wang, Wei Li, Yushuang Wu,\nRui Zhao, and Liwei Wu. Fastflow: Unsupervised anomaly\ndetection and localization via 2d normalizing flows. arXiv\npreprint arXiv:2111.07677, 2021. 1, 2\n[36] Qingru Zhang, Minshuo Chen, Alexander Bukharin,\nPengcheng He, Yu Cheng, Weizhu Chen, and Tuo Zhao.\nAdaptive budget allocation for parameter-efficient finetuning. CoRR, abs/2303.10512, 2023. 8\n\n\f</code></pre></article>\n        \n</main>\n\n<script src=\"https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/katex.min.js\"></script>\n<script src=\"https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/contrib/auto-render.min.js\"></script>\n<script>\n\nfunction initTheme() {\n  const saved = localStorage.getItem('kb-theme') || 'light';\n  document.documentElement.setAttribute('data-theme', saved);\n  updateThemeIcon(saved);\n}\nfunction toggleTheme() {\n  const cur = document.documentElement.getAttribute('data-theme') || 'light';\n  const next = cur === 'light' ? 'dark' : 'light';\n  document.documentElement.setAttribute('data-theme', next);\n  localStorage.setItem('kb-theme', next);\n  updateThemeIcon(next);\n}\nfunction updateThemeIcon(t) {\n  const btn = document.getElementById('theme-toggle-btn');\n  if (btn) btn.innerHTML = t === 'dark' ? '☀️' : '🌙';\n}\ndocument.addEventListener('DOMContentLoaded', initTheme);\n\nfunction setViewMode(m) {\n  const grid = document.getElementById('bento-grid-view');\n  const list = document.getElementById('list-table-view');\n  const bGrid = document.getElementById('view-grid-btn');\n  const bList = document.getElementById('view-list-btn');\n  if (m === 'list') {\n    if (grid) grid.style.display = 'none';\n    if (list) list.style.display = 'flex';\n    if (bGrid) bGrid.classList.remove('active');\n    if (bList) bList.classList.add('active');\n  } else {\n    if (grid) grid.style.display = 'grid';\n    if (list) list.style.display = 'none';\n    if (bGrid) bGrid.classList.add('active');\n    if (bList) bList.classList.remove('active');\n  }\n  localStorage.setItem('kb-view', m);\n}\ndocument.addEventListener('DOMContentLoaded', () => {\n  const s = localStorage.getItem('kb-view') || 'grid';\n  setViewMode(s);\n});\n\ndocument.addEventListener('DOMContentLoaded', () => {\n  document.querySelectorAll('pre').forEach(pre => {\n    const b = document.createElement('button');\n    b.className = 'copy-code-btn';\n    b.innerText = 'Copy';\n    b.onclick = () => {\n      const c = pre.querySelector('code') ? pre.querySelector('code').innerText : pre.innerText;\n      navigator.clipboard.writeText(c).then(() => {\n        b.innerText = 'Copied!';\n        setTimeout(() => { b.innerText = 'Copy'; }, 2000);\n      });\n    };\n    pre.appendChild(b);\n  });\n});\n\nwindow.addEventListener('keydown', (e) => {\n  if ((e.key === '/' || (e.metaKey && e.key === 'k')) && document.activeElement.tagName !== 'INPUT' && document.activeElement.tagName !== 'TEXTAREA') {\n    e.preventDefault();\n    const q = document.getElementById('global-search-input');\n    if (q) q.focus();\n  }\n});\n\n// Scrollspy for TOC\nwindow.addEventListener('scroll', () => {\n  const headers = document.querySelectorAll('.article-body h1, .article-body h2, .article-body h3');\n  const scrollPos = window.scrollY + 100;\n  headers.forEach(h => {\n    if (h.offsetTop <= scrollPos) {\n      const id = h.getAttribute('id');\n      if (id) {\n        document.querySelectorAll('.reading-sidebar a').forEach(a => {\n          a.classList.toggle('active', a.getAttribute('href') === '#' + id);\n        });\n      }\n    }\n  });\n});\n\ndocument.addEventListener(\"DOMContentLoaded\", function() {\n  if (window.renderMathInElement) {\n    renderMathInElement(document.body, {\n      delimiters: [\n        {left: '$$', right: '$$', display: true},\n        {left: '$', right: '$', display: false},\n      ],\n      throwOnError : false\n    });\n  }\n});\n</script>\n\n</body>\n</html>\n"