0% found this document useful (0 votes)
51 views

Summer Training Report 1

This document summarizes a summer training report submitted by Sahib Preet Singh for their internship at CodeClause working on projects related to artificial intelligence for autonomous vehicles. The internship involved two key projects - developing a road lane detection system using computer vision techniques and contributing to the development of a self-driving car simulation using Python, machine learning and computer vision. The report documents the methodologies, challenges and outcomes of these projects, highlighting the skills and experience gained from this transformative internship experience.

Uploaded by

Anushka Janoti
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views

Summer Training Report 1

This document summarizes a summer training report submitted by Sahib Preet Singh for their internship at CodeClause working on projects related to artificial intelligence for autonomous vehicles. The internship involved two key projects - developing a road lane detection system using computer vision techniques and contributing to the development of a self-driving car simulation using Python, machine learning and computer vision. The report documents the methodologies, challenges and outcomes of these projects, highlighting the skills and experience gained from this transformative internship experience.

Uploaded by

Anushka Janoti
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

Summer Training Report-1

(AIML359)
on

AI for Autonomous Vehicles

Submitted in partial fulfillment of the


Requirements for the award of the Degree
of

Bachelors of Technology
in
Artificial Intelligence and Machine Learning

Submitted by
Sahib Preet Singh
00713211621
DECLARATION

I hereby declare that all the work presented in this Summer Training Report-1 entitled
“Artificial Intelligence” for the partial fulfillment of the requirements for the award of
the degree of Bachelor of Technology in Artificial Intelligence and Machine Learning,
Guru Tegh Bahadur Institute of Technology, affiliated to Guru Gobind Singh Indraprastha
University Delhi, is an authentic record of my own work carried out at CodeClause as AI
Intern from 1 August 2023 to 1st September 2023

The work reported in this has not been submitted by me for the award of any other degree
of this or any other institute.

DATE: 16th December 2023

Sahib Preet Singh


00713211621
sahib61003@gmail.com

2
CERTIFICATE

3
ACKNOWLEDGEMENT

I would like to express my great gratitude towards Mr. P S Bedi Sir , who has given me
support and suggestions. Without their help, I could not have presented this work to the
present standard. Their feedback vastly improved the quality of this report and provided
an enthralling experience. I am indeed proud and fortunate to be supervised by him.
I am also thankful to Dr. Savneet Kaur mam, H.O.D. IT department, Guru Tegh
Bahadur Institute of Technology, New Delhi, for her constant encouragement, valuable
suggestions, and moral support and blessings.
I shall remain indebted to the faculty and staff members of Guru Tegh Bahadur Institute
of Technology, New Delhi. I also take this opportunity to give thanks to all others who
gave their support for the project or in other aspects of our study at Guru Tegh Bahadur
Institute of Technology

Sahib Preet Singh (00713211621/AIML/2021-25) Date: 16th December 2023


sahib61003@gmail.com

4
ABSTRACT

This internship report encapsulates a transformative one-month experience at


CodeClause, where I undertook significant projects integral to the realm of autonomous
vehicles. The first project focused on road lane detection, a fundamental step in the
development of self-driving car systems. Leveraging data augmentation techniques and
utilizing datasets sourced from Kaggle, the project involved an intricate pipeline
encompassing grayscale conversion, edge detection, region of interest masking, and
Hough line transformation. The culmination of these processes enabled the identification
and highlighting of lane markings, laying the groundwork for subsequent stages in
autonomous vehicle development. The second project delved into the broader scope of
creating a self-driving car, employing a synergy of Python, Machine Learning (ML), and
Computer Vision (CV) technologies. These endeavors not only honed technical skills but
also provided a hands-on understanding of cutting-edge technologies driving
advancements in the automotive industry. This report chronicles the methodologies,
challenges, and outcomes of these projects, underscoring the immersive learning
experience gained during the internship at CodeClause.

Throughout the internship, I navigated the intricacies of modern software development


processes and worked with a team of high-caliber engineers. The report chronicles the
methodologies, challenges, and outcomes of these projects, shedding light on the
innovative strides made in the automotive industry. This experience at CodeClause has
not only enriched my technical skill set but has also cultivated a deep appreciation for the
collaborative and visionary approach to technology that defines the organization's culture.

5
LIST OF FIGURES

Figure Number Figure Name Page Number

Fig 1.1 Codeclause Logo 9

Fig 1.2 Internship Dashboard 9

Fig 2.1 Software Requirements 12

Fig 2.2 Python and Computer Vision 13

Fig 2.3 VS Code 14

