Submitted:
08 May 2025
Posted:
08 May 2025
You are already at the latest version
Abstract
Keywords:
1. Introduction
2. Related Work
3. Technical Background
3.1. YOLOv5 for Real-Time Object Detection
3.2. LIDAR for Spatial Mapping
3.3. PID Controller for Motor Control
3.4. LoRa-Based V2V and V2I Communication
3.5. Simultaneous Localization and Mapping (SLAM)
3.6. Neural Networks
3.7. Convolutional Neural Networks (CNNs)
3.8. Transfer Learning
4. Methodology
4.1. Integration of Components
4.2. Software Setup
4.3. Working Operation
- Start by moving the robot forward
-
Check for an obstacle using Ultrasonic
- (a)
- If no obstacle is detected, continue to move forward.
- (b)
- If an obstacle is detected, turn left and check for obstacle and, if the path is clear, start moving forward.
- (c)
- If an obstacle is detected, turn right and check for obstacle and, if the path is clear, start moving forward.
-
Check for an obstacle using LIDAR
- (a)
- If no obstacle is detected, continue to move forward.
- (b)
- If an obstacle is detected, the robot will plan the path according to the Slam.
-
Check for Traffic Light using Camera
- (a)
- If no Traffic light is detected the car moves forward.
- (b)
- If the Red light is active on the traffic light, The Vehicle comes to a stop.
- (c)
- If the Yellow light is active on the traffic light, The Vehicle slows down.
- (d)
- If the Green light is active on the traffic light, The Vehicle continues its forward motion.
- The process repeats until the robot navigates the path without encountering any obstacles.
4.4. Object Detection and Navigation
4.4.1. YOLOv5 Training and Optimization
4.4.2. Pathfinding and Collision Avoidance Techniques
4.4.3. Decision-Making for Movement and Interaction
5. System Architecture
5.1. Perception System Data Collection and Annotation
- Ultrasonic Sensors: Sense for an obstacle that are in its range to avoid by the vehicle.
- LIDAR: Generates very detailed 2D models of the surrounding environment.
- Camera with YOLOv5: Recognizes traffic lights, road signs, and other vehicles.
- Scenario Creation: Real-life junction scenarios were staged, and videos were recorded.
- Video to Frames Conversion: The recorded videos were converted into frames using a Python script, sampled at 5 frames per second (fps).
- Annotation: The frames were annotated using LabelImg software to label traffic lights, road signs, and other relevant objects [17].
5.2. Communication and Coordination
5.3. Dataset Collection and Annotation
- Red (class 0): Represented by traffic light only when the Red color is active.
- Yellow (class 1): Represented by traffic light only when the yellow color is active.
- Green (class 2): Represented by traffic light only when the Green color is active.
5.4. Training Process and Parameters
- Data Preprocessing: The images were preprocessed to meet the input requirements of the YOLOv5 architecture. The images were resized to 640 x 640.
- Model Configuration: The classes in the configuration file of YOLOv5 were modified to include our classes: Red, Yellow and Green. The path that points at the training folder and validation training folder were also replaced by path that points at our training and validation training folder.
- Learning Rate: The parameters were manually tuned in a way that helps to enhance the training performance and also to minimize over-fitted problem.
- Epochs: Optimal outcomes were achieved at an overall of ninety seven epochs.
- Training Setup: The training process was done.
5.5. Control Logic and Algorithms
Path-finding Algorithm
SLAM (Simultaneous Localization and Mapping)
Obstacle Detection and Avoidance
Motion Contro
6. Testing and Results
6.1. Testing Methodologies
- Test Scenarios: The ideas enumerated are explained through different scenarios of a comprehensive strategic planning and realization of changes considering several aspects.
- Testing Tools: Techniques and equipment used for testing were simulated on the computerized payroll software as well as other measurement instruments.
- Evaluation Metrics: Metrics are used to assess performance metrics including accuracy, response time and reliability.
Testing Environments
Testing Procedures
- Preparation: Necessary setup before testing included calibration of sensors and configuration of software.
- Execution: Testing involved executing specific steps and commands to evaluate system performance.
- Data Collection: Data was collected through logs and real-time monitoring.
Performance Metrics
- Precision: It answers the question “Out of all the instances that the model predicted as positive, how many were actually positive?”. High precision indicates that the model has a low false positive rate.
- Recall: It answers the question “Out of all the actual positive instances, how many did the model correctly identify?”. High recall indicates that the model has a low false negative rate.
- Training Box Loss: Training Box Loss refers to the error between the predicted bounding boxes and the actual ground-truth bounding boxes during the training process.
- Training Object Loss: Refers to the error or discrepancy between the predicted object scores (probabilities that a specific region contains an object) and the actual ground-truth labels (indicating whether the region contains an object or is just background) during the training process.
- Training Classification Loss: Refers to the error or discrepancy between the predicted class labels for objects within the bounding boxes and the actual ground-truth class labels during the training process.
- Validation Box Loss: Validation Box Loss refers to the error between the predicted bounding boxes and the actual ground-truth bounding boxes during the model testing on validation data.
- Validation Object Loss: Refers to the error or discrepancy between the predicted object scores (probabilities that a specific region contains an object) and the actual ground-truth labels (indicating whether the region contains an object or is just background) during the model testing on validation data.
- Validation Classification Loss: Refers to the error or discrepancy between the predicted class labels for objects within the bounding boxes and the actual ground-truth class labels during the model testing on validation data.
6.2. Results
7. Conclusions
- Effective Object Detection: The custom-trained YOLOv5 model successfully detected traffic-related objects, achieving high precision and recall. The model’s ability to classify traffic lights into Red, Yellow, and Green categories enhanced the robot’s capacity to interpret scenarios and contribute to smoother vehicular movement.
- Real-Time Performance: The robot demonstrated effective real-time autonomous operation. The integration of SLAM, ultrasonic sensors, and PID control enabled accurate object identification and obstacle avoidance. With YOLOv5’s fast and reliable object detection, the robot responded quickly and accurately to its surroundings.
- Challenges and Limitations: Some challenges included limited dataset size, hardware constraints, real-time processing limitations, and environmental variations. Addressing these factors will be vital for improving robustness and reliability in real-world applications.
Author Contributions
Funding
References
- Bai, W.; Zheng, Y.; Chen, Y.; Yang, S. Towards Autonomous Driving: Sensor Fusion for Self-Driving Cars. Sensors 2020, 20, 2775. [Google Scholar]
- Jamal, M.; Ullah, Z.; Naeem, M.; Abbas, M.; Coronato, A. A hybrid multi-agent reinforcement learning approach for spectrum sharing in vehicular networks. Future Internet 2024, 16, 152. [Google Scholar] [CrossRef]
- Organization, W.H. Global status report on road safety. https://www.who.int/publications/i/item/9789241565684, 2022. Accessed: 2025-04-12.
- Zhou, H.; Wang, J.; Wang, J. A Survey on Deep Learning-Based Traffic Signal Recognition: Challenges and Future Directions. IEEE Transactions on Intelligent Transportation Systems 2020, 22, 1642–1652. [Google Scholar]
- Gonzalez, J.; Smith, J. Object Detection with YOLOv5: A Practical Approach. Journal of Machine Learning Research 2021, 22, 1–13. [Google Scholar]
- Zyss, H. V2X Communication Toward a Zero-Accident Future. EE Times Europe 2023. [Google Scholar]
- European Telecommunications Standards Institute (ETSI). ETSI TR 103 439: V2X Standards for Road Safety and Smart Transport. Technical report, ETSI, 2022.
- Fiorino, M.; Naeem, M.; Ciampi, M.; Coronato, A. Defining a metric-driven approach for learning hazardous situations. Technologies 2024, 12, 103. [Google Scholar] [CrossRef]
- Naeem, M.; Coronato, A.; Ullah, Z.; Bashir, S.; Paragliola, G. Optimal User Scheduling in Multi-Antenna Systems Using Multi-Agent Reinforcement Learning. Sensors 2022, 22, 8278. [Google Scholar] [CrossRef] [PubMed]
- Naeem, M.; Bashir, S.; Ullah, Z.; Syed, A.A. A near optimal scheduling algorithm for efficient radio resource management in multi-user MIMO systems. Wireless Personal Communications 2019, 106, 1411–1427. [Google Scholar] [CrossRef]
- Smith, J. LIDAR-Based Mapping and Localization Techniques. International Journal of Robotics Research 2020, 39, 450–468. [Google Scholar]
- Garcia, L. Hector SLAM: Efficient Mapping and Localization. In Proceedings of the Proceedings of the International Conference on Robotics, 2021; pp. 77–90. [Google Scholar]
- Shehzad, F.; Khan, M.A.; Yar, M.A.E.; Sharif, M.; Alhaisoni, M.; Tariq, U.; Majumdar, A.; Thinnukool, O. Two-Stream Deep Learning Architecture-Based Human Action Recognition. Computers, Materials & Continua 2023, 74. [Google Scholar]
- Ullah, N.; Javed, A.; Ghazanfar, M.A.; Alsufyani, A.; Bourouis, S. A novel DeepMaskNet model for face mask detection and masked facial recognition. Journal of King Saud University-Computer and Information Sciences 2022, 34, 9905–9914. [Google Scholar] [CrossRef] [PubMed]
- Kohlbrecher, S.; Von Stryk, O.; Meyer, J.; Klingauf, U. A flexible and scalable SLAM system with full 3D motion estimation. Proc. IEEE International Symposium on Safety, Security, and Rescue Robotics (SSRR) 2011. [Google Scholar]
- Hart, P.E.; Nilsson, N.J.; Raphael, B. A formal basis for the heuristic determination of minimum cost paths. IEEE transactions on Systems Science and Cybernetics 1968, 4, 100–107. [Google Scholar] [CrossRef]
- Tzutalin. LabelImg, 2015. Accessed: 2024-07-22.
- Gao, W.; et al. Radar Technology and Its Applications in Autonomous Driving. IEEE Transactions on Intelligent Transportation Systems 2020, 21, 233–245. [Google Scholar]












| Software | Description |
|---|---|
| Operating System | Raspbian OS / Ubuntu Server OS 20.04 on the Raspberry Pi. |
| Programming Language | Python, used for coding control algorithms and integrating components. |
| ROS Noetic | A Robot Operating System (ROS) version utilized for controlling sensors, managing data transactions, and executing control blocks. |
| OpenCV | Employed for image processing and traffic light recognition. |
| YOLOv5 | An algorithm used to predict the position of traffic lights and classify their states. |
| TensorFlow or PyTorch | Frameworks for training and deploying the YOLOv5 model. |
| Arduino IDE | Used for programming the Arduino Mega board to control various components and perform tasks. |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 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 (http://creativecommons.org/licenses/by/4.0/).