[G1-Sync] Manual knowledge update
This commit is contained in:
@@ -2,62 +2,156 @@
|
||||
id: wiki-2026-0508-pattern-recognition
|
||||
title: Pattern Recognition
|
||||
category: 10_Wiki/Topics
|
||||
status: needs_review
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: [PAT-REC-001]
|
||||
aliases: [Pattern Classification, Statistical Pattern Recognition]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 1.0
|
||||
tags: [ai, machine-learning, Statistics, data-Analysis]
|
||||
confidence_score: 0.9
|
||||
verification_status: applied
|
||||
tags: [pattern-recognition, classification, ml, signal-processing]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-04-26
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
|
||||
tech_stack:
|
||||
language: python
|
||||
framework: scikit-learn, pytorch
|
||||
---
|
||||
|
||||
# Pattern Recognition (패턴 인식)
|
||||
# Pattern Recognition
|
||||
|
||||
## 📌 한 줄 통찰 (The Karpathy Summary)
|
||||
> "데이터 속의 숨겨진 규칙성을 찾아 의미를 부여하라" — 원시 데이터에서 유의미한 특징을 추출하여 분류, 클러스터링, 회귀 등의 기법을 통해 사전에 정의된 범주나 규칙을 식별해내는 기술.
|
||||
## 매 한 줄
|
||||
> **"매 raw signal → category label"**. 매 1960s statistical pattern recognition (Bayes, kNN, LDA) → 1980s neural pattern recognition → 매 2020s deep learning 의 absorbed sub-field. 매 modern frame: 매 supervised classification + representation learning. Bishop's PRML (2006) 의 canonical reference.
|
||||
|
||||
## 📖 구조화된 지식 (Synthesized Content)
|
||||
- **추출된 패턴:** 입력 데이터의 통계적 특성이나 구조적 유사성을 분석하여, 알려지지 않은 데이터가 어떤 그룹에 속하는지 판단하는 일반화(Generalization) 패턴.
|
||||
- **세부 내용:**
|
||||
- **Feature Extraction:** 데이터의 본질을 나타내는 핵심 속성들을 선별하여 차원을 축소.
|
||||
- **Supervised Pattern Recognition:** 라벨링된 데이터를 학습하여 분류 모델 구축 (예: 숫자 인식).
|
||||
- **Unsupervised Pattern Recognition:** 라벨 없이 데이터 간의 유사성만으로 그룹화 (예: 고객 세그멘테이션).
|
||||
- **Template Matching:** 기준이 되는 템플릿과 입력 데이터 간의 일치도를 비교하여 인식.
|
||||
## 매 핵심
|
||||
|
||||
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
|
||||
- **과거 데이터와의 충돌:** 수동으로 특징(Feature)을 설계하던 방식에서, 딥러닝을 통해 모델이 스스로 최적의 특징을 학습하는 '표현 학습(Representation Learning)' 시대로 전환.
|
||||
- **정책 변화:** Antigravity 프로젝트는 패턴 인식 기술을 활용하여 사용자 로그 데이터에서 특정 작업 패턴(예: 디버깅 루틴)을 식별하고 맞춤형 가이드를 제공함.
|
||||
### 매 history & framing
|
||||
- 매 1960s: Bayesian decision theory + linear classifiers.
|
||||
- 매 1970-80s: HMM (speech), template matching (OCR).
|
||||
- 매 1990s: SVM, kernel methods 의 dominance.
|
||||
- 매 2010s: DL absorbed it — "pattern recognition" 의 vintage term.
|
||||
- 매 modern: 매 ML/DL classification + representation learning.
|
||||
|
||||
## 🔗 지식 연결 (Graph)
|
||||
- Machine-Learning, [[Computer-Vision|Computer-Vision]], Signal-[[Processing|Processing]], Clustering
|
||||
- **Raw Source:** 10_Wiki/Topics/AI/Pattern-Recognition.md
|
||||
### 매 classical approaches
|
||||
- **Statistical**: Bayesian, MAP, ML, GMM, LDA, QDA.
|
||||
- **Neural**: perceptron → MLP → CNN → transformer.
|
||||
- **Structural / syntactic**: grammar-based, less common today.
|
||||
- **Template matching**: cross-correlation, used in OCR, fingerprint.
|
||||
- **Kernel methods**: SVM with RBF/poly kernels.
|
||||
|
||||
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
|
||||
### 매 pipeline (classic)
|
||||
1. Sensor / data acquisition.
|
||||
2. Preprocessing (denoise, normalize).
|
||||
3. Feature extraction (HOG, SIFT, MFCC) — 매 hand-crafted.
|
||||
4. Classifier (SVM, RF, NN).
|
||||
5. Post-processing (smoothing, thresholding).
|
||||
|
||||
**언제 이 지식을 쓰는가:**
|
||||
- *(TODO)*
|
||||
### 매 modern deep pipeline
|
||||
- 매 raw input → end-to-end DNN → label.
|
||||
- Feature extraction = learned (no HOG/SIFT).
|
||||
- Backbone (ResNet, ViT, CLIP) → head (linear / MLP).
|
||||
|
||||
**언제 쓰면 안 되는가:**
|
||||
- *(TODO)*
|
||||
### 매 응용
|
||||
1. Computer vision (face, OCR, object detection).
|
||||
2. Speech recognition (Whisper, ASR).
|
||||
3. Biometrics (fingerprint, iris).
|
||||
4. Medical imaging (radiology AI).
|
||||
5. Anomaly detection (fraud, network intrusion).
|
||||
|
||||
## 🧪 검증 상태 (Validation)
|
||||
## 💻 패턴
|
||||
|
||||
- **정보 상태:** needs_review
|
||||
- **출처 신뢰도:** A
|
||||
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
|
||||
### Classic: Bayesian classifier
|
||||
```python
|
||||
from sklearn.naive_bayes import GaussianNB
|
||||
from sklearn.datasets import load_iris
|
||||
X, y = load_iris(return_X_y=True)
|
||||
clf = GaussianNB().fit(X, y)
|
||||
print(clf.score(X, y))
|
||||
```
|
||||
|
||||
## 🧬 중복 검사 (Duplicate Check)
|
||||
### Classic: SVM with RBF
|
||||
```python
|
||||
from sklearn.svm import SVC
|
||||
from sklearn.preprocessing import StandardScaler
|
||||
from sklearn.pipeline import make_pipeline
|
||||
|
||||
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
|
||||
- **처리 방식:** UPDATE (자동 정규화)
|
||||
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
|
||||
clf = make_pipeline(StandardScaler(), SVC(kernel="rbf", C=1.0, gamma="scale"))
|
||||
clf.fit(X_train, y_train)
|
||||
```
|
||||
|
||||
## 🕓 변경 이력 (Changelog)
|
||||
### Modern: CNN classification
|
||||
```python
|
||||
import torch.nn as nn
|
||||
import torchvision.models as tvm
|
||||
|
||||
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|
||||
|------|-----------|-----------|--------|
|
||||
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
|
||||
model = tvm.resnet50(weights=tvm.ResNet50_Weights.IMAGENET1K_V2)
|
||||
model.fc = nn.Linear(2048, num_classes) # transfer learn
|
||||
```
|
||||
|
||||
### Modern: CLIP zero-shot
|
||||
```python
|
||||
import clip, torch
|
||||
model, preprocess = clip.load("ViT-B/32")
|
||||
classes = ["cat", "dog", "bird"]
|
||||
text = clip.tokenize([f"a photo of a {c}" for c in classes])
|
||||
with torch.no_grad():
|
||||
img_feat = model.encode_image(preprocess(image).unsqueeze(0))
|
||||
txt_feat = model.encode_text(text)
|
||||
logits = (img_feat @ txt_feat.T).softmax(-1)
|
||||
print(classes[logits.argmax()])
|
||||
```
|
||||
|
||||
### HOG + SVM (classic CV pipeline)
|
||||
```python
|
||||
from skimage.feature import hog
|
||||
from sklearn.svm import LinearSVC
|
||||
|
||||
features = [hog(img, pixels_per_cell=(8,8)) for img in images]
|
||||
clf = LinearSVC().fit(features, labels)
|
||||
```
|
||||
|
||||
### Anomaly detection
|
||||
```python
|
||||
from sklearn.ensemble import IsolationForest
|
||||
detector = IsolationForest(contamination=0.01).fit(X_train)
|
||||
anomalies = detector.predict(X_test) == -1
|
||||
```
|
||||
|
||||
## 매 결정 기준
|
||||
| 상황 | Approach |
|
||||
|---|---|
|
||||
| Tabular small data | RF / GBDT / SVM |
|
||||
| Image | Pretrained CNN/ViT (transfer) |
|
||||
| Speech / audio | Whisper / wav2vec finetune |
|
||||
| Few-shot / zero-shot | CLIP / SigLIP / VLM |
|
||||
| Anomaly (no labels) | IsolationForest / autoencoder |
|
||||
| Real-time embedded | Quantized CNN (MobileNet) |
|
||||
|
||||
**기본값**: 매 image/speech 의 pretrained foundation model 의 fine-tune; tabular 의 GBDT.
|
||||
|
||||
## 🔗 Graph
|
||||
- 부모: [[Machine-Learning]] · [[Statistical-Inference]]
|
||||
- 변형: [[Classification]] · [[Detection]] · [[Recognition]]
|
||||
- 응용: [[Computer-Vision]] · [[Speech-Recognition]] · [[OCR]] · [[Biometrics]]
|
||||
- Adjacent: [[Feature-Engineering]] · [[Representation-Learning]] · [[CLIP]]
|
||||
|
||||
## 🤖 LLM 활용
|
||||
**언제**: 매 classification problem framing, choosing classical vs DL approach, transfer learning decision.
|
||||
**언제 X**: 매 generative tasks (use diffusion / LLM instead).
|
||||
|
||||
## ❌ 안티패턴
|
||||
- **Hand-crafted features in 2026**: 매 HOG/SIFT 의 99% case 에서 pretrained CNN feature 가 우수.
|
||||
- **No baseline**: 매 jumping to DL without trying logistic / RF baseline.
|
||||
- **Class imbalance ignored**: 매 99% accuracy on 99/1 split = trivial. 매 use F1, ROC-AUC, balanced metrics.
|
||||
- **Test contamination**: 매 train/test split 의 leakage (especially time series).
|
||||
- **Calibration ignored**: 매 raw softmax ≠ probability. 매 use Platt scaling / temperature.
|
||||
|
||||
## 🧪 검증 / 중복
|
||||
- Verified (Bishop "PRML" 2006, Duda & Hart "Pattern Classification" 2001).
|
||||
- 신뢰도 A.
|
||||
|
||||
## 🕓 Changelog
|
||||
| 날짜 | 변경 |
|
||||
|---|---|
|
||||
| 2026-05-08 | Phase 1 |
|
||||
| 2026-05-10 | Manual cleanup — classical-to-modern framing, pipeline patterns |
|
||||
|
||||
Reference in New Issue
Block a user