Fig 3.1 Lane Detection 15

Fig 3.2 Libraries 16

Fig 4.1 Self Driving Car 21

Fig 4.2 Libraries Used 22

Fig 6.1.1 Sample Input 28

Fig 6.1.2 Grayscaled 28

Fig 6.1.3 Blurred 29

Fig 6.1.4 Canny Edge Detection 29

Fig 6.1.5 Region Selection 30

Fig 6.1.6 Testing Output Images 30

Fig 6.1.7 Steering Angles 31

Fig 6.1.8 Randomly Rotated 31

Fig 6.1.9 Randomly Flipped 31

Fig 6..2.0 Model Graphs 32

6
CONTENTS

Chapters Page Number

Title Page 1
Declaration 2
Certificate 3
Acknowledgement 4
Abstract 5
List of Figures 6
Chapter 1: Introduction 8
1.1: Objective 8
1.2: Organization Overview – CodeClause 9
1.3: Internship Overview 9
1.4 Scope and Significance 10
Chapter 2: Software Requirements 12
2.1 Technology Stack Requirements 12
2.2 Development Environment Requirements 14
Chapter 3: Project- Road Lane Detection 15
3.1 Overview 15
3.2 Libraries Used 16
3.3 Procedure 17
Chapter 4: Project- Self Driving Car Simulation 21
4.1 Overview 21
4.2 Libraries Used 22
4.3 Procedure 24
Chapter 5: Conclusion 27
Chapter 6: Appendices 28
6.1 Appendix A: Outputs (Images) 28
6.2 Appendix B: Source Code 32
Chapter 7: Future Scope 39
Chapter 8: References 40

7
1. Introduction

Embarking on a month-long internship at CodeClause marked a pivotal chapter in my


academic and professional journey. CodeClause, a visionary technology company,
provided me with a unique opportunity to delve into the intricate realms of software
development and cutting-edge technologies. During this transformative experience, I had
the privilege of working alongside high-caliber engineers and contributing to projects at
the forefront of innovation. The company's commitment to reliability, efficiency, and a
culture rooted in leadership, integrity, and accountability fostered an environment where I
could not only apply my theoretical knowledge but also actively participate in shaping
the future of technology.

Against the backdrop of my internship, I found myself immersed in the dynamic


landscape of artificial intelligence (AI) and autonomous vehicles. The exponential growth
of AI technologies has become a driving force in reshaping industries, from enhancing
user experiences to revolutionizing the way we approach complex problem-solving. At
CodeClause, this growth manifested in projects that extended into the field of
autonomous vehicles, a domain pushing the boundaries of what technology can achieve.
The surge in autonomous vehicle development is not merely a technological feat but a
testament to the convergence of AI, machine learning, and computer vision, propelling us
toward a future where self-driving cars could redefine mobility and transportation. This
internship not only provided hands-on experience in these transformative technologies
but also granted me insights into the potential societal impacts and ethical considerations
associated with the advent of AI and autonomous vehicles.

1.1 Objective

The objective of my internship project at CodeClause is to advance the field of


autonomous vehicles through two key initiatives. Firstly, by implementing a robust road
lane detection system, employing data augmentation techniques and a multi-step image
processing pipeline. Secondly, by contributing to the development of a self-driving car
system using Python, machine learning, and computer vision. The goal is to enhance the
accuracy and reliability of lane detection, a fundamental component of autonomous
navigation, while exploring innovative technologies to create an intelligent and adaptive
self-driving vehicle. This project aims to contribute to the ongoing evolution of
autonomous driving technologies, paving the way for safer and more efficient
transportation systems.

8
1.2 Organization Overview

Fig 1.1 Codeclause Logo

CodeClause, a dynamic and forward-thinking technology company, AICTE certified, sets


itself apart with a commitment to delivering reliable and efficient solutions through a
team of high-caliber engineers and finely-tuned software development processes. Rooted
in a strong belief in leadership, integrity, and accountability, the company envisions
engineers, modernizes, and manages projects with a passion for client success.

The global perspective and responsibility that CodeClause embraces are evident in its
approach to deep connectedness between people, ideas, communities, and the
environment. The organization places a premium on treating each individual with respect,
fostering an open environment that encourages learning and growth while embracing
diversity.

At the core of CodeClause's operations is an unyielding commitment to integrity, going


beyond mere legal compliance to encompass honesty, fairness, and ethical conduct in all
circumstances. As a result, CodeClause stands as a beacon in the tech industry,
embodying a culture of excellence, collaboration, and global citizenship that shapes a
better future for both its employees and the broader community.

