1 AlexNet
AlexNet网络,以第一作者Alex Krizhevsky命名,开创性的使用了ReLu激活单元,GPU训练,局部归一化,Dropout,数据集扩展等技术手段,将图像分类任务的准确率提升了很多,并获得ISVRC-2012比赛的冠军,给后续深度网络的发展提供了思路。
数据扩展:
从256x256的照片中,随机截取224x224的子图(和水平镜像),把数据集的数量增加到了2048倍
PCA转换,用于数据维度降低,怎么用在数据扩展上?
PCA原理
2 VGG
使用最小的卷积核,加深网络层数
3X3卷积核,最小的尺寸能捕捉左/右,上/下,中心的概念
3 R-CNN
3.1 IOU计算
4 图像标注工具
4.1 labelImg
4.2 yolo_mark
5 数据集
cifar-10 10个类,32x32图片,无重叠
pascal voc 20个类,2万张图片
ms coco 80个物体种类,12万张图片
from pycocotools.coco import COCO
annFile='/data/coco_data/annotations/instances_train2014.json'
coco = COCO(annFile)
coco.cats
{1: {'supercategory': 'person', 'id': 1, 'name': 'person'},
2: {'supercategory': 'vehicle', 'id': 2, 'name': 'bicycle'},
3: {'supercategory': 'vehicle', 'id': 3, 'name': 'car'},
4: {'supercategory': 'vehicle', 'id': 4, 'name': 'motorcycle'},
5: {'supercategory': 'vehicle', 'id': 5, 'name': 'airplane'},
6: {'supercategory': 'vehicle', 'id': 6, 'name': 'bus'},
7: {'supercategory': 'vehicle', 'id': 7, 'name': 'train'},
8: {'supercategory': 'vehicle', 'id': 8, 'name': 'truck'},
9: {'supercategory': 'vehicle', 'id': 9, 'name': 'boat'},
10: {'supercategory': 'outdoor', 'id': 10, 'name': 'traffic light'},
11: {'supercategory': 'outdoor', 'id': 11, 'name': 'fire hydrant'},
13: {'supercategory': 'outdoor', 'id': 13, 'name': 'stop sign'},
14: {'supercategory': 'outdoor', 'id': 14, 'name': 'parking meter'},
15: {'supercategory': 'outdoor', 'id': 15, 'name': 'bench'},
16: {'supercategory': 'animal', 'id': 16, 'name': 'bird'},
17: {'supercategory': 'animal', 'id': 17, 'name': 'cat'},
18: {'supercategory': 'animal', 'id': 18, 'name': 'dog'},
19: {'supercategory': 'animal', 'id': 19, 'name': 'horse'},
20: {'supercategory': 'animal', 'id': 20, 'name': 'sheep'},
21: {'supercategory': 'animal', 'id': 21, 'name': 'cow'},
22: {'supercategory': 'animal', 'id': 22, 'name': 'elephant'},
23: {'supercategory': 'animal', 'id': 23, 'name': 'bear'},
24: {'supercategory': 'animal', 'id': 24, 'name': 'zebra'},
25: {'supercategory': 'animal', 'id': 25, 'name': 'giraffe'},
27: {'supercategory': 'accessory', 'id': 27, 'name': 'backpack'},
28: {'supercategory': 'accessory', 'id': 28, 'name': 'umbrella'},
31: {'supercategory': 'accessory', 'id': 31, 'name': 'handbag'},
32: {'supercategory': 'accessory', 'id': 32, 'name': 'tie'},
33: {'supercategory': 'accessory', 'id': 33, 'name': 'suitcase'},
34: {'supercategory': 'sports', 'id': 34, 'name': 'frisbee'},
35: {'supercategory': 'sports', 'id': 35, 'name': 'skis'},
36: {'supercategory': 'sports', 'id': 36, 'name': 'snowboard'},
37: {'supercategory': 'sports', 'id': 37, 'name': 'sports ball'},
38: {'supercategory': 'sports', 'id': 38, 'name': 'kite'},
39: {'supercategory': 'sports', 'id': 39, 'name': 'baseball bat'},
40: {'supercategory': 'sports', 'id': 40, 'name': 'baseball glove'},
41: {'supercategory': 'sports', 'id': 41, 'name': 'skateboard'},
42: {'supercategory': 'sports', 'id': 42, 'name': 'surfboard'},
43: {'supercategory': 'sports', 'id': 43, 'name': 'tennis racket'},
44: {'supercategory': 'kitchen', 'id': 44, 'name': 'bottle'},
46: {'supercategory': 'kitchen', 'id': 46, 'name': 'wine glass'},
47: {'supercategory': 'kitchen', 'id': 47, 'name': 'cup'},
48: {'supercategory': 'kitchen', 'id': 48, 'name': 'fork'},
49: {'supercategory': 'kitchen', 'id': 49, 'name': 'knife'},
50: {'supercategory': 'kitchen', 'id': 50, 'name': 'spoon'},
51: {'supercategory': 'kitchen', 'id': 51, 'name': 'bowl'},
52: {'supercategory': 'food', 'id': 52, 'name': 'banana'},
53: {'supercategory': 'food', 'id': 53, 'name': 'apple'},
54: {'supercategory': 'food', 'id': 54, 'name': 'sandwich'},
55: {'supercategory': 'food', 'id': 55, 'name': 'orange'},
56: {'supercategory': 'food', 'id': 56, 'name': 'broccoli'},
57: {'supercategory': 'food', 'id': 57, 'name': 'carrot'},
58: {'supercategory': 'food', 'id': 58, 'name': 'hot dog'},
59: {'supercategory': 'food', 'id': 59, 'name': 'pizza'},
60: {'supercategory': 'food', 'id': 60, 'name': 'donut'},
61: {'supercategory': 'food', 'id': 61, 'name': 'cake'},
62: {'supercategory': 'furniture', 'id': 62, 'name': 'chair'},
63: {'supercategory': 'furniture', 'id': 63, 'name': 'couch'},
64: {'supercategory': 'furniture', 'id': 64, 'name': 'potted plant'},
65: {'supercategory': 'furniture', 'id': 65, 'name': 'bed'},
67: {'supercategory': 'furniture', 'id': 67, 'name': 'dining table'},
70: {'supercategory': 'furniture', 'id': 70, 'name': 'toilet'},
72: {'supercategory': 'electronic', 'id': 72, 'name': 'tv'},
73: {'supercategory': 'electronic', 'id': 73, 'name': 'laptop'},
74: {'supercategory': 'electronic', 'id': 74, 'name': 'mouse'},
75: {'supercategory': 'electronic', 'id': 75, 'name': 'remote'},
76: {'supercategory': 'electronic', 'id': 76, 'name': 'keyboard'},
77: {'supercategory': 'electronic', 'id': 77, 'name': 'cell phone'},
78: {'supercategory': 'appliance', 'id': 78, 'name': 'microwave'},
79: {'supercategory': 'appliance', 'id': 79, 'name': 'oven'},
80: {'supercategory': 'appliance', 'id': 80, 'name': 'toaster'},
81: {'supercategory': 'appliance', 'id': 81, 'name': 'sink'},
82: {'supercategory': 'appliance', 'id': 82, 'name': 'refrigerator'},
84: {'supercategory': 'indoor', 'id': 84, 'name': 'book'},
85: {'supercategory': 'indoor', 'id': 85, 'name': 'clock'},
86: {'supercategory': 'indoor', 'id': 86, 'name': 'vase'},
87: {'supercategory': 'indoor', 'id': 87, 'name': 'scissors'},
88: {'supercategory': 'indoor', 'id': 88, 'name': 'teddy bear'},
89: {'supercategory': 'indoor', 'id': 89, 'name': 'hair drier'},
90: {'supercategory': 'indoor', 'id': 90, 'name': 'toothbrush'}}
imagenet 2.2万个物体种类,1500万张图片
6 神经网络模型压缩和加速
参数修剪和共享(parameter pruning and sharing)
低秩因子分解(low-rank factorization)
转移/紧凑卷积滤波器(transferred/compact convolutional filters)
知识蒸馏(knowledge distillation)
7 deep compression
剪枝(pruning),量化(quantization),哈夫曼编码(Huffman encoding)
7.1 剪枝
1.在正常的网络训练
2.小于某个阈值的权重删掉
3.在剩余的稀疏连接上重新训练网络
7.2 训练量化和权值共享
把权值矩阵n用聚类方式分成k个部分,用log2k位bits表示
聚类方法中,质心初始化的选择很重要,有以下方式可选,Forgy(random),Density-based,Linear
在网路中,大值的权重对结果影响大,但其数量较少,如果采用Forgy,Density-based的初始化方法,最终的质心会远离这些大值的权重。
7.3 霍夫曼编码
CDF Cumulative Distribution Function 累积分布函数
PDF Probability Density Function 概率密度函数
8 迁移学习
采用vgg19和resnet50的网络和权重,作为特征提取网络,后续增加浅层的神经网络作为种类的分类器
狗类识别
鸟类识别