# Transferability of a Convolutional Neural Network (CNN) to Measure Traffic Density

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Reviewing Our Previous Effort to Alleviate the Labeling Burden

## 3. Modeling Framework to Transfer a Trained CNN to Another Site

## 4. Testing for Varying Ambient Conditions of a Road Segment

## 5. Conclusions

## Author Contributions

## Funding

## Data Availability Statement

## Conflicts of Interest

## References

- Ryus, P.; Vandehey, M.; Elefteriadou, L.; Dowling, R.G.; Ostrom, B.K. Highway Capacity Manual 2010; Transportation Research Board: Washington, DC, USA, 2010. [Google Scholar]
- López, M.T.; Fernández-Caballero, A.; Mira, J.; Delgado, A.E.; Fernández, M.A. Algorithmic lateral inhibition method in dynamic and selective visual attention task: Application to moving objects detection and labeling. Expert. Syst. Appl.
**2006**, 31, 570–594. [Google Scholar] [CrossRef][Green Version] - López, M.T.; Fernández-Caballero, A.; Fernández, M.A.; Mira, J.; Delgado, A.E. Visual Surveillance by Dynamic Visual Attention Method. Pattern Recogn.
**2006**, 39, 2194–2211. [Google Scholar] [CrossRef][Green Version] - Ji, X.; Wei, Z.; Feng, Y. Effective vehicle detection technique for traffic surveillance systems. J. Vis. Commun. Image Represent.
**2006**, 17, 647–658. [Google Scholar] [CrossRef] - Zhou, J.; Gao, D.; Zhang, D. Moving vehicle detection for automatic traffic monitoring. IEEE Trans. Veh. Technol.
**2007**, 56, 51–59. [Google Scholar] [CrossRef][Green Version] - Niu, X. A semi-automatic framework for highway extraction and vehicle detection based on a geometric deformable model. ISPRS J. Photogramm. Remote Sens.
**2006**, 61, 170–186. [Google Scholar] [CrossRef] - Krizhevsky, A.; Sutskever, I.; Hinton, G.E. ImageNet classification with deep convolutional neural networks. Adv. Neural Inf. Process. Syst.
**2012**, 25, 1097–1105. [Google Scholar] [CrossRef] - Girshick, R.; Donahue, J.; Darrell, T.; Malik, J. Rich feature hierarchies for accurate object detection and semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Columbus, OH, USA, 23–28 June 2014; pp. 580–587. [Google Scholar]
- Girshick, R. Fast r-cnn. In Proceedings of the IEEE International Conference on Computer Vision, Santiago, Chile, 7–13 December 2015; pp. 1440–1448. [Google Scholar]
- Ren, S.; He, K.; Girshick, R.; Sun, J. Faster R-CNN: Towards real-time object detection with region proposal networks. IEEE Trans. Pattern Anal. Mach. Intell.
**2016**, 39, 1137–1149. [Google Scholar] [CrossRef] [PubMed][Green Version] - Redmon, J.; Divvala, S.; Girshick, R.; Farhadi, A. You only look once: Unified, real-time object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 779–788. [Google Scholar]
- Redmon, J.; Farhadi, A. Yolov3: An incremental improvement. arXiv
**2018**, arXiv:1804.02767. [Google Scholar] - Bochkovskiy, A.; Wang, C.Y.; Liao, H.Y.M. Yolov4: Optimal speed and accuracy of object detection. arXiv
**2020**, arXiv:2004.10934. [Google Scholar] - Messelodi, S.; Modena, C.M.; Zanin, M. A computer vision system for the detection and classification of vehicles at urban road intersections. Pattern Anal. Appl.
**2005**, 8, 17–31. [Google Scholar] [CrossRef] - Park, K.; Lee, D.; Park, Y. Video-based detection of street-parking violation. In Proceedings of the International Conference on Image Processing, Computer Vision, and Pattern Recognition (IPCV), Las Vegas, NV, USA, 25–28 June 2007; Volume 1, pp. 152–156. [Google Scholar]
- Sommer, L.W.; Schuchert, T.; Beyerer, J. Fast deep vehicle detection in aerial images. In Proceedings of the IEEE Winter Conference on Applications of Computer Vision (WACV), Santa Rosa, CA, USA, 24 March 2017; pp. 311–319. [Google Scholar]
- Wang, L.; Lu, Y.; Wang, H.; Zheng, Y.; Ye, H.; Xue, X. Evolving boxes for fast vehicle detection. In Proceedings of the IEEE International Conference on Multimedia and Expo, Hong Kong, China, 10–14 July 2017; pp. 1135–1140. [Google Scholar]
- Liu, W.; Anguelov, D.; Erhan, D.; Szegedy, C.; Reed, S.; Fu, C.Y.; Berg, A.C. Ssd: Single shot multibox detector. In Proceedings of the European Conference on Computer Vision, Amsterdam, The Netherlands, 8–16 October 2016; pp. 21–37. [Google Scholar]
- Zhou, X.; Wang, D.; Krähenbühl, P. Objects as points. arXiv
**2019**, arXiv:1904.07850. [Google Scholar] - Chung, J.; Sohn, K. Image-Based Learning to Measure Traffic Density Using a Deep Convolutional Neural Network. IEEE Trans. Intell. Transp. Syst.
**2018**, 19, 1670–1675. [Google Scholar] [CrossRef] - Lee, J.; Roh, S.; Shin, J.; Sohn, K. Image-based learning to measure the space mean speed on a stretch of road without the need to tag images with labels. Sensors
**2019**, 19, 1227. [Google Scholar] [CrossRef] [PubMed][Green Version] - Chen, K.; Gong, S.; Xiang, T.; Loy, C.C. Cumulative attribute space for age and crowd density estimation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Portland, OR, USA, 23–28 June 2013; pp. 2467–2474. [Google Scholar]
- Zhang, C.; Li, H.; Wang, X.; Yang, X. Cross-scene crowd counting via deep convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Boston, MA, USA, 7–12 June 2015; pp. 833–841. [Google Scholar]
- Goodfellow, I.; Pouget-Abadie, J.; Mirza, M.; Xu, B.; Warde-Farley, D.; Ozair, S.; Bengio, Y. Generative adversarial nets. In Proceedings of the Conference on Advances in Neural Information Processing Systems, Montreal, QC, Canada, 8–13 December 2014; pp. 2672–2680. [Google Scholar]
- Zhu, J.Y.; Park, T.; Isola, P.; Efros, A.A. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Proceedings of the IEEE International Conference on Computer Vision, Venice, Italy, 22–29 October 2017; pp. 2223–2232. [Google Scholar]

