DetectNet을 multi class로 학습합니다.
detection의 정밀도를 높이기 위해fine tuning에서 두 단계의 학습을 진행한다.
예를 들어 얼굴을 각각 검출하려는classes={tanaka,nakajima,takahashi},classes={face}에서 한 번 배운 후에classe={tanaka,nakajima,takahashi}로fine tuning을 진행한다.
일급 학습
데이터 준비
train
|- images
| |- image0001.png
| |- ...
|- labels
|- image001.txt
|- ...
validate
|- images
| |- image1001.png
| |- ...
|- labels
|- image101.txt
|- ...
이런 식으로 준비하세요.txt 등의 내용은 공식이다이 단계에서 txt의 내용은 단지 한 단계이다. 즉,
face 0.00 0 -10 496.00 222.00 599.00 328.00 -1 -1 -1 -1000 -1000 -1000 -10
이런 형식을 이루다.데이터 세트 만들기
https://github.com/NVIDIA/DIGITS/blob/digits-4.0/digits/extensions/data/objectDetection/README.md#custom-class-mappings

주의점

배우다
https://github.com/NVIDIA/DIGITS/blob/digits-4.0/digits/extensions/data/objectDetection/README.md#custom-class-mappings

주의점

공부를 시작하다
정확한 정밀도가 있나~
https://github.com/NVIDIA/caffe/blob/caffe-0.15/examples/kitti/detectnet_network.prototxt
괜찮아 보여요.
안 되는 경우:
multi반 학습
데이터 준비
이번엔 다반, 이미지 001.txt에서
takahashi 0.00 0 -10 496.00 222.00 599.00 328.00 -1 -1 -1 -1000 -1000 -1000 -10
nakajima 0.00 0 -10 291.00 138.00 327.00 212.00 -1 -1 -1 -1000 -1000 -1000 -10
이런 형식을 이루다.데이터 세트 만들기

주의점
배우다

상반기의 학습 설정은 한 반 때의 주의점과 마찬가지로 이번에는 인터넷의 정의 설정에 주의해야 한다.
방금 배운 네트워크를 선택하고 epoch를 지정하고coustomize를 클릭하세요.

같은 네트워크 정의 아래의 클래스 항목에서 자동으로 배운 네트워크 경로를 지정합니다!
그러나 이렇게 실행하는 것도 같은 종류의 네트워크에서 배우기 때문에 여러 종류에서 배울 수 없기 때문에 네트워크 구조의 정의를 변경해야 한다.
현재 텍스트에 적힌 네트워크 정의는 여기에 있습니다

