FINAL
FINAL
Project Report
On
Submitted in partial fulfillment of the requirements for the award of the degree of
Master of Science (Information System)
By
NAME: KANAGANDLA RAJKUMAR
ROLL NO: 100924862050)
CERTIFICATE
This is to certify that the project entitled “ AI CAR WITH REAL-TIME DETECTION OF
DAMAGED ROAD AND LANE DETECTION USING DEEP LEARNING ” has been
Assistant Professor
The success and final outcome of this project required a lot of guidance and
assistance from many people and I am extremely fortunate to have got this all along
the completion of my project work. Whatever I have done is only due to such
guidance and assistance and I would not forget to thank them.
I would like to thank the ALMIGHTY, who gave me enough strength and
health to complete this task without any interruption and My Parents who gave me
all the support during the project work.
I thank to Mr. T. Ramdas Naik, Head of the Dept. of Computer Science (PG),
Nizam College, For his moral Support and Guidance.
Last but not the least, I would like to thank all my friends for their compliment
S. NO TITLE PAGE NO
LIST OF FIGURES iii
LIST OF ABBREVATIONS iv
ABSTRACT V
1 CHAPTER 1: INTRODUCTION 1
1.1 INRODUCTION 1
1.1.1 PROJECT DESCRIPTION 2
1.1.2 METHODOLOGIES 3
1.2 EXISTING SYSTEM 5
1.3 PROBLEM STATEMENT 6
1.4 PROPOSED SYSTEM 7
2 CHAPTER 2: LITERATURE SURVEY 9
2.1 LITERATURE SURVEY 9
3 CHAPTER 3: REQUIREMENTS AND DOMAIN 12
INFORMATION
3.1 REQUIREMENT SPECIFICATIONS 12
3.1.1 HARDWARE REQUIREMENTS 12
3.1.2 SOFTWARE REQUIREMENTS 14
3.2 SYSTEM SPECIFICATIONS 15
3.3 FLOWCHART 17
3.4 SOFTWARE SPECIFICATIONS 18
4 CHAPTER 4: SYSTEM METHODOLOGY 21
4.1 ARCHITECTURE 21
4.2 ALGORITHM 23
4.3 SYSTEM DESIGN 25
4.3.1 DATA FLOW DIAGRAM 26
4.3.2 UML DIAGRAMS 27
4.3.3 CONTEXT DIAGRAM 31
i
5 CHAPTER5: EXPERIMENTATION & 33
ANALYSIS
5.1 EXPERIMENTATION 33
5.2 RESULTS 41
5.3 TESTING 45
5.3.1 TYPES OF TESTING 45
5.3.2 TEST CASES 46
6 CHAPTER 6: CONCLUSION AND FUTURE 48
SCOPE
6.1 CONCLUSION 48
6.2 FUTURE SCOPE 48
REFERENCES 50
ii
LIST OF FIGURES
iii
LIST OF ABBREVATIONS
iv
ABSTRACT
By overlaying detected objects and lane markings on each video frame, the
application offers immediate visual feedback, which can be valuable in applications
such as autonomous vehicle navigation, road safety inspections, and infrastructure
maintenance planning. This fusion of machine learning with practical utility
demonstrates the potential of AI-driven tools in enhancing transportation technologies
and urban mobility solutions. Overall, the project serves as a robust prototype that
showcases how AI can be integrated into real-world scenarios to make road systems
safer, smarter, and more efficient.
v
CHAPTER 1
INTRODUCTION
1.1 INTRODUCTION
In today’s fast-paced world, road safety has become a growing concern. With
the increasing number of vehicles and deteriorating road conditions, timely detection of
road damages and proper lane guidance is more important than ever. While traditional
methods of road inspection and traffic monitoring rely heavily on manual labor and
visual surveys, these are often time-consuming, inconsistent, and impractical for large-
scale use.
1
A critical advantage of the system lies in its dual-model approach—one model
identifies road anomalies such as potholes, cracks, and wear, while the other is
dedicated to lane detection. This separation of concerns enhances detection accuracy
and allows each model to specialize in its task, reflecting the real-world complexity of
road environments.
The primary goal of the system is to help monitor and analyze road conditions
without relying on manual inspections. Traditional inspection methods are time-
consuming and can often miss critical issues, especially in large urban areas. By
contrast, this system uses computer vision to automatically detect common road defects
such as potholes, cracks, and worn-out surfaces. Simultaneously, it identifies lane lines
to ensure accurate navigation support, which is crucial for autonomous driving systems
and intelligent transportation networks.
To make the system user-friendly and visually appealing, the interface is built
using CustomTkinter, a modern Python GUI framework. The application allows users
to simply click a few buttons to load their input source, whether it's a video file or live
feed. The detections are displayed clearly on the screen, with bounding boxes and labels
highlighting the identified features.
Technically, the application uses threading to manage model inference and video
streaming efficiently, ensuring that real-time performance is smooth and uninterrupted.
The results are drawn over each video frame using OpenCV, creating an interactive
visual output that updates continuously as new frames are processed.
What makes this project especially practical is its modular structure. The models
([Link] for road damage and [Link] for lane detection) can easily be replaced or
updated, and new features such as traffic sign recognition or speed estimation could be
added in the
2
future. This makes the project scalable and adaptable for use in smart city planning,
road safety audits, or integration into autonomous vehicle systems.
At the core of the system are two YOLOv8 (You Only Look Once version 8)
models—one specialized in detecting road damage (e.g., potholes, cracks, and uneven
surfaces) and the other focused on identifying lane markings. These models were
trained using datasets containing thousands of labelled images to ensure high accuracy
and performance in diverse real-world conditions.
The models are loaded using the Ultralytics YOLO API, which provides a fast and
simple interface for performing object detection.
2. Input Handling
Image files
Users can choose the input source using the graphical interface. Once the input
is selected, the frames are read using OpenCV and prepared for processing by the
models.
3
3. Real-Time Detection with Multithreading
Each frame is passed through both models. The results include bounding boxes,
confidence scores, and class labels. These are drawn on the frame using OpenCV’s
drawing functions, clearly marking each detected object.
The results are updated for every frame, giving users a real-time view of
what the system sees.
5. User Interface (CustomTkinter)
This makes the tool accessible to a wide audience, from developers to educators
and city planners.
Additional features (like traffic sign detection or speed estimation) can be added
easily.
4
This methodology ensures that the system remains responsive, accurate, and easy
to use. By blending AI, real-time processing, and user-focused design, the project
demonstrates a practical application of deep learning in everyday life, especially in the
domain of road safety and intelligent transportation.
Traditionally, road damage and lane conditions are assessed through manual
inspections carried out by engineers or municipal workers. These methods involve
physically visiting roads, noting visible damage, and preparing reports. While this
approach can be accurate in small-scale scenarios, it is:
This manual process delays repairs and increases the risk of accidents caused
by unnoticed road hazards.
Are mostly used for traffic monitoring, not for identifying road quality
Lack intelligent analysis — humans must still manually review the footage
In the past, researchers tried using basic image processing algorithms (like edge
detection and thresholding) to find cracks or lines in road images. These methods had
some success but faced major challenges:
5
Poor accuracy under varying lighting or weather conditions
Some earlier AI systems used basic machine learning algorithms to classify road
damage types. While these models marked progress, they often:
Many existing solutions focused on just one aspect — either damage detection or
lane marking — and not both in combination.
Most road condition assessments are still done manually, which is time-
consuming, expensive, and often inaccurate due to human error. These inspections are
6
not performed frequently enough to catch issues early, leading to delayed repairs,
increased accident risks, and reduced driving comfort. Similarly, lane detection systems
used in many vehicles and traffic tools are limited in scope, often failing to perform
well under challenging conditions such as poor lighting, faded lines, or complex road
environments.
o The other detects lane markings to support navigation and safety applications.
7
3. Modern and User-Friendly Interface
o Simple buttons allow users to load inputs, start or stop detection, and view
outputs instantly.
o Ideal for use by students, researchers, city planners, or anyone without deep
technical knowledge.
o Bounding boxes and labels are overlaid on the input video or image, highlighting
the detected road damage and lane lines.
o Detection confidence scores help users assess the reliability of each prediction.
6. High-Resolution Output
8
CHAPTER 2
LITERATURE REVIEW
9
3. Pan et al. – SCNN: Spatial CNN for Lane Detection (2018)
Pan et al. proposed Spatial CNN (SCNN), a novel lane detection model that
extends traditional CNNs by enabling spatial message propagation across feature maps.
This innovation allows the network to better capture the geometric continuity of lanes,
making it particularly effective for structured lane detection in complex urban
environments. The SCNN architecture achieved strong results on the TuSimple dataset,
outperforming earlier models in both accuracy and stability. However, the model’s
complexity limits its applicability in resource-constrained environments like embedded
automotive systems. Despite this, SCNN remains a foundational model in lane detection
research, especially for scenarios requiring high precision.
To address the need for speed in real-time lane detection, Qin et al. introduced the
Ultra Fast Lane Detection model, which significantly improves inference time by
predicting fixed lane keypoints rather than performing full semantic segmentation. This
structure-aware model reduces computational overhead and achieves over 300 FPS on a
single GPU while maintaining competitive accuracy. Its lightweight design makes it
ideal for deployment in real-time systems, such as driver assistance or autonomous
navigation. The model's ability to operate in high-speed environments without
sacrificing detection quality marks a significant advancement in practical lane detection
for AI-powered vehicles.
Neven et al. presented LaneNet, a dual-branch deep neural network designed for
real-time lane detection. The model comprises two components: a semantic
segmentation branch that identifies lane regions, and an instance embedding branch that
distinguishes between individual lane markings. LaneNet’s architecture enables it to
detect multiple lanes even in challenging driving conditions. Although it performs well
on urban road scenarios, its sensitivity to occlusions and sharp curves is a limitation.
Nevertheless, its real-time capability and robustness in multi-lane situations make it a
strong candidate for integration into autonomous driving systems, especially when lane
differentiation is essential.
10
6. Fan et al. – Road Crack Detection Using Deep Convolutional Neural Networks
(2020)
Fan et al. proposed a deep learning-based approach for detecting cracks in road
surfaces using a customized convolutional neural network (CNN). The model was
trained on a large-scale dataset comprising high-resolution pavement images and
showed robust performance under varying lighting and weather conditions. Compared
to traditional edge detection and thresholding techniques, the CNN approach
demonstrated higher precision and recall. One of the key contributions was the
model’s adaptability across different types of roads (asphalt, concrete) without
retraining. However, challenges remained in accurately detecting micro-cracks and
dealing with shadows and road markings, which occasionally led to false positives.
7. Hou et al. – Inter-region Affinity Distillation for Lane Detection (2022)
Hou et al. introduced an efficient knowledge distillation technique called Inter-
region Affinity Distillation (IAD) to improve the performance of lightweight lane
detection models. The approach involves transferring relational knowledge between
spatial regions from a larger, more accurate teacher network to a compact student
network. This innovation enabled the deployment of lane detection systems on edge
devices with limited computational resources, such as mobile platforms or embedded
systems in autonomous vehicles. The method achieved a balance between model size
and accuracy, outperforming prior lightweight architectures on benchmarks like
CULane and TuSimple. Its major advantage lies in real-time efficiency without major
accuracy degradation.
8. Zhang et al. – DSDNet: Dual Supervised Deformation Network for Road
Damage Detection (2021)
Zhang et al. presented DSDNet, a dual-supervised deformation-aware network
that addresses the challenges of detecting irregular-shaped and deformed road
damages. Unlike standard object detectors, DSDNet combines a deformation
alignment module and two-stage supervision to enhance detection robustness,
especially for non-uniform potholes and cracks. The model was evaluated on the
RDD2020 dataset and showed significant improvements in F1-score compared to
YOLO and Faster R-CNN variants. It also proved capable of generalizing well across
road types and environmental conditions. However, its complex training pipeline and
reliance on detailed annotations make it more suitable for centralized infrastructure
monitoring systems than on-vehicle applications.
11
CHAPTER 3
1. Processor (CPU)
Why it’s needed: The CPU handles input/output processing, interface management,
and runs the background logic. A faster processor helps manage the workload of both
the GUI and real-time video streaming.
12
2. RAM (Memory)
Why it’s needed: Deep learning models, especially those using real-time video
processing, consume a significant amount of memory. Adequate RAM ensures smooth
frame processing without lag or crashes.
NVIDIA GPU with CUDA support (e.g., GTX 1650 / RTX 2060 or above).
Optional for CPU-only usage (YOLOv8 supports CPU inference but may be
slower).
Why it’s needed: A GPU speeds up deep learning model inference dramatically,
enabling real-time detection. While the system can run on CPU, using a GPU makes it
much faster and smoother, especially for video input.
4. Display
Why it’s needed: The detection results (bounding boxes and labels) are displayed
directly on the video frames. A high-resolution display ensures you can clearly see
small road details like cracks or faded lane markings.
Optional but recommended: Any USB or built-in webcam with 720p or higher
resolution
Why it’s needed: A webcam enables live road detection through real-time
camera feed, useful for demonstrations, testing, or mobile deployment.
6. Storage
Why it’s needed: To store the YOLOv8 models, video/image input files, and any
processed results. SSD storage is preferred for faster read/write speeds.
13
Why it’s needed: Running real-time models for extended periods can heat up the
system. Adequate cooling prevents performance throttling or system shutdowns.
1. Operating System
Several Python libraries are needed to run this system efficiently. The Ultralytics
library is used to run the YOLOv8 models for both road damage and lane detection.
OpenCV (cv2) plays a vital role in capturing video, processing frames, and displaying
visual output. CustomTkinter is used to build a modern and easy-to-use graphical
interface, while Numpy supports numerical operations and data handling. Python’s
threading module is also used to enable smooth, real-time processing across different
tasks. These libraries can be easily installed using pip.
4. YOLOv8 Framework
The system uses YOLOv8, a state-of-the-art deep learning model, through the
Ultralytics library. Two pre-trained YOLOv8 models are used—one for detecting road
14
damage like cracks and potholes, and the other for identifying lane markings.
YOLOv8 is known for its high speed and accuracy, making it suitable for real-time
applications.
To run the system, you need specific files provided with the project. The main
file, [Link], is the central script that connects the user interface and detection models.
The models themselves are stored as [Link] (for road damage detection) and [Link] (
for lane detection). These files must be placed in the same directory as the main script or
correctly linked in the code. You may also include sample images or videos for testing
in a designated folder.
While not required, tools like VS Code or Jupyter Notebook can be helpful for
writing and testing the code. You can also use Anaconda to manage your Python
environment, which makes handling dependencies easier. If the project is being shared
or updated collaboratively, Git can be used for version control.
15
inference, allowing the system to achieve real-time detection speeds of up to 30 frames
per second or higher depending on the input resolution and system specifications.
Beyond its technical strengths, the system is designed with scalability and
customization in mind. Developers and researchers can easily integrate new detection
models, adapt the interface to different use cases, or expand functionalities such as GPS
tagging, heatmap generation, or automatic report creation.
16
3.3 FLOWCHART
Fig.3.3 Flowchart
The flowchart for this project outlines the step-by-step flow of how the road
damage and lane detection system operates—from the moment the user opens the
application to the point where results are displayed. Here’s a breakdown of the logical
flow in a simple and understandable way:
The flowchart visually represents how the road and lane detection system works
step-by-step, making it easier to understand the entire process.
The process begins with the Start point, where the user opens the application.
Right after that, the system moves into the Input Selection phase. Here, the user decides
how
17
they want to provide input—either by using a webcam for real-time analysis or by
uploading an image or video for offline detection.
Once the input is chosen, the user then proceeds to Model Selection. There are
two options available here: they can choose Road Damage Detection to find cracks or
potholes, or select Lane Detection to identify lane lines on the road. Based on this
selection, the system loads the appropriate pre-trained YOLOv8 model.
After selecting the model, the system enters the Preprocessing Input stage. In this
step, the input (video or image) is resized, formatted, and prepared so it can be correctly
understood by the AI model.
The next step is Output Display, where the results of the detection are shown to
the user. This includes bounding boxes around damaged areas or lane lines, clearly
labelled with detection confidence scores.
Once the detection results are visible, the user can interact with the system in the
User Interaction stage. They can choose to stop the detection, restart it with new input,
or exit the application.
For the detection models, the system uses the Ultralytics YOLOv8 framework, a
cutting-edge deep learning model known for its high accuracy and speed in object
detection tasks. YOLOv8 is ideal for identifying road damages like cracks and potholes,
as well as lane markings on the road. These models are loaded through pre-trained
weight files, such as [Link] for damage detection and [Link] for lane detection.
To process images and video streams, the project uses OpenCV (cv2), a well-
known computer vision library that handles everything from reading video frames to
displaying real-time output. For the user interface, the system uses CustomTkinter, a
modern and visually appealing GUI library that makes the application intuitive and easy
to use, even for those without technical backgrounds.
18
Other essential libraries include NumPy for numerical operations and threading to
allow the system to handle multiple tasks simultaneously—like running both detection
and UI updates without lag. The overall setup is lightweight and doesn't require heavy
installation; all dependencies can be installed using pip commands in the Python
environment.
To handle the image and video processing required for detection, the system uses
OpenCV (cv2), one of the most popular open-source computer vision libraries. OpenCV
allows the application to read and display images and video frames, apply
transformations, and overlay detection results such as bounding boxes and labels.
Whether the input is a live webcam feed, an image file, or a video clip, OpenCV
ensures it is efficiently processed for accurate detection.
For the user interface, the project uses CustomTkinter, an upgraded version of the
standard Tkinter library. This provides a cleaner, more modern look to the graphical
user interface, making the system visually appealing and easy to navigate.
CustomTkinter enables the user to load files, start detection, switch between damage
and lane detection modes, and view the output in real time—all within a single,
19
streamlined window.
20
Other essential Python libraries used include NumPy, which is responsible for
managing arrays and performing fast mathematical operations on image data, and
threading, which allows multiple processes to run in parallel. This ensures that the
application remains responsive while performing complex detection tasks, even when
dealing with high-resolution video input.
Additionally, the application supports a modular file structure. The primary logic
resides in [Link], which connects the GUI with the detection models and handles all
backend processes. Supporting folders are organized to include the model weights (.pt
files), sample media files, and utility scripts, making the entire project easy to manage,
debug, and expand in the future.
Overall, the software stack has been thoughtfully chosen to provide a balanced
combination of performance, usability, and flexibility, making this system suitable for
academic research, prototype development, and potential real-world applications in road
safety and smart transportation systems.
21
CHAPTER 4
SYSTEM METHODOLOGY
4.1 ARCHITECTURE
1. Input Acquisition
The system starts with an onboard camera mounted on a vehicle, which serves as
the primary sensor. It continuously captures real-time footage of the road. This visual
input is crucial for both road surface damage analysis and lane detection tasks.
22
2. Preprocessing
Image Resizing: Ensures that input images conform to the dimensions expected by
detection models.
Frame Extraction (for video input): Converts video streams into a sequence of
images for frame-wise analysis.
3. AI Detection
This is the core intelligence layer of the system and consists of two
detection subsystems:
In this stage, the outputs from road damage and lane detection models are
aggregated and fused. The system performs:
Data Fusion: Cross-verifies lane and damage data for contextual decision-
making.
Alert System: Based on severity and position of detected issues, the system
triggers alerts using visual, audio, or haptic feedback to the driver.
This module ensures that the AI outputs are translated into actionable feedback.
23
5. Output and Response
This layer deals with how information is presented and acted upon:
Feedback Logging: Displays real-time detection on a dashboard and logs data for
future review.
Autonomous Driving Interface (Optional): For advanced systems, detected data
can be sent to autonomous vehicle controllers for immediate actions like braking or lane
correction.
Cloud Sync: All detected events and raw data can be uploaded to the cloud for
storage.
Model Retraining: Periodically, this data is used to retrain and fine-tune the AI
models, enabling the system to adapt to new types of road conditions or regional
variations.
The system integrates two main algorithms—YOLOv8 for road damage detection
and a combination of image processing and deep learning techniques for lane detection.
YOLOv8 (You Only Look Once version 8) is a state-of-the-art object detection
algorithm known for its speed and accuracy, making it ideal for real-time applications in
autonomous vehicles. It operates by dividing an image into a grid and simultaneously
predicting bounding boxes and class probabilities, enabling it to detect various types of
road damage such as potholes, cracks, and surface wear in a single forward pass through
the neural network. For lane detection, the system initially applies traditional image
processing techniques such as Canny edge detection, Gaussian blur, and Hough
Transform to extract clear lane lines under normal conditions. In more challenging
scenarios—such as poor lighting, faded markings, or curved roads—the system can
incorporate deep learning-based lane detection models to improve accuracy. This hybrid
approach ensures robust performance across diverse road conditions. By combining
24
object detection with lane detection, the system enhances both road safety awareness
and vehicle guidance capabilities. The output is displayed with annotated visuals,
showing detected damages and lane boundaries in real-time. This makes it highly
suitable for use in driver assistance systems and autonomous navigation.
1. Input Acquisition
The system captures frames either from a live webcam feed or from pre-recorded
videos/images.
2. Road Damage Detection using YOLOv8
YOLOv8 (You Only Look Once v8) is used as the object detection model.
The process involves:
1. The image is divided into a grid.
2. Each grid cell predicts:
Bounding boxes (for object locations).
Class probabilities (to identify objects).
3. In a single forward pass, the network detects:
Potholes
Cracks
Surface wear
4. It outputs:
The location and label of each detected damage
Confidence score for each detection
3. Lane Detection using Image Processing and Deep Learning
Traditional techniques are first applied for simple, fast lane detection:
1. Gaussian Blur – Smooths the image to reduce noise.
2. Canny Edge Detection – Finds edges in the image.
3. Hough Line Transform – Detects straight lines (likely lane lines).
4. Optionally, deep learning models may also be used for more accurate or
complex lane detection in challenging conditions.
4. Output Display
The system overlays:
o Bounding boxes with labels for road damages.
o Highlighted lane lines on the road.
It displays the processed output frame-by-frame in real-time or recorded video
format.
25
4.3 SYSTEM DESIGN
The system design of a road damage detection system using YOLOv8, explained
step by step in a simplified and human-readable manner.
The process begins at the Input Layer, where the system receives either an image
or a video feed—typically from a camera mounted on a vehicle. These inputs are then
sent into the Preprocessing phase, which involves several key steps to prepare the data
for analysis. First, image or video processing enhances the quality of the visual data.
Then, data augmentation is applied to generate more varied examples of road
conditions, helping the model learn better. Lastly, segmentation is used to isolate
relevant regions of the image, such as the road surface, from the background.
Next, the preprocess data goes through the Feature Extraction phase. This
includes edge detection to highlight road boundaries and cracks, and extraction of
texture features that help identify different types of road surfaces. A Convolutional
Neural Network (CNN) is then used to detect specific road damages, such as cracks,
potholes, or uneven surfaces.
Once features are extracted, the information is passed to the YOLOv8 model,
which acts as the core engine for identifying and classifying the types of damage in real-
time. YOLOv8 (You Only Look Once version 8) is a highly efficient object detection
model known for its speed and accuracy, making it well-suited for real-time road
analysis.
26
Finally, the system produces output in the form of an alert system that can notify
drivers of dangerous road conditions, and lane assistance to help vehicles stay within
safe driving lanes. This end-to-end setup enables smarter, safer, and more automated
road navigation.
4.3.1 DATAFLOW DIAGRAMS
The data flow diagram illustrates the interaction between the user and the system
in an AI-based road monitoring application, specifically focusing on road damage
detection and lane detection. The process begins with the user initiating the system,
which then captures real-time road images using an onboard camera. These images are
processed internally by the system to detect road damages and lane markings. The
YOLOv8 model is employed for detecting different types of road surface damages such
as potholes, cracks, and surface wear, while lane detection is carried out using either
traditional image processing techniques (like edge detection and Hough Transform) or
deep learning models (like CNN-based segmentation). After detection, the data is
further processed to extract meaningful insights, such as the severity of damage or lane
deviation. Based on this analysis, the system alerts the driver through visual or auditory
signals if any damage or lane departure is detected, thus enhancing driving safety.
Additionally, the system is capable of updating the AI model over time, either manually
or automatically, based on new data or user feedback to improve detection accuracy and
27
adapt to changing road conditions. The flow of data from the user to the system and
back, through various detection and processing modules, ensures a closed-loop
feedback system aimed at making autonomous or assisted driving safer and more
efficient.
4.3.2 UML DIAGRAMS
o This is the first step in the pipeline, where raw visual data is collected.
o The captured images are processed by a YOLOv8 model, which detects and
classifies road surface issues such as potholes, cracks, and bumps.
28
3. Detect Lane Markings
o Lane markings are extracted from the road view to maintain vehicle alignment
and ensure lane discipline.
5. Alert Driver
o If damage is detected or the vehicle is drifting out of the lane, the system sends
alerts through a visual, audio, or haptic feedback mechanism.
o This helps the driver take corrective action or slows/stops the vehicle in
autonomous mode.
6. Update AI Model
29
The sequence diagram illustrates the workflow of an AI-assisted car system
designed for real-time lane detection and road damage recognition. The process begins
with the driver starting the car, which triggers the vehicle to initiate data collection
through its sensor system. This system comprises cameras, LIDAR, and radar sensors
that gather detailed environmental data. The collected sensor data, such as images and
LIDAR point clouds, is then transmitted to the AI model. The AI model processes this
data to detect lane markings and identify any road damage like potholes or cracks. Once
the analysis is complete, the AI model sends the detection results back to the sensor
system. Based on these results, the car updates its control mechanisms, including
steering and braking, to ensure safe navigation. Finally, the car notifies the driver of any
necessary actions or warnings, such as suggesting a lane change or alerting about
detected road hazards. This sequence ensures a continuous loop of perception, analysis,
and action, enabling enhanced situational awareness and safety for the driver.
The class diagram represents the structure of an AI-based autonomous car system,
highlighting the interactions among its core components: Car, SensorSystem, AIModel,
30
and ControlSystem. The Car class initiates and manages the overall operation with
functions such as starting, stopping, and receiving alerts. It uses the SensorSystem to
collect and transmit environmental data via cameras, LIDAR, and radar through the
methods collectData() and sendData(). This data is then processed by the AIModel,
which contains the core intelligence of the system with functions like processData(),
detectLane(), and detectRoadDamage() to interpret the surroundings. Based on the
processed information, the AIModel sends results to the ControlSystem, which adjusts
the car's behavior using methods such as controlSteering(), controlBrakes(), and
updateCarState() to ensure safe and intelligent navigation. The diagram illustrates a clear
and modular interaction among components, enabling efficient autonomous driving.
31
The flowchart provides a comprehensive overview of the decision-making
process in an AI-enabled autonomous car system for lane detection and road damage
assessment. The sequence initiates when the driver starts the car; if the vehicle fails to
start, an error message is displayed, terminating the process. Upon successful ignition,
the system collects environmental data through sensors such as cameras, LIDAR, and
radar. This data is transmitted to the AI model, which processes it to determine if lane
markings are present. If lanes are detected, the system identifies the lane boundaries;
otherwise, it continues without lane data. The next step involves analyzing the road
surface to detect any damage, such as cracks or potholes. If damage is identified, it is
classified; if not, the system proceeds with normal functioning. Based on the detected
lane and road conditions, the control system is updated to adjust steering and braking
mechanisms for safe navigation. Finally, the driver is notified of any alerts or actions
needed, ensuring informed decision-making and enhanced driving safety throughout the
vehicle’s operation.
32
The context diagram represents the high-level interaction between the AI Car
system and its surrounding entities. It outlines the data flow between external sources
(like a camera) and recipients (such as users or data outputs) and how these interact with
the core system.
The context diagram illustrates the high-level interactions between the AI Car
System and its surrounding entities, focusing on real-time lane detection and road
damage detection functionalities. At the center of the system is the AI Car, which
receives a continuous video feed from the onboard camera. This visual data is critical
for the operation of the system, as it forms the basis for detecting lane markings and
identifying road surface anomalies. The camera acts as the primary input source,
feeding real-time imagery into the AI Car's processing pipeline where deep learning
models analyze the frames.
Once processed, the AI Car generates two key types of output: lane data and
damaged data. The lane data includes information about road lane boundaries, lane
direction, and vehicle alignment, which is crucial for safe navigation and lane keeping.
The damaged data includes detected potholes, cracks, or other road surface issues that
could affect driving safety. These outputs are then fed into a visualization module,
which overlays them onto the original feed and presents them to the user—either a
human driver via a dashboard interface or an autonomous driving system. The context
diagram thus effectively encapsulates the real-time interaction between hardware
(camera), intelligent processing (AI Car), and human/machine end-users in a
streamlined, modular structure.
33
CHAPTER 5
5.1 EXPERIMENTATION
This section provides a detailed look at how we built, tested, and evaluated the
deep learning system for detecting road damage and identifying lane markings. The goal
of this experimentation was to ensure the system works efficiently, even in real-world
conditions, and delivers reliable results.
Once the images were collected, we labeled (annotated) them manually using
specialized tools. Each type of damage (like potholes, road cracks) and lane markings
34
were highlighted with bounding boxes and class names. This labeling was crucial for
supervised learning, allowing the model to learn what each type of object looks like.
Before feeding the images into the model, we cleaned and prepared them:
This helped the model learn the unique features of different types of road damages
and lanes.
After training, we tested the model using a separate test dataset—images it had
never seen before. This allowed us to check if the model could generalize its learning. It
detected potholes, cracks, and lanes by drawing boxes around them in the test images.
We evaluated how well the model performed using the following statistical
metrics:
Accuracy = (TP + TN) / (TP + TN + FP + FN): Overall, how often the model
was correct.
Precision = TP / (TP + FP): Out of all detections, how many were truly
correct.
Recall = TP / (TP + FN): Out of all actual damages, how many the model
detected.
35
F1 Score = 2 * (Precision * Recall) / (Precision + Recall): Harmonic mean of
precision and recall.
The confusion matrix helped identify where the model struggled, so we could
make improvements.
We also plotted graphs such as training loss curves and accuracy trends across
epochs to track improvement over time.
36
SOURCE CODE
YOLOv8 models
model1 = YOLO(r"Model\
[Link]") model2 =
YOLO(r"Model\[Link]") #
Globals
cap = None
stop_event =
False results1 =
None results2 =
None
# Inference
def run_model1(frame):
global results1
results1 = model1(frame)
def run_model2(frame):
global results2
results2 = model2(frame)
def draw_results(frame):
output =
[Link]() if
results1:
for r in results1:
37
cls = int([Link]()) conf
= [Link]()
if results2:
for r in results2:
class_id = int([Link]())
= [Link][0].tolist()
return output
ef update_image(frame):
img = [Link](rgb)
imgtk = [Link](image=img)
video_label.imgtk = imgtk
video_label.configure(image=imgtk)
def process_video():
38
if ret:
= [Link](target=run_model2, args=(frame,))
[Link]()
[Link]()
[Link]()
[Link]()
output = draw_results(frame)
update_image(output)
[Link](10, process_video)
def open_webcam():
global cap, stop_event
stop_video()
cap = [Link](0)
stop_event = False
status_label.configure(text="Webcam started...")
process_video()
def open_video():
global cap, stop_event
stop_video()
path = [Link](filetypes=[("Video files", "*.mp4 *.avi *.webm")])
if path:
cap = [Link](path)
stop_event = False
status_label.configure(text="Video loaded...")
process_video()
def open_image():
path = [Link](filetypes=[("Image files", "*.jpg *.jpeg *.png")])
if path:
image = [Link](path)
39
image = [Link](image, (1280, 720))
run_model1(image)
run_model2(image)
output = draw_results(image)
update_image(output)
status_label.configure(text="Image processed.")
def stop_video():
global cap, stop_event
stop_event = True
if cap:
[Link]()
status_label.configure(text="Detection stopped.")
def on_close():
stop_video()
[Link]()
# ---------- UI ----------
ctk.set_appearance_mode("light")
ctk.set_default_color_theme("blue")
app = [Link]()
[Link]("🚘 YOLOv8 Road & Lane Detection")
[Link]("1280x820")
[Link](1024, 720)
# Title
title_label = [Link](app, text="Road damage & Lane Detection",
40
font=[Link](size=22, weight="bold"))
title_label.grid(row=0, column=0, pady=(10, 5), sticky="n")
# Video display
video_label = [Link](app, text="", fg_color="#eeeeee", corner_radius=12)
video_label.grid(row=1, column=0, sticky="nsew", padx=20)
# Buttons Frame
btn_frame = [Link](app, fg_color="transparent")
btn_frame.grid(row=2, column=0, pady=10)
[Link]("WM_DELETE_WINDOW", on_close)
[Link]()
5.2 RESULTS
The diagram titled "Result Output Overview" visually represents the flow of outputs
generated by a machine learning or AI model. It begins with a Model, which processes
input data to generate a Result. This result serves as a central point from which multiple
types of outputs can be derived. The first branch leads to Text Output, which typically
includes human-readable summaries, labels, predictions, or classification results. The
second pathway leads to Plot Output, used to visually represent data trends, detection
outcomes, or performance metrics through graphs or annotated images. From the plot
output, we further derive Data Output, which includes structured numerical or tabular
information that can be exported, analyzed, or stored for further use. This flow ensures that
42
model results can be interpreted in various forms—making the system adaptable for
developers, analysts, and end-users depending on their needs.
5.2.1 SCREENSHOTS
This screenshot shows a simple application window for detecting road damage
and lane lines using YOLOv8.
At the top, it says "Road damage & Lane Detection" to show what the app does.
The large empty area in the middle is where the video, image, or webcam feed will be
shown with the detection results.
At the bottom, there are several buttons:
Start Webcam: Starts the camera to detect in real time.
Analyze Image: Lets you choose an image to detect damage or lanes.
Analyze Video: Lets you select a video for analysis.
Stop Detection: Stops the current detection process.
Exit: Closes the app.
Below the buttons, there is a welcome message saying to select an option to begin.
The design is simple and user-friendly, made for easy road and lane detection.
43
Fig no 5.2.2 Potholes Detection
This screenshot shows the result of analyzing an image using the YOLOv8 Road
Damage & Lane Detection app. The image displays a road with multiple potholes, and
the system has successfully detected [Link] boxes are drawn around the potholes,
and labels like “Potholes: 0.25” and “Potholes: 0.31” appear above each box, showing
the detection confidence score. At the bottom of the screen, it says “Image processed.”,
meaning the detection is complete. The control buttons for starting webcam, analyzing
image/video, stopping detection, and exiting the app are still available, just like in the
previous screen.
This screenshot shows the result of a lane detection using the YOLOv8-based
Road Damage & Lane Detection app. The image displays a clear road with visible lane
markings.
44
The system has detected different types of lane lines:
A solid white line on the left side with a confidence score of 0.94.
Dashed white lines in the center with scores like 0.85.
A mix of dashed and solid white lines labeled on the right side with a score of
0.25.
Each detection is marked with a blue box and label. At the bottom, it says "Image
processed.", indicating the detection is done. The usual control buttons (Start Webcam,
Analyze Image, Analyze Video, Stop Detection, and Exit) are still shown.
This screenshot shows the result of detecting both potholes and lane lines using
the YOLOv8 Road Damage & Lane Detection app. The image shows a road with
several large potholes and visible lane markings.
The system has detected:
Potholes, highlighted with green boxes and labeled with confidence scores like
0.48, 0.74, and 0.69.
A double solid white lane line on the left side, marked with a blue box and a label
showing a confidence score of 0.68.
At the bottom of the screen, it says "Image processed.", meaning the detection is
complete. The control buttons (Start Webcam, Analyze Image, Analyze Video, Stop
Detection, Exit) are still available.
45
5.3 TESTING
1. Unit Testing
This is the first and most basic level of testing. It involves checking individual
components or functions of the project—like a preprocessing module or the YOLOv8
object detection algorithm—to make sure each part works correctly on its own. It’s like
testing each gear in a machine before putting the whole machine together.
2. Integration Testing
Once individual parts are working, we test how they work together. For example,
we check how the image input, preprocessing steps, feature extraction, and model
prediction components interact with each other. This type of testing ensures that data
flows smoothly from one stage to the next, without errors or breakdowns.
3. System Testing
This type of testing looks at the entire system as a whole. We check if the project
works from start to finish—from taking an image input to detecting road damage and
displaying results like alerts or lane guidance. It mimics how the system would operate
in a real environment, ensuring it meets the required functionalities.
4. Functional Testing
Here, we verify whether the software performs the expected tasks. For example, if
the system is supposed to identify potholes, cracks, and uneven surfaces, we run tests to
confirm it correctly detects and classifies them under various lighting and road
conditions.
5. Performance Testing
This testing focuses on how fast and efficiently the model performs. We check if
it can process live video streams or large image batches in real-time without lagging. It
helps us understand if the system is ready for real-world deployment on roads.
46
6. Accuracy and Validation Testing
We use statistical tools like confusion matrices and accuracy metrics to test how
correct the predictions are. This step is important to ensure the model isn't just fast—
but also smart and precise in identifying road damages.
This is the final stage where we ask users (like vehicle operators or road safety
officials) to test the system in a realistic scenario. Their feedback helps us improve the
system’s usability, interface, and real-world applicability.
Expected Output:
o Bounding box around crack with label "Crack".
o Lower confidence may be acceptable (> 0.5).
o Lane detection may degrade but should attempt detection.
47
Test Case 4: Curved Road with Lane Detection
Expected Output:
48
CHAPTER 6
CONCLUSION AND FUTURE SCOPE
6.1 CONCLUSION
The integration of real-time road damage detection and lane detection using deep
learning in AI-powered vehicles marks a significant step toward safer and more
intelligent transportation systems. By leveraging advanced computer vision techniques
and deep neural networks, these vehicles can autonomously monitor and respond to
dynamic road conditions, such as identifying potholes, cracks, and faded markings, as
well as accurately tracking lane boundaries. These capabilities not only enhance driver
safety but also contribute to road maintenance and infrastructure monitoring by
providing valuable, real-time data.
In conclusion, the deployment of deep learning for real-time road damage and
lane detection offers transformative potential for autonomous vehicles and smart city
initiatives. Continued refinement through real-world testing, along with regular updates
to the AI models based on new road data, will further enhance accuracy and reliability.
As these technologies mature, they are expected to significantly reduce human error,
improve road safety, and optimize infrastructure management—ultimately contributing
to a more efficient and intelligent transportation ecosystem.
AI-powered real-time road damage and lane detection systems are set to
revolutionize transportation safety and autonomous driving. With advancements in deep
learning, these systems now perform reliably even under challenging conditions such as
night-time driving, heavy rain, fog, or poor lighting. Their integration with IoT and
cloud-based analytics enables real-time data sharing among vehicles, infrastructure, and
49
city planners, which helps in predictive maintenance, route optimization, and traffic
congestion management.
As we move closer to achieving higher levels of vehicle autonomy (Levels 4 and 5),
precise lane detection, obstacle recognition, and environmental awareness become
critical. These AI systems will evolve through innovations such as sensor fusion—
combining inputs from LiDAR, radar, and computer vision to provide a more accurate
and holistic understanding of the driving environment.
Future enhancements may also include adaptive learning systems that update in
real-time as road conditions change, V2X communication (vehicle-to-everything) for
better coordination between vehicles and infrastructure, and augmented reality-based
driver assistance systems that overlay important road information directly onto the
windshield. As these technologies mature, they will not only enhance passenger safety
but also significantly reduce road maintenance costs, carbon emissions, and travel times
—ushering in a smarter, safer, and more sustainable global transportation network.
50
REFERENCES
1. C. Y. Chan, “Trends in crash detection and occupant restraint technology,” Proc.
IEEE, vol. 95, no. 2, pp. 388–396, Feb. 2007, doi: 10.1109/JPROC.2006.888391.
2. Z. Sun, G. Bebis, and R. Miller, “On-road vehicle detection: A review,” IEEE Trans.
Pattern Anal. Mach. Intell., vol. 28, no. 5, pp. 694–711, May 2006, doi:
10.1109/TPAMI.2006.104.
4. C. Lee and J. H. Moon, “Robust lane detection and tracking for real-time
applications,” IEEE Trans. Intell. Transp. Syst., vol. 19, no. 12, pp. 4043–4048, Dec.
2018, doi: 10.1109/TITS.2018.2791572.
7. Y. Wu, F. Liu, W. Jiang, and X. Yang, “Multi spatial convolution block for lane lines
semantic segmentation,” Lecture Notes in Computer Science, vol. 12837, pp. 31–41,
2021.
10. Y. Qin et al., “Lane recognition system for machine vision,” in Proc. 10th Int.
Conf. Comput. Eng. Netw., 2020, pp. 388–398, doi: 10.1007/978-981-15-8462-6_44.
11. R. Agrawal and N. Singh, “Lane detection and collision prevention system for
automated vehicles,” in Applied Computer Vision and Image Processing, Springer,
2021, doi: 10.1007/978-981-15-4029-5_5.
51