1.3 Internship Overview

Fig 1.2 Internship Dashboard

Over the course of one enriching month, I actively participated in projects at the forefront
of software development and emerging technologies. CodeClause, a visionary technology

9
company, provided a dynamic platform for hands-on learning alongside high-caliber
engineers. The internship's focus centered on the pivotal projects — the refinement of a
road lane detection system using data augmentation techniques and the development of a
self-driving car system, incorporating Python, machine learning, and computer vision.

The first project not only honed my technical skills but also underscored the importance
of precision in identifying lane markings — a fundamental step in the autonomous
vehicle landscape. The second project propelled me into the realm of self-driving cars,
requiring the integration of Python, machine learning, and computer vision technologies.
This endeavor aimed at not just developing a system, but fostering an intelligent and
adaptive vehicle capable of navigating diverse scenarios.

This overview encapsulates the symbiosis of theoretical knowledge and practical


application during my internship at CodeClause. It illustrates a journey where innovation
met execution, laying the groundwork for future advancements in autonomous vehicles
and reaffirming my passion for driving technological progress.

1.4 Scope and Significance

The scope of the road lane detection project is paramount in establishing a fundamental
building block for advanced autonomous vehicle systems. By implementing a refined
image processing pipeline, the project seeks to elevate the accuracy and reliability of lane
detection, ensuring a robust foundation for subsequent stages in the development of
self-driving car technologies. The scope extends beyond mere lane identification,
encompassing the intricate steps of grayscale conversion, edge detection, region of
interest masking, and Hough line transformation. This comprehensive approach not only
contributes to the immediate project goals but sets the stage for broader applications in
real-world scenarios, where precise lane detection is critical for safe and effective
autonomous navigation.

In tandem with the road lane detection project, the broader scope of developing a
self-driving car system using computer vision is monumental. The significance lies in the
convergence of these cutting-edge technologies to create an intelligent and adaptive
vehicle capable of navigating diverse and dynamic environments. This project's scope
encompasses algorithmic complexities, training data nuances, and the integration of
computer vision techniques. The self-driving car system's potential significance extends
beyond the immediate project objectives; it aligns with the global pursuit of safer, more
efficient transportation, showcasing the transformative impact that such technologies can
have on the future of mobility.

10
The significance of these projects within the broader context of CodeClause's mission
and the technological landscape cannot be overstated. They represent a tangible
contribution to the ongoing evolution of autonomous driving technologies, addressing
real-world challenges and setting new standards for innovation. The projects not only
push the boundaries of current capabilities but also align with the global trajectory
towards intelligent, connected, and autonomous vehicles — a paradigm shift with
far-reaching implications for the automotive industry, transportation infrastructure, and
societal norms. In essence, the scope and significance of these projects extend beyond
individual technical accomplishments, resonating with the broader narrative of
technological progress and its transformative impact on our daily lives.

11
2. Software Requirements

The software requirements section serves as the foundational blueprint for the successful
execution of any project, acting as the bridge between conceptual vision and tangible
implementation. From specifying programming languages and version compatibility to
delineating the intricacies of machine learning algorithms and computer vision
frameworks, the software requirements serve as a comprehensive guide.

As a roadmap for developers and stakeholders alike, the software requirements overview
underscores the meticulous planning essential for translating visionary concepts into
tangible, operational software solutions.

Fig 2.1 Software Requirements

2.1 Technology Stack Requirements

The technology stack requirements encompass Python 3.9 as the programming language,
leveraging its rich library ecosystem for computer vision tasks. The stack integrates
computer vision techniques, data augmentation, and image processing to enhance road
lane detection accuracy. RGB values understanding further refines the system,
collectively forming a comprehensive and effective technology stack for the project.

12
Fig 2.2 Python and Computer Vision

2.1.1 Python 3.9: It serves as the programming language backbone for the road lane
detection project, providing a versatile and expressive environment for algorithm
implementation. Its extensive library support, particularly in the field of computer vision
with libraries like OpenCV and scikit-image, facilitates the seamless integration of
sophisticated image processing techniques and machine learning algorithms.

2.1.2 Computer Vision Techniques: At the heart of the project lies a robust set of
computer vision techniques that empower the system to comprehend and interpret visual
data from road scenes. These techniques, ranging from traditional image processing
methods to advanced pattern recognition and machine learning algorithms, collectively
enable the system to detect and analyze lane markings with precision, contributing to the
overall effectiveness of the road lane detection system.

