语义分割小综述
课程
应用
人像分割
自动驾驶
医疗影像
智能遥感:河流、田地等
思路
先验知识:颜色相近,物体交界颜色变化
先验知识不完全准确
逐像素分类:滑窗,逐个滑动预测类别
需重复计算卷积
复用卷积:直接在feature map上预测
需要全连接层的卷积化:每个全连接层神经元用一个卷积核替换(Fully Convolutional Network)
预测图上采样:双线性插值或转置卷积
双线性插值可以用对应卷积核代替:先进行零插值,再使用设计好的卷积核卷积
转置卷积
也称升卷积Upconvolution或反卷积Deconvolution,但不建议使用反卷积,其在数学上与卷积不互逆。转置卷积Transposed Convolution名称来源于卷积对应的矩阵运算。
对于卷积运算
O=I∗h=CIO = I * h = CI
O=I∗h=CI
其中hhh为卷积核,OOO为输出(小图),III为输入(大图),CCC为卷积运算的等价矩阵乘法项。可以发现其转置卷积有
I′=O′∗h′=CTO′I' = O'*h' = C^TO ...
mmDetection实战
课程
YOLOv3模型
主干网络:Darknet53
颈部:FPN
检测头
技巧
搜索模型:
1mim search mmdet --model "mask r-cnn"
推理
12345from mmdet.apis import init_detector, inference_detector, show_result_pyplotmodel = init_detector('config_path', 'checkpoint_path')result = inference_detector(model, 'img_path')show_result_pyplot(model, 'img_path', result)
推理
简单的推理
1234from mmdet.apis import init_detector, inference_detetor, show_result_pyplotmodel = init_detector(cfg, checkpoint ...
目标检测小综述
课程
这节课讲得有点划,硬核的部分都略去了orz
思路
滑窗:不可接受的效率成本
R-CNN、Fast R-CNN:Selective Search提议,比较复杂
Regional Proposal:使用一些特征减少框数
Selective Search:贪心算法将相邻而相似的图像块合并
消除滑窗重复计算:一次卷积计算所有特征,裁切特征图分类
密集预测
两阶段方法
区域提议+区域识别,逐步被单阶段取代
Fast R-CNN
Faster R-CNN
Mask R-CNN
锚框:原图上设置不同尺寸的基准框,基于特征独立预测其中是否包含物体(区域提议)
级联方法
Cascade R-CNN
HTC
单阶段方法
YOLO Series
SSD:在多个特征图上使用密集预测方法,产生所有位置、不同尺度、所有锚框的预测结果
锚框与真值匹配原则:一个真值框可匹配多个IoU > 0.5的锚框
8732个锚框分类 + 回归预测计算损失,每个锚框都有其分类、回归真值
Retina Net:FPN多尺度特征融合+Focal loss
FCOS:直接在多尺 ...
mmClassification实战
笔记
训练注意事项
对Evaluation部分
123456evaluation = dict( interval=1, metric='accuracy', save_best='accuracy_top-1', metric_options={'topk':(1,)} # 由于总类为4,这里必须指明metric_options)
启用标签平滑:
12# 在head中修改lossloss=dict(type='LabelSmoothLoss', label_smooth_val=0.2, mode='original')
load_from用于加载模型,resume_from用于重启训练,两者不同。
想要启用Wandb,可以用
1234567log_config = dict( interval=10, hooks=[ dict(type='TextLoggerHook'), dict(type='MMC ...
mmClassification学习
课程
mim很好用,感觉需要更多地研究一下
流程
下载配置文件和模型
1mim download mmcls --config mobilenetblablabla --dest .
使用API
123456from mmcls.apis import init_model, inference_modelmodel = init_model('config.py', 'model.pth', device='cuda:0')result = inference_model(model, 'pic.jpg')from mmcls.apis import show_result_pyplotshow_result_pyplot(model, 'pic.jpg', result)
修改配置文件
12345678num_classes = 10load_from = 'model_path.pth'type = 'CustomDataset ...
CV小综述
课程
设计图像特征
可以看这篇文章和这篇文章:
方向梯度直方图Histogram of Oriented Gradients/HOG,局部统计像素梯度的方向分布,将物体映射为低维特征向量,简化数据表达。
Dense grid descriptor (HOG, LBP) => Coding: local coordinate, super-vector => Pooling, SPM => Linear SVM
深度学习
用于解决此前难以进行的特征提取
卷积
多头注意力:实现一步特征提取
ResNet
有效性猜想
等同于多模型集成:路径之间的复杂组合,每种组合都视为一个新模型
Loss Surface更加平滑,图很好玩(Visualizing the Loss Landscape of Neural Nets)
改良
ResNet B/C/D:残差模块基部改进
ResNeXt:分组卷积(将通道拆解成两部分,分别进行卷积,再将结果堆叠),降低参数量
SEResNet:通道维度引入注意力机制
某些情况下分组卷积效果更好,可能是由于增强了通道之间 ...
Mechanism: Address Translation
Mechanism: Address Translation
CPU: limited direct execution (LDE)
In virtualizing memory, we will pursue efficiency and control.
CRUX: How to efficiently and flexibly virtualize memory?
Technique: hardware-based address translation / address translation, changing the virtual address provided by the instruction to a physical address.
Interposition is powerful: On of the usual benefits of such an approach is transparency.
Dynamic (Hardware-based) Relocation
base and bounds / dynamic relocation:
...
Interlude: Memory API
Interlude: Memory API
CRUX: How to allocate and manage memory in UNIX/C programs?
Types of Memory
stack memory: allocations and deallocations are managed implicitly by the compiler. For this reason it is sometimes called automatic memory.
Declaring memory on the stack in C is easy. For example, let’s say you need some space in function func() for an integer, called x. To declare such a piece of memory, you just do something like this:
123void func() { int x;}
The compiler does the res ...
The Abstraction: Address Spaces
The Abstraction: Address Spaces
Early Systems
From the perspective of memory, early machine didn’t provide much of an abstraction to users. The OS was a set of routines (a library, really) that sat in memory (starting at physical address 0, for example), and there would be one running program (a process) that currently sat in physical memory and used the rest of memory.
Multiprogramming and Time Sharing
multiprogramming: multiple processes were ready to run at a given time, and the OS would swit ...
Scheduling: Proportional Share
Operating Systems: Three Easy Pieces
We will examine a different type of scheduler known as a proportional-share scheduler, also sometimes referred to as a fair-share scheduler.
An early example of proportional-share scheduling is known as lottery scheduling. The crux is how can we design a scheduler to share the CPU in a proportional manner?
Basic Concept: Tickets Represent Your Share
tickets: used to represent the share of a resource that a process (or user) should receive.
Lottery allocate ...