-
文中实验均在Cityscapes数据集和Foggy Cityscapes数据集上进行。Cityscapes数据集是一个街道场景的图像数据集,包含2975张训练集图像以及500张验证集图像,图像的分辨率均为2048×1024 pixel,该数据集包含物体的分割标注。为了适应目标检测任务,文中对图像分割标注中每一个连通域物体取外接矩形作为检测的标注框。
Foggy Cityscapes是基于Cityscapes构建的数据集,该数据集使用Cityscapes提供的景深信息模拟了3种不同级别的雾霾天气,模拟的过程可参考原论文。该数据集包含8895张训练集图像以及1500张验证图像,即Cityscapes中每张图像对应3种不同浓度的有雾霾图像。
文中算法代码基于PyTorch[24]编写。在第1阶段无监督图像转换阶段,网络中
$\mathcal{B}$ 模块的个数n为24,Cityscapes数据集中的无雾图像以原图尺寸(2048×1024)作为输入,经过DCT预处理后变为尺寸为256×128×64的系数特征。经过生成网络${G_{c \to h}}( \cdot )$ 后,得到有雾图像的DCT系数特征${F_{c \to h}}$ 。Foggy Cityscapes数据集中的图像也作了相同的DCT预处理,以无监督的方式交替优化生成器$ G( \cdot )\left\{ {{G_{c \to h}}( \cdot ),{G_{h \to c}}( \cdot )} \right\} $ 和鉴别器$D( \cdot )$ 。使用Adam优化器训练100代,学习率固定为$2 \times {10^{ - 4}}$ 。在第2阶段中间域到目标域的领域自适应阶段,目标检测使用Faster RCNN网络。原始的Faster RCNN通常是将RGB图像缩放为短边为600,长边不超过1000的图像。在文中的方法中,目标域的图像从Foggy Cityscapes数据集采样,使用原始图像作为输入(2048×1024),经过颜色和亮度增强、随机翻折数据增强后,转换到YCbCr空间并分块作离散余弦变换后每个块内选取64个系数,最终得到
$150 \times 250 \times 64$ 的系数特征。而中间域图像由无雾图像转换得到的有雾的DCT系数特征直接作为输入。预先计算了所有训练集图像的DCT系数的均值和方差,并对输入的DCT特征作标准化处理。 使用随机梯度下降(Stochastic Gradient Descent,SGD)算法训练,共训练12代,第1代为学习率预热(warmup),学习率为$1 \times {10^{ - 4}}$ ,第2代开始学习率调整为$1 \times {10^{ - 3}}$ ,在第8代和第11代进行学习率衰减,学习率分别变为原来的1/10。由于输入的DCT特征尺寸较小,本位将锚框面积尺寸调整为{1282, 642, 322, 162, 82},以适应目标物体大小的变化,锚框的长宽比仍然是{1:1, 1:2, 2:1}不变。 -
为了可视化无监督图像转换
${G_{c \to h}}( \cdot )$ 的效果,文中对转换网络${G_{c \to h}}( \cdot )$ 输出的系数${F_{c \to h}}$ 作了逆离散余弦变换(Inverse Discrete Cosine Transform,IDCT),结果如图4所示,从图中可以看出,频域内的无监督图像转换能够将清晰图像进行加雾渲染生成有雾图像,转换后的图像具有目标域特性。同时,文中也与空域中的算法CycleGAN[1]作了对比。为了公平起见,将文中提出的频域内的无监督转换与CycleGAN使用相同的骨干网络训练相同的代数,并控制模型所需运算量GFLOPS相同。文中算法使用原图尺寸作为输入,经过DCT预处理后变为256×128×64的DCT系数特征,CycleGAN将输入图像降采样到256×128×3,通过一层
$3 \to 64$ 通道的卷积层得到256×128×64的特征。图4中可视化了在RGB空间进行无监督图像转换的结果。 为了进行细节的对比,在图像下方可视化了局部细节放大后的结果。从图中可以看出,在相同的计算资源条件下,在频域内做图像转换能够生成细节信息更为清晰的有雾图像,对后续的目标检测任务更为有利,而RGB颜色空间的降采样操作造成了明显的信息损失,存在图像局部信息模糊的情况,见图(c)下方的局部细节放大图。 -
文中将提出的频域内领域自适应方法与具有代表性的三种领域自适应方法[15-17]作了比较,并以IoU为0.5报告了物体平均精确率的均值(mean Average Precision,mAP),结果如表1所示。
在所有对比方法中,训练集由Cityscapes中有检测标注的训练图像(晴朗天气)以及没有标注的Foggy Cityscapes中的训练图像(雾霾天气)构成。
Method Bus Bicycle Car Motor Person Rider Train Truck mAP(@.5) Cityscapes only 31.3% 33.8% 47.7% 20.2% 34.9% 40.5% 12.5% 17.8% 29.8% MDA[15] 41.8% 36.5% 44.8% 30.5% 33.2% 44.2% 28.7% 28.2% 36.0% PDA[16] 44.4% 35.9% 54.4% 29.1% 36.0% 45.5% 25.8% 24.3% 36.9% CFF[17] 43.2% 37.4% 52.1% 34.7% 34.0% 46.9% 29.9% 30.8% 38.6% Proposed algorithms 48.1% 42.7% 61.9% 32.1% 43.1% 49.1% 17.7% 25.4% 39.9% Table 1. Object detection results of different domain adaptation algorithms on Cityscapes → Foggy Cityscapes datasets
测试图像均来源于Foggy Cityscapes提供的验证集(雾霾天气)。表1中,MDA[15](Multi-level Domain Adaptation)、PDA[16](Progressive Domain Adaptation),CFF[17](Coarse-to-Fine Feature adaptation)是对比的3种领域自适应算法,数据引自参考文献[17]。“Cityscapes Only”表示仅用源域图像图像训练,在有雾的测试集上进行测试的结果,检测结果如图5所示,仅用源域图像训练难以检测出雾霾中的目标,mAP仅为29.8%,证实了源域和目标域之间的差异。与仅用有标注的无雾图训练相比,文中提出的算法由于采用了两阶段的领域自适应方法,利用频域能量集中的特性,提高了输入特征的信息利用率,避免了降采样带来的信息损失,将mAP值由29.8%提升到39.9%,mAP值提高了33.9%左右,在4种对比算法中排名第一。证明了这两种策略能有效降低不同域之间差异,提高目标检测任务泛化性能。
为了评价文中提出算法两个阶段的有效性,文中采用消融实验的方式,分别移除领域自适应阶段和无监督图像转换阶段,并评价了单个阶段目标检测的效果,结果如表2所示。从表中可以看出,与仅用Cityscapes训练相比,无监督转换方式和领域自适应方式mAP均有所提高,但都小于完整的两阶段算法,说明文中算法两个阶段的有效性和必要性,能够显著增强模型在无标注领域的泛化能力。
Algorithm Bus Bicycle Car Motor Person Rider Train Truck mAP(@.5) Cityscapes only 31.3% 33.8% 47.7% 20.2% 34.9% 40.5% 12.5% 17.8% 29.8% Ours w/o stage 2 39.3% 38.5% 63.3% 28.0% 39.6% 42.4% 15.7% 23.6% 36.3% Ours w/o stage 1 41.3% 39.0% 58.4% 28.6% 42.4% 44.7% 10.7% 23.6% 36.1% Full model 48.1% 42.7% 61.9% 32.1% 43.1% 49.1% 17.7% 25.4% 39.9% Table 2. Results of the ablation experiments corresponding to the two stages of the proposed algorithm
Domain adaptation for object detection in the frequency domain
doi: 10.3788/IRLA20210638
- Received Date: 2022-01-20
- Rev Recd Date: 2022-03-15
- Publish Date: 2022-08-05
-
Key words:
- domain adaptation /
- object detection /
- image translation /
- frequency domain
Abstract: Deep learning-based object detection technology has recently made significant progress and has a wide range of applications in robotics, autonomous driving, traffic surveillance, etc. However, due to the distribution discrepancy between the training and testing datasets, the off-the-shelf detectors pre-trained using the data in a specific domain often show apparent performance degradation when applied in wild scenarios. To address this problem, a domain adaptation method for object detection in the frequency domain is proposed. In light of the energy concentration property of the discrete cosine transform, the proposed algorithm conducts domain adaptation for object detection by processing only a few of the most significant frequency coefficients, which reduces memory and computing resource consumption and alleviates the domain shift problem. The proposed method consists of two stages. In the first stage, it translates annotated training data from the source domain to the target domain using unsupervised image-to-image translation. Adversarial domain adaptation is then applied to the object detection model to align the features of the translated data and the real data in the target domain. The experimental results of the object detection under different weather conditions show that the proposed method ranks first among the four testing algorithms. Compared with the object detection model trained with only source domain data, it can increase the mAP value by 33.9%.