2.1.3 Data Augmentation: Data augmentation plays a pivotal role in fortifying the
model's resilience by artificially diversifying the training dataset. Through techniques
such as rotation, scaling, and flipping, the model becomes more adept at generalizing to
various real-world scenarios and adapting to different environmental conditions,
ultimately improving its performance and accuracy in lane detection tasks.

2.1.4 Image Processing: Image processing techniques are employed as a preprocessing


step for raw input images, elevating their quality and extracting pertinent features.
Operations such as filtering, edge detection, and color space transformations contribute to
refining the input data, ensuring that the subsequent lane detection algorithms operate on
optimized and relevant information, thereby enhancing the overall accuracy of the
system.

13
2.1.5 RGB Values Understanding: Understanding RGB values is integral to the
project's success as it facilitates the extraction of crucial color information from images.
In the context of road lane detection, the analysis of RGB values proves invaluable for
distinguishing lane markings from the surrounding environment. This understanding
significantly contributes to the system's capability to accurately detect and delineate lanes
on the road.

2.2 Development Environment Requirements

Fig 2.3 VS Code

Visual Studio Code:


The development environment for the project relies on Visual Studio Code (VS Code)
as the primary integrated development environment (IDE). VS Code's lightweight yet
powerful features, such as IntelliSense, Git integration, and a wide array of extensions,
streamline the coding process and enhance productivity. Its cross-platform compatibility
ensures a seamless development experience across different operating systems.
Additionally, VS Code's support for various programming languages, including Python,
aligns well with the project's requirements, providing a versatile and efficient
environment for coding, debugging, and version control throughout the development
lifecycle.

14
3. Road Lane Detection

Fig 3.1 Lane Detection

The goal of this project is to detect road lanes in a video stream. This project is based on
the detection of road lanes. It is the base step of creating a self driving car project. In this
I have collected the images data from kaggle. It involves processing images of roads to
identify and highlight lane markings. The pipeline includes steps like grayscale
conversion, edge detection, region of interest masking, and Hough line transformation.

3.1 Overview

The Road Lane Detection Project, undertaken during my AI internship at


CODECLAUSE, is a critical component in the pursuit of developing autonomous driving
systems. The primary objective of this project is to implement a robust lane detection
algorithm capable of processing video streams to identify and highlight road lanes
accurately. Serving as a foundational step toward the realization of a self-driving car, the
project encompasses a comprehensive pipeline of image processing techniques.

The project commences with the collection of image data from Kaggle, establishing a
diverse dataset essential for training and testing the lane detection algorithm. Leveraging
key libraries such as OpenCV, NumPy, and Matplotlib for image processing tasks, the
pipeline involves grayscale conversion, Gaussian blur application, canny edge detection,
region of interest masking, and Hough line transformation.

The implementation unfolds in a systematic manner, wherein the project reads all files
from a designated folder, applies preprocessing steps like grayscale conversion and edge
detection, and defines a region of interest to focus on relevant details. The Hough line

15
transformation is then employed to identify and extrapolate lane markings, contributing
to accurate lane detection. The project concludes with a weighted image function that
blends the detected lanes with the original image, producing a visually intuitive
representation of the road environment.

File operations, facilitated by the 'os' library, enable efficient handling of multiple images
within the pipeline. The final output is displayed on-screen or saved to disk based on user
input, providing a tangible and interpretable result. This project not only showcases
proficiency in image processing techniques but also lays the groundwork for more
advanced applications in autonomous vehicle technology.

3.2 Libraries Used

The Road Lane Detection Project, undertaken during my AI internship at CodeClause, is


a critical component in the pursuit of developing autonomous driving systems. The
primary objective of this project is to implement a robust lane detection algorithm
capable of processing video streams to identify and highlight road lanes accurately.
Serving as a foundational step toward the realization of a self-driving car, the project
encompasses a comprehensive pipeline of image processing techniques.

Fig 3.2 Libraries

3.2.1 OpenCV
OpenCV (Open Source Computer Vision Library) is a fundamental library for image
processing tasks in the project. Leveraging its extensive functionalities, OpenCV plays a

16
pivotal role in tasks such as edge detection, Gaussian blur application, Hough line
transformation, and image blending. Its versatility and efficiency make it an
indispensable tool for handling and manipulating image data.

3.2.2 NumPy
NumPy serves as a crucial numerical computing library, providing support for array
operations and manipulation. In the context of the road lane detection project, NumPy
facilitates efficient handling of image data, enabling numerical operations essential for
various image processing tasks. Its array-based approach enhances the speed and
performance of numerical computations, contributing to the overall efficiency of the
project.

