"<!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>This CVPR paper is the Open Access version, provided by the Computer Vision Foundation.\nExcept for this watermark, it is identical to the accepted version;\nthe final published version of the proceedings is available on IEEE Xplore.\n\nRAID: Retrieval-Augmented Anomaly Detection\nMingxiu Cai1,∗ Zhe Zhang1,∗ Gaochang Wu1,† Tianyou Chai1 Xiatian Zhu2\n1\nState Key Laboratory of Synthetical Automation for Process Industries, Northeastern University\n2\nUniversity of Surrey\nMulti-dataset setting\n\nMulti-class\n\nAbstract\n\nDataset 1\n\nUnsupervised Anomaly Detection (UAD) aims to identify\nabnormal regions by establishing correspondences between\ntest images and normal templates. Existing methods primarily rely on image reconstruction or template retrieval\nbut face a fundamental challenge: matching between test\nimages and normal templates inevitably introduces noise\ndue to intra-class variations, imperfect correspondences,\nand limited templates. Observing that Retrieval-Augmented\nGeneration (RAG) leverages retrieved samples directly in\nthe generation process, we reinterpret UAD through this\nlens and introduce RAID, a retrieval-augmented UAD\nframework designed for noise-resilient anomaly detection\nand localization. Unlike standard RAG that enriches context or knowledge, we focus on using retrieved normal samples to guide noise suppression in anomaly map generation. RAID retrieves class-, semantic-, and instance-level\nrepresentations from a hierarchical vector database, forming a coarse-to-fine pipeline. A matching cost volume correlates the input with retrieved exemplars, followed by a\nguided Mixture-of-Experts (MoE) network that leverages\nthe retrieved samples to adaptively suppress matching noise\nand produce fine-grained anomaly maps. RAID achieves\nstate-of-the-art performance across full-shot, few-shot, and\nmulti-dataset settings on MVTec, VisA, MPDD, and BTAD\nbenchmarks. https://github.com/Mingxiu-Cai/RAID.\n\nClass 1\n“Empowering UAD through RAG.”\n\nFew-shot setting\n\n...\n\nDataset 2\n\n...\n\n...\n\nClass 2\n\nDataset N\n\nClass C\n\nw/o RAID w/ RAID\n\nw/o RAID w/ RAID\n\nw/o RAID w/ RAID\n\nFigure 1. We reformulate UAD within the Retrieval-Augmented\nGeneration (RAG) paradigm, effectively reducing retrieval and\nmatching noise and enabling stronger generalization across fullshot, few-shot, and multi-dataset settings.\n\n1. Introduction\n\n[59, 60, 71] is steadily enhancing its practical applicability.\nExisting UAD methods can be broadly categorized\ninto reconstruction- and embedding-based paradigms [36].\nReconstruction-based methods leverage Generative Adversarial Networks (GANs) [24], Transformers [21, 41, 64],\nor diffusion models [63] to learn the manifold of normal patterns, projecting inputs onto this manifold to obtain normal-looking reconstructions, where discrepancies\nfrom the inputs reveal anomalies. Embedding-based methods [45, 55, 67], in contrast, bypass explicit reconstruction\nand instead perform feature-level matching between a query\nand its corresponding normal templates stored in a memory bank, which may consist of image-level features [18],\nor patch-level embeddings [11, 47, 49]. Recently, growing attention has been directed toward leveraging vision\nfoundation models [46, 48, 52] to enhance both paradigms\nwith semantically rich representations, e.g., WinCLIP [26],\nAnomalyDINO [11], and Dinomaly [21]. However, these\napproaches still suffer from unreliable feature matching\narising from imperfect reconstructions [36] or suboptimal\ntemplate retrieval, and limited few-shot generalization when\nadapting to domain-specific categories [1].\nIn this paper, we reinterpret UAD through the lens of the\nRetrieval-Augmented Generation (RAG) paradigm, as illus-\n\nAnomaly detection serves as a cornerstone task in computer vision with applications in industrial quality inspection [38, 56, 66], medical image analysis [25], and intelligent surveillance [58]. Given the limited availability and\ndiverse nature of anomaly patterns, recent studies [2, 15, 21]\nhave increasingly gravitated toward Unsupervised Anomaly\nDetection (UAD) without access to anomalous samples.\nIn parallel, the shift from the traditional one-class-onemodel paradigm [49, 63] toward unified multi-class UAD\n∗ Equal Contribution.\n† Gaochang Wu (wugc@mail.neu.edu.cn) is the corresponding author.\n\n21367\n\n\ftrated in Fig. 1. In the era of reasoning-driven artificial intelligence, RAG has emerged as an effective framework to mitigate hallucinations and enhance generalization when models lack sufficient domain-specific knowledge or data [17].\nIt has been successfully applied to diverse vision tasks [72],\nincluding conditional image generation [5], long-tailed image classification [40], and open-vocabulary object detection [28]. From this perspective, most reconstructionand embedding-based UAD approaches can be conceptualized as partial realizations of the RAG pipeline, where\nthe model retrieves a normal counterpart (via reconstruction, e.g., GLAD [59], memory retrieval, e.g., PatchCore [49], or teacher-student distillation, e.g., RD++ [54])\nand identifies anomalies via feature matching. Despite this\nconceptual alignment, most existing methods overlook the\ngenerative reasoning stage of RAG, producing hallucinatory detection noise (e.g., blurred anomaly boundaries\nand missing subtle anomalies) due to unreliable feature\nmatching.\nTo address this gap, we propose RAID, a RetrievalAugmented Industrial anomaly Detection framework that\nfully integrates the RAG pipeline for UAD, which\nretrieves normal representations and subsequently\ngenerates anomaly maps by jointly reasoning over the\nretrieved patches and the input patches. To achieve efficient and scalable retrieval, we design a hierarchical vector database that organizes tokenized templates into three\nlevels of entities, class prototype (category-level concept),\nsemantic prototype (clustered patch token), and instance\ntoken (patch token), rather than adopting a flat structure.\nCompared to existing image-level template retrieval and flat\nretrieval schemes, this hierarchy facilitates a coarse-to-fine\nretrieval flow, enabling query tokens to efficiently access semantically relevant template patches with strong contextual\nconsistency for downstream anomaly generation.\n\nfilter, enabling it to focus on matching-cost denoising and\nlearn category-agnostic anomaly representations. This joint\nretrieval-generation scheme leads to robust anomaly localization and strong few-shot generalization across unseen\ncategories, as demonstrated in Fig. 1 (bottom).\nWe summarize our contributions as follows: 1) We propose RAID, a new paradigm that reconceptualizes UAD\nwithin the RAG framework, enabling reliable detection and\nlocalization with strong generalization. 2) We introduce a\nhierarchical vector database that enables a coarse-to-fine\nretrieval flow, allowing query tokens to efficiently access\nsemantically relevant template tokens with strong contextual consistency. 3) We design the generation stage as a\nguided MoE filtering network, which dynamically allocates\ndenoising experts to suppress hallucinatory matching noise\nand improve robustness against diverse anomaly distributions. 4) We extensively evaluate RAID under full-shot,\nfew-shot, and multi-dataset settings, where it consistently\noutperforms existing methods across multiple benchmarks,\ndemonstrating superior generalization and scalability.\n\n2. Related works\n2.1. Unsupervised Anomaly Detection\n\nWe model the generation stage as a guided Mixture-ofExperts (MoE) filtering network designed to mitigate potential matching noise between the input and its multiple\nretrieved counterparts. Following CostFilter-AD [68], we\nfirst construct a matching cost volume by correlating each\ninput token with its retrieved template tokens. In contrast to previous approaches [11, 68], the hierarchical retrieval structure in RAID effectively reduces the matching\ndimensionality in the cost volume while preserving semantic fidelity. To further mitigate unreliable feature correspondence, the proposed guided MoE filter leverages both\nthe input tokens and the retrieved semantic prototypes as\ndual guidance, adaptively assigning multiple denoising experts that specialize in distinct semantic and spatial contexts to generate a refined anomaly map that preserves finegrained anomaly boundaries and subtle anomalies. Leveraging category- and dataset-agnostic retrieval, RAID injects\nuniversal semantic priors into a dynamically activated MoE\n\nEarly studies mainly followed the single-class paradigm,\nwhere models are trained on normal samples to detect\nanomalies at test time [49, 62]. With the advent of\nfoundation models and the emergence of new architectures [12, 29, 46, 52], research has progressed along two\ndirections: (i) multi-class detection using a unified model\nto identify all categories within a dataset [34, 41, 59,\n60, 68]; and (ii) few-shot detection for unknown classes\nunseen during training [7, 9, 69, 73], which leverages\na small set of auxiliary anomalies without class overlap\nto the test domain. Existing approaches can be broadly\ngrouped into reconstruction-based and embedding-based\nfamilies [6, 36]. Reconstruction-based pipelines attempt\nto map anomalous regions back to normal ones and identify discrepancies through similarity or residual analysis.\nRepresentative architectures include U-Net [62, 71], Vision\nTransformer (ViT) [20, 21], Mamba [22], Diffusion [23,\n34], and MoE-based [43] frameworks. These models typically integrate pre-trained features with customized decoders [21, 22, 41, 59, 60] to address the pervasive “identical shortcut” issue [36], which weakens matching similarity\nor residual contrast.\nEmbedding-based methods learn either classspecific [39, 49, 67] or class-agnostic [47, 55] normal\nrepresentations, and detect outliers by modeling a normal distribution [74], maintaining a memory bank [49]\nthat stores image-level [18] or patch-level embeddings [11, 47, 49]. While effective, these methods often\nsuffer from high computational overhead due to large\n\n21368\n\n\f(a) Retrieval Stage\n\nTemplate &amp; Embedding\n\n(b) Generation Stage: Matching Cost Filtering\n\n𝐻′ × 𝑊′ × 𝐷\n\nHierarchical vector database\n\nEnc.\n\nClass proto.\n\nPCB1\n\nSemantic proto.\n\nInput &amp; Embedding\n\n𝐾\n\nInstance token\n\n(𝐻′ × 𝑊 ′ + 1) × 𝐷\n\nQuery\n\n𝐾\n\nE1\n\nE2\n\n...\n\nEM\n\nFeature\nmatching\nAnomaly cost\nvolume 𝒞\n\nRetrieved instances\n(template tokens)\n\nEnc.\n𝐻×𝑊×3\n\n𝐻′ × 𝑊′ × 𝐾\n\n𝐻′ × 𝑊′ × 𝐷 × 𝐾\n\nPatch token\n\nGuided MoE filter\nRouter\n\nRetrieved semantic\nprototypes\n\nCable\n\nTemplate\nCLS token\n\nPrototype guidance 𝑔𝑠\n\nCapsules\n\nOutput\n\nAnomaly\nmap ℳ\n\nQuery guidance 𝑔𝒬\n\nIndexing flow\nRetrieval flow\nIndexing / Retrieval flow\n\nGeneration flow\n\nFigure 2. Overview of our RAID, which reinterprets UAD within a RAG paradigm. (a) In the retrieval stage, a hierarchical vector\ndatabase is constructed, indexing tokenized templates into three sequential entity levels: class prototype, semantic prototype, and instance\ntoken. This structure allows efficient retrieval flow queried by input tokens. (b) In the generation stage, an anomaly cost volume is\nbuilt by matching each input token with its retrieved template tokens. A guided MoE filter then dynamically refines this cost volume under\nthe dual guidance of the retrieved semantic prototypes and the input tokens.\n\nswering that retrieves image-document knowledge to condition an MLLM [3] for generating textual anomaly descriptions and image-level decisions. In contrast, RAID targets\npurely visual UAD with pixel-level output (i.e., segmentation) without relying on text Information. It performs hierarchical retrieval over visual exemplars to strike a balance between accuracy and efficiency, and further leverages filtering-based generative reasoning to suppress matching noise and enhance anomaly localization. This design\nnot only clearly distinguishes RAID from existing retrievalonly approaches [11, 18, 47, 49], but also delivers robust\ngeneralization and superior performance across multi-class,\nfew-shot, and multi-dataset UAD settings.\n\ntemplate search spaces [36] or matching noise caused by\nnon-ideal retrieval templates. CostFilter-AD [68] further\nintroduces a matching-cost filtering module as a plug-in\nto suppress such noise, yet its performance remains constrained by the initial anomaly cues provided by the host\nmodels. Recently, CLIP-based approaches [10, 26, 42, 73]\nhave been explored for novel-class anomaly detection in\nthe few-shot setting, where text embeddings are treated\nas semantic templates. However, their success heavily\ndepends on the diversity and representativeness of auxiliary\nreal anomaly data.\n\n2.2. Retrieval-Augmented Generation in Vision\nRetrieval-Augmented Generation (RAG) injects retrievable\nexternal knowledge around encoding/decoding to align with\nmodel context [17, 32, 50], improving factual consistency,\ninterpretability, and timeliness. Originally developed for\nlanguage and text understanding [17], RAG has progressively extended to vision tasks [72]. In image understanding, notable directions include retrieval-augmented openvocabulary object detection [28], image captioning and\ngeneration [51], medical image segmentation for clinical\ndecision-making [70], and question answering over visually rich, mixed-format documents [53]. For visual generation, retrieved image priors are integrated into diffusion\nand reconstruction pipelines to refine structural and textural fidelity, exemplified by retrieval-augmented text-toimage generation [8], image restoration [19], and superresolution [31]. In video understanding, CadenceRAG [37]\ndemonstrates that retrieval across large video libraries enhances text-grounded video retrieval and question answering, while multi-query and multi-evidence strategies further\nadvance multimodal RAG [30, 61].\nA conceptually related work is ADSeeker [65], which\ncasts anomaly analysis as vision and language question an-\n\n3. Methodology\n3.1. Overview\nGiven an input (query) image xQ ∈ RH×W ×3 (channel, height, and width) or a template (reference) image\nxT ∈ RH×W ×3 prepared for the database, a pre-trained\nViT encoder is employed to embed them into patch tokens\n′\n′\n{pQ }, {pT } ∈ R(H ×W )×D and class (CLS) tokens cQ ,\ncT ∈ R1×D , where H ′ , W ′ , and D denote the resulting\nspatial resolution and token dimension, respectively. The\ncosine similarity between a query token vector pQ and a\ntemplate token pT is defined as:\nsim(pQ , pT ) =\n\npQ p⊤\nT\n,\n∥pQ ∥ ∥pT ∥\n\n(1)\n\nwhere ∥ · ∥ is the L2 norm. In most existing retrieval-only\napproaches, both template retrieval and anomaly scoring\nrely on this similarity measure. However, directly searching\nacross all template tokens in the database incurs substantial\ncomputational overhead and generalizes poorly to unseen\ncategories. Moreover, when the number of templates is lim-\n\n21369\n\n\fited, as in few-shot scenarios, the detection performance becomes highly sensitive to noisy or unreliable templates.\nMotivated by the RAG paradigm [17, 72], which alleviates hallucinations through augmented generation, we enhance UAD by further introducing a filtering-based generation reasoning process, as illustrated in Fig. 2. The overall\nRAID framework can be formulated as:\nM = G({pQ }, R({pQ }, D)).\n\n(2)\n\nHere, R({pQ }, D) performs hierarchical retrieval from the\ndatabase D, balancing search efficiency and retrieval accuracy; G(·, ·) then executes guided MoE filtering to generate\nthe refined anomaly map M, conditioned on the query and\nretrieved templates, effectively suppressing retrieval noise.\n\n3.2. Hierarchical Vector Database Construction\nExisting UAD methods typically adopt a flat retrieval structure [11, 18, 49], where each query patch searches for its\nglobally most similar counterpart in a large memory bank.\nSuch a design leads to high computational overhead and degraded inference efficiency as the bank size grows. To balance retrieval accuracy and efficiency while ensuring interclass discriminability and intra-class representational richness, we introduce a hierarchical vector database D, as illustrated in Fig. 2(a), with the following indexing flow of\ntemplate tokens: class prototype {c̄} → semantic prototype\n{s̄} → instance token {t̄}. During database construction,\nboth the CLS token cT and the patch tokens {pT } are utilized to form this multi-level hierarchy.\nThe class prototype entity indexes template tokens into\ncorresponding class-level clusters. To obtain it, we perform\nK-means clustering on the CLS tokens from all templates:\n\u0001\n{c̄} = KMeans {cnT }N\nn=1 ,\nwhere KMeans(·) denotes the K-means operation, N is the\nnumber of templates, and c̄ ∈ R1×D represents the class\nprototype (class-level centroids), with |{c̄}| = C as the\nclass number. Leveraging the class-level semantics encoded\nin CLS tokens, the class prototype entity enables categoryand dataset-agnostic retrieval, providing a strong scalability\ncapability for multi-dataset UAD.\nThe semantic prototype entity organizes template tokens into an intra-class semantic structure:\n\u0001\nNc\n{s̄}c = KMeans {pc,n\nT }n=1 ,\nwhere s̄c ∈ R1×D represents the resulting semantic prototype. Note that multiple semantic prototypes are generated\nper class, and we use s̄c,j to indicate the j-th semantic prototype guided by the class prototype entity c̄c . These prototypes capture recurring intra-class patterns, such as textures,\nstructural components, or backgrounds, and serve as structured guidance for more effective anomaly detection.\nThe instance token entity stores all template tokens\n{pT } in organized instance token sets {t}c,j , sequentially\n\nindexed following the flow defined by the class prototype\nand semantic prototype entities. Here, we use tc,j,k ∈\nR1×D to denote the k-th instance token associated with the\nsemantic prototype s̄c,j . This entity preserves fine-grained\nvisual details, enabling accurate retrieval and pixel-level\nmatching for downstream anomaly detection.\n\n3.3. Hierarchical Retrieval\nThe hierarchical vector database naturally supports a\ncoarse-to-fine retrieval flow, as demonstrated in Fig.\n2(a), which refines correspondences by narrowing the\nsearch space from global class-level clusters to intra-class\nsemantics, and finally to local instance-level template tokens. This hierarchical retrieval mechanism (R in Eqn. (2))\neffectively reduces redundant matching and mitigates scalability bottlenecks observed in prior works [11, 68], thereby\nenhancing the applicability of the proposed RAID framework to large-scale datasets.\nAt the top level, the CLS token of the input cQ is compared with the class prototypes {c̄} via cosine similarity:\nĉ = arg max sim(cQ , c̄c ),\nc\n\nc̄c ∈ {c̄}.\n\nThe top-1 match provides an estimation of the input category ĉ.\nAt the intermediate level, each patch token pQ from\nthe input image queries the semantic prototype set {s̄}ĉ of\nclass ĉ, retrieving its top-K ′ nearest semantic prototypes\n′\n{s̄ĉ,j }K\nj=1 , defined as:\n′\n\n′\n\nK\nĉ,j\n{s̄ĉ,j }K\nj=1 = arg maxs̄∈{s̄}ĉ sim(pQ , s̄ ).\n\nFinally, at the lowest level, pQ further queries the instance token set {t}ĉ,j associated with its matched seman′\ntic prototypes {s̄ĉ,j }K\nj=1 , retrieving the top-K most similar\ninstance tokens {tĉ,j,k }K\nk=1 , defined as:\nK\nĉ,j,k\n{tĉ,j,k }K\n).\nk=1 = arg maxt∈{t}ĉ,j sim(pQ , t\n\nAmong the retrieved K ′ semantic prototypes, only the\nmost relevant one is retained for each patch token. Consequently, by efficiently traversing all patch tokens {pQ } of\nthe input image, we prepare a total of H ′ ×W ′ ×1 semantic\nprototypes and H ′ × W ′ × K template tokens, each represented as a 1 × D feature vector.\n\n3.4. Filtering-based Generation Reasoning\nWhile the hierarchical retrieval flow effectively gathers template tokens, it also introduces hallucinatory noise from unreliable matches, spatial misalignment, and domain shifts.\nThis noise blurs anomaly boundaries and obscures subtle\ndefects. To address it, we reformulate the generation stage\nof RAG as a filtering-based generative reasoning process,\nemploying a guided MoE filter that adaptively denoises and\nrefines the anomaly cost volume, as shown in Fig. 2(b).\n\n21370\n\n\fInitial anomaly cost volume. For each query token\n(y,x)\npQ\nat spatial coordinate (y, x), we define patch-level\nanomaly cost with its retrieved instance patches t(y,x),k ∈\n{t(y,x),k }K\nk=1 based on cosine similarity in Eqn. (1):\n(y,x)\n\nC y,x,k = 1 − sim(pQ\n′\n\n, t(y,x),k ),\n\nWe adopt a self-supervised training strategy commonly\nused in UAD [59, 62, 63], where synthetic anomalous images are paired with their corresponding synthetic anomaly\nmasks Ms . The overall objective function is defined as:\n\n′\n\nwhere C ∈ RH ×W ×K is the resulting 3D anomaly cost\n′\n′\nvolume, with (y, x) ∈ RH ×W indicating spatial positions\nand k ∈ RK indexing the matching candidates. Note that\nlower similarity values correspond to higher anomaly likelihoods.\nBy leveraging the hierarchical retrieval mechanism,\nRAID selects only a small set of highly relevant candidates for each query token, resulting in a compact and wellaligned cost volume. This design contrasts with CostFilterAD [68], which constructs a global matching space, thereby\nsignificantly improving inference efficiency.\nGuided MoE filtering. The guided MoE filter is designed as a two-stage architecture: the first stage constructs\na guidance map via dual-guidance fusion, while the second\nstage performs guided filtering.\nIn the first stage, the semantic prototypes {s̄} are rearranged into image-like prototype guidance maps gs ∈\n′\n′\nRH ×W ×D×1 , and the query tokens {pQ } are rearranged\n′\n′\ninto image-like query guidance maps gQ ∈ RH ×W ×D×K .\nA convolutional router takes the concatenation cat(gQ , gs )\nas input to compute sparse routing probabilities and\nweights, then aggregates the activated experts to produce\nthe fused guidance g̃:\np = Softmax(Router(cat(gQ , gs ))),\n(\npi , i ∈ Top-k(p),\ni\np̃ =\n0, otherwise,\nXM\ng̃ =\np̃i Egi (cat(gQ , gs )) ,\ni=1\n\nwhere Egi\n\ndenotes the i-th convolutional expert used for\nguidance fusion, and p̃i is its routing weight. Only the topk experts with the highest scores are activated, encouraging\nspecialization across distinct semantic patterns.\nIn the second stage, the initial anomaly cost volume C is\nrefined via denoising MoE, where a router softly activates\nall experts. Each denoising expert ECi performs dual-branch\nfiltering of C under the fused guidance g̃, which consists\nof a cross-attention branch (g̃ as query and C as key/value)\nand a convolutional branch. The router assigns dense expert\nweights pi and aggregates the expert outputs C˜i to yield the\nfinal anomaly map:\nM=\n\n3.5. Training and Inference\n\nXM\ni=1\n\npi · C˜i , C˜i = ECi (g̃, C),\n\nwhere M denotes the generated anomaly map. The complete MoE architecture is detailed in the Appendix.\n\nL = Lfocal (M, Ms ) + λbal Lbal ,\nwhere the focal loss [35] Lfocal addresses the inherent imbalance between normal and anomalous pixels, Lbal regularizes\nthe expert routing process to prevent bias toward dominant\nexperts and mitigate router collapse [14], and λbal is the balancing weight.\nFor inference, the anomaly cost volume is constructed\nand filtered to yield the refined anomaly map M. The\nimage-level anomaly score is computed as the mean of the\ntop 1% highest responses in M, while for pixel-level localization, M is directly used as the anomaly map.\n\n4. Experiments\n4.1. Experimental Settings\nDatasets. We evaluate our method on four widely used\nindustrial anomaly detection benchmarks, MVTec-AD [4],\nVisA [75], MPDD [27], and BTAD [44], which cover diverse anomaly types, object complexities, and imaging conditions, offering a comprehensive benchmark for assessing\nUAD robustness and generalization. MVTec-AD contains\n5,354 high-resolution images of 10 objects and 5 textures,\nwith normal samples for training and diverse defects for\ntesting. VisA includes 10,821 images across 12 object subsets, covering various surface and structural anomalies such\nas scratches, dents, and color spots. MPDD focuses on\nmetallic parts, providing 1,346 images under challenging\nbackgrounds and illumination. BTAD comprises 2,830 images from three industrial categories, featuring both normal\nand defective samples with real-world variability.\nEvaluation metrics. Following common practice, we\nprimarily report the Area Under the Receiver Operating\nCharacteristic Curve for image-level anomaly detection (IAUROC) and pixel-level anomaly localization (P-AUROC).\nAdditional metrics, including Average Precision (AP), the\nmaximum F1 score (F1-max), and the pixel-level Area Under the Per-Region Overlap (AUPRO), are also evaluated.\nImplementation details. For full-shot and multi-dataset\nexperiments, all input images are resized to 256 × 256. We\nuse DINOv2-s [46] as the feature extractor. In constructing the hierarchical vector database, 80 templates are used\nfor MVTec-AD and 100 for VisA, while all normal samples serve as templates for MPDD and BTAD. Patch tokens\nwithin each class are clustered into 50 semantic prototypes.\nDuring retrieval, the K ′ = 5 nearest semantic prototypes\nand K = 150 instance tokens are retrieved for each query\n\n21371\n\n\fTable 1. Full-shot (multi-class UAD) performance (%) on four industrial datasets. Best results are highlighted in bold.\nDataset\n\nImage-level\n\nMethod\n\nPixel-level\n\nAUROC\n\nAP\n\nF1-max\n\nAUROC\n\nAP\n\nF1-max\n\nAUPRO\n\nMVTec-AD [4]\n\nPatchCore [49]\nUniAD [60]\nSimpleNet [39]\nMambaAD [22]\nGLAD [59]\nDiAD [23]\nViTAD [64]\nAnomalyDINO [11]\nCostfilter-AD [68]\nRAID (Ours)\n\n96.4\n96.5\n95.3\n98.6\n97.5\n97.2\n98.3\n96.8\n99.0\n99.4\n\n98.8\n98.4\n99.6\n98.8\n99.0\n99.4\n98.6\n99.7\n99.8\n\n96.2\n95.8\n97.8\n96.8\n96.5\n97.3\n97.1\n98.6\n98.7\n\n95.7\n96.8\n96.9\n97.7\n97.3\n96.8\n97.7\n98.1\n98.0\n98.6\n\n43.4\n45.9\n56.3\n58.8\n52.6\n55.3\n61.3\n58.1\n71.7\n\n49.5\n49.7\n59.2\n59.7\n55.5\n58.7\n60.8\n61.2\n68.5\n\n90.7\n86.5\n93.1\n92.8\n90.7\n91.4\n93.6\n93.2\n95.6\n\nVisA [75]\n\nUniAD [60]\nSimpleNet [39]\nMambaAD [22]\nGLAD [59]\nDiAD [23]\nViTAD [64]\nAnomalyDINO [11]\nCostfilter-AD [68]\nRAID (Ours)\n\n85.5\n87.2\n94.3\n90.1\n86.8\n90.5\n90.5\n93.4\n94.9\n\n85.5\n87.0\n94.5\n91.4\n88.3\n91.7\n91.4\n95.2\n95.5\n\n84.4\n81.8\n89.4\n86.7\n85.1\n86.3\n86.2\n89.3\n90.6\n\n95.9\n96.8\n98.5\n97.4\n96.0\n98.2\n97.5\n98.6\n99.0\n\n21.0\n34.7\n39.4\n33.9\n26.1\n36.6\n39.6\n41.4\n45.2\n\n27.0\n37.8\n44.0\n39.4\n33.0\n41.1\n40.4\n45.0\n49.2\n\n75.6\n81.4\n91.0\n91.5\n75.2\n85.1\n86.3\n86.8\n91.7\n\nMPDD [27]\n\nPatchCore [49]\nUniAD [60]\nHvq-Trans [60]\nSimpleNet [39]\nMambaAD [22]\nGLAD [59]\nDiAD [23]\nViTAD [64]\nCostfilter-AD [68]\nRAID (Ours)\n\n83.5\n80.1\n86.5\n90.6\n89.2\n90.8\n85.8\n87.4\n93.1\n96.3\n\n83.2\n87.9\n94.1\n93.1\n90.5\n89.2\n90.8\n95.4\n97.6\n\n85.1\n85.6\n89.7\n90.3\n90.2\n86.5\n87.0\n90.3\n95.0\n\n97.7\n95.4\n96.9\n97.1\n97.7\n98.0\n91.4\n97.8\n97.5\n98.9\n\n19.0\n26.4\n33.6\n33.5\n40.0\n15.3\n44.1\n34.1\n47.0\n\n25.6\n30.5\n35.7\n38.6\n40.6\n19.2\n46.4\n37.0\n46.9\n\n83.8\n88.0\n90.0\n92.8\n93.1\n66.1\n95.3\n82.9\n96.6\n\nBTAD [44]\n\nUniAD [60]\nHvq-Trans [60]\nSimpleNet [39]\nMambaAD [22]\nDiAD [23]\nViTAD [64]\nCostfilter-AD [68]\nRAID (Ours)\n\n94.5\n90.9\n94.0\n92.9\n90.2\n94.0\n93.3\n95.2\n\n98.4\n97.8\n97.9\n96.2\n88.3\n97.0\n98.6\n96.3\n\n94.9\n94.8\n93.9\n93.0\n92.6\n93.7\n96.0\n93.0\n\n97.4\n96.7\n96.2\n97.6\n91.9\n97.6\n97.3\n97.6\n\n52.4\n43.2\n41.0\n51.2\n20.5\n58.3\n47.0\n67.3\n\n55.5\n48.7\n43.7\n55.1\n27.0\n56.5\n50.2\n64.3\n\n78.9\n75.6\n69.6\n77.3\n70.3\n72.8\n76.2\n72.2\n\ntoken. The guided MoE filter in the generation stage includes three experts per layer, with sparse routing in the\nfirst layer activating two experts per input. The weighting\nparameter λbal is 0.005. Models are trained for 100 epochs\nusing Adam with an initial learning rate of 1 × 10−4 . For\nfew-shot evaluation, the same settings are applied except\nthat input images are resized to 224 × 224 and the number\nof templates is adjusted accordingly.\n\n4.2. Quantitative Comparison\n\nfeature-embedding, diffusion-based, and transformer-based\nframeworks. For the few-shot scenario, we evaluate against\nPatchCore [49], Win-CLIP [26], FastRecon [13], PromptAD [33], IIPAD [42], and DFM [57], to assess the model\nperformance using limited normal samples without any\nfine-tuning. For the multi-dataset scenario, we adopt the\n“one-model-for-all datasets” paradigm, jointly training on\nmultiple datasets and comparing it with the representative\nOneNIP [16] to validate cross-dataset generalization.\nFull-shot for multi-class UAD. We evaluate image-level\ndetection and pixel-level localization for full-shot UAD,\nwhere the training phase has access to all normal samples\non four benchmarks, as shown in Table 1. On MVTec-AD\n[4], our method outperforms GLAD [59], AnomalyDINO\n[11], and CostFilter-AD [68] by 1.9%/1.3%, 1.6%/0.5%,\nand 0.4%/0.6% in I-AUROC/P-AUROC, respectively. On\nVisA [75], it reaches SOTA with gains of 4.8%/1.6%,\n4.4%/1.5%, and 1.5%/0.4%. On MPDD [27], advances are 5.5%, 8.9%, and 3.2% for I-AUROC and\n0.9%, 1.1%, and 1.4% for P-AUROC over GLAD, ViTAD, and CostFilter-AD. On BTAD [44], it exceeds\nCostFilter-AD and ViTAD by 1.9% and 1.2% in I-AUROC.\n\nWe comprehensively evaluate the effectiveness and generalization of RAID under the multi-class UAD paradigm.\nThe extensive experiments are conducted on four widely\nused benchmarks: MVTec-AD [4], VisA [75], MPDD [27],\nand BTAD [44], under three representative settings: fullshot, few-shot, and multi-dataset. For the full-shot scenario, we adopt the “one-model-for-all classes” paradigm\nand compare our method with a diverse set of StateOf-The-Art (SOTA) baselines, including PatchCore [49],\nHVQ-Trans [41], GLAD [59], DiAD [23], ViTAD [64],\nCostFilter-AD [68], UniAD [60], SimpleNet [39], MambaAD [22], and AnomalyDINO (full-shot) [11], covering\n\n21372\n\n\fTable 2. Few-shot performance comparison under the multi-class paradigm on MVTec-AD and VisA using I-AUROC/P-AUROC.\nSetup\n\nDatasets\n\nPatchCore [49]\n\nWin-CLIP [26]\n\nFastRecon [13]\n\nPromptAD [33]\n\nIIPAD [42]\n\nDFM [57]\n\nRAID (Ours)\n\n1-shot\n\nMVTec-AD\nVisA\n\n86.3 / 93.3\n79.9 / 95.4\n\n92.6 / 91.6\n84.8 / 95.3\n\n83.7 / 93.9\n80.1 / 96.5\n\n93.0 / 95.2\n85.2 / 97.2\n\n94.2 / 96.4\n85.4 / 96.9\n\n87.2 / 95.2\n84.0 / 96.4\n\n95.1 / 96.6\n85.8 / 97.7\n\n2-shot\n\nMVTec-AD\nVisA\n\n83.4 / 92.0\n81.6 / 96.1\n\n93.8 / 91.9\n83.5 / 95.7\n\n88.9 / 95.3\n84.6 / 97.5\n\n95.4 / 95.6\n85.1 / 97.7\n\n95.7 / 96.7\n86.7 / 97.2\n\n90.2 / 96.0\n86.0 / 96.8\n\n96.6 / 97.1\n88.5 / 97.9\n\n4-shot\n\nMVTec-AD\nVisA\n\n88.8 / 94.3\n85.3 / 96.8\n\n95.5 / 92.4\n85.7 / 96.0\n\n94.2 / 95.9\n68.5 / 96.0\n\n95.9 / 96.0\n87.5 / 97.9\n\n96.1 / 97.0\n88.3 / 97.4\n\n92.0 / 96.2\n89.8 / 97.1\n\n96.9 / 96.9\n89.3 / 98.2\n\nHazelnut\n\nRAID (Ours)\n\nMVTec-AD\n\nVisA\nMPDD\nBTAD\n\n15\n12\n6\n3\n\n96.7 / 98.8 / 97.1 / 57.5\n92.8 / 95.1 / 98.7 / 41.1\n85.2 / 88.4 / 97.8 / 37.0\n93.2 / 96.5 / 97.9 / 59.8\n\n99.4 / 99.8 / 98.5 / 69.4\n94.6 / 94.8 / 98.8 / 47.1\n93.6 / 96.1 / 98.8 / 44.9\n93.8 / 96.0 / 97.8 / 66.4\n\nAll\n\n36\n\n92.0 / 94.7 / 97.9 / 48.9 95.4 / 96.7 / 98.5 / 57.0\n\nCandle\n\nPipe fryum\n\nCashew\n\nChewinggum\n\nGLAD\n\nOneNIP [16]\n\nTransistor\n\nIn addition, our method also delivers strong performance\non other metrics involving image-level AP/F1-max, and\npixel-level AP/F1-max/AUPRO. Collectively, the consistent gains across datasets support our RAG-inspired design:\nhierarchical retrieval supplies contextually relevant references, and the guided filter refines the anomaly cost volume\ninto reliable image-level decisions and precise pixel-level\nlocalization.\nFew-shot UAD generalizability. We evaluate RAID in\nthe few-shot setting, resizing inputs to 224 × 224 for a\nfair comparison with DFM [42], IIPAD [57], and PromptAD [57]. Following common practice, the model is trained\non the auxiliary MPDD dataset and then tested on MVTecAD [4] and VisA [75]. Table 2 reports averaged results over five seeds, RAID attains consistently high IAUROC/P-AUROC (standard deviations in the Appendix).\nOn MVTec-AD, it surpasses DFM [57] by 7.9%/1.4%,\n6.4%/1.1%, and 4.9%/0.7% for the 1-, 2-, and 4-shot settings (I-AUROC/P-AUROC). Notably, RAID operates in\nan image-only manner, unlike PromptAD [33] and WinCLIP [26] that leverage language priors, and it uses a lower\ninput resolution than FastRecon [13] and WinCLIP [26].\nThese results highlight the strong generalization capability of RAID, which redefines UAD through the RAG perspective: contextually relevant references retrieved from\nthe database iteratively refine the anomaly cost volume\nand guide generation toward semantically coherent regions,\nleading to more accurate and transferable anomaly localization.\nMulti-dataset UAD scalability. We merge MVTecAD [4], VisA [75], BTAD [44], and MPDD [27] into a\nlarger and more diverse dataset following OneNIP [16], and\ntrain RAID on this merged corpus. Table 3 reports imagelevel classification and pixel-level segmentation, including\n\nCostfilter-AD AnomalyDINO\n\n# class\n\nTile\n\nOurs\n\nDatasets\n\nPill\n\nInput/GT\n\nTable 3. Multi-dataset performance comparison of a single\nmodel jointly trained on MVTec-AD, VisA, MPDD, and BTAD\nusing I-AUROC/I-AP/P-AUROC/P-AP.\n\nFigure 3. Qualitative comparison of multi-class anomaly localization results on MVTec-AD and VisA datasets.\n\nthe overall average across 36 categories and the per dataset\naverages. In this multi-dataset setting, RAID surpasses\nOneNIP [16] in image-level classification (95.4%/96.7%)\nand pixel-level segmentation (98.5%/57.0%), whereas\nOneNIP attains 92.0%/94.7%/97.9%/48.9% on the corresponding metrics. Moreover, moving from the multi-class\nsetting in Table 1 to the unified regime of the dataset across\nTable 3, our method shows no noticeable degradation, thus\nestablishing the proposed RAID as a scalable and effective\nsolution for UAD in complex distributions.\n\n4.3. Qualitative Comparison\nWe present qualitative comparisons on the MVTec-AD [4]\nand VisA [75] benchmarks to further validate the effectiveness of our method. As shown in Fig. 3, our approach outperforms GLAD [59], AnomalyDINO [11], and\nCostFilter-AD [68], achieving more precise anomaly localization with sharper boundaries, reduced matching noise,\nand enhanced sensitivity to subtle defects, owing to the\nRAG-like paradigm. Please refer to the Appendix for more\nvisualization results.\n\n4.4. Ablation Studies and Further Analysis\n\n21373\n\nEffectiveness of the retrieval strategy. In Table 4,\nwe compare two retrieval schemes (flat vs. hierarchical) under three database capacity settings (multi-class,\nsingle-class, and few-shot).\nIn practice, the hierar-\n\n\fTable 4. The efficiency and accuracy (I-AUROC and P-AUROC)\ncomparison on MVTec-AD under the different retrieval and\ndatabase (DB.) capacity settings.\nMethods\n\nRetrieval DB. FLOPs Mem. (GB) Inf. (s)\n\nPatchCore\nPatchCore\nAnomalyDINO\n\nRAID\nRAID\nRAID\nRAID\n\nFlat\nFlat\nFlat\nFlat\nHier.\nHier.\nHier.\n\nMulti 7.12G\nSingle 7.12G\nSingle 4.90G\nMulti 14.2G\nSingle 14.2G\nMulti 14.2G\n4-shot 14.2G\n\n3.46\n2.48\n3.25\n6.55\n6.52\n6.52\n5.28\n\n0.093\n0.054\n0.067\n0.267\n0.052\n0.062\n0.046\n\nTable 6. Ablation studies of guided MoE filter on MVTec-AD.\n\nResults\n96.4 / 95.7\n99.0 / 98.0\n96.8 / 98.1\n99.4 / 98.7\n99.3 / 98.7\n99.4 / 98.6\n96.9 / 96.9\n\nMetrics\n\n20\n\n40\n\n60\n\n80\n\nMoEg\n\nCro-Att.\n\nConv.\n\nRouterC\n\nI-/P-AUROC\n\n0\n1\n2\n3\n4\n5\n6\n7\n\n✓\n✓\n✓\n\n✓\n✓\n✓\n✓\n✓\n\n✓\n✓\n✓\n✓\n✓\n\n✓\n✓\n✓\n✓\n✓\n✓\n\n97.9 / 97.5\n98.5 / 97.6\n99.2 / 98.4\n98.7 / 97.8\n99.1 / 98.1\n98.9 / 98.2\n98.0 / 97.5\n99.4 / 98.6\n\nTable 7. Effectiveness of expert quantity on MVTec-AD.\n\nTable 5. Effectiveness of template quantity on MVTec-AD.\n# template\n\nID\n\n# (Eg , EC )\nMetrics\n\nAll\n\n(3, 1)\n\n(3, 2)\n\n(2, 3)\n\n(3, 3)\n\n(4, 3)\n\n99.0 / 98.2 99.2 / 98.4 99.0 / 98.1 99.4 / 98.6 98.8 / 97.9\n\n98.1 / 97.7 98.7 / 97.8 98.9 / 98.1 99.4 / 98.6 99.3 / 98.6\n\nchical retrieval achieves about 5× lower per-image latency than the flat scheme 0.267s (which prioritizes accuracy over speed) while maintaining nearly identical\nI-AUROC and P-AUROC of 99.4%/98.6%. This demonstrates the efficiency–precision balance of our hierarchical retrieval scheme. Across the database capacities,\nmulti-class and single-class settings yield comparable accuracy (99.4%/98.6% vs. 99.3%/98.7%), and even a 4-shot\nsetup preserves strong performance 96.9%/96.9% at a similar per-image runtime (0.046s), highlighting the efficient\nuse of limited normal templates. Overall, these observations validate the design of the hierarchical vector database\nand the associated retrieval strategy.\nAnalysis of template quantity. We vary the perclass template count on MVTec-AD from 20 to All, as\nshown in Table 5. The performance steadily improves\nfrom 98.1%/97.7% (I-AUROC/P-AUROC) to a peak of\n99.4%/98.6% at 80 templates, while the All setting remains\nnear-saturated at 99.3%/98.6%. The gain up to 80 templates validates the retrieval pipeline: expanding the relevant template pool broadens normal-mode coverage and enhances query–template contrast, while hierarchical retrieval\ncompacts matching candidates into a cleaner cost volume\nfor the guided MoE to refine. The near-saturation under All\nsuggests that, while further increasing the template count\nmay offer marginal gains, relevance remains the dominant\nfactor in achieving strong detection and localization with a\ncompact, well-curated template database.\nEffectiveness of the guided MoE filter. Table 6 analyzes how the guided MoE filter transforms the retrievalbuilt cost volume into reliable anomaly decisions. Starting from retrieval only (ID0, 97.9%/97.5%), adding the\ncross-attention branch (Cro-Att.) and the RouterC in the 2nd\nMoE stage (ID1) raises accuracy to 98.5%/97.6% by refining semantically consistent matches. Incorporating the firststage MoEg (ID2) further boosts accuracy to 99.2%/98.4%,\ndemonstrating the benefits of dual-guidance fusion. The\nconvolutional branch (Conv.) in the second-stage (ID3) re-\n\nfines local responses (98.7%/97.8%), while its combination\nwith cross-attention (ID4, 99.1%/98.1%) or MoEg (ID5,\n98.9%/98.2%) brings complementary gains. The former\nstrengthens denoising with a global perception, and the latter refines the guidance. Removing RouterC (ID6) leads to a\ndrop (98.0%/97.5%), confirming the need for sparse routing to preserve expert specialization. The full configuration\n(ID7) achieves the best (99.4%/98.6%), validating that the\nguided MoE filter jointly denoises and refines the cost volume, delivering consistent improvements in both detection\nand localization.\nExpert quantity in MoE. Table 7 analyzes the impact\nof expert numbers in the two-stage guided MoE filtering\n(Eg , EC ). Performance peaks at (3, 3) with 99.4%/98.6%\n(I-AUROC/P-AUROC), indicating optimal specialization.\nIncreasing the denoising experts EC from 1 to 3 improves\naccuracy, while reducing guidance diversity Eg = 2 or\nover-expanding experts Eg = 4 degrades results due to\nreduced specialization and diluted guidance. These results highlight a capacity-specialization tradeoff, with (3, 3)\nachieving the best balance for reliable anomaly detection.\n\n5. Conclusion\nWe presented RAID, a Retrieval-Augmented Industrial\nanomaly Detection framework that revisits UAD from a\nRAG perspective. By integrating hierarchical retrieval\nwith guided MoE filtering-based generation, RAID effectively suppresses matching noise and preserves fine-grained\nanomaly boundaries and subtle anomalies. Extensive experiments across full-shot, few-shot, and multi-dataset settings on four benchmarks demonstrate that RAID consistently outperforms prior SOTA methods, achieving both robust generalization and scalability. Looking forward, we\nenvision that bringing the RAG paradigm into agentic and\ncross-modal anomaly detection opens a new direction toward more explainable, scalable, and data-efficient industrial intelligence.\n\n21374\n\n\fAcknowledgements\nThis work is supported in part by the Natural Science\nFoundation of Liaoning Province of China under Grant\nNo. 2024-MSBA-42, by the Science and Technology\nMajor Project of Liaoning Province under Grant No.\n2024JH1/11700048, by the UKRI-AHRC CoSTAR National Lab for Creative Industries Research and Development No. AH/Y001060/1, and by the Key Research and\nDevelopment Program of Liaoning Province under Grant\nNo. 2023JH26/10200011.\n\n[11] Simon Damm, Mike Laszkiewicz, Johannes Lederer, and\nAsja Fischer. Anomalydino: Boosting patch-based few-shot\nanomaly detection with dinov2. In 2025 IEEE/CVF Winter Conference on Applications of Computer Vision (WACV),\npages 1319–1329. IEEE, 2025. 1, 2, 3, 4, 6, 7\n[12] Alexey Dosovitskiy. An image is worth 16x16 words:\nTransformers for image recognition at scale. arXiv preprint\narXiv:2010.11929, 2020. 2\n[13] Zheng Fang, Xiaoyang Wang, Haocheng Li, Jiejie Liu, Qiugui Hu, and Jimin Xiao. Fastrecon: Few-shot industrial anomaly detection via fast feature reconstruction. In\nProceedings of the IEEE/CVF International Conference on\nComputer Vision, pages 17481–17490, 2023. 6, 7\n[14] William Fedus, Barret Zoph, and Noam Shazeer. Switch\ntransformers: Scaling to trillion parameter models with simple and efficient sparsity. Journal of Machine Learning Research, 23(120):1–39, 2022. 5\n[15] Matic Fučka, Vitjan Zavrtanik, and Danijel Skočaj.\nTransfusion–a transparency-based diffusion model for\nanomaly detection. In European conference on computer vision, pages 91–108. Springer, 2024. 1\n[16] Bin-Bin Gao. Learning to detect multi-class anomalies with\njust one normal image prompt. In European Conference on\nComputer Vision, pages 454–470. Springer, 2024. 6, 7\n[17] Yunfan Gao, Yun Xiong, Xinyu Gao, Kangxiang Jia, Jinliu Pan, Yuxi Bi, Yixin Dai, Jiawei Sun, Haofen Wang, and\nHaofen Wang. Retrieval-augmented generation for large language models: A survey. arXiv preprint arXiv:2312.10997,\n2(1), 2023. 2, 3, 4\n[18] Hewei Guo, Liping Ren, Jingjing Fu, Yuwang Wang,\nZhizheng Zhang, Cuiling Lan, Haoqian Wang, and Xinwen\nHou. Template-guided hierarchical feature restoration for\nanomaly detection. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 6447–6458,\n2023. 1, 2, 3, 4\n[19] Hang Guo, Tao Dai, Zhihao Ouyang, Taolin Zhang, Yaohua\nZha, Bin Chen, and Shu-tao Xia. Refir: Grounding large\nrestoration models with retrieval augmentation. Advances\nin Neural Information Processing Systems, 37:46593–46621,\n2024. 3\n[20] Jia Guo, Shuai Lu, Lei Fan, Zelin Li, Donglin Di, Yang\nSong, Weihang Zhang, Wenbing Zhu, Hong Yan, Fang Chen,\net al. One dinomaly2 detect them all: A unified framework\nfor full-spectrum unsupervised anomaly detection. arXiv\npreprint arXiv:2510.17611, 2025. 2\n[21] Jia Guo, Shuai Lu, Weihang Zhang, Fang Chen, Huiqi Li,\nand Hongen Liao. Dinomaly: The less is more philosophy in\nmulti-class unsupervised anomaly detection. In Proceedings\nof the Computer Vision and Pattern Recognition Conference,\npages 20405–20415, 2025. 1, 2\n[22] Haoyang He, Yuhu Bai, Jiangning Zhang, Qingdong He,\nHongxu Chen, Zhenye Gan, Chengjie Wang, Xiangtai Li,\nGuanzhong Tian, and Lei Xie. Mambaad: Exploring state\nspace models for multi-class unsupervised anomaly detection. Advances in Neural Information Processing Systems,\n37:71162–71187, 2024. 2, 6\n[23] Haoyang He, Jiangning Zhang, Hongxu Chen, Xuhai Chen,\nZhishan Li, Xu Chen, Yabiao Wang, Chengjie Wang, and Lei\n\nReferences\n[1] Mouin Ben Ammar, Arturo Mendoza, Nacim Belkhir, Antoine Manzanera, and Gianni Franchi. Foundation models\nand transformers for anomaly detection: A survey. Information Fusion, 126:103517, 2026. 1\n[2] Muhammad Aqeel, Shakiba Sharifi, Marco Cristani, and\nFrancesco Setti. Towards real unsupervised anomaly detection via confident meta-learning. In Proceedings of the\nieee/cvf international conference on computer vision, pages\n4858–4867, 2025. 1\n[3] Shuai Bai, Keqin Chen, Xuejing Liu, Jialin Wang, Wenbin\nGe, Sibo Song, Kai Dang, Peng Wang, Shijie Wang, Jun\nTang, et al. Qwen2. 5-vl technical report. arXiv preprint\narXiv:2502.13923, 2025. 3\n[4] Paul Bergmann, Michael Fauser, David Sattlegger, and\nCarsten Steger. Mvtec ad – a comprehensive real-world\ndataset for unsupervised anomaly detection. In Proceedings\nof the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2019. 5, 6, 7\n[5] Andreas Blattmann, Robin Rombach, Kaan Oktay, Jonas\nMüller, and Björn Ommer. Retrieval-augmented diffusion\nmodels. In Advances in Neural Information Processing Systems, pages 15309–15324. Curran Associates, Inc., 2022. 2\n[6] Yunkang Cao, Xiaohao Xu, Jiangning Zhang, Yuqi Cheng,\nXiaonan Huang, Guansong Pang, and Weiming Shen. A survey on visual anomaly detection: Challenge, approach, and\nprospect. arXiv preprint arXiv:2401.16402, 2024. 2\n[7] Yunkang Cao, Jiangning Zhang, Luca Frittoli, Yuqi Cheng,\nWeiming Shen, and Giacomo Boracchi. Adaclip: Adapting\nclip with hybrid learnable prompts for zero-shot anomaly detection. In European Conference on Computer Vision, pages\n55–72. Springer, 2024. 2\n[8] Wenhu Chen, Hexiang Hu, Chitwan Saharia, and William W\nCohen. Re-imagen: Retrieval-augmented text-to-image generator. arXiv preprint arXiv:2209.14491, 2022. 3\n[9] Xuhai Chen, Yue Han, and Jiangning Zhang. April-gan:\nA zero-/few-shot anomaly classification and segmentation\nmethod for cvpr 2023 vand workshop challenge tracks 1&amp;2:\n1st place on zero-shot ad and 4th place on few-shot ad. arXiv\npreprint arXiv:2305.17382, 2023. 2\n[10] Zhewei Dai, Shilei Zeng, Haotian Liu, Xurui Li, Feng Xue,\nand Yu Zhou. Seas: few-shot industrial anomaly image generation with separation and sharing fine-tuning. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 23135–23144, 2025. 3\n\n21375\n\n\fZhou. Vague prototype-oriented diffusion model for multiclass anomaly detection. In Forty-first International Conference on Machine Learning, 2024. 2\n[35] Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and\nPiotr Dollár. Focal loss for dense object detection. IEEE\nTransactions on Pattern Analysis and Machine Intelligence,\n42(2):318–327, 2020. 5\n[36] Yuxuan Lin, Yang Chang, Xuan Tong, Jiawen Yu, Antonio\nLiotta, Guofan Huang, Wei Song, Deyu Zeng, Zongze Wu,\nYan Wang, et al. A survey on rgb, 3d, and multimodal approaches for unsupervised industrial image anomaly detection. Information Fusion, page 103139, 2025. 1, 2, 3\n[37] Heng Liu, Siru Jiang, Fangyun Duan, Yongzhe Lyu, Xiusong\nWang, Hanlin Ge, and Chao Liang. Cadencerag: Contextaware and dependency-enhanced retrieval augmented generation for holistic video understanding. In Proceedings of the\nComputer Vision and Pattern Recognition Conference, pages\n3679–3688, 2025. 3\n[38] Wenrui Liu, Hong Chang, Bingpeng Ma, Shiguang Shan,\nand Xilin Chen. Diversity-measurable anomaly detection.\nIn Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 12147–12156, 2023. 1\n[39] Zhikang Liu, Yiming Zhou, Yuansheng Xu, and Zilei Wang.\nSimplenet: A simple network for image anomaly detection\nand localization. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages\n20402–20411, 2023. 2, 6\n[40] Alexander Long, Wei Yin, Thalaiyasingam Ajanthan, Vu\nNguyen, Pulak Purkait, Ravi Garg, Alan Blair, Chunhua\nShen, and Anton Van den Hengel. Retrieval augmented classification for long-tail visual recognition. In Proceedings of\nthe IEEE/CVF conference on computer vision and pattern\nrecognition, pages 6959–6969, 2022. 2\n[41] Ruiying Lu, YuJie Wu, Long Tian, Dongsheng Wang, Bo\nChen, Xiyang Liu, and Ruimin Hu. Hierarchical vector\nquantized transformer for multi-class unsupervised anomaly\ndetection. Advances in Neural Information Processing Systems, 36:8487–8500, 2023. 1, 2, 6\n[42] Wenxi Lv, Qinliang Su, and Wenchao Xu. One-for-all fewshot anomaly detection via instance-induced prompt learning. In International Conference on Learning Representations, 2025. 3, 6, 7\n[43] Shiyuan Meng, Wenchao Meng, Qihang Zhou, Shizhong Li,\nWeiye Hou, and Shibo He. Moead: A parameter-efficient\nmodel for multi-class anomaly detection. In European Conference on Computer Vision, pages 345–361. Springer, 2024.\n2\n[44] Pankaj Mishra, Riccardo Verk, Daniele Fornasier, Claudio\nPiciarelli, and Gian Luca Foresti. Vt-adl: A vision transformer network for image anomaly detection and localization. In 2021 IEEE 30th International Symposium on Industrial Electronics, pages 01–06, 2021. 5, 6, 7\n[45] Mojtaba Nafez, Amirhossein Koochakian, Arad Maleki,\nJafar Habibi, and Mohammad Hossein Rohban. Patchguard: Adversarially robust anomaly detection and localization through vision transformers and pseudo anomalies. In\nProceedings of the Computer Vision and Pattern Recognition\nConference, pages 20383–20394, 2025. 1\n\nXie. A diffusion-based framework for multi-class anomaly\ndetection. In Proceedings of the AAAI conference on artificial intelligence, pages 8472–8480, 2024. 2, 6\n[24] 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\nProceedings of the IEEE/CVF International Conference on\nComputer Vision, pages 8791–8800, 2021. 1\n[25] Chaoqin Huang, Aofan Jiang, Jinghao Feng, Ya Zhang, Xinchao Wang, and Yanfeng Wang. Adapting visual-language\nmodels for generalizable anomaly detection in medical images. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 11375–11385,\n2024. 1\n[26] Jongheon Jeong, Yang Zou, Taewan Kim, Dongqing Zhang,\nAvinash Ravichandran, and Onkar Dabeer. Winclip: Zero/few-shot anomaly classification and segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision\nand Pattern Recognition, pages 19606–19616, 2023. 1, 3, 6,\n7\n[27] Stepan Jezek, Martin Jonak, Radim Burget, Pavel Dvorak,\nand Milos Skotak. Deep learning-based defect detection of\nmetal parts: evaluating current methods in complex conditions. In 2021 13th International congress on ultra modern telecommunications and control systems and workshops,\npages 66–71, 2021. 5, 6, 7\n[28] Jooyeon Kim, Eulrang Cho, Sehyung Kim, and Hyunwoo J\nKim. Retrieval-augmented open-vocabulary object detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 17427–17436,\n2024. 2, 3\n[29] Alexander Kirillov, Eric Mintun, Nikhila Ravi, Hanzi Mao,\nChloe Rolland, Laura Gustafson, Tete Xiao, Spencer Whitehead, Alexander C Berg, Wan-Yen Lo, et al. Segment anything. In Proceedings of the IEEE/CVF international conference on computer vision, pages 4015–4026, 2023. 2\n[30] Jian Lang, Zhangtao Cheng, Ting Zhong, and Fan Zhou.\nRetrieval-augmented dynamic prompt tuning for incomplete\nmultimodal learning. In Proceedings of the AAAI Conference\non Artificial Intelligence, pages 18035–18043, 2025. 3\n[31] Byeonghun Lee, Hyunmin Cho, Hong Gyu Choi, Soo Min\nKang, Iljun Ahn, and Kyong Hwan Jin. Reference-based\nsuper-resolution via image-based retrieval-augmented generation diffusion. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 10764–10774,\n2025. 3\n[32] Patrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio\nPetroni, Vladimir Karpukhin, Naman Goyal, Heinrich\nKüttler, Mike Lewis, Wen-tau Yih, Tim Rocktäschel, et al.\nRetrieval-augmented generation for knowledge-intensive nlp\ntasks. Advances in neural information processing systems,\n33:9459–9474, 2020. 3\n[33] Yiting Li, Adam Goodge David, Fayao Liu, and ChuanSheng Foo. Promptad: Zero-shot anomaly detection using\ntext prompts. In IEEE/CVF Winter Conference on Applications of Computer Vision, pages 1082–1091, 2024. 6, 7\n[34] Yuxin Li, Yaoxuan Feng, Bo Chen, Wenchao Chen, Yubiao\nWang, Xinyue Hu, Baolin Sun, Chunhui Qu, and Mingyuan\n\n21376\n\n\f[46] Maxime Oquab, Timothée Darcet, Théo Moutakanni, Huy\nVo, Marc Szafraniec, Vasil Khalidov, Pierre Fernandez,\nDaniel Haziza, Francisco Massa, Alaaeldin El-Nouby, et al.\nDinov2: Learning robust visual features without supervision.\narXiv preprint arXiv:2304.07193, 2023. 1, 2, 5\n[47] Zhen Qu, Xian Tao, Xinyi Gong, ShiChen Qu, Xiaopei\nZhang, Xingang Wang, Fei Shen, Zhengtao Zhang, Mukesh\nPrasad, and Guiguang Ding. Dictas: A framework for classgeneralizable few-shot anomaly segmentation via dictionary\nlookup. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 20519–20528, 2025. 1,\n2, 3\n[48] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya\nRamesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry,\nAmanda Askell, Pamela Mishkin, Jack Clark, et al. Learning\ntransferable visual models from natural language supervision. In International conference on machine learning, pages\n8748–8763. PmLR, 2021. 1\n[49] Karsten Roth, Latha Pemula, Joaquin Zepeda, Bernhard\nSchölkopf, Thomas Brox, and Peter Gehler. Towards total recall in industrial anomaly detection. In Proceedings\nof the IEEE/CVF conference on computer vision and pattern\nrecognition, pages 14318–14328, 2022. 1, 2, 3, 4, 6, 7\n[50] Dongyu Ru, Lin Qiu, Xiangkun Hu, Tianhang Zhang, Peng\nShi, Shuaichen Chang, Cheng Jiayang, Cunxiang Wang,\nShichao Sun, Huanyu Li, et al. Ragchecker: A finegrained framework for diagnosing retrieval-augmented generation. In Advances in Neural Information Processing Systems, pages 21999–22027, 2024. 3\n[51] Lei Shen, Kang Zhao, Zhipeng Jin, Wen Tao, Yi Yang, Cong\nHan, Shuanglong Li, Zhongmin Cai, and Lin Liu. Retrievalaugmented image captioning and generation with entity concepts enhancement for baidu multimodal advertising. In\nProceedings of the 48th International ACM SIGIR Conference on Research and Development in Information Retrieval,\npages 4324–4328, 2025. 3\n[52] Oriane Siméoni, Huy V Vo, Maximilian Seitzer, Federico\nBaldassarre, Maxime Oquab, Cijo Jose, Vasil Khalidov,\nMarc Szafraniec, Seungeun Yi, Michaël Ramamonjisoa,\net al. Dinov3. arXiv preprint arXiv:2508.10104, 2025. 1,\n2\n[53] Ryota Tanaka, Taichi Iki, Taku Hasegawa, Kyosuke Nishida,\nKuniko Saito, and Jun Suzuki.\nVdocrag: Retrievalaugmented generation over visually-rich documents. In Proceedings of the Computer Vision and Pattern Recognition\nConference, pages 24827–24837, 2025. 3\n[54] Tran Dinh Tien, Anh Tuan Nguyen, Nguyen Hoang Tran,\nTa Duc Huy, Soan Duong, Chanh D Tr Nguyen, and\nSteven QH Truong. Revisiting reverse distillation for\nanomaly detection. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages\n24511–24520, 2023. 2\n[55] Shun Wei, Jielin Jiang, and Xiaolong Xu. Uninet: A contrastive learning-guided unified framework with feature selection for anomaly detection. In Proceedings of the Computer Vision and Pattern Recognition Conference, pages\n9994–10003, 2025. 1, 2\n\n[56] Gaochang Wu, Yapeng Zhang, Lan Deng, Jingxin Zhang,\nand Tianyou Chai. Cross-modal learning for anomaly detection in complex industrial process: Methodology and benchmark. IEEE Transactions on Circuits and Systems for Video\nTechnology, 35(3):2632–2645, 2025. 1\n[57] Sheng Wu, Yimi Wang, Xudong Liu, Yuguang Yang, Runqi\nWang, Guodong Guo, David Doermann, and Baochang\nZhang. Dfm: Differentiable feature matching for anomaly\ndetection. In 2025 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 15224–15233,\n2025. 6, 7\n[58] Zhiwei Yang, Jing Liu, and Peng Wu. Text prompt with normality guidance for weakly supervised video anomaly detection. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 18899–18908,\n2024. 1\n[59] Hang Yao, Ming Liu, Zhicun Yin, Zifei Yan, Xiaopeng\nHong, and Wangmeng Zuo. Glad: Towards better reconstruction with global and local adaptive diffusion models for\nunsupervised anomaly detection. In European Conference\non Computer Vision, pages 1–17. Springer, 2024. 1, 2, 5, 6,\n7\n[60] Zhiyuan You, Lei Cui, Yujun Shen, Kai Yang, Xin Lu,\nYu Zheng, and Xinyi Le. A unified model for multi-class\nanomaly detection. Advances in Neural Information Processing Systems, 35:4571–4584, 2022. 1, 2, 6\n[61] Qinhan Yu, Zhiyou Xiao, Binghui Li, Zhengren Wang,\nChong Chen, and Wentao Zhang. Mramg-bench: A comprehensive benchmark for advancing multimodal retrievalaugmented multimodal generation. In Proceedings of the\nInternational ACM SIGIR Conference on Research and Development in Information Retrieval, pages 3616–3626, 2025.\n3\n[62] Vitjan Zavrtanik, Matej Kristan, and Danijel Skočaj. Draema discriminatively trained reconstruction embedding for surface anomaly detection. In Proceedings of the IEEE/CVF\ninternational conference on computer vision, pages 8330–\n8339, 2021. 2, 5\n[63] Hui Zhang, Zheng Wang, Dan Zeng, Zuxuan Wu, and YuGang Jiang. Diffusionad: Norm-guided one-step denoising\ndiffusion for anomaly detection. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2025. 1, 5\n[64] Jiangning Zhang, Xuhai Chen, Yabiao Wang, Chengjie\nWang, Yong Liu, Xiangtai Li, Ming-Hsuan Yang, and\nDacheng Tao. Exploring plain vit reconstruction for multiclass unsupervised anomaly detection. CVIU, 2025. 1, 6\n[65] Kai Zhang, Zekai Zhang, Xihe Sun, Jingmeng Nie, Qinghui\nChen, Han Hao, Jianyuan Guo, and Jinglin Zhang. Adseeker:\nA knowledge-infused framework for anomaly detection and\nreasoning. arXiv preprint arXiv:2508.03088, 2025. 3\n[66] Xinyi Zhang, Naiqi Li, Jiawei Li, Tao Dai, Yong Jiang,\nand Shu-Tao Xia. Unsupervised surface anomaly detection\nwith diffusion probabilistic model. In Proceedings of the\nIEEE/CVF International Conference on Computer Vision,\npages 6782–6791, 2023. 1\n[67] Xuan Zhang, Shiyu Li, Xi Li, Ping Huang, Jiulong Shan,\nand Ting Chen. Destseg: Segmentation guided denoising\n\n21377\n\n\fstudent-teacher for anomaly detection. In Proceedings of\nthe IEEE/CVF conference on computer vision and pattern\nrecognition, pages 3914–3923, 2023. 1, 2\n[68] Zhe Zhang, Mingxiu Cai, Hanxiao Wang, Gaochang Wu,\nTianyou Chai, and Xiatian Zhu. Costfilter-ad: Enhancing\nanomaly detection through matching cost filtering. In International Conference on Machine Learning, 2025. 2, 3, 4, 5,\n6, 7\n[69] Zhe Zhang, Mingxiu Cai, Gaochang Wu, Jing Zhang,\nLingqiao Liu, Dacheng Tao, Tianyou Chai, and Xiatian Zhu.\nUnified unsupervised anomaly detection via matching cost\nfiltering. arXiv preprint arXiv:2510.03363, 2025. 2\n[70] Lin Zhao, Xiao Chen, Eric Z Chen, Yikang Liu, Terrence\nChen, and Shanhui Sun. Retrieval-augmented few-shot medical image segmentation with foundation models. IEEE\nTransactions on Neural Networks and Learning Systems,\n2025. 3\n[71] Ying Zhao. Omnial: A unified cnn framework for unsupervised anomaly localization. In Proceedings of the IEEE/CVF\nConference on Computer Vision and Pattern Recognition,\npages 3924–3933, 2023. 1, 2\n[72] Xu Zheng, Ziqiao Weng, Yuanhuiyi Lyu, Lutao Jiang, Haiwei Xue, Bin Ren, Danda Paudel, Nicu Sebe, Luc Van Gool,\nand Xuming Hu. Retrieval augmented generation and understanding in vision: A survey and new outlook. arXiv preprint\narXiv:2503.18016, 2025. 2, 3, 4\n[73] Qihang Zhou, Guansong Pang, Yu Tian, Shibo He, and\nJiming Chen. Anomalyclip: Object-agnostic prompt learning for zero-shot anomaly detection.\narXiv preprint\narXiv:2310.18961, 2023. 2, 3\n[74] Yixuan Zhou, Xing Xu, Jingkuan Song, Fumin Shen, and\nHeng Tao Shen. Msflow: Multiscale flow-based framework\nfor unsupervised anomaly detection. IEEE transactions on\nneural networks and learning systems, 2024. 2\n[75] Yang Zou, Jongheon Jeong, Latha Pemula, Dongqing Zhang,\nand Onkar Dabeer. Spot-the-difference self-supervised pretraining for anomaly detection and segmentation. In Computer Vision – ECCV 2022, pages 392–408, Cham, 2022.\nSpringer Nature Switzerland. 5, 6, 7\n\n21378\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"