클래스 1의 네트워크 정의 파일과 클래스 2의 네트워크 정의 파일의 차이를 보면 클래스 3 이상의 네트워크 정의 파일도 쓸 수 있다.
linux
diff
명령으로 차이를 보십시오.82c82,83
< object_class: { src: 1 dst: 0} # obj class 1 -> cvg index 0
---
> object_class: { src: 1 dst: 0} # cars -> 0
> object_class: { src: 8 dst: 1} # pedestrians -> 1
121c122,123
< object_class: { src: 1 dst: 0} # obj class 1 -> cvg index 0
---
> object_class: { src: 1 dst: 0} # cars -> 0
> object_class: { src: 8 dst: 1} # pedestrians -> 1
2386c2388
< num_output: 1
---
> num_output: 2
2500c2502,2503
< top: 'bbox-list'
---
> top: 'bbox-list-class0'
> top: 'bbox-list-class1'
2504c2507
< param_str : '1248, 352, 16, 0.6, 3, 0.02, 22, 1'
---
> param_str : '1248, 352, 16, 0.6, 3, 0.02, 22, 2'
2515c2518,2519
< top: 'bbox-list-label'
---
> top: 'bbox-list-label-class0'
> top: 'bbox-list-label-class1'
2519c2523
< param_str : '1248, 352, 16, 1'
---
> param_str : '1248, 352, 16, 2'
2525,2528c2529,2532
< name: 'score'
< bottom: 'bbox-list-label'
< bottom: 'bbox-list'
< top: 'bbox-list-scored'
---
> name: 'score-class0'
> bottom: 'bbox-list-label-class0'
> bottom: 'bbox-list-class0'
> top: 'bbox-list-scored-class0'
2537,2541c2541,2572
< name: 'mAP'
< bottom: 'bbox-list-scored'
< top: 'mAP'
< top: 'precision'
< top: 'recall'
---
> name: 'mAP-class0'
> bottom: 'bbox-list-scored-class0'
> top: 'mAP-class0'
> top: 'precision-class0'
> top: 'recall-class0'
> python_param {
> module: 'caffe.layers.detectnet.mean_ap'
> layer: 'mAP'
> param_str : '1248, 352, 16'
> }
> include: { phase: TEST stage: "val" }
> }
>
> layer {
> type: 'Python'
> name: 'score-class1'
> bottom: 'bbox-list-label-class1'
> bottom: 'bbox-list-class1'
> top: 'bbox-list-scored-class1'
> python_param {
> module: 'caffe.layers.detectnet.mean_ap'
> layer: 'ScoreDetections'
> }
> include: { phase: TEST stage: "val" }
> }
> layer {
> type: 'Python'
> name: 'mAP-class1'
> bottom: 'bbox-list-scored-class1'
> top: 'mAP-class1'
> top: 'precision-class1'
> top: 'recall-class1'
변경점은 9곳입니다.변경된 부분을 간신히 정리했다.
train transform 및 val transform 레이어
object_class: {src: 1 dst: 0}
열다object_class: {src: 1 dst: 0}
object_class: {src: 2 dst: 1}
object_class: {src: 3 dst: 2}
src:0은dontcare입니다. 문자대로 쓰지 않습니다.cvg/classifier 레이어
num_output: 1
열다num_output: 3
변경됨,name: "cvg/clasifier"
열다name: "cvg/classifier_for_3classes"
변하지 않으면 배운 도표와 공유권의 차원 차이로 error 토해야 한다.cluster 레이어
top: 'bbox-list'
열다 top: 'bbox-list-class0'
top: 'bbox-list-class1'
top: 'bbox-list-class2'
로 변경합니다. param_str : '1248, 352, 16, 0.6, 3, 0.02, 22, 1'
열다 param_str : '1248, 352, 16, 0.6, 3, 0.02, 22, 3'
로 변경합니다.cluster gt 레이어
top: 'bbox-list-label'
열다 top: 'bbox-list-label-class0'
top: 'bbox-list-label-class1'
top: 'bbox-list-label-class2'
로 변경합니다. param_str : '1248, 352, 16, 1'
열다 param_str : '1248, 352, 16, 3'
로 변경합니다.score 레이어, mAP 레이어
이것들은name,bottom,top의 값에 각각'-class0','-class1','-class2'를 더하면 된다.
이런 느낌.
layer {
type: 'Python'
name: 'score-class0'
bottom: 'bbox-list-label-class0'
bottom: 'bbox-list-class0'
top: 'bbox-list-scored-class0'
python_param {
module: 'caffe.layers.detectnet.mean_ap'
layer: 'ScoreDetections'
}
include: { phase: TEST stage: "val" }
}
layer {
type: 'Python'
name: 'mAP-class0'
bottom: 'bbox-list-scored-class0'
top: 'mAP-class0'
top: 'precision-class0'
top: 'recall-class0'
python_param {
module: 'caffe.layers.detectnet.mean_ap'
layer: 'mAP'
param_str : '1248, 352, 16'
}
include: { phase: TEST stage: "val" }
}
layer {
type: 'Python'
name: 'score-class1'
bottom: 'bbox-list-label-class1'
bottom: 'bbox-list-class1'
top: 'bbox-list-scored-class1'
python_param {
module: 'caffe.layers.detectnet.mean_ap'
layer: 'ScoreDetections'
}
include: { phase: TEST stage: "val" }
}
layer {
type: 'Python'
name: 'mAP-class1'
bottom: 'bbox-list-scored-class1'
top: 'mAP-class1'
top: 'precision-class1'
top: 'recall-class1'
python_param {
module: 'caffe.layers.detectnet.mean_ap'
layer: 'mAP'
param_str : '1248, 352, 16'
}
include: { phase: TEST stage: "val" }
}
layer {
type: 'Python'
name: 'score-class2'
bottom: 'bbox-list-label-class2'
bottom: 'bbox-list-class2'
top: 'bbox-list-scored-class2'
python_param {
module: 'caffe.layers.detectnet.mean_ap'
layer: 'ScoreDetections'
}
include: { phase: TEST stage: "val" }
}
layer {
type: 'Python'
name: 'mAP-class2'
bottom: 'bbox-list-scored-class2'
top: 'mAP-class2'
top: 'precision-class2'
top: 'recall-class2'
python_param {
module: 'caffe.layers.detectnet.mean_ap'
layer: 'mAP'
param_str : '1248, 352, 16'
}
include: { phase: TEST stage: "val" }
}
너무 길어.. 수고했어.자, 공부를 시작합시다!
https://github.com/NVIDIA/caffe/blob/caffe-0.15/examples/kitti/detectnet_network-2classes.prototxt
이런 느낌의 메트릭이'와'나왔다.
나중에 두고 보자.
최후
그럼 공부는 다 했어요?
무슨 댓글이 있으면 환영합니다.
마지막으로 DIGITS의 규격 변경으로 이번 정보는 곧 유행이 지날 것이니 충분히 주의해 주십시오.
DIGITS-5.1
Caffe-0.16.2
2017/11/9
Reference
이 문제에 관하여(DetectNet을 multi class로 학습합니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/Yoshiki-Takahashi/items/171d541d3adb9ab5298a텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)