3.2.3 Matplotlib
Matplotlib is employed for data visualization purposes within the project. With its
capabilities for creating plots, charts, and graphical representations, Matplotlib aids in
visually assessing the results of image processing steps. It is instrumental in displaying
images, plots, and the final output, providing a valuable tool for interpreting and
validating the effectiveness of the implemented lane detection algorithm.

3.2.4 OS
This library provides a platform-independent interface for interacting with the operating
system, enabling tasks such as directory listing and file operations. In the context of the
project, the 'os' module is employed to efficiently read files from a designated folder,
facilitating the seamless processing of multiple images. By leveraging the 'os' library, the
project ensures robust file handling, allowing for the systematic execution of image
processing steps on diverse datasets.

3.3 Procedure

The Road Lane Detection Project, undertaken during my AI internship at CodeClause, is


a critical component in the pursuit of developing autonomous driving systems. The
primary objective of this project is to implement a robust lane detection algorithm
capable of processing video streams to identify and highlight road lanes accurately.
Serving as a foundational step toward the realization of a self-driving car, the project
encompasses a comprehensive pipeline of image processing techniques.

3.3.1 Model Preparation with Varied Lane Markings


To enhance the robustness and versatility of the road lane detection model, two distinct
images with different lane markings are utilized during the model preparation phase. This
approach aims to expose the model to a diverse set of lane scenarios, accommodating

17
variations in road environments. The selected images, "swr.jpg" and "syl.jpg," exhibit
white and yellow border lines, respectively, both featuring white dashed lines on the road.

3.3.2 Pre-processing of the Image using Grayscale Method and Gaussian Blur
The grayscale images and Gaussian-blurred versions provide a clearer foundation for
edge detection and lane identification.
Grayscale Method
The Grayscale method involves converting a full-color image into a single-channel
image, where each pixel represents the intensity of light. This process effectively
removes color information, simplifying the image while preserving essential details
related to brightness and darkness.
Gaussian Blur
Gaussian Blur is employed to smooth out high-frequency noise and details in the image
by applying a weighted average to each pixel and its neighboring pixels. This step helps
in reducing noise and enhancing the robustness of the subsequent image processing tasks.

3.3.3 Canny Edge Detection


Canny Edge Detection is a pivotal step in the road lane detection pipeline, utilized to
identify sharp changes in intensity within an image, particularly edges. This method plays
a crucial role in isolating meaningful features such as lane markings while filtering out
noise. The implementation involves setting minimum and maximum threshold values,
denoted as low_threshold and high_threshold respectively. For this project, these
thresholds are set to 150 and 220, respectively, to strike a balance between sensitivity and
noise reduction.

3.3.4 Region Masking


Region masking is a crucial step in the road lane detection process, involving the
selective identification and suppression of unwanted elements in the image, leaving only
the region of interest for further analysis. In this project, a region mask is applied to two
images, img1 and img2, to focus on relevant details such as road lanes while suppressing
distracting features.
The fitted lines on the region of interest further define the geometric properties of the
road lanes, contributing to accurate lane detection in the road lane detection algorithm.

3.3.4 Marking Regions


The process of marking the region of interest and identifying lane lines is a critical stage
in the road lane detection pipeline. Here, the project utilizes geometric calculations to

18
define the region and subsequently highlights the detected lane lines on the original
images.

3.3.5 Hough Transformation


Hough Transformation is a key technique in computer vision that enables the detection of
lines and shapes in images by transforming them into parameter space. It is particularly
valuable for detecting geometric patterns such as lines, circles, and ellipses. In the context
of road lane detection, the Hough Transformation provides an efficient and reliable
method for identifying and extrapolating lane lines.
To implement the Hough Transformation in the road lane detection pipeline, a region of
interest is first defined using a polygonal mask. This mask is then applied to the edges
detected in the Canny Edge Detection step to focus on the relevant features. The Hough
Transformation is subsequently applied to the masked edges to identify and draw lines
representing the road lanes.

3.3.6 Road Lane Detection Pipeline


The road lane detection pipeline is a sequence of image processing steps aimed at
identifying and highlighting road lanes in an image. The following functions contribute to
the creation of this pipeline:

region_of_interest(img, vertices):
This function establishes a region of interest (ROI) mask on the input image, defining
specific vertices that encompass the relevant portion of the road. The mask is then
applied to the original image, effectively eliminating extraneous information from the
analysis.

weighted_img(output_img, input_img, α=0.1, β=1., γ=0.):


The purpose of this function is to blend the output image, containing lane information,
with the original input image. The weighted addition allows for controlled transparency,
influencing the visual impact of the overlay on the original scene.

