Skip to content

Commit e8027dc

Browse files
authored
Update README.md
1 parent 6d9dfe9 commit e8027dc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ To write down code for these two models, you first need to know how to write dow
2222
<img src="https://github.com/SKKU-AutoLab-VSW/TaillightPipeline/blob/main/vggRRC-vs-resnetRRC.png">
2323
</p>
2424

25-
The VGG-RRC is the previously proposed model that uses a pre-initialized reduced VGG16 base net, and ResNet-RRC is the proposed model of this paper that uses a pre-initialized ResNet18 base net. The remaining layers are the same. Although conv4_3, FC7, and FC7_pool of the reduced VGG16 are nonexistent names in terms of the ResNet18 layers, in the VGG16, conv4_3 is the second-last convolution layer and FC7 is the layer right after the last layer, excluding pooling layer. Plus, the rest of the layers were newly appended. Judging from this, we hypothesized that such pattern can be similarly applied for the ResNet18 by binding additional feature maps on Res4b and Res5b. This results in a pre-trained layer set without any fully-connected layers before the RRC rolling layers.
25+
The VGG-RRC is the previously proposed model that uses a pre-initialized VGG16 base net. The VGG-RRC is written using Caffe framework (https://github.com/xiaohaoChen/rrc_detection). ResNet-RRC, on the other hand, uses a pre-initialized ResNet18 base net. The remaining layers of ResNet-RRC are the same as those of VGG-RRC.
26+
27+
The connection pattern between base layers and rolling layers of ResnNet-RRC can be found out by analyzing such connection pattern of VGG-RRC. In the VGG16 base net part of the VGG-RRC, conv4_3 is the final convolution layer of the second-last convolutional block, and fc7 is the second-last non-pooling layer of all VGG16 layers. conv4_3 is connected to conv4_3r, the first rolling layer, and fc7 is connected to fc7r, the second rolling layer. Here, fc7_relu which is the layer that performs ReLU activation on the output of fc7 is branched out and connected to conv6_1, the first intermediate layer. From this, we can infer that res4b, res5b, and res5b_relu can be used for connection. res4b is connected to conv4_3r since it is the final convolution layer of the second-last convolutional block, and res5b is connected to fc7r since it is the second-last non-pooling layer of all Resnet18 layers. res5b_relu is the layer that performs ReLU activation on the output of res5b, so it is branched out and connected to conv6_1, the first intermediate layer.
2628

2729
The most intuitive way to write down code for Resnet-RRC is to first refer to the VGG-RRC git repository (https://github.com/xiaohaoChen/rrc_detection), which uses Caffe framework with user-defined layers. After cloning the git repository and using it as the workspace, we need to modify it so that it constructs and trains Resnet-RRC instead of VGG-RRC. Here, `examples/car/rrc_kitti_car.py` constructs the VGG-RRC for training. It has multiple occurrences of `VGGNetBody()` which instantiates VGG16 base layers. We can replace these function calls to `ResnetBody()` so that it instantiates Resnet18 base layers instead. Note that `ResnetBody()` needs to be defined in `python/caffe/model_libs.py` of the cloned git repository. Then, we need to modify `AddExtraLayers()` function, defined in `examples/car/rrc_kitti_car.py`, so that it appends the proper intermediate and rolling layers to Resnet18. Pre-trained weights of Resnet18 can also be downloaded as well (https://github.com/HolmesShuan/ResNet-18-Caffemodel-on-ImageNet). To use the pre-trained model, line 107 of `examples/car/rrc_kitti_car.py` needs to be modified so that it points to the correct pathname of the pre-trained Resnet18. After the source code modification is finished, the instructions on the VGG-RRC git repository web page can be followed to compile the Caffe source, prepare datasets, build the Resnet-RRC, and then train or test the Resnet-RRC.
2830

0 commit comments

Comments
 (0)