"<!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>arXiv:2503.06661v1 [cs.CV] 9 Mar 2025\n\nAA-CLIP: Enhancing Zero-Shot Anomaly Detection via Anomaly-Aware CLIP\nWenxin Ma1,2\nXu Zhang1,2\nQingsong Yao5\nFenghe Tang1,2\nChenxu Wu1,2\nYingtai Li1,2\nRui Yan1,2\nZihang Jiang1,2 *\nS.Kevin Zhou1,2,3,4 *\n1\nSchool of Biomedical Engineering, Division of Life Sciences and Medicine, USTC\n2\nMIRACLE Center, Suzhou Institute for Advance Research, USTC\n3\nKey Laboratory of Intelligent Information Processing of CAS, ICT, CAS\n4\nState Key Laboratory of Precision and Intelligent Chemistry, USTC\n5\nStanford University\nwxma@mail.ustc.edu.cn jzh0103@ustc.edu.cn s.kevin.zhou@gmail.com\n\nNormal\nAnomaly\n\nClass 3\n\nAnomaly\nPatch\n\nAnomaly Text\nNormal Text\n\nUnseen Classes\n\nNormal Patch\nAnomaly Patch\n\nClass 1\n\nAnomaly Text\n\nNormal\nPatch\nNormal\nPatch\n\nAnomaly Text\n\nClass 2\n\nAnomaly Patch\n\nSeen Classes\nNormal Text\n\nText Embeddings\nPatch Feature Space\n\nText Embeddings\nPatch Feature Space\n\nFeatures from Original CLIP\n\n(Left)\n\nText Embeddings\nPatch Feature Space\n\nNormal Text\n\nStage1: Disentangling Anomaly-Aware\nText Anchors\n\nStage2: Aligning Patch Features\nAccording to Text Anchors\n\n(Middle)\n\nText Embeddings\nPatch Feature Space\n\nFeatures from our Anomaly-Aware CLIP\n\n(Right)\n\nFigure 1. (Left) CLIP’s anomaly unawareness: Category-level image-text alignment in pre-training leads to CLIP’s vague distinctions\nin anomaly/normal semantics and inaccurate patch-text alignment. (Middle) Our two-stage adaptation strategy: In Stage1, anomaly\nand normal text features are disentangled as anchors in text space; in Stage2, patch-level visual features are trained to align to these anchors, forming Anomaly-Aware CLIP. (Right) Generalizable anomaly awareness: Our method enables CLIP with generalizable anomaly\nawareness for both known and unseen classes.\n\nAbstract\n\nner, achieving effective AD while maintaining CLIP’s class\nknowledge. Extensive experiments validate AA-CLIP as a\nresource-efficient solution for zero-shot AD tasks, achieving state-of-the-art results in industrial and medical applications. The code is available at https://github.\ncom/Mwxinnn/AA-CLIP.\n\nAnomaly detection (AD) identifies outliers for applications\nlike defect and lesion detection. While CLIP shows promise\nfor zero-shot AD tasks due to its strong generalization capabilities, its inherent Anomaly-Unawareness leads to limited discrimination between normal and abnormal features.\nTo address this problem, we propose Anomaly-Aware CLIP\n(AA-CLIP), which enhances CLIP’s anomaly discrimination ability in both text and visual spaces while preserving\nits generalization capability. AA-CLIP is achieved through\na straightforward yet effective two-stage approach: it first\ncreates anomaly-aware text anchors to differentiate normal\nand abnormal semantics clearly, then aligns patch-level visual features with these anchors for precise anomaly localization. This two-stage strategy, with the help of residual adapters, gradually adapts CLIP in a controlled man-\n\n1. Introduction\nAnomaly detection (AD) involves modeling the distribution\nof a dataset to identify outliers, such as defects in industrial\nproducts [2] or lesions in medical images [12]. Despite that\nprevious AD frameworks [9, 10, 14, 22, 30, 56] effectively\ndetect anomalies when sufficient labeled data is available\nfor specific classes, their high resource demands often limit\ntheir generalization ability to novel and rare classes. This\nlimitation is particularly challenging in real-world scenarios\nwhere collecting comprehensive labeled datasets for AD is\noften infeasible, necessitating the exploration of low-shot\n\n* Corresponding author.\n\n1\n\n\flearning and transfer learning approaches.\nContrastive Language-Image Pretraining (CLIP) model\nhas emerged as a promising solution, demonstrating remarkable generalization capabilities across various zeroshot tasks [23–25, 41]. Building upon CLIP’s success,\nseveral recent studies have adapted CLIP for few/zero-shot\nAD tasks by utilizing anomaly-related descriptions to guide\nthe detection of anomalous regions. Specifically, the vision encoder is trained to map anomaly images to visual\nfeatures that align more closely with text features of abnormal descriptions than with those of normal descriptions [28, 29, 48, 58]. Further works [5, 6, 16, 40] have\nfocused on enhancing CLIP’s patch-level feature representations to achieve better alignment with text features, resulting in improved anomaly localization performance.\nThese methods depend on text features that need to\nbe anomaly-aware to effectively differentiate abnormalities.\nHowever, recent studies highlight CLIP’s limitations in finegrained semantic perception and reasoning [20, 21, 35, 37,\n44, 45]. Upon exploring CLIP’s texture features for AD, we\nobserve that while CLIP’s text encoder effectively captures\nobject-level information, it struggles to reliably distinguish\nbetween normal and abnormal semantics. As shown in conceptual visualization Fig. 1(left) and sampled examples in\nFig. 2, CLIP has the intrinsic Anomaly-Unawareness problem: the overlap of normal and abnormal texture features\nhampers the precision of text-guided anomaly detection.\nWe argue that making CLIP anomaly-aware — by establishing clearer distinctions between normal and abnormal\nsemantics in the text space — is essential for guiding the\nvision encoder to precisely detect and localize anomalies.\nThis observation drives us to improve CLIP-based zeroshot AD through enhancing anomaly discrimination in text\nspace, achieved with our method Anomaly-Aware CLIP\n(AA-CLIP) — a CLIP model with anomaly-aware information encoded. AA-CLIP is implemented through a novel\ntwo-stage adaptation approach. In the first stage, AA-CLIP\nadapts the text encoder with frozen visual encoder, creating “anchors” for anomaly-aware semantics within the text\nspace for each trained class. As illustrated in Fig. 1(middle), each class’s text features are disentangled to distinct\nanchors, with clear abnormality discrimination. Notably,\nthis disentanglement also applies to novel, unseen classes,\nsupporting effective zero-shot inference in AD tasks (refer to Fig. 1(right)). In the second stage, AA-CLIP aligns\npatch-level visual features with these specially adapted texture anchors, guiding CLIP’s visual encoder to concentrate\non anomaly-relevant regions. This two-stage approach ensures a focused and precise anomaly detection framework.\nImportantly, as CLIP is extensively trained on massive data, to preserve its pre-trained knowledge, we utilize\nsimple-structured Residual Adapters in both stages. This\ndesign enables a controlled adaptation of CLIP while en-\n\nhancing its capability to handle fine-grained AD tasks without sacrificing its generalization ability.\nOur extensive experiments in both industrial and medical domains demonstrate that our straightforward approach\nequips CLIP with improved zero-shot AD ability, even in\ndata-limited scenarios. By training with a minimal sample — such as one normal sample and one anomaly sample (2-shot) per class — and testing across unseen datasets,\nour method achieves zero-shot performance comparable to\nother CLIP-based AD techniques. With only 64-shot of\neach class seen in the training set, our method reaches stateof-the-art (SOTA) results in cross-dataset zero-shot testing,\nvalidating our method’s ability to maximize the CLIP’s potential for AD with a minimal data requirement.\nOur contributions are summarized as follows:\n1. Anomaly-Aware CLIP with enhanced and generalizable\nanomaly-discriminative ability. We introduce AA-CLIP\nwhich is more sensitive to anomalies sequentially in text\nand visual spaces, encoding anomaly-aware information\ninto the original CLIP.\n2. Efficient adaptation using residual adapters. We implement simple residual adapters to boost zero-shot\nanomaly detection performance without compromising\nthe model’s generalization ability.\n3. SOTA performance with high training efficiency. Our\nmethod achieves SOTA results across diverse datasets,\nshowing robust anomaly detection capabilities even with\nlimited training samples.\n\n2. Related Work\nTraditional Anomaly Detection in images involves modeling the normal data distribution to detect rare and diverse unexpected signals within visual data [43, 51,\n59]. Reconstruction-based [10, 15, 31, 32, 52, 54],\naugmentation-based [30, 43, 47, 53, 56] and discriminative [9, 14, 22, 30, 42, 59] methods are typically used to facilitate better modeling. Despite the huge progress of traditional anomaly detection methods, their effectiveness relies\nheavily on a well-modeled normal data distribution. Without sufficient normal data, their ability to accurately detect\nanomalies is significantly reduced.\nCLIP, trained on a vast amount of image-text data, leverages contrastive learning alongside powerful language models and visual feature encoders to capture robust concepts.\nThis combination enables CLIP to achieve impressive zeroshot performance on image classification, as it can generalize well to new categories without requiring task-specific\ntraining [23–26, 41, 50]. More recently, numerous studies [8, 11, 34, 38] have explored ways to transfer the knowledge embedded in CLIP models to a variety of downstream\ntasks, yielding promising results in fields like image captioning, image-text retrieval, and image generation. These\nefforts demonstrate CLIP’s versatility and potential to drive\n2\n\n\f“This is a [\n\nadvancements across diverse applications.\nDespite the rapid advancements achieved by CLIP, numerous studies have highlighted persistent limitations in the\nfeatures it extracts. While CLIP demonstrates strong generalization across various tasks, it often struggles to capture\nnuanced details and essential spatial relationships, which\nare crucial for tasks demanding precise boundary delineation and fine-grained feature extraction. This limitation\nresults in suboptimal performance in downstream applications, especially that require high levels of detail, such as\nobject detection, scene segmentation, or tasks in medical\nimaging [13, 28, 29, 36, 48, 49, 55, 58]. As a result, leveraging CLIP for fine-granular tasks frequently necessitates\ntask-specific adaptations to bridge the gap between its generalized feature extraction and the precision required for\nspecialized applications.\n\n] carpet.”\n\nSemantics\n\nSimilarity\n\nProbabilityt=0.01\n\nbroken\nnormal\n\n0.18\n0.19\n\n0.22\n0.78\n\n“This is a [\n\n] zipper.”\n\nSemantics\n\nSimilarity\n\nProbabilityt=0.01\n\nbroken\nnormal\n\n0.20\n0.21\n\n0.38\n0.62\n\nOriginal CLIP\n\nCLIP-based Anomaly Detection There have been several\nefforts to leverage CLIP for AD tasks. One of the pioneering approaches, WinCLIP [18], proposes a method for extracting and aggregating visual features from multiple levels to align with text features, demonstrating the potential\nof CLIP in this context. Subsequent research investigates\nvarious adaptation methods to bridge the gap between natural domains and the AD domain, resulting in performance\nimprovements. For instance, [6, 7, 17] focus on refining visual features by employing adapters to enhance patch-level\nvisual representations. However, these approaches often\nrely on text embeddings from the original CLIP model as\nsoft supervision and overlook a critical limitation of CLIP\nin AD: its unclearness in distinguishing between anomalous and normal semantics, particularly within the text encoder, resulting in suboptimal performance. Other works\nhave employed prompt-learning-based methods[5, 40, 57],\nintroducing learnable embeddings into the text encoder to\nbetter represent abnormality. However, the class information in CLIP can be damaged, potentially degrading generalization, especially in data-limited and zero-shot settings.\nDifferent from previous methods, we are the first to investigate CLIP’s inherent limitation in capturing anomalyaware information, specifically in differentiating between\nnormal and anomalous semantics in text prompts. Rather\nthan relying solely on the original anomaly-unaware text\nembeddings or unaltered feature spaces, our method is able\nto refine the embeddings to actively incorporate anomalydiscriminative representations.\n\nAfter Text Adaptation\n\nFigure 2. (Top) Examples illustrating CLIP’s Anomaly Unawareness. Despite the obvious anomalies present in the images,\nimage features have higher similarities to normal descriptions,\nrather than anomaly descriptions, mistakenly. This problem is enlarged with a low temperature τ . (Bottom) Text Feature Similarity Heatmap among Normal and Anomaly Descriptions:\nOriginal CLIP vs. After Text Adaptation. Red indicates high\nsimilarity. In original CLIP, normal features exhibit strong similarity with anomaly features, whereas text adaptation successfully\nseparates them, clarifying the semantic distinctions between normal and anomaly descriptions.\n\nboth normal and abnormal patterns that are shared across\ndifferent classes given a training set Dtrain with normal\nor anomalous samples, in order to be capable of performing AD tasks on a series of different test datasets\ni\nn\n2\n1\nis distinct from\n}, where each Dtest\n, ..., Dtest\n, Dtest\n{Dtest\nDtrain . Image-level AD can be formally defined as a binary classification problem, where the model aims to classify samples x ∈ D as either normal (y = 0) or anomalous\n(y = 1). Anomaly segmentation extends this concept to\npixel-level with mask S, aiming to identify anomalous regions by highlighting pixels associated with anomalies.\n3.1.2. Current Challenges\nAnomaly Unawareness in CLIP: The CLIP-based AD\nmethod classifies visual features as “anomalies” if they exhibit greater similarities to anomaly prompt embeddings\nthan to normal prompt embeddings, thus requiring welldefined boundaries between these two kinds of prompts.\nHowever, in real applications, CLIP’s text embeddings often lack the clear separability needed to reliably distinguish\nbetween normal and anomaly classes.\nWe observe that, despite the visible defects in example images from the MVTec-AD [2], their features exhibit\nhigher cosine similarity with “normal” prompts than with\ncorrect “anomaly” descriptions (see Fig. 2 (top)), indicating\nCLIP’s inaccurate semantic understanding. Without adap-\n\n3. Method\n3.1. Overview\n3.1.1. Problem Formulation\nZero-shot AD models are trained to identify anomalous\nsamples whose categories may be unseen in the training dataset. Specifically, the model is expected to learn\n3\n\n\fTo address this, a carefully controlled refinement is crucial to preserve CLIP’s generalization capabilities while enhancing its sensitivity to anomalies.\n\nUnseen Classes\n\nOriginal CLIP\n\nSeen Classes\n\n3.1.3. Overview of Our Solution\n\nAA-CLIP\n\nMotivated by Sec. 3.1.2, we propose Anomaly-Aware\nCLIP (AA-CLIP) with improved anomaly awareness. As\nshown in Fig. 4, AA-CLIP is trained through a two-stage\ntraining strategy that sequentially adapts the semantic-rich\ntext space and detail-focused visual space, with original\nCLIP parameters remaining frozen. In the first stage (see\nFig. 4 (Top)), we incorporate Residual Adapters into the\nshallow layers of the text encoder, and the visual features\nfrom the fixed image encoder serve as a stable reference for\noptimization. A Disentangle Loss is purposed to enforce\neffective discrimination by ensuring independence between\nnormal and anomaly embeddings. In the second stage, we\nintegrate Residual Adapters into the shallow layers of the\nvisual encoder to align patch-level features with the fixed,\nspecially adapted texture features from the fixed text encoder (see in Fig. 4 (Bottom)). Ultimately, our AA-CLIP\nsucceeds in equipping CLIP with anomaly awareness across\nseen and unseen classes, as shown in Fig. 3 (bottom).\n\nFigure 3. t-SNE Visualization of Text Features from Original\nCLIP vs. AA-CLIP. Each point represents a text feature encoded\nfrom a prompt. Original CLIP’s normal and anomaly text features\nare intertwined, while our method effectively disentangles them.\nThis disentanglement is generalizable to novel classes, validating\nthe anomaly-awareness of our model.\n\n3.2. AA-CLIP with Two-Stage Adaptation Strategy\n3.2.1. Residual Adapter\nTo preserve CLIP’s pre-trained knowledge while enabling\ntargeted adaptation, we introduce lightweight Residual\nAdapters in the shallow layers (up to layer K) of both text\nand vision encoders.\nThe output feature xi ∈ RN ×d of CLIP’s i-th (i ≤ K)\ntransformer layer is fed into the i-th adapter, outputting\nadapted feature xiresidual , as shown in Eq. (1),\n\ntation, there persists a high similarity between the normal\nand abnormal text embeddings of a single class, as shown\nin Fig. 2 (bottom), suggesting a potential entanglement of\nnormal and anomaly semantics within text space. We term\nthis limitation Anomaly Unawareness and attribute it to\nthe training process of CLIP: it is primarily trained on general, non-anomalous datasets and lacks specific guidance\non defect detection. Consequently, it is challenging to rely\non original CLIP embeddings to detect subtle or contextspecific anomalies.\nThis issue remains evident across different categories in\nour t-SNE analysis: as shown in Fig. 3 (top), only subtle separations are observed within an object cluster, where\ntext embeddings for both normal and abnormal semantics\nare intermixed. This entangled pattern may potentially\nlead to anomaly-unaware text-image alignment, which reinforces the necessity to adapt CLIP’s to enhance its ability\nof anomaly-awareness.\n\nxiresidual = N orm(Act(W i xi )),\n\n(1)\n\nwhere W i ∈ Rd×d is the trainable linear weight of i-th\nadapter, Act(·) is an activation function, and N orm(·) is\na normalizing function. The original feature xi and the\nenhanced feature xiresidual are fused in a weighted manner, generating xienhanced , the input to the next transformer\nlayer, as shown in Eq. (2),\nxienhanced = λ xiresidual + (1 − λ) xi ,\n\n(2)\n\nwhere λ is a hyper-parameter to control the residual ratio, adjusting the fusing degree of AD-specific knowledge\nfor preserving the original CLIP’s generalization ability and\nimproved performance.\n\nEmbedding Adaptation Dilemma: Discussion above\nrenders the adaptation of CLIP essential for effective AD.\nHowever, since CLIP’s embeddings are already optimized\nthrough extensive pretraining, it could be susceptible to\noverfitting to new dataset during adaptation. Overfitting\nconvergence leads to minimized intra-class distinctions in\nthe training data, often at the expense of the feature separability for effective generalization to unseen data.\n\n3.2.2. Two-Stage Training Strategy\nDisentangling Anomaly-Aware Text Anchors: In the\nfirst stage, our objective is to learn anomaly-discriminative\ntext anchors by adapting the text encoder while keeping the\n4\n\n\fStage1: Disentangling Anomaly-Aware Text Anchors\n\nShallow Layers of Text Encoder\n\nV1patch +\n\nTrainable\nFreeze\n\nVisual\nBlock1\n\n…\n\nTN\n\nProjector\n\n…\n\nTransformer\nLayer\n\nA photo of broken [CLS]\n\nTransformer\nLayer\n\nAnomaly Prompt\n\nT’\nT +\n\nAdapter\n\nTransformer\nLayer\n\nTransformer\nLayer\n\nA photo of [CLS]\n\nAdapter\n\nTransformer\nLayer\n\nAdapter\n\nNormal Prompt\n\nLdisentangle :\n|&lt;T N , T A &gt;| ! → 0\n\nTA\n\nLseg\n\nDeep Layers\n\nV2patch +\n\nVisual\nBlock2\n\nV3patch +\n\nVisual\nBlock3\n\nV4patch ⟹\n\nVpatch\nVimage\n\nVisual\nBlock4\n\n1 - Anomaly\n0 - Normal\n\nLcls\n\nStage2: Aligning Patch Features According to Text Anchors\n\npatch\n\n+\nProjector\n\nShallow Layers of Visual Encoder\n\nLseg\n\n⟹\n\n1 - Anomaly\n0 - Normal\n\nLcls\n\nBlock4\n\nTransformer\nLayer\n\n…\n\nTransformer\nLayer\n\n…\n\nBlock2\n\nVpatch\n\nProjector\n\nBlock3\n\nTransformer\nLayer\n\n…\n\n+\n\nTransformer\nLayer\n\nF’\nF +\n\nAdapter\n\nV4patch\n\npatch\n\n…\n\nProjector\n\nV3\n\nProjector\n\nTransformer\nLayer\n\nAdapter\n\nAdapter\n\nV2\n\nProjector\n\nTransformer\nLayer\n\nTransformer\nLayer\n\nV1patch\n+\n\nTrainable\nFreeze\nBlock1\n\nTN TA\n\nAdapted Text Encoder\n\nA photo of broken [CLS]\n\nTransformer\nLayer\n\nA photo of [CLS]\n\nVimage\n\nDeep Layers\n\nFigure 4. The Two-Stage Training Pipeline of Anomaly-Aware CLIP. In the first stage, the text encoder of AA-CLIP is trained to\nidentify anomaly-related semantics, helped by a disentangle loss. In the second stage, patch features are aligned with these text anchors.\nBoth stages are achieved by the integration of Residual Adapters into the shallow layers of CLIP’s backbone. This controlled adaptation\nenables CLIP to effectively distinguish anomalies, which forms our Anomaly-Aware CLIP.\n\nwith the height H and width W of segmentation mask S.\nFollowing previous works [5, 6, 17, 57], we compute the\nclassification loss Lcls and segmentation loss Lseg to optimize parameters, as specified in Eq. (4). Specifically, the\nclassification loss is a binary cross-entropy that compares\nclassification predictions with ground-truth labels y, and the\nsegmentation loss is a combination of dice loss and focal\nloss applied to segmentation predictions and the anomaly\nsegmentation mask S.\n\nimage encoder fixed. We incorporate Residual Adapters\ninto the first KT layers of the CLIP text encoder, as illustrated in Fig. 4 (Top), and set the final projector in the text\nencoder to be learnable to facilitate improved alignment.\nUsing prompts designed to encapsulate both normal and\nanomalous semantics (as detailed in Appendix), text encoder generates corresponding high-level embeddings. The\naverage embeddings of the normal and anomaly prompts\nserve as our initial text anchors, denoted as TN and TA ∈\nRd , respectively. These anchors are refined by being aligned\nwith visual features extracted from an enhanced CLIP visual encoder, as [27, 57]. Alignment is conducted at both\nimage and patch levels to incorporate both global and local semantics. By calculating the cosine similarity between\nthese anchors and the image features Vimage ∈ Rd or patch\nfeatures Vpatch ∈ RN ×d , as shown in Eq. (3),\npcls = CosSim(Vimage , [TN , TA ]),\nposeg = CosSim(Vpatch , [TN , TA ]),\n\nLcls = BCE(pcls , y),\nLseg = Dice(pseg , S) + Focal(pseg , S),\n\n(4)\n\nLalign = Lcls + Lseg .\nTo enhance the separation between normal and anomaly\ntext embeddings, we introduce a Disentangle Loss encouraging orthogonality between TN and TA to minimize correlation, as in Eq. (5):\n\n(3)\n\nLdis = | &lt; TN , TA &gt; |2 .\n\n(5)\n\nThe Disentangle Loss Ldis is incorporated into the alignment loss Lalign as a regularization term, weighted by a\nfactor γ, which forms the total loss, as in Eq. (6):\n\nwhere [·, ·] means concatenate operation, we obtain the classification prediction pcls ∈ R2 and the segmentation prediction poseg ∈ RN ×2 . The segmentation prediction poseg is\nthen reshaped and upsampled to pseg ∈ RH×W ×2 to align\n\nLtotal = Lalign + γLdis .\n5\n\n(6)\n\n\fIn this stage, the distinction between normal and\nanomaly semantics is embedded into CLIP’s text encoder\nwhile its original object-recognition capability is preserved.\nFigure 3 indicates that this ability of anomaly-awareness is\nrobust and generalizable to novel classes.\n\nthe training dataset. To demonstrate adaptation efficiency,\nwe conduct training under various data levels: 2-shot per\nclass, 16-shot per class, 64-shot per class, and full-shot. The\ncorresponding number of samples are randomly selected\nfrom each class, while maintaining a consistent 1:1 ratio\nbetween normal and anomaly samples.\nMetrics Following [5, 6, 9, 10, 17, 18, 42, 53], we use the\nArea Under the Receiver Operating Characteristic Curve\n(AUROC) as the metric. We compute AUROC at both\nthe image and pixel levels to comprehensively assess the\nmodel’s effectiveness in detecting and localizing anomalies.\nImplementation Details Following [5, 6, 40, 57], we use\nOpenCLIP with the ViT-L/14 architecture as the backbone,\nand input images are resized to 518×518. All parameters\nof CLIP remain frozen. We set λ to 0.1, KT to 3, KI to 6,\nand γ to 0.1. For multi-level feature extraction, we utilize\noutputs from the 6-th, 12-th, 18-th, and 24-th layers of the\nvisual encoder to compose the overall output. For the first\nstage, we train the model for 5 epochs with a learning rate\nof 1 × 10−5 . For the second stage, we continue training for\n20 epochs, adjusting the learning rate to 5 × 10−4 . Parameters are updated by Adam optimizers. All experiments are\nconducted on a single NVIDIA GeForce RTX 3090 GPU.\nMore details are available in Appendix.\n\nAligning Patch Features According to Text Anchors:\nAnomaly-aware semantic anchors can facilitate the adaptation of patch features, thereby improving the effectiveness\nand generalizability of anomaly localization. To achieve\nalignment between patch features and anchors from the\nprevious stage, we introduce trainable Residual Adapters\nwithin the initial KI layers of the CLIP visual encoder.\nFeatures with multi-granularities are utilized to enhance\nsegmentation [6, 18, 57]. Specifically, as shown in Fig. 4\n(bottom), the intermediate output feature F i are extracted\nfrom four distinct granularities. These multi-granularity\nfeatures are then projected to align with the channel of text\ni\nanchors via a trainable projector P roji (·), yielding Vpatch\nat four distinct levels of granularity. The aggregated output\ni\nVpatch is computed by summing individual Vpatch\noutputs,\nas in Eq. (7):\ni\nVpatch\n= P roji (F i ), i ∈ {1, 2, 3, 4}\n\nVpatch =\n\n4\nX\n\ni\nVpatch\n.\n\n(7)\n\n4.2. Comparison with SOTA Methods\n\ni=1\n\nWe compare our method against CLIP and several recent\nSOTA models. Among them, WinCLIP [18], VAND [6]\nand MVFA-AD [17] use original CLIP text encoder, and\nAnomalyCLIP [57] and AdaCLIP [5] incorporate learnable\nprompts. To ensure a fair comparison, we re-train models\nthat are originally trained on different datasets to match the\ndataset settings of other approaches (detailed in Appendix).\nQuantitative results are presented in Tab. 1 and Tab. 2.\nAlthough adapting only the patch feature with original text\nembeddings has made progress in AD, the superior performance of AA-CLIP highlights its effective disentanglement of anomaly-discriminative semantics, leading to further progress. Notably, even in data-limited situations, our\nmethod consistently demonstrates top performance. At the\npixel level, with only 2 shots per class used for training, our\nmethod achieves improved average zero-shot performance\ncompared to previous methods. With the full dataset, we\nset a new pixel-level SOTA with an AUROC of 93.4%. At\nthe image level, our method is competitive with just 2 shots\nfor training and establishes a new SOTA of 83.1% with 64\nshots per class.\nUnlike previous methods, our approach does not rely\nheavily on data resources to achieve top-tier performance.\nComparison under different levels of data available, as\nshown in Fig. 5, reveals that our approach consistently outperforms other methods in general. Even with limited data,\nour model reaches competitive results, while other methods\n\nThe cosine similarity scores between the aggregated Vpatch\nand the text anchors are calculated to generate patch-level\npredictions as Eq. (3), resulting in the prediction maps.\nDuring training, alignment is guided by the loss function defined in Eq. (4), facilitating both global and local\nalignment. During inference, anomaly prediction maps and\ncorresponding anomaly scores are derived by comparing\nthe similarity scores of visual features against normal and\nanomaly text embeddings.\n\n4. Experiments\n4.1. Experiment Setups\nDatasets We evaluate our model on 11 widely used benchmarks, as previous AD works [5, 6, 17, 18, 57], with distinct foreground objects spanning a variety of modalities,\nincluding photography, endoscopy, CT, MRI, and OCT. For\nthe industrial domain, we use MVTec AD [2], VisA [60],\nBTAD [33] and MPDD [19]. For medical domain, we use\nbrain MRI, liver CT and retina OCT from BMAD [1], and\nfour different colon polyp detection datasets with different views (CVC-ClinicDB [4], CVC-ColonDB [3], KvasirSEG [39] and CVC-300 [46]). Each dataset has both imagelevel labels and pixel-level masks for evaluation.\nWe train our model on a real-world industrial AD dataset\n- VisA [60] - in which objects are different from other\ndatasets. Results of VisA are obtained using MVTec-AD as\n6\n\n\fDomain\n\nMedical\n\nWinCLIP∗\n\nVAND∗\n\nCVPR 2023\n\nCVPRw 2023\n\nMVFA-AD AnomalyCLIP∗ AdaCLIP\n\n-\n\n-\n\nfull\n\nfull\n\nfull\n\nfull\n\n2\n\nBTAD\nMPDD\nMVTec-AD\nVisA\n\n30.6\n62.1\n38.4\n46.6\n\n32.8\n95.2\n85.1\n79.6\n\n91.1\n94.9\n87.6\n94.2\n\n90.1\n94.5\n84.9\n93.4\n\n93.3\n96.2\n91.1\n95.4\n\n90.8\n96.6\n89.9\n95.5\n\n92.8\n96.3\n91.0\n93.4\n\n94.4\n96.5\n91.2\n93.8\n\n96.5\n96.3\n91.6\n94.0\n\n97.0\n96.7\n91.9\n95.5\n\nBrain MRI\nLiver CT\nRetina OCT\nColonDB\nClinicDB\nKvasir\nCVC-300\n\n68.3\n90.5\n21.3\n49.5\n47.5\n44.6\n49.9\n\n86.0\n96.2\n80.6\n51.2\n70.3\n69.7\n-\n\n94.5\n95.6\n88.5\n78.2\n85.1\n80.3\n92.8\n\n95.6\n96.8\n90.9\n78.4\n83.9\n81.9\n82.6\n\n96.2\n93.9\n92.6\n82.9\n85.0\n81.9\n95.4\n\n93.9\n94.5\n88.5\n80.0\n85.9\n86.4\n92.9\n\n96.3\n97.3\n94.2\n83.9\n89.2\n82.1\n96.0\n\n96.4\n97.7\n95.1\n83.5\n87.6\n84.6\n97.4\n\n96.5\n97.7\n94.4\n84.7\n87.8\n85.2\n96.0\n\n95.5\n97.8\n95.5\n84.0\n89.9\n87.2\n96.4\n\nAverage\n\n49.9\n\n74.7\n\n89.3\n\n88.5\n\n91.3\n\n90.4\n\n92.0\n\n92.6\n\n92.8\n\n93.4\n\nAvailable training shots\n\nIndustrial\n\nCLIP∗\nOpenCLIP\n\nOurs\n16\n64\n\nDataset\n\nCVPR 2024\n\nICLR2024\n\nECCV2024\n\nfull\n\nTable 1. Pixel-level AUROC of zero-shot AD methods in Industrial and Medical domains. Method sources and the number of shots used\nfor training are noted. Results of methods with ∗ are copied from the papers or inferred from official weight. Best results are highlighted\nas first , second and third .\n\nDomain\n\nMedical\n\nMVFA-AD AnomalyCLIP∗ AdaCLIP\n\n-\n\n-\n\nfull\n\nfull\n\nfull\n\n2\n\nBTAD\nMPDD\nMVTec-AD\nVisA\n\n73.6\n73.0\n86.1\n66.4\n\n68.2\n63.6\n91.8\n78.0\n\n94.3\n70.9\n86.6\n76.5\n\n85.3\n73.7\n90.9\n82.1\n\n90.9\n72.1\n90.0\n84.3\n\n88.0\n63.6\n85.9\n78.4\n\n90.9\n78.3\n89.7\n84.0\n\n94.7\n75.7\n92.0\n84.1\n\n94.8\n75.1\n90.5\n84.6\n\nBrain MRI\nLiver CT\nRetina OCT\n\n58.8\n54.7\n65.6\n\n66.5\n64.2\n42.5\n\n70.9\n63.0\n77.3\n\n83.3\n61.6\n75.7\n\n80.2\n64.2\n82.7\n\n84.3\n69.4\n77.4\n\n80.4\n68.1\n81.0\n\n83.4\n69.2\n82.9\n\n80.2\n69.7\n82.7\n\nAverage\n\n68.3\n\n67.8\n\n77.1\n\n78.4\n\n80.6\n\n78.1\n\n81.8\n\n83.1\n\n82.5\n\nAvailable training shots\n\nIndustrial\n\nCLIP&amp;VAND∗ WinCLIP∗\n\nOurs\n16\n64\n\nDataset\n\nOpenCLIP\n\nCVPR 2023\n\nCVPR 2024\n\nICLR2024\n\nECCV2024\n\nfull\n\nTable 2. Image-level AUROC of zero-shot AD methods in Industrial and Medical domains. Method sources and the number of shots used\nfor training are noted. Results of methods with ∗ are copied from the papers or inferred from official weight. Best results are highlighted\nas first , second and third .\n\ndisplay signs of underfitting. As data increases, our method\nmaintains its lead, establishing a new SOTA at both pixel\nand image levels.\n\nMethod\nCLIP\n\n4.3. Visualization\nTo illustrate the alignment intuitively, we present visualization examples in Fig. 6 with original configuration for previous works. Although previous methods with can detect\nanomalous regions, our AA-CLIP demonstrates fewer falsenegative predictions in both industrial and medical domains,\naccurately highlighting the correct anomaly regions.\n\nAvg. AUROC\nPixel-Level Image-Level\n50.3\n\n69.3\n\nImage\n\n1.\n2.\n3.\n\n+ Linear Proj. (VAND [6])\n+ Adapter\n+ Residual Adapter\n\n88.9\n48.9(-40.0)\n91.3(+2.4)\n\n69.3\n53.4(-15.9)\n80.7(+11.4)\n\nText\n\n4.\n5.\n\n+ Residual Adapter\n+ Disentangle Loss\n\n92.1(+3.2)\n92.7(+3.8)\n\n82.6(+13.3)\n83.3(+14.0)\n\nTable 3. Ablation Study of Our Training Strategy with VisATrained 64-Shot Setup. Our contributions are bold. While\nVAND uses linear projectors to improve AD performance, incorporating Residual Adapters further refines patch feature adaptation. Moreover, integrating our Disentangle Loss yields the best\noverall results.\n\n4.4. Ablations Analysis\nWe conduct thorough ablation experiments of our refinement of both visual and text space, as shown in Tab. 3 and\nFig. 7. The second row in Tab. 3, which mirrors the structure of VAND [6], serves as our baseline.\n\ndamage of the original generalization ability of CLIP. Incorporating our Residual Adapters mitigates this issue (shown\nin line “3.”), enhancing performance while preserving original information stored in CLIP.\n\nImage Space: As shown in Tab. 3 line “2.”, inserting the\nvallina linear adapter into transformer layers results in a\nsignificant decline in zero-shot performance, indicating the\n\nText Space: The last two rows in Tab. 3 highlight the impact of our approach in equipping CLIP’s encoder with\n7\n\n\fPixel-Level AUROC\n\nOne-Stage Training (Testing on MVTec-AD):\nP-/I-AUROC 90.1(-1.8)/88.6(-1.9)\n\nImage-Level AUROC\n\nEpoch1\n\nEpoch5\n\nAdaCLIP\n\nFigure 7. Visualization of Text Space from One-Stage Training\nand from AdaCLIP. During one-stage training, class information\ncollapses easily, leading to damaged zero-shot performance.\n\nin Fig. 7, one-stage model can easily exaggerate anomaly\nsemantics and forget class information embedded in CLIP,\ndamaging the model’s generalization ability. The two-stage\ntraining strategy allows controlled adaptation, preserving\nCLIP’s class-relevant knowledge in one end while adapting\nthe other, as shown in Fig. 3.\n\nFigure 5. Average Results (Top) and Results on BTAD (Bottom) of Different methods Trained on 2-, 16-, 64-shot per Class\nand Full Data of VisA. Our method shows high fitting efficiency,\nachieving strong results across all data scales.\nImage\n\nGround Truth\n\nCLIP\n\nAnomalyCLIP\n\n5. Conclusion and Discussion\nVAND\n\nOurs\n\nTo our knowledge, this is the first work to explicitly analyze the intrinsic Anomaly Unawareness problem in CLIP.\nTo tackle this issue, we propose a simple yet effective twostage training strategy to embed anomaly-aware information into CLIP, enabling clear disentanglement of anomaly\nrepresentations across both seen and novel classes. By\nleveraging residual adapters, our method preserves CLIP’s\nstrong generalization ability, achieving outstanding zeroshot performance across multiple datasets.\nOur adapted AA-CLIP, developed through this twostage adaptation strategy, reveals the potential of refining\nCLIP’s feature space for improved performance in downstream applications. Beyond addressing anomaly unawareness, our work also provides a potential foundation for tackling other “unawareness” issues within CLIP. These may\ninclude limitations in context-awareness or specificity to\ndomain-relevant nuances, suggesting further applications\nof our method in expanding CLIP’s adaptability across diverse tasks. Additionally, we observe signs of overfitting\nwith full-shot training, suggesting potential saturation during CLIP adaptation and warranting further investigation.\n\nFigure 6. Visualization of Anomaly Localization Results of\nOriginal CLIP [41], AnomalyCLIP [57], VAND [6] and our\nAA-CLIP. Compared to previous methods, AA-CLIP demonstrates more reliable prediction capabilities in localizing anomaly.\n\nanomaly-aware semantics. Line “4.” validates that, with\nAA-CLIP, the model’s ability to discriminate anomalies\nfurther improves, as the AA-CLIP’s text encoder provides\na more precise semantic foundation. Adding Disentangle\nLoss leads to an additional improvement (shown in Line\n“5.”), especially at image-level, validating the necessity of\nindependence between normal and anomaly anchors. These\nresults underscore the crucial role of text space refinement\nin improved anomaly localization and classification.\n\nAcknowledgement\nThis work is supported by Natural Science Foundation\nof China under Grant 62271465, Suzhou Basic Research\nProgram under Grant SYG202338, Open Fund Project of\nGuangdong Academy of Medical Sciences, China (No.\nYKY-KF202206), and Jiangsu Province Science Foundation for Youths (NO. BK20240464).\n\nTwo-Stage Training: To validate the necessity of two-stage\ntraining, we adapt both text and image encoders together\nwithin one stage (also adopted by AdaCLIP). As shown\n8\n\n\fReferences\n\nadapters. International Journal of Computer Vision, 132(2):\n581–595, 2024. 3\n[14] Denis Gudovskiy, Shun Ishizaka, and Kazuki Kozuka.\nCflow-ad: Real-time unsupervised anomaly detection with\nlocalization via conditional normalizing flows. In Proceedings of the IEEE/CVF Winter Conference on Applications of\nComputer Vision, pages 98–107, 2022. 1, 2\n[15] Haoyang He, Jiangning Zhang, Hongxu Chen, Xuhai Chen,\nZhishan Li, Xu Chen, Yabiao Wang, Chengjie Wang, and\nLei Xie. Diad: A diffusion-based framework for multi-class\nanomaly detection. arXiv preprint arXiv:2312.06607, 2023.\n2\n[16] 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 (CVPR), pages 11375–\n11385, 2024. 2\n[17] 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. 3, 5, 6\n[18] 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. 3, 6\n[19] 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\n(ICUMT), pages 66–71. IEEE, 2021. 6\n[20] Ruixiang Jiang, Lingbo Liu, and Changwen Chen. Clipcount: Towards text-guided zero-shot object counting. In\nProceedings of the 31st ACM International Conference on\nMultimedia, pages 4535–4545, 2023. 2\n[21] Zeeshan Khan, Makarand Tapaswi, et al. Figclip: Finegrained clip adaptation via densely annotated videos. arXiv\npreprint arXiv:2401.07669, 2024. 2\n[22] Daehyun Kim, Sungyong Baik, and Tae Hyun Kim. Sanflow:\nSemantic-aware normalizing flow for anomaly detection. In\nThirty-seventh Conference on Neural Information Processing Systems, 2023. 1, 2\n[23] Junnan Li, Ramprasaath Selvaraju, Akhilesh Gotmare,\nShafiq Joty, Caiming Xiong, and Steven Chu Hong Hoi.\nAlign before fuse: Vision and language representation learning with momentum distillation. Advances in neural information processing systems, 34:9694–9705, 2021. 2\n[24] Junnan Li, Dongxu Li, Caiming Xiong, and Steven Hoi.\nBlip: Bootstrapping language-image pre-training for unified\nvision-language understanding and generation. In International conference on machine learning, pages 12888–12900.\nPMLR, 2022.\n[25] Junnan Li, Dongxu Li, Silvio Savarese, and Steven Hoi.\nBlip-2: Bootstrapping language-image pre-training with\n\n[1] Jinan Bao, Hanshi Sun, Hanqiu Deng, Yinsheng He, Zhaoxiang Zhang, and Xingyu Li. Bmad: Benchmarks for medical\nanomaly detection, 2024. 6\n[2] 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\nrecognition, pages 9592–9600, 2019. 1, 3, 6\n[3] Jorge Bernal, Javier Sánchez, and Fernando Vilarino. Towards automatic polyp detection with a polyp appearance\nmodel. Pattern Recognition, 45(9):3166–3182, 2012. 6\n[4] Jorge Bernal, F Javier Sánchez, Gloria FernándezEsparrach, Debora Gil, Cristina Rodrı́guez, and Fernando\nVilariño. Wm-dova maps for accurate polyp highlighting\nin colonoscopy: Validation vs. saliency maps from physicians. Computerized medical imaging and graphics, 43:99–\n111, 2015. 6\n[5] 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, 2025. 2, 3, 5, 6\n[6] 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, 3, 5, 6, 7, 8\n[7] Xuhai Chen, Jiangning Zhang, Guanzhong Tian, Haoyang\nHe, Wuhao Zhang, Yabiao Wang, Chengjie Wang, and\nYong Liu. Clip-ad: A language-guided staged dual-path\nmodel for zero-shot anomaly detection. arXiv preprint\narXiv:2311.00453, 2023. 3\n[8] Jaemin Cho, Seunghyun Yoon, Ajinkya Kale, Franck Dernoncourt, Trung Bui, and Mohit Bansal. Fine-grained\nimage captioning with clip reward.\narXiv preprint\narXiv:2205.13115, 2022. 2\n[9] Thomas Defard, Aleksandr Setkov, Angelique Loesch, and\nRomaric Audigier. Padim: a patch distribution modeling\nframework for anomaly detection and localization. In International Conference on Pattern Recognition, pages 475–489.\nSpringer, 2021. 1, 2, 6\n[10] Hanqiu Deng and Xingyu Li. Anomaly detection via reverse\ndistillation from one-class embedding. In Proceedings of\nthe IEEE/CVF Conference on Computer Vision and Pattern\nRecognition, pages 9737–9746, 2022. 1, 2, 6\n[11] Han Fang, Pengfei Xiong, Luhui Xu, and Yu Chen.\nClip2video: Mastering video-text retrieval via image clip.\narXiv preprint arXiv:2106.11097, 2021. 2\n[12] Tharindu Fernando, Harshala Gammulle, Simon Denman,\nSridha Sridharan, and Clinton Fookes. Deep learning for\nmedical anomaly detection–a survey. ACM Computing Surveys (CSUR), 54(7):1–37, 2021. 1\n[13] Peng Gao, Shijie Geng, Renrui Zhang, Teli Ma, Rongyao\nFang, Yongfeng Zhang, Hongsheng Li, and Yu Qiao.\nClip-adapter: Better vision-language models with feature\n\n9\n\n\f[38] Or Patashnik, Zongze Wu, Eli Shechtman, Daniel Cohen-Or,\nand Dani Lischinski. Styleclip: Text-driven manipulation of\nstylegan imagery. In Proceedings of the IEEE/CVF international conference on computer vision, pages 2085–2094,\n2021. 2\n[39] Konstantin Pogorelov, Kristin Ranheim Randel, Carsten Griwodz, Sigrun Losada Eskeland, Thomas de Lange, Dag\nJohansen, Concetto Spampinato, Duc-Tien Dang-Nguyen,\nMathias Lux, Peter Thelin Schmidt, Michael Riegler, and\nPål Halvorsen. Kvasir: A multi-class image dataset for computer aided gastrointestinal disease detection. In Proceedings\nof the 8th ACM on Multimedia Systems Conference, pages\n164–169, New York, NY, USA, 2017. ACM. 6\n[40] Zhen Qu, Xian Tao, Mukesh Prasad, Fei Shen, Zhengtao\nZhang, Xinyi Gong, and Guiguang Ding. Vcp-clip: A visual\ncontext prompting model for zero-shot anomaly segmentation. arXiv preprint arXiv:2407.12276, 2024. 2, 3, 6\n[41] 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. 2, 8\n[42] Karsten Roth, Latha Pemula, Joaquin Zepeda, Bernhard\nSchölkopf, Thomas Brox, and Peter Gehler. Towards total recall in industrial anomaly detection. In Proceedings of\nthe IEEE/CVF Conference on Computer Vision and Pattern\nRecognition, pages 14318–14328, 2022. 2, 6\n[43] Thomas Schlegl, Philipp Seeböck, Sebastian M Waldstein,\nUrsula Schmidt-Erfurth, and Georg Langs. Unsupervised\nanomaly detection with generative adversarial networks to\nguide marker discovery. In International conference on information processing in medical imaging, pages 146–157.\nSpringer, 2017. 2\n[44] Sanjay Subramanian, William Merrill, Trevor Darrell, Matt\nGardner, Sameer Singh, and Anna Rohrbach. Reclip: A\nstrong zero-shot baseline for referring expression comprehension. arXiv preprint arXiv:2204.05991, 2022. 2\n[45] Yingtian Tang, Yutaro Yamada, Yoyo Zhang, and Ilker\nYildirim. When are lemons purple? the concept association\nbias of vision-language models. In Proceedings of the 2023\nConference on Empirical Methods in Natural Language Processing, pages 14333–14348, 2023. 2\n[46] David Vázquez, Jorge Bernal, F Javier Sánchez, Gloria\nFernández-Esparrach, Antonio M López, Adriana Romero,\nMichal Drozdzal, and Aaron Courville. A benchmark for endoluminal scene segmentation of colonoscopy images. Journal of healthcare engineering, 2017(1):4037190, 2017. 6\n[47] Guodong Wang, Shumin Han, Errui Ding, and Di Huang.\nStudent-teacher feature pyramid matching for anomaly detection. arXiv preprint arXiv:2103.04257, 2021. 2\n[48] Zhaoqing Wang, Yu Lu, Qiang Li, Xunqiang Tao, Yandong\nGuo, Mingming Gong, and Tongliang Liu. Cris: Clipdriven referring image segmentation. In Proceedings of\nthe IEEE/CVF conference on computer vision and pattern\nrecognition, pages 11686–11695, 2022. 2, 3\n[49] Mengde Xu, Zheng Zhang, Fangyun Wei, Han Hu, and Xiang Bai. Side adapter network for open-vocabulary semantic\n\nfrozen image encoders and large language models. In International conference on machine learning, pages 19730–\n19742. PMLR, 2023. 2\n[26] Xin Li, Dongze Lian, Zhihe Lu, Jiawang Bai, Zhibo Chen,\nand Xinchao Wang. Graphadapter: Tuning vision-language\nmodels with dual knowledge graph. Advances in Neural Information Processing Systems, 36, 2024. 2\n[27] Yi Li, Hualiang Wang, Yiqun Duan, and Xiaomeng Li. Clip\nsurgery for better explainability with enhancement in openvocabulary tasks. arXiv preprint arXiv:2304.05653, 2023.\n5\n[28] Yuqi Lin, Minghao Chen, Wenxiao Wang, Boxi Wu, Ke\nLi, Binbin Lin, Haifeng Liu, and Xiaofei He. Clip is also\nan efficient segmenter: A text-driven approach for weakly\nsupervised semantic segmentation. In Proceedings of the\nIEEE/CVF Conference on Computer Vision and Pattern\nRecognition, pages 15305–15314, 2023. 2, 3\n[29] Jie Liu, Yixiao Zhang, Jie-Neng Chen, Junfei Xiao, Yongyi\nLu, Bennett A Landman, Yixuan Yuan, Alan Yuille, Yucheng\nTang, and Zongwei Zhou. Clip-driven universal model for\norgan segmentation and tumor detection. In Proceedings\nof the IEEE/CVF International Conference on Computer Vision, pages 21152–21164, 2023. 2, 3\n[30] 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. 1, 2\n[31] 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. arXiv preprint arXiv:2310.14228, 2023. 2\n[32] Wenxin Ma, Qingsong Yao, Xiang Zhang, Zhelong Huang,\nZihang Jiang, and S.Kevin Zhou. Towards accurate unified\nanomaly segmentation. In Proceedings of the Winter Conference on Applications of Computer Vision (WACV), pages\n1342–1352, 2025. 2\n[33] 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 (ISIE), pages 01–06. IEEE, 2021. 6\n[34] Ron Mokady, Amir Hertz, and Amit H Bermano. Clipcap: Clip prefix for image captioning. arXiv preprint\narXiv:2111.09734, 2021. 2\n[35] Liliane Momeni, Mathilde Caron, Arsha Nagrani, Andrew\nZisserman, and Cordelia Schmid. Verbs in action: Improving\nverb understanding in video-language models. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 15579–15591, 2023. 2\n[36] Amin Karimi Monsefi, Kishore Prakash Sailaja, Ali\nAlilooee, Ser-Nam Lim, and Rajiv Ramnath. Detailclip:\nDetail-oriented clip for fine-grained tasks. arXiv preprint\narXiv:2409.06809, 2024. 3\n[37] Roni Paiss, Ariel Ephrat, Omer Tov, Shiran Zada, Inbar\nMosseri, Michal Irani, and Tali Dekel. Teaching clip to count\nto ten. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 3170–3180, 2023. 2\n\n10\n\n\fsegmentation. In Proceedings of the IEEE/CVF Conference\non Computer Vision and Pattern Recognition, pages 2945–\n2954, 2023. 3\n[50] Xingyi Yang and Xinchao Wang. Diffusion model as representation learner. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 18938–18949,\n2023. 2\n[51] Qingsong Yao, Li Xiao, Peihang Liu, and S Kevin Zhou.\nLabel-free segmentation of covid-19 lesions in lung ct. IEEE\ntransactions on medical imaging, 40(10):2808–2819, 2021.\n2\n[52] Xincheng Yao, Chongyang Zhang, Ruoqi Li, Jun Sun, and\nZhenyu Liu. One-for-all: Proposal masked cross-class\nanomaly detection. In Proceedings of the AAAI Conference\non Artificial Intelligence, pages 4792–4800, 2023. 2\n[53] 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. 2, 6\n[54] Zhiyuan You, Kai Yang, Wenhan Luo, Lei Cui, Yu Zheng,\nand Xinyi Le. Adtr: Anomaly detection transformer with\nfeature reconstruction. In International Conference on Neural Information Processing, pages 298–310. Springer, 2022.\n2\n[55] Renrui Zhang, Wei Zhang, Rongyao Fang, Peng Gao, Kunchang Li, Jifeng Dai, Yu Qiao, and Hongsheng Li. Tipadapter: Training-free adaption of clip for few-shot classification. In European conference on computer vision, pages\n493–510. Springer, 2022. 3\n[56] Xuan Zhang, Shiyu Li, Xi Li, Ping Huang, Jiulong Shan,\nand Ting Chen. Destseg: Segmentation guided denoising\nstudent-teacher for anomaly detection. In Proceedings of\nthe IEEE/CVF Conference on Computer Vision and Pattern\nRecognition, pages 3914–3923, 2023. 1, 2\n[57] 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. 3, 5, 6, 8\n[58] Ziqin Zhou, Yinjie Lei, Bowen Zhang, Lingqiao Liu, and\nYifan Liu. Zegclip: Towards adapting clip for zero-shot semantic segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages\n11175–11185, 2023. 2, 3\n[59] Bo Zong, Qi Song, Martin Renqiang Min, Wei Cheng, Cristian Lumezanu, Daeki Cho, and Haifeng Chen. Deep autoencoding gaussian mixture model for unsupervised anomaly\ndetection. In International conference on learning representations, 2018. 2\n[60] Yang Zou, Jongheon Jeong, Latha Pemula, Dongqing Zhang,\nand Onkar Dabeer. Spot-the-difference self-supervised pretraining for anomaly detection and segmentation. In European Conference on Computer Vision, pages 392–408.\nSpringer, 2022. 6\n\n11\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"