draw_lines(img, lines, color=[240, 248, 255], thickness=10):


Responsible for rendering lines on the input image based on the coordinates provided in
the lines parameter. The color and thickness of these lines are customizable, contributing
to the clarity and prominence of the detected road lanes.

slope_lines(img, lines):

19
This function identifies and computes the average slopes of the detected lines. By
categorizing lines as left or right lanes based on their slope, a composite representation of
the left and right lane lines is generated. The resulting lanes are then drawn onto the input
image.

hough_lines(img, rho, theta, threshold, min_line_len, max_line_gap):


Applying the Hough Transformation to the input image, this function identifies lines
within the image space. Leveraging the slope_lines function, it extracts and draws
averaged left and right lane lines on a blank canvas, contributing to the overall lane
detection process.

get_vertices(image):
This function defines the vertices of the region of interest based on the dimensions of the
input image. These vertices determine the polygonal area within which the pipeline
focuses its lane detection efforts.

3.3.7 Testing
The testing of the road lane detection model involves iterating through a list of image
files within a specified directory. For each image, the pipeline function is applied to
detect and highlight road lanes, and the input and output images are displayed side by
side for visual assessment. The code snippet you provided uses Matplotlib to generate a
subplot with the original image on the left and the output image (with detected road
lanes) on the right.

20
4. Self Driving Car

Fig 4.1 Self Driving Car

The main objective of this project is to train a model which can drive a car on its own.
The model is trained on the basis of the data collected from the car. The data is collected
using the Udacity Simulator. The model is trained using the Convolutional Neural
Network. The model is trained on the basis of the images collected from the car. The
model is trained to predict the steering angle of the car. The model is tested on the
Udacity Open Source simulator.

4.1 Overview

A comprehensive initiative developed during my internship at CodeClause as an AI


Intern. The primary goal of this project is to create an autonomous driving system using
the Udacity dataset and an open-source simulator. Leveraging Convolutional Neural
Networks (CNNs) and computer vision techniques, the model is trained to predict the
steering angle of the car based on the input data from the center camera. This autonomous
driving system is designed to navigate various scenarios, contributing to the advancement
of self-driving technology.

4.1.1 Features
Autonomous Driving
The project introduces a sophisticated self-driving car system capable of autonomously
navigating through diverse environments. The integration of machine learning and
computer vision techniques empowers the vehicle to make informed decisions, ensuring
safe and efficient autonomous driving.

21
Steering Wheel Angle
An integral aspect of the project involves utilizing the angle of the steering wheel as a
key input for controlling the direction of the vehicle. This crucial information is
fundamental in maintaining accurate and secure navigation, allowing the self-driving car
to adapt to changing road conditions.

Camera Data
The self-driving car relies on data captured by the center camera to analyze its
surroundings in real-time. The visual input from the camera serves as a primary source of
information, enabling the car to perceive and respond to the environment dynamically.
This data-driven approach enhances the system's ability to make precise driving
decisions.

Open-Source Simulator
To rigorously test and validate the self-driving car system, the project integrates with an
open-source simulator. This simulator provides a virtual environment where the
autonomous vehicle can navigate autonomously, replicating real-world scenarios. Testing
in the simulator ensures the robustness and adaptability of the developed self-driving
technology.

4.2 Libraries Used

Fig 4.2 Libraries Used

4.2.1. TensorFlow:
TensorFlow is an open-source machine learning framework developed by Google. It
provides a comprehensive set of tools and libraries for building and training machine
learning models, including neural networks.

22
4.2.2 Keras:
Keras is an high-level neural networks API written in Python and integrated into
TensorFlow. It simplifies the process of building and training deep learning models,
offering a user-friendly interface for constructing complex neural networks.

4.2.3. NumPy:
NumPy is a fundamental library for numerical computing in Python. It provides support
for large, multi-dimensional arrays and matrices, along with a collection of mathematical
functions to operate on these arrays. NumPy is essential for efficient data manipulation
and processing.

4.2.4. Matplotlib.pyplot
Matplotlib is a plotting library for the Python programming language. Matplotlib.pyplot,
a submodule of Matplotlib, is commonly used for creating various types of visualizations,
including line plots, bar plots, and scatter plots, which are useful for analyzing and
presenting data.

4.2.5. Pandas
Pandas is a powerful data manipulation and analysis library for Python. It offers data
structures like DataFrames, making it easy to handle and manipulate structured data.
Pandas is commonly used for data preprocessing and exploration in machine learning
projects.

