SSD:默认框、匹配与困难负例
SSD detectors
生成多尺度默认框,核对匹配冲突与负例预算,再推导损失并训练小卷积检测头。
ssd在每个位置先摆几种可能的框
一张街景里有近处的公交车,也有远处的小行人。检测器既需要较大的观察范围,也需要足够细的空间信息来定位行人。SSD 全称为 Single Shot MultiBox Detector,在不同分辨率的特征图上安装检测预测器。每个位置先摆一组尺寸和宽高比不同的默认框,网络再预测每个框该怎样调整、里面是什么类别。SSD方法概览
与外部候选区域流程不同,这些候选几何在看图之前就已确定。与初版 YOLO不同,SSD 不让同格所有框共享一个类别向量,每个默认框都有自己的类别分数。同一目标可以同时监督多个默认框,之后再用 NMS处理冗余检测。
SSD 首版预印本于2015年12月8日提交。本章核读的是2016年12月29日的 arXiv v5,以及作者 Caffe 实现的一个固定版本。这些日期对应不同材料,后续修订不等于首次公开。下面的数值例子为原创教学实现,不是已训练 SSD 基准的复现。版本历史
默认框、目标分配与归一化损失
先数框,再数参数
设第 s 张特征图高为 、宽为 ,每个位置有 个默认框。C 包含背景类别。共享定位表示每个默认框有四个坐标偏移,而不是为每个类别另预测一个框。框数 P 和标量输出数 O 为
这是输出数量,不是网络参数数量。同一特征图中的空间位置复用同一个卷积核,不同预测层可以使用不同卷积核。一个接收 F 个通道、输出 A(C+4) 个通道的3×3预测器,有9FA(C+4)个权重,另加偏置,与特征图宽度无关。论文第2.1—2.2节、预测头构造
固定 Pascal 配置使用以下六张特征图。小数值程序会减少特征图和通道数,同时单独核对这一完整配置的框数。
| 特征图边长 | 每格框数 | 默认框总数 | 300像素输入中的中心步长 |
|---|---|---|---|
| 38 | 4 | 5,776 | 8 |
| 19 | 6 | 2,166 | 16 |
| 10 | 6 | 600 | 32 |
| 5 | 6 | 150 | 64 |
| 3 | 4 | 36 | 100 |
| 1 | 4 | 4 | 300 |
合计8,732个默认框。20个前景类别加上背景,C=21,因此共有218,300个输出标量。这不表示检测到了8,732个目标:大多数框应当得到背景判断或较低的前景分数。固定配置
尺度公式不等于完整模型配置
对于归一化尺度 s、宽高比 a,框宽为 ,高为 ,乘积仍是 。因此改变宽高比会改变形状,但保持面积。除了原尺度正方框,还会加入尺度为的正方框,然后加入所选宽高比及其倒数。在本章的正方格子记法中,设归一化中心步长为 Δ,则
论文用0.2到0.9之间等间隔的尺度说明一般设计;固定 SSD300 配置则更加具体:最小像素尺寸为[30,60,111,162,213,264],最大尺寸为[60,111,162,213,264,315]。第一张图采用Δ=8/300,而不是1/38,因此第37列的归一化中心恰好为1。配置关闭裁剪,部分默认框会伸出图像。不能用方便的均匀格子公式替换这些细节后,仍声称复现了该固定配置。论文尺度讨论、配置、PriorBox生成
默认框也不必等于该特征单元的感受野。它是监督与解码所用的参考几何;真正影响该单元的输入像素取决于此前的网络。不同特征分辨率提供不同空间采样和视觉上下文,单改默认框尺寸无法找回特征图已经丢失的细节。
区分贪心配对与全局匹配
论文先描述为每个真实框找到最好重叠,再匹配其他超过 IoU 阈值的默认框。固定 Caffe 实现给出更精确的操作约定:仅保存大于1e-6的重叠,反复选择尚未使用的默认框与目标之间的最大重叠对,然后把其他默认框分给其最好目标,条件是 IoU至少为0.5。最初的贪心过程不是求全局最优的 Hungarian 分配。论文匹配方法、MatchBBox
考虑两个默认框与两个真实框的下表。这些 IoU 来自同一坐标系里的实际矩形:默认框为[0.5,0,2.5,1]和[0,0,1,1],真实框为[0,0,2,1]和[1,0,3,1]。这里采用任意共同单位,并非图像归一化坐标。
| 目标0 | 目标1 | |
|---|---|---|
| 默认框0 | 0.6 | 0.6 |
| 默认框1 | 0.5 | 0 |
按记录中的扫描顺序,首个同分选择默认框0—目标0。剩余配对没有重叠,不重复配对阶段便停止;后续阈值阶段又将默认框1以IoU=0.5分给目标0。目标1没有得到正默认框。但换成默认框0—目标1、默认框1—目标0,就能覆盖两个目标。这个反例限定了“保证每个真实目标都有匹配”的说法,并不表示该边界情况在数据集中很常见。
教学代码遵循这个贪心加阈值流程,包括排除零重叠。它不会额外强制一个零IoU匹配,也不会悄悄覆盖早先分配。困难负例排序遇到同分时明确保持默认框顺序;这是为了教学确定性作出的选择,不保证与C++排序逐位一致。
相对于默认框编码偏移
设 d 是默认框中心与尺寸,g 是匹配真实框的中心与尺寸,v 是四个固定缩放系数。实现沿用的历史名称 variance,不表示这些数值在本例中由数据估计成统计方差。所选配置使用v=[0.1,0.1,0.2,0.2],目标偏移为
零偏移恢复默认框。解码逆转这一变换:x中心为,宽度为,y与高度同理。取对数前,宽高必须为正。论文展示未加这些系数的相对偏移,而固定实现另外提供缩放因子。论文公式2、CENTER_SIZE编码、固定系数
训练选中的负例,而不是所有空位置
未匹配默认框的背景分类损失为,p是它的C个logit经过softmax得到的概率。一个确信自己属于前景的框,其较小,因此背景损失较大。通常的困难负例流程按这个损失对合格的未匹配框排序,最多选择正默认框匹配数的三倍,而非真实目标数的三倍。负例还须满足配置的重叠资格条件。困难负例挖掘、资格与选择
令、分别是选中的正、负例索引,,为类别标签(负例背景为零),为预测偏移,为其目标。本例取α=1:
Smooth L1让小残差按平方增长,大残差按线性增长:
对选中的分类行与正例定位坐标,梯度分别为
未选中的行、负例的框坐标梯度为零。检查梯度时,匹配与选中的负例集合保持固定,不对排序本身求导。在论文N=0约定和这个3:1挖掘流程下,没有负例被选中,总损失为零。其他检测器或其他挖掘配置未必如此。论文公式1—3、MultiBox损失前向
在给定特征图上训练小卷积头
下面的原创 NumPy 程序把默认框生成、匹配、挖掘、缩放偏移、归一化损失与真实3×3卷积预测头连接起来,还会计算预测头卷积核和偏置的梯度。输入特征图明确给定,没有在示例中藏入图像主干、数据增强或完整数据集训练。
先做一个手算:一个正例、三个选中负例,每行三个类别logit相等,分类项贡献4 ln 3。若正例只有一个偏移残差为0.5,定位项再加0.125。这可以检查分母:若除以四个选中行,而不是一个正匹配,得到的就不是同一个目标。
可执行例子使用2×2和1×1特征图,每格四个默认框,共20个。固定种子的小权重产生不完全相同的logit;真实框设为第一个默认框,会得到三个正匹配与九个选中负例。随后固定这份训练选择,更新一次卷积参数。
"""Original NumPy SSD teaching head; fixed priors, explicit Caffe-style matching profile."""
import numpy as np
def boxes(value):
a = np.asarray(value, float)
if a.ndim != 2 or a.shape[1] != 4 or not np.isfinite(a).all() or (a[:,2:] <= a[:,:2]).any():
raise ValueError('finite N-by-4 xyxy boxes with positive width/height required')
return a
def default_grid(side, scale, next_scale, ratios=(2.,3.), step=None):
"""Square image; scales and center step are image-normalized; no clipping."""
step = 1/side if step is None and type(side) is int and side > 0 else step
if type(side) is not int or side < 1 or step is None:
raise ValueError('positive integer grid side required')
if not np.isfinite([scale,next_scale,step]).all() or not 0 < scale < next_scale or step <= 0:
raise ValueError('finite positive step and increasing scales required')
if any(not np.isfinite(r) or r <= 1 for r in ratios) or len(set(ratios)) != len(ratios):
raise ValueError('supply distinct aspect ratios greater than one; reciprocals are added')
shapes = [(scale,scale), (np.sqrt(scale*next_scale),)*2]
for ratio in ratios:
w,h = scale*np.sqrt(ratio), scale/np.sqrt(ratio)
shapes.extend([(w,h),(h,w)])
size = np.asarray(shapes)
row,col = np.indices((side,side))
centers = (np.stack([col,row],axis=-1)+.5)*step
return np.concatenate([centers[...,None,:]-size/2,
centers[...,None,:]+size/2],axis=-1).reshape(-1,4)
def iou_matrix(first, second):
a,b = boxes(first),boxes(second)
area_a = np.prod(a[:,2:]-a[:,:2],axis=1)
area_b = np.prod(b[:,2:]-b[:,:2],axis=1)
inter = np.maximum(0,np.minimum(a[:,None,2:],b[None,:,2:])-np.maximum(a[:,None,:2],b[None,:,:2])).prod(axis=-1)
return inter/(area_a[:,None]+area_b[None,:]-inter)
def match(priors, truth, threshold=.5):
"""Greedy distinct pairs, then per-prior threshold matching; zero-overlap pairs excluded."""
overlap = iou_matrix(priors,truth)
count, targets = overlap.shape
if not np.isfinite(threshold) or not 0 <= threshold <= 1:
raise ValueError('overlap threshold must lie in [0,1]')
assigned = np.full(count,-1,dtype=int)
if count == 0 or targets == 0:
return assigned,np.zeros(count)
remaining = np.where(overlap > 1e-6,overlap,-1.)
for _ in range(min(count,targets)):
i,j = np.unravel_index(np.argmax(remaining),remaining.shape)
if remaining[i,j] < 0:
break
assigned[i] = j
remaining[i,:] = -1
remaining[:,j] = -1
best = np.argmax(overlap,axis=1)
quality = overlap[np.arange(count),best]
eligible = (assigned < 0) & (quality >= threshold) & (quality > 1e-6)
assigned[eligible] = best[eligible]
return assigned,quality
def variance_vector(value):
v = np.asarray(value,float)
if v.shape != (4,) or not np.isfinite(v).all() or (v <= 0).any():
raise ValueError('four positive finite offset scale factors required')
return v
def encode(priors, truth, variance=(.1,.1,.2,.2)):
d,g,v = boxes(priors),boxes(truth),variance_vector(variance)
if d.shape != g.shape:
raise ValueError('one target per supplied prior required')
ds,gs = d[:,2:]-d[:,:2],g[:,2:]-g[:,:2]
dc,gc = (d[:,2:]+d[:,:2])/2,(g[:,2:]+g[:,:2])/2
return np.c_[(gc-dc)/ds,np.log(gs/ds)]/v
def decode(priors, offsets, variance=(.1,.1,.2,.2)):
d,l,v = boxes(priors),np.asarray(offsets,float),variance_vector(variance)
if l.shape != d.shape or not np.isfinite(l).all():
raise ValueError('finite four offsets per prior required')
ds,dc = d[:,2:]-d[:,:2],(d[:,2:]+d[:,:2])/2
with np.errstate(over='ignore',invalid='ignore'):
center = dc+l[:,:2]*v[:2]*ds
size = ds*np.exp(l[:,2:]*v[2:])
result = np.c_[center-size/2,center+size/2]
return boxes(result)
def log_probabilities(logits):
z = np.asarray(logits,float)
if z.ndim != 2 or z.shape[1] < 2 or not np.isfinite(z).all():
raise ValueError('finite P-by-C logits, including background class zero, required')
shifted = z-z.max(axis=1,keepdims=True)
return shifted-np.log(np.exp(shifted).sum(axis=1,keepdims=True))
def prepare(priors, truth, target_classes, logits, neg_ratio=3):
"""Freeze matches and hard-negative selection; default thresholds .5, no ignored boxes."""
d,g = boxes(priors),boxes(truth)
classes = np.asarray(target_classes)
lp = log_probabilities(logits)
if lp.shape[0] != len(d) or classes.shape != (len(g),):
raise ValueError('target/class or prior/logit count mismatch')
if len(classes) and (classes.dtype.kind not in 'iu' or (classes < 1).any() or (classes >= lp.shape[1]).any()):
raise ValueError('target classes must be foreground integer indices')
if type(neg_ratio) is not int or neg_ratio < 0:
raise ValueError('nonnegative integer negative-to-positive ratio required')
assigned,quality = match(d,g)
positive = np.flatnonzero(assigned >= 0)
candidates = np.flatnonzero((assigned < 0) & (quality < .5))
# Larger background cross-entropy first; stable ties retain prior order.
order = np.argsort(lp[candidates,0],kind='stable')
negative = candidates[order[:neg_ratio*len(positive)]]
labels = np.zeros(len(d),dtype=int)
labels[positive] = classes[assigned[positive]].astype(int)
targets = np.zeros((len(d),4))
targets[positive] = encode(d[positive],g[assigned[positive]])
return {'positive':positive,'negative':negative,'labels':labels,'targets':targets}
def objective(offsets, logits, plan, alpha=1.):
"""Sum selected cross-entropy and positive Smooth L1, divided by positive count."""
l = np.asarray(offsets,float)
lp = log_probabilities(logits)
if l.shape != (len(lp),4) or not np.isfinite(l).all() or not np.isfinite(alpha) or alpha < 0:
raise ValueError('finite offsets and nonnegative localization weight required')
pos,neg = plan['positive'],plan['negative']
dl,dz = np.zeros_like(l),np.zeros_like(lp)
n = len(pos)
if n == 0:
return 0.,{'classification':0.,'localization':0.},dl,dz
selected = np.r_[pos,neg]
labels = plan['labels'][selected]
classification = -lp[selected,labels].sum()/n
dz[selected] = np.exp(lp[selected])/n
dz[selected,labels] -= 1/n
error = l[pos]-plan['targets'][pos]
magnitude = np.abs(error)
a = np.minimum(magnitude,1.)
localization = alpha*np.sum(.5*a*a+(magnitude-a))/n
dl[pos] = alpha*np.clip(error,-1,1)/n
parts = {'classification':float(classification),'localization':float(localization)}
return float(classification+localization),parts,dl,dz
def conv3x3(feature, kernel, bias):
"""HWC input; 3x3xCxO kernels, stride one and zero padding."""
x,w,b = np.asarray(feature,float),np.asarray(kernel,float),np.asarray(bias,float)
if x.ndim != 3 or min(x.shape) < 1 or w.ndim != 4 or w.shape[:3] != (3,3,x.shape[2]) or b.shape != (w.shape[3],):
raise ValueError('incompatible convolution shapes')
if not all(np.isfinite(a).all() for a in [x,w,b]):
raise ValueError('finite convolution inputs required')
padded = np.pad(x,((1,1),(1,1),(0,0)))
output = np.empty((*x.shape[:2],len(b)))
for row,col in np.ndindex(x.shape[:2]):
patch = padded[row:row+3,col:col+3]
output[row,col] = np.einsum('ijc,ijco->o',patch,w)+b
return output
def conv_parameter_gradient(feature, output_gradient):
"""Gradient for kernel and bias, holding the provided feature map fixed."""
x,dy = np.asarray(feature,float),np.asarray(output_gradient,float)
if x.ndim != 3 or dy.ndim != 3 or x.shape[:2] != dy.shape[:2]:
raise ValueError('feature/output-gradient grids must match')
padded = np.pad(x,((1,1),(1,1),(0,0)))
dw = np.zeros((3,3,x.shape[2],dy.shape[2]))
for row,col in np.ndindex(x.shape[:2]):
patch = padded[row:row+3,col:col+3]
dw += np.einsum('ijc,o->ijco',patch,dy[row,col])
return dw,dy.sum(axis=(0,1))
if __name__ == '__main__':
rng = np.random.default_rng(17)
features = [np.arange(4.).reshape(2,2,1)/4,np.ones((1,1,1))*.5]
priors = np.concatenate([default_grid(2,.2,.5,(2.,)),default_grid(1,.6,.9,(2.,))])
anchors,classes = 4,3 # three classes include background
kernels = [rng.normal(0,.02,(3,3,1,anchors*(4+classes))) for _ in features]
biases = [np.zeros(anchors*(4+classes)) for _ in features]
def forward():
raw = [conv3x3(x,w,b).reshape(-1,4+classes) for x,w,b in zip(features,kernels,biases)]
joined = np.concatenate(raw)
return joined[:,:4],joined[:,4:]
offsets,logits = forward()
truth = priors[[0]].copy()
plan = prepare(priors,truth,[1],logits)
value,parts,dl,dz = objective(offsets,logits,plan)
gradient = np.concatenate([dl,dz],axis=1)
cursor = 0
for i,x in enumerate(features):
count = x.shape[0]*x.shape[1]*anchors
dy = gradient[cursor:cursor+count].reshape(*x.shape[:2],-1)
dw,db = conv_parameter_gradient(x,dy)
kernels[i] -= .01*dw
biases[i] -= .01*db
cursor += count
print('priors:',len(priors),'positive:',plan['positive'].tolist(),'negative:',plan['negative'].tolist())
print('loss parts:',{k:round(v,6) for k,v in parts.items()})
print('fixed-plan loss:',round(value,6),'->',round(objective(*forward(),plan)[0],6))
print('first decoded box:',np.round(decode(priors,offsets)[0],6).tolist())
Python 3.12、NumPy 1.26.4环境实际输出:
priors: 20 positive: [0, 2, 3] negative: [15, 18, 1, 4, 14, 5, 9, 17, 11]
loss parts: {'classification': 4.404802, 'localization': 1.646181}
fixed-plan loss: 6.050983 -> 6.022782
first decoded box: [0.150183, 0.149552, 0.349627, 0.350073]
每个打包输出先放四个偏移,再放C个类别logit。把定位与分类输出通道合并进一个线性卷积,等价于采用相应权重的两个独立卷积,但这个数组布局不是Caffe二进制格式。展平顺序依次为特征图、行、列、默认框。测试用独立有限差分核对小损失的每个输出,以及卷积核和偏置梯度。原始预测头布局
对P个默认框、G个目标,完整IoU表耗费O(PG)计算与存储。本例直接反复扫描的贪心匹配耗时O(PG min(P,G)),旨在展示规则,没有针对大图优化。负例排序耗时O(P log P),损失计算为O(PC)。输入F通道、输出Q通道的3×3头耗时O(9HWFQ),参数梯度计算同阶;这些成本不含CNN主干和推理NMS。
多个正框仍可能漏掉一个目标
默认框形状与特征分辨率决定哪些目标能得到有效监督。匹配反例说明,候选覆盖与分配规则必须一起检查。小目标、拥挤场景和特殊宽高比可能压迫系统的不同环节;改变负例比例本身无法恢复缺失的空间细节。
论文还在训练中使用图像裁块与光度变化。其裁块流程在目标中心位于所选图块内时,保留真实框的可见部分,随后缩放并可能水平翻转。变换会同时改变像素与目标几何。它们属于训练方法,但本例的给定特征实验并未实现这些操作。数据增强
困难负例挖掘把计算集中到难判的背景预测,不替代干净标签,也不意味着应在训练图像上报告评测。多个框仍可能同时对同一个目标打高分,因此SSD推理仍使用NMS。比较方法时要统一输入分辨率、数据划分、IoU指标、硬件与计时范围;框数公式或梯度检查成功都不能证明检测精度。模型推理、目标检测评测
应用代码还需特别留意空目标约定。本例按所选损失与挖掘流程,对没有正匹配的图像给出零训练信号;不能假设所有框架的SSD变体都采用同一个选择,也不能把它移植到DETR。
检查数量、几何与监督
1. 数清完整输出
六层的格子与默认框数分别为38²×4、19²×6、10²×6、5²×6、3²×4、1²×4。20个前景类别时,共多少框、多少输出标量?这些是否为参数数量?
答案:合计8,732个框。加上背景,C=21,输出8,732×25=218,300个标量。卷积让空间位置共享参数,因此不能把这些数当成参数量。
2. 用正确的数量决定负例预算
一个目标匹配到三个默认框,另有14个合格的未匹配默认框。负正比3:1时选择多少负例,损失总和由什么归一化?
答案:选择九个负例,分类与定位损失合计后除以N=3个正默认框。除以一个真实目标或十二个选中行都会改变目标函数。
3. 找出漏掉的目标
使用前面的2×2 IoU表。为什么存在覆盖两个目标的一对一分配,固定贪心加阈值流程却可能漏掉目标1?
答案:首个同分将默认框0给了目标0;默认框1与剩余目标没有重叠,不重复配对阶段结束。之后它以0.5通过目标0的阈值,目标1仍未覆盖。交换首次分配便可覆盖两个目标,但贪心局部选择没有优化这个全局条件。
4. 逆转带缩放的偏移
默认框x中心为0.2、宽度0.2,真实中心为0.3、宽度0.4。=0.1、=0.2时,x与宽度的目标偏移是多少,怎样解码?
答案:=5,=ln 2/0.2,约为3.465736。解码得到0.2+0.1×5×0.2=0.3,以及。漏掉缩放系数,就会把相同的存储输出解释成另一组框。
把匹配规则与配置一起读
先读论文中的设计问题和显式目标,再到所选配置与实现中核对中心步长、缩放系数、阈值等号、忽略框和空样本。这些细节会决定训练标签和梯度,不是无关紧要的格式选择。
从初版YOLO、SSD到集合预测检测器,变化不只是“框更多”。类别怎样表示、目标怎样获得监督、推理怎样处理重复候选,都在改变。本章的矩形反例和独立导数检查提供了阅读下一篇论文的具体问题,但不替代完整论文导读或已训练模型的复现。
先判断,再看解释
一张图只有一个真实目标,却有三个正匹配默认框。符合条件的负例充足、负正比3:1时,最多选择多少负例?
学习目标
- 从固定配置生成多尺度默认框,推导类别与偏移输出数量。
- 区分贪心匹配、阈值正例与困难负例挖掘,处理冲突和空目标情形。
- 求归一化MultiBox损失的梯度,并在给定特征上训练小卷积检测头。
先修与延伸
查看知识关联图 →参考文献
- SSD: Single Shot MultiBox Detector — arXiv v5 method
Wei Liu; Dragomir Anguelov; Dumitru Erhan; Christian Szegedy; Scott Reed; Cheng-Yang Fu; Alexander C. Berg · 2016 - Caffe SSD box utilities — fixed matching and coordinate encoding
Wei Liu and Caffe contributors · 2021 - SSD Pascal configuration at a fixed author-repository commit
Wei Liu and Caffe contributors · 2021 - Caffe SSD PriorBoxLayer — center steps and default-box order
Wei Liu and Caffe contributors · 2021 - Caffe SSD CreateMultiBoxHead — prediction layers and layout
Wei Liu and Caffe contributors · 2021 - Caffe SSD MultiBoxLossLayer — selected examples and normalization
Wei Liu and Caffe contributors · 2021 - SSD arXiv version history — first preprint and later revisions
arXiv; Wei Liu and coauthors · 2015
版本1 · 编写状态: 已完成记录中的技术复核
查看技术检查记录(AI)
Codex · 2026-09-07 · Codex single-AI-author technical check: bounded SSD v5 method, fixed author-repository configuration/code, literal box geometry, independent loss/kernel finite differences and complete bilingual comparison. Not independent human review, full-backbone training or benchmark reproduction.
- 核对8732默认框与固定中心步长、字面/随机框还原、几何贪心匹配反例、阈值、零重叠排除、负例预算/排序、手算损失、全部输出有限差分、卷积参数有限差分、空目标、小Smooth L1残差和完整小头权重更新;十四项计算加一项双语结构检查。
- 对照完整双语论证、六组展示公式、程序、固定配置与论文一般尺度的区别、正匹配框归一化、四组答案及七项引用;按质量标准核查,不将来源读取改称完整训练或独立审查。
- 目视检查后,将正式双语中的明确行内变量与短公式排成数学形式,展示公式、代码和数值不变,保留原冻结稿。
核对的来源位置:
- SSD: Single Shot MultiBox Detector — arXiv v5 method · Read physical pages 2–6, sections 2.1–2.2; pages 5–6 matching/loss/scale equations visually checked. Version dated 29 December 2016; no benchmark claims adopted.
- Caffe SSD box utilities — fixed matching and coordinate encoding · Read MatchBBox, mining eligibility/selection excerpts, and CENTER_SIZE EncodeBBox. Greedy distinct pairs, overlaps above 1e-6, inclusive per-prediction threshold, fixed scaling and negative selection; not a global Hungarian solver. No code copied or executed.
- SSD Pascal configuration at a fixed author-repository commit · Read lines 262–332 and head call parameters: 21 classes including background, MAX_NEGATIVE, 3:1, fixed steps/sizes/ratios, shared localization, normalization and variance values. The configuration is not the paper general scale illustration.
- Caffe SSD PriorBoxLayer — center steps and default-box order · Read setup and CPU forward: reciprocal ratios, square and geometric-mean square before ratio boxes, step/offset centers and optional clipping. Local program uses one min/max pair and square images; not every Caffe option.
- Caffe SSD CreateMultiBoxHead — prediction layers and layout · Read CreateMultiBoxHead prediction/reshape/concat block around lines 850–930. Separate linear localization/class convolutions are permuted to spatial-first layout; the original local example packs their channels together equivalently.
- Caffe SSD MultiBoxLossLayer — selected examples and normalization · Read CPU forward lines 146–252: matching, mining, positive localization, selected confidence samples and shared normalizer calls. Full backward and all loss configurations not audited.
- SSD arXiv version history — first preprint and later revisions · Read title/authors and submission history: v1 on 8 December 2015 and v5 on 29 December 2016. Used for chronology, not mutable abstract benchmark comparison.
相关主题