Skip to main content

Real-Time Traffic Counter Using Mobile Devices


Automatic traffic counting and classification (ATCC) is a salient step in many applications such as accessing the contribution of traffic to air pollution for clean air strategies and computing the passenger car unit (PCU) for urban road infrastructure planning and management. This work focuses on developing an ATCC system that is low cost, privacy-preserving, and auditable using state-of-the-art AI technology on mobile phones. The camera unit and the GPU compute available within a mobile phone are used to capture the video feed and run the required analytics for detection, tracking and counting in real time. On the target device, we have been able to achieve 12 FPS. On the test data composed of four videos, the solution achieved a counting precision and recall of 0.96 ± 0.02 and 0.86 ± 0.03, respectively.

This is a preview of subscription content, access via your institution.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6


  • Abadi M, Barham P, Chen J, Chen Z, Davis A, Dean J, Devin M, Ghemawat S, Irving G, Isard M, Kudlur M (2016) Tensorflow: a system for large-scale machine learning. In: 12th USENIX symposium on operating systems design and implementation (OSDI 16), pp 265–283

  • Barnich O, Van Droogenbroeck M (2010) Vibe: A universal background subtraction algorithm for video sequences. IEEE Trans Image Process 20(6):1709–1724

  • Bautista CM, Dy CA, Mañalac MI, Orbe RA, Cordel M (2016) Convolutional neural network for vehicle detection in low resolution traffic videos. In: Region 10 Symposium (TENSYMP), 2016 IEEE. IEEE, pp 277–281

  • Bewley A, Ge Z, Ott L, Ramos F, Upcroft B (2016) Simple online and realtime tracking. In: 2016 IEEE International Conference on Image Processing (ICIP). IEEE, pp 3464–3468

  • Chen T, Li M, Li Y, Lin M, Wang N, Wang M, Xiao T, Xu B, Zhang C, Zhang Z (2015) Mxnet: a flexible and efficient machine learning library for heterogeneous distributed systems. arXiv:1512.01274

  • Chollet F (2017) Xception: Deep learning with depthwise separable convolutions. In: Proceedings of the IEEE conference on computer vision and pattern recognition, pp 1251–1258

  • Dalal N, Triggs B (2005) Histograms of oriented gradients for human detection. In: 2005 IEEE computer society conference on computer vision and pattern recognition (CVPR′05), vol 1. IEEE, pp 886–893

  • Devi RB, Chanu YJ, Singh KM (2016) A survey on different background subtraction method for moving object detection. Int J Res Emerg Sci Technol 3(10)

  • Fan Q, Brown L, Smith J (2016) A closer look at faster R-CNN for vehicle detection. In: 2016 IEEE Intelligent Vehicles Symposium (IV). IEEE, pp 124–129

  • Feng X, Jiang Y, Yang X, Du M, Li X (2019) Computer vision algorithms and hardware implementations: a survey. Integration 69:309–320

  • Google-Developers (2020).

  • Hardjono B, Tjahyadi H, Rhizma MG, Widjaja AE, Kondorura R, Halim AM (2018) Vehicle counting quantitative comparison using background subtraction, viola jones and deep learning methods. In: 2018 IEEE 9th Annual information technology, electronics and mobile communication conference (IEMCON). IEEE, pp 556–562

  • Henriques JF, Caseiro R, Martins P, Batista J (2014) High-speed tracking with kernelized correlation filters. IEEE Trans Pattern Anal Mach Intell 37(3):583–596

  • Howard AG, Zhu M, Chen B, Kalenichenko D, Wang W, Weyand T, Andreetto M, Adam H (2017) Mobilenets: efficient convolutional neural networks for mobile vision applications. arXiv:1704.04861

  • Howard A, Sandler M, Chu G, Chen LC, Chen B, Tan M, Wang W, Zhu Y, Pang R, Vasudevan V, Le QV (2019) Searching for mobilenetv3. In: Proceedings of the IEEE international conference on computer vision, pp 1314–1324

  • Jeeva S, Sivabalakrishnan M (2015) Survey on background modeling and foreground detection for real time video surveillance. Proc Comput Sci 50:566–571

    Article  Google Scholar 

  • Jia Y, Shelhamer E, Donahue J, Karayev S, Long J, Girshick R, Guadarrama S, Darrell T (2014) Caffe: Convolutional architecture for fast feature embedding. In: Proceedings of the 22nd ACM international conference on Multimedia, pp 675–678

  • Kingma DP, Ba J (2014) Adam: a method for stochastic optimization. arXiv:1412.6980

  • Krizhevsky A, Sutskever I, Hinton GE (2012) Imagenet classification with deep convolutional neural networks. Adv Neural Inf Proc Syst 25:1097–105

  • Lee J, Chirkov N, Ignasheva E, Pisarchyk Y, Shieh M, Riccardi F, Sarokin R, Kulik A, Grundmann M (2019) On-device neural net inference with mobile gpus. arXiv:1907.01989

  • Liu W, Wang Z, Liu X, Zeng N, Liu Y, Alsaadi FE (2017) A survey of deep neural network architectures and their applications. Neurocomputing 234:11–26

    Article  Google Scholar 

  • Liu W, Anguelov D, Erhan D, Szegedy C, Reed S, Fu CY, Berg AC (2016) Ssd: Single shot multibox detector. In: European conference on computer vision. Springer, Cham, pp 21–37

  • Onoro-Rubio D, López-Sastre RJ (2016) Towards perspective-free object counting with deep learning. European conference on computer vision. Springer, New York, pp 615–629

    Google Scholar 

  • Paszke A, Gross S, Massa F, Lerer A, Bradbury J, Chanan G, Killeen T, Lin Z, Gimelshein N, Antiga L, Desmaison A (2019) Pytorch: an imperative style, high-performance deep learning library. arXiv:1912.01703

  • Piccardi M (2004) Background subtraction techniques: a review. In: 2004 IEEE International Conference on Systems, Man and Cybernetics (IEEE Cat. No. 04CH37583), vol 4. IEEE, pp 3099–3104

  • Redmon J, Divvala S, Girshick R, Farhadi A (2016) You only look once: Unified, real-time object detection. In: Proceedings of the IEEE conference on computer vision and pattern recognition, pp 779–788

  • Redmon J, Farhadi A (2018) Yolov3: an incremental improvement. arXiv:1804.02767

  • Ren S, He K, Girshick R, Sun J (2016) Faster R-CNN: towards real-time object detection with region proposal networks. IEEE Trans Pattern Anal Mach Intell 39(6):1137–1149

  • Russakovsky O, Deng J, Su H, Krause J, Satheesh S, Ma S, Huang Z, Karpathy A, Khosla A, Bernstein M et al (2015) Imagenet large scale visual recognition challenge. Int J Comput Vision 115(3):211–252

    MathSciNet  Article  Google Scholar 

  • Shi J (1994) Good features to track. In: 1994 Proceedings of IEEE conference on computer vision and pattern recognition. IEEE, pp 593–600

  • Stauffer C, Grimson WEL (1999) Adaptive background mixture models for real-time tracking. In: Proceedings. 1999 IEEE computer society conference on computer vision and pattern recognition (Cat. No PR00149), vol 2. IEEE, pp 246–252

  • Sturgess P, Alahari K, Ladicky L, Torr PH (2009) Combining appearance and structure from motion features for road scene understanding. In: BMVC 2012-23rd british machine vision conference, BMVA

  • Viola P, Jones M (2001) Rapid object detection using a boosted cascade of simple features. In: Proceedings of the 2001 IEEE computer society conference on computer vision and pattern recognition. CVPR 2001, vol 1. IEEE

  • Wojke N, Bewley A, Paulus D (2017) Simple online and realtime tracking with a deep association metric. In: 2017 IEEE international conference on image processing (ICIP). IEEE, pp 3645–3649

  • Xiang X, Zhai M, Lv N, El Saddik A (2018) Vehicle counting based on vehicle detection and tracking from aerial videos. Sensors 18(8):2560

    Article  Google Scholar 

  • Yeshwanth C, Sooraj PA Sudhakaran V, Raveendran V (2017) Estimation of intersection traffic density on decentralized architectures with deep networks. In: 2017 International smart cities conference (ISC2). IEEE, pp 1–6

  • Zhang X, Wang Y, Shi W (2018) pcamp: Performance comparison of machine learning packages on the edges. In: USENIX workshop on hot topics in edge computing (HotEdge 18)

Download references

Author information

Authors and Affiliations


Corresponding author

Correspondence to Varghese Kollerathu.

Ethics declarations

Conflict of Interest

Arun Sooraj P S, Varghese Alex Kollerathu and Vinay Sudharkaran declare that they have no conflict of interest.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Sooraj, P.S.A., Kollerathu, V. & Sudhakaran, V. Real-Time Traffic Counter Using Mobile Devices. J. Big Data Anal. Transp. 3, 109–118 (2021).

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI:


  • Deep learning on mobile devices
  • MobileNetSSDLite V3
  • Traffic counter
  • Vehicle detection
  • Clean air strategies