4.2.6. OpenCV
OpenCV, or Open Source Computer Vision Library, is a computer vision and image
processing library. It provides a wide range of tools and functions for tasks such as image
manipulation, feature extraction, and object detection, making it valuable for tasks
involving visual data.

4.2,7. argparse
Argparse is a Python module for parsing command-line arguments. It simplifies the
process of writing user-friendly command-line interfaces for your programs, allowing
users to customize the behavior of the script.

4.2.8. base64
The base64 module provides functions for encoding and decoding data in base64 format.
It is commonly used for tasks like encoding binary data for transmission over text-based
protocols.

23
4.2.9. Datetime
The datetime module in Python provides classes for working with dates and times. It is
useful for manipulating and formatting timestamps in various applications.

4.2.10. Socket.IO
It is a real-time web library that enables bidirectional communication between web
clients and servers. The socketio library in Python facilitates the integration of
WebSocket communication in applications.

4.3 Procedure

4.3.1. Reading Data and Selecting Features


In this step, the project involves reading data from a CSV file named "data_cars.csv" into
a Pandas DataFrame (train_df). The dataset includes information from car cameras, such
as the center camera, left camera, right camera, steering angle, throttle, reverse signal,
and speed. However, the focus is narrowed down to the "center_camera" and "steering"
features. The DataFrame is then displayed with the head() function. Additionally, the first
entry in the "center_camera" column is processed to extract the filename by splitting the
path using "\" and taking the last element.

4.3.2. Steering Angles Graph


This section involves visualizing the distribution of steering angles in the dataset using a
histogram. The matplotlib style is set to "fivethirtyeight," and a histogram is created with
20 bins to illustrate the frequency of different steering angles. The distribution reveals the
prevalence of certain steering angles, providing insights into the dataset's steering angle
distribution. Additionally, a subset of the dataset (df_steeringnotzero) is created,
containing entries where the steering angle is not equal to zero, and the first few rows of
this subset are displayed.

4.3.3. Plotting Images of Different Steering Angles


In this step, images corresponding to different steering angles are visualized. The dataset
directory for images (img_dir) is specified, and the names of image files in that directory
are retrieved. Subsequently, a subplot with one row and five columns is created to display
images of the first five entries in the dataset. The images are loaded using plt.imread()
and plotted using Matplotlib. The resulting plot showcases five images along with their
corresponding titles, representing various steering angles. This visualization aids in
understanding how steering angles correlate with the visual data captured by the car's
cameras.

24
4.3.4 Applying Data Augmentation to Increase the Size of the Training Dataset
In this step, data augmentation techniques are applied to artificially increase the size of
the training dataset. Two specific transformations, namely Random Rotation and Flipped
Image, are implemented to introduce variations in the dataset.

Random Rotation
The random_rotation function takes an image path, its corresponding label, and a
maximum rotation angle as parameters. It randomly rotates the image within the specified
angle range to simulate variations in camera perspectives. The resulting rotated image
and label are then returned.

Flipped Image
The flipped_data function takes an image directory, image name, and label as input. It
reads the image, flips it horizontally (creating a mirror image), and negates the label. This
operation is performed to introduce diversity in the dataset by presenting images from the
opposite perspective.

4.3.5 Image Data Generator and Data Splitting


The generator is configured with a validation split of 20%. Two separate data generators,
train_generator and valid_generator, are created to handle training and validation subsets
of the dataset, respectively. These generators are initialized using the
flow_from_dataframe method, specifying the dataframe (new_train_df), the image
directory, column names for images and steering angles, batch size, seed for
reproducibility, shuffling, class mode, and target size.

4.3.6 Model Architecture and Training


The neural network model architecture is defined using TensorFlow and Keras. The
model incorporates data augmentation using the RandomContrast layer and follows a
convolutional neural network (CNN) structure. The layers include convolutional layers
with batch normalization, max-pooling, and dropout for regularization. The model is
compiled with mean squared error as the loss function, the Adam optimizer with a
specified learning rate, and mean absolute error as the evaluation metric.

The training process (model.fit) is executed with the train_generator for a specified
number of epochs (20 in this case), and the validation data (valid_generator) is used for
model evaluation during training. The training history is stored in the history variable for
later analysis or visualization.

4.3.7 Visualization of Training Metrics

25
Mean Absolute Error (MAE) Plot
The first plot illustrates the training and validation MAE values across different epochs.
The x-axis represents the epochs, while the y-axis represents the MAE values. Two lines
are plotted, one for the training set and one for the validation set, allowing the
observation of model performance on both datasets over time.