**Figure 1.**Conceptual explanation of space mean speed [21].

**Figure 5.**The original video snapshot (

**top**), the green approach to train the former CNN model (

**middle**), and the new yellow approach to test the transferability of the trained model (

**bottom**). The new approach is zero-padded.

**Figure 6.**Every data point has a variance and a bias. The bias can be removed using the nonlinear data transformation.

**Table 1.**Results of the naïve prediction for the new approach. RMSE, root mean square error; MAE, mean absolute error.

Test Result on the Original Road Segement (A) | Naïve Predict on New Road Segement (B) | |
---|---|---|

Plot | ||

Number of test data | 4632 | 100 |

%RMSE | 3.4920 | 90.283 |

MAE | 1.3427 | 13.586 |

Correlation coefficient | 0.995 | 0.967 |

**Table 2.**Comparison of data transformation and convolutional neural network (CNN) training for a new approach.

Nonlinear Transformation | CNN Finetuning | |
---|---|---|

Plot | ||

Number of test data | 100 | 100 |

%RMSE | 17.002 | 11.255 |

MAE | 2.125 | 1.271 |

Correlation coefficient | 0.970 | 0.991 |

Additional training time | 0.002 s | 554.477 s |

Reference case (Image of the previous road segment) | ||||

Test result | %RMSE | MAE | Corr. Coeff. | Additional training |

3.492 | 1.343 | 0.995 | 0.000 s | |

Case 1 (Baseline: original image of the newly chosen road segment) | ||||

%RMSE | MAE | Corr. Coeff. | Additional training | |

Naïve prediction (D) | 90.283 | 13.586 | 0.967 | 0.000 s |

Nonlinear data transformation (E) | 17.002 | 2.125 | 0.970 | 0.002 s |

CNN finetuning (F) | 11.255 | 1.271 | 0.991 | 554.477 s |

Case 2 (Downsized image) | ||||

%RMSE | MAE | Corr. Coeff. | Additional training | |

Naïve prediction (D) | 64.482 | 8.160 | 0.943 | 0.000 s |

Nonlinear data transformation (E) | 22.774 | 2.834 | 0.946 | 0.002 s |

CNN finetuning (F) | 10.995 | 1.279 | 0.989 | 600.439 s |

Case 3 (Upscaled image) | ||||

%RMSE | MAE | Corr. Coeff. | Additional training | |

Naïve prediction (D) | 37.056 | 4.383 | 0.972 | 0.000 s |

Nonlinear data transformation (E) | 15.984 | 2.071 | 0.975 | 0.003 s |

CNN finetuning (F) | 12.944 | 1.596 | 0.987 | 856.122 s |

Case 4 (Downsized and rotated image) | ||||

%RMSE | MAE | Corr. Coeff. | Additional training | |

Naïve prediction (D) | 33.038 | 4.355 | 0.951 | 0.000 s |

Nonlinear data transformation (E) | 21.249 | 2.672 | 0.953 | 0.001 s |

CNN finetuning (F) | 11.810 | 1.437 | 0.989 | 675.667 s |

Case 5 (Flipped image) | ||||

%RMSE | MAE | Corr. Coeff. | Additional training | |

Naïve prediction (D) | 95.239 | 13.998 | 0.937 | 0.000 s |

Nonlinear data transformation (E) | 22.228 | 2.668 | 0.949 | 0.003 s |

CNN finetuning (F) | 12.584 | 1.547 | 0.986 | 674.942 s |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Chung, J.; Kim, G.; Sohn, K. Transferability of a Convolutional Neural Network (CNN) to Measure Traffic Density. *Electronics* **2021**, *10*, 1189.
https://doi.org/10.3390/electronics10101189

**AMA Style**

Chung J, Kim G, Sohn K. Transferability of a Convolutional Neural Network (CNN) to Measure Traffic Density. *Electronics*. 2021; 10(10):1189.
https://doi.org/10.3390/electronics10101189

**Chicago/Turabian Style**

Chung, Jiyong, Gyeongjun Kim, and Keemin Sohn. 2021. "Transferability of a Convolutional Neural Network (CNN) to Measure Traffic Density" *Electronics* 10, no. 10: 1189.
https://doi.org/10.3390/electronics10101189