- mAP(mean Average Precision)
: 각 클래스당 AP의 평균
- Precision
:
- Recall
:
- PR Curve
: 모든 예측에 대해confidence
를 내림차순으로 정렬하여누적 Precision
과누적 Recall
을 구하여 그린 그래프
- AP(Average Precision)
:PR Curve
의 아랫 면적 값 (0 ~ 1 사이)
- mAP(mean Average Precision)
:
- IOU(Intersection Over Union)
:
:IOU
가 일정 기준(ex 0.5) 이상일 때True
라고 판정
mAP
와IOU
의 기준 값을 정하여 다음과 같이 사용
mAP50
mAP60
mAP70
...
- FPS(Frame Per Second)
: 초당 처리할 수 있는 이미지 숫자. 클 수록 모델이 빠름
- FLOPs(Floateing Poing opertaions)
: model이 얼마나 빠르게 동작하는지 측정하는 metric
: 연산량 횟수(+
,*
,-
등)
- MMDetection
: pytorch 기반 object detection 오픈소스
:MMCV
,MMClassification
,MMDetection3D
,MMSegmentation
등이 있음
- Detectron2
: 페이스북 AI 리서치의 라이브러리
:Object Detection
과Segmentation
알고리즘을 제공
- YOLOv5
: coco 데이터셋으로 사전학습된 모델
- EfficientDet
: Google Research & Brain에서 연구한 모델로 EfficientNet을 응용해 만든 Detection 모델
: Tensorflow, pytorch 가능
1. input image
2. Extract Region Proposals(selective search),2000개의 RoI
추출
3. warp(RoI
를 동일한 크기로 맞춰줌)
4. CNN(AlexNet
)4096dim feature
추출
5. SVM에서class
와confidence score
예측
6. CNN feature를regression
을 이용해bbox
예측
- Training
- Ground truth: positive samples
IoU < 0.3
: negative samples- Positive samples 32, negative samples 96
- Hard negative mining:
Hard negative: False negative
배경으로 식별하기 어려운 샘플들을 강제로 다음 배치의 negative sample로 mining하는 방법
- R-CNN의 한계점
- CNN의
입력크기가 고정
되어 있음 - 이미지를 고정된 크기로 자르거나(crop) 비율을 조정(warp)해야함RoI마다 CNN통과
- 하나의 이미지에 대해서 2000번의 CNN을 통과해야함
한 번의 CNN
연산 후 2000개의 Region을 추출- CNN을 통과한 feature map에서
region proposal(ex. selective search)
을 적용하여 RoI 추출warp
를spatial pyramid pooling
으로 대체
- Spatial Pyramid Pooling
- cnn에서 얻은
feature map
에서 2000개의RoI
를 추출하고feature map
에 다양한 사이즈의pooling
을 적용한 후concat
하여 동일한input size
를 만듦- ex.
window size
와stride
를RoI
크기에 맞게 조정해줌으로써 같은 크기의feature
를 얻을 수 있음.
참고블로그
CNN
-RoI Projection
-RoI Pooling
-FC
-prediction
- VGG-16 사용
- 원본이미지에서 얻은 RoI를
RoI Projection
을 통해feature map
에 적용RoI Pooling
:SPPNet
의spatial pyramid pooling
과 비슷함
: 한 사이즈로만pooling
을 한다는 점이 다름
RoI Pooling
의 결과를FC layer
에 feeding하여class
와bbox
를 예측
- multi task Loss 사용
- classification(
Cross entropy
)- BB regressor(
Smooth L1
): outlier에 덜 민감
- Dataset 구성
IoU > 0.5
: positive samples0.1 < IoU < 0.5
: negative samples- positive samples 25%, negative samples 75%
- sampling:
R-CNN
의 경우 이미지에 존재하는 RoI를 전부 저장해 사용해서한 배치에 서로 다른 이미지의 RoI
가 포함됨Fast R-CNN
의 경우한 배치에 한 이미지의 RoI
만을 포함- 한 배치 안에서 연산과 메모리를 공유
Selective Search
를RPN(Region Proposal Network)
로 대체CNN(한번만사용)
-RPN을 통해 RoI계산, Anchor box
Anchor box
:CNN
으로 얻은feature map
에서cell
(x개)마다 개의anchor box
를 만듦
:
RPN
anchor box
가object
를 포함하고 있는지 여부()와 위치를 미세조정(regression
)하는 역할
: class score를 얻기 위해 feature map에1x1 conv
연산을 적용
:object
포함 여부를 위해channel
은 2(True
/False
) x 9(anchor box
)로 설정
:bbox 위치
를 얻기위해channel
은 4(w
,h
,x
,y
) x 9(anchor box
)로 설정
:RPN
은class score
를 반환함
: 유사한
NMS(Non Maximum suppression)
RPN Proposals
를 제거하기 위해 사용
:class score
기준으로 proposals 분류
:IoU
가 0.7 이상인 proposals 영역들은 중복된 영역으로 판단한 뒤 제거
Training
IoU > 0.7
orhighest IoU with GT
: positive samplesIoU < 0.3
: negative samples그 외
는 학습데이터로 사용 안함IoU > 0.5
: positive samples → 32개IoU < 0.5
: negative samples → 96개- 128개의 samples로 mini-bath 구성
4 steps alternative training
활용 매우 복잡해서 최근에는Approximate Joint Training
활용
Loss
: : 번 째anchor box
가 객체를 포함하고 있는지 아닌지에 대한 인덱스 지표(객체포함:1, 안포함:0)
: , 즉, 객체를 포함하고 있는anchor box
만regression
을 수행함