Loss Plot
The second plot focuses on the training and validation loss values. Similar to the MAE
plot, it visualizes how the loss changes during the training process. The x-axis represents
epochs, and the y-axis represents the loss values.

26
5. Conclusion

Road Lane Detection Project:


The Road Lane Detection project successfully leverages advanced computer vision
techniques and machine learning algorithms to detect and highlight road lanes in
real-time. The utilization of Python 3.9, computer vision libraries, and data augmentation
enhances the project's robustness. The integration of image processing, RGB value
understanding, and data augmentation contributes to accurate lane detection in diverse
road conditions. This project serves as a foundational step towards the development of
self-driving car technology.

Self-Driving Car Project:


The Self-Driving Car project is a remarkable endeavor aimed at creating an autonomous
driving system. Utilizing a Convolutional Neural Network (CNN) trained on a dataset
from the Udacity Simulator, the model demonstrates the capability to navigate various
scenarios. The incorporation of the steering wheel angle as a crucial input ensures
accurate control and safe navigation. The project's reliance on an open-source simulator
allows for thorough testing and evaluation of the self-driving system. Overall, this project
showcases significant progress in the pursuit of autonomous vehicle technology.

27
6. Appendices

6.1 Appendix A : Outputs(Images)

Fig 6.1.1 Sample Input

Fig 6.1.2 Grayscaled

28
Fig 6.1.3 Blurred

Fig 6.1.4 Canny Edge Detection

29
Fig 6.1.5 Region Selection

Fig 6.1.6 Testing Output Images

30
6.1.7 Steering Angles

6.1.8 Randomly Rotated

6.1.9Randomly Flipped

31
6.2.0 Model Graphs

32
6.2 Appendix B : Source Code

6.2.1 Road Lane Detection

33
34
6.2.2 Self Driving Car

35
36
37
38
7. Future Scope

The future scope of these projects involves the seamless integration of AI with
electronics and IoT for real-world deployment. Implementing sensor technologies, such
as LiDAR and radar, can enhance the model's perception capabilities, ensuring robust
navigation in diverse environments. Integration with IoT facilitates real-time
communication between vehicles, traffic infrastructure, and central control systems,
contributing to safer and more efficient transportation. Additionally, deploying the model
in edge devices for on-board processing enhances responsiveness and reduces reliance on
external servers. This holistic approach paves the way for the development of advanced
autonomous driving systems that can revolutionize the automotive industry and urban
mobility.

39
8. References

1. Python: https://www.python.org/
2. Kaggle : https://www.kaggle.com/code/soumya044/lane-line-detect
3. Lane Detection Dataset :
https://www.kaggle.com/datasets/thomasfermi/lane-detection-for-carla-driving-simulator/
code
4. Python Libraries : https://www.geeksforgeeks.org/libraries-in-python/
5. Geek4geeks:
https://www.geeksforgeeks.org/videos/top-10-most-popular-python-libraries/
6. Udacity simulator GitHub link : https://github.com/udacity/self-driving-car-sim
7. Udacity stimulator :
https://www.instructables.com/Self-Driving-Car-With-Udacity-Simulator/
8. Computer Vision GFG : https://www.geeksforgeeks.org/computer-vision/
9. Kaggle :
https://www.kaggle.com/code/aslanahmedov/self-driving-car-behavioural-cloning
10. Keras Documentation: https://www.tensorflow.org/guide/keras
11. Deep Learning : https://www.geeksforgeeks.org/introduction-deep-learning/
12. CNN : https://www.geeksforgeeks.org/introduction-convolution-neural-network/
13. DL Documentation : https://deeplearn.org/
14. CNN Javatpoint: https://www.javatpoint.com/pytorch-convolutional-neural-network
15. Matplotlib: https://www.javatpoint.com/matplotlib
16. A Paradigm of Complexity:
https://www.google.co.in/books/edition/CNN/G86zMVD3yNYC?hl=en&gbpv=1&dq=cn
n+&pg=PA1&printsec=frontcover
17. Detection of Lanes Research paper:
https://www.sciencedirect.com/science/article/abs/pii/S003132032030426X
18. Hough Transformation: https://ieeexplore.ieee.org/abstract/document/1593662
19. Canny Edge Detection: https://ieeexplore.ieee.org/abstract/document/6885761/
20. OpenCV:
http://roswiki.autolabor.com.cn/attachments/Events(2f)ICRA2010Tutorial/ICRA_2010_
OpenCV_Tutorial.pdf
21. w3school : https://www.w3schools.com/python/pandas/default.asp
22. numpy: https://numpy.org/

40

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy