Professional Documents
Culture Documents
Submitted by
NIRANJAN B (2003027)
RAMALINGAM M (2003029)
SYED ABDUL HAQ S (2003040)
TARUN B A (2003041)
BACHELOR OF ENGINEERING
in
Submitted by
NIRANJAN B (2003027)
RAMALINGAM M (2003029)
SYED ABDUL HAQ S (2003040)
TARUN B A (2003041)
BACHELOR OF ENGINEERING
in
ELECTRICAL AND ELECTRONICS ENGINEERING
BONAFIDE CERTIFICATE
Place: COIMBATORE
Date:
CERTIFICATE OF EVALUATION
NIRANJAN B
2003027
“Design and Development of
Dr. S. Nandakumar,
automatic Steering Control
RAMALINGAM M System for Autonomous M.E., Ph.D.,
2003029 Electric Tractor ” ASSISTANT PROFESSOR
Department of Electrical
SYED ABDUL and Electronics Engineering
HAQ S
2003040
TARUN B A
2003041
The report of the project work submitted by the above students in partial
fulfilment for the award of Bachelor of Engineering degree in Electrical and
Electronics Engineering of Anna University, Chennai is evaluated and
conformed to be report of the work done by the above students.
Certified that the candidates have been examined in the mini project work
viva-voce examination held on
NIRANJAN B RAMALINGAM M
2003027 2003029
We thank all our faculty members, staffs and technicians for their support.
ABSTRACT
The automobile industry is moving towards a fully automated electric vehicle future.
Automation of agricultural equipment will greatly help reduce workload on farmers. It
will also be beneficial to farmers economically. Automation will also help improve
efficiency and mass output. This is why our group has taken this project of design and
developing of automatic power steering control system for autonomous electric tractor. To
accomplish this using help of yolo algorithm which is a software used for object detection
in real time application and autonomous driving.
A camera can be used to capture and send a live stream data to the computing part
where the yolo runs the stream dynamically and detects objects which are found to be
obstacle. When an obstacle is detected, the system calculates the obstacle’s size and
distance from the vehicle. The calculated data is sent to the steering control unit where it
computes by how much degrees should the vehicle turn in order to avoid it. The calculated
information is sent to a motor which is connected to the front axle of the vehicle. A motor
is used as this is a steer by wire method.
This can automate the vehicle and save a lot of time and money for the farmers. It is
very cost effective compared to other autonomous driving methods. If trained with more
data, this can also be used to drive in a real life traffic environment.
TABLE OF CONTENTS
ABSTRACT I
1 INTRODUCTION 1
1.1 Overview 1
1.3 Objectives 1
1.5 Summary 2
2 LITERATURE REVIEW 3
2.1 Introduction 3
2.3 Summary 7
3.1 Introduction 8
3.2 Block Diagram 8
3.3 Hardware Description 15
4.1 Introduction 22
4.2 Hardware 22
4.3 Summary 25
5 CONCLUSION 25
5.1 Conclusion 25
APPENDIX 1 29
APPENDIX 2 32
CHAPTER – 1
INTRODUCTION
1.1 OVERVIEW
YOLO (You Only Look Once) is a popular object detection model known for its speed and accuracy. Single-
shot object detection uses a single pass of the input image to make predictions about the presence and location
of objects in the image. It processes an entire image in a single pass, making them computationally efficient.
YOLO is a single-shot detector that uses a fully convolutional neural network (CNN) to process an image. In
our project YOLO algorithm is used in automatic steering control system for autonomous electric tractor
to detect objects around the agriculture field such as vehicles, people, stones and animals
1.3 OBJECTIVES
1
1.4 ADVANTAGES OF THE PROPOSED SYSTEM
• Speed: This algorithm improves the speed of detection because it can predict objects in real-
time.
• High accuracy: YOLO is a predictive technique that provides accurate results with
minimal background errors.
• Learning capabilities: The algorithm has excellent learning capabilities that enable it to
learn the representations of objects and apply them in object detection.
1.5 SUMMARY
The chapter describes the objectives of the project, the need for this project,
and theadvantages of the proposed system with its working block diagram.
2
CHAPTER - 2
LITERATURE REVIEW
2.1 INTRODUCTION
The following chapter describes about the various literatures for autonomous
dvobject detection and identification.
2. Literature Survey on
RekhaB.S,Ath The problems such as noise, A unified model for object detection
Object Detection
iyaMarium,Dr blurring and rotating jitter, which is easy to build and is trained
Using YOLO
.G.N.Srinivas etc. with images in real-world straight on full images. YOLO also
an,Supreetha have an important impact on generalized well to new domains
A.Shetty object detection. The objects can used in applications that rely on fast,
be detected in real time using robust object detection. To
YOLO (You only look once), an recognize indoor obstacles a new
algorithm based on method of using deep learning along
convolutional neural networks with a light field camera was used.
The method identifies the obstacles
and perceives its information.
3 YOLO-Former: The vision transformer (ViT) is Learnt about object detection and
Yuan Dai;
Marrying YOLO
Weiming Liu; introduced for dynamic attention obstacle identification in a live
and Transformer for and global modeling, thereby stream and avoiding an accident.
3
Heng Wang; solving the problem that the
Foreign Object Wei Xie; original YOLOv5 only utilizes
Detection Kejun Long information in region proposals
and has insufficient ability to
capture global information.
Second, the convolutional block
attention module (CBAM) and the
stem module are used to improve
feature expression ability further
and reduce floating-point
operations (FLOPs).
4 S.. Jansi Rani, The performance of YOLO-based The ability to observe and
Drive Assistant
software and VGGNet-based
System using YOLO S. Uthirapathi comprehend static and non static
Eswaran, architecture for traffic sign around the vehicle autonomous
V3 and VGGNET
A.V. Vedha detection that is augmented with a vehicles and advanced systems that
Mukund, M. CNN is compared, because the assist in driving .Learnt about how
Vidul detection should be real-time and yolo can be used as a driving
quick for the driving to be safe, assictance.
the networks used here have only
been trained to recognise and
classify items such as traffic
signs and lights.
4
on YOLOv4 network and modified by inserting
the SE block in attention
mechanism to strengthen the
effective channels, and the
information is effectively utilized
by SPP and PANet modules.
8 Xia Zhao, By increasing cluster box count Object detection method M-YOLO,
Modified object
Yingting Ni, and increasing anchor boxes we which utilizes the cluster center in the
detection method
Haihang Jia can have a faster result and super-pixel segmentation and the
based on YOLO improves localization Anchor Box of Faster RCNN. The
accuracy ,convergence experimental result confirms that M-
speed is increased YOLO improves the accuracy of
object bounding boxes by about 10%
and the recall rate, while keeping the
detection accuracy.
9 YOLO Algorithm- Irvine Valiant Using camera module to record The results showed that the most
Based Surrounding Fanthony,Zaenal surrounding the vehicle , giving compatible YOLO model for the system
Object Identification Husin, Hera this to yolo and calculating size was the Tiny YOLOv4 model which
on Autonomous Hikmarika, Suci and distance of object. was built with the darknet framework.
Electric Vehicle Dwijayanti, The simulation experiment showed that
Bhakti Yudho detection accuracy was 80% and was
Suprapto able to transmit information in a form
of data location of the object to the
microcontroller. Hence, it showed that
the YOLO was able to detect objects
and provided input to the
steering control system.
5
10 Zhihen Yang, Autonomous Vehicles (AVs) have In YOLOv4 focused on optimising
Real-time pedestrian
Jun Li, Huiyun the potential to solve many traffic the speed and accuracy of the system,
and vehicle
Li problems, such as accidents, in such a manner that only one
detection for
congestion and pollution. conventional GPU is required (e.g.,
autonomous driving
However, there are still challenges
1080Ti or 2080Ti GPU). In this
to overcome, for instance, AVs
paper, they described that one stage
need to accurately perceive their
object detector is made of several
environment to safely navigate in
elements, input,
busy urban scenarios. The aim of
backbone, neck, and head.
this paper is to review recent
articles on computer vision
techniques that can be used to
build an AV perception system.
12 Design and Rishabh Reinforcement learning methods The process of fabricating a model
Development of an Chopda, Saket can be introduced in
vehicle, from its embedded hardware
Autonomous Car Pradhan, Anuj addition to this method to better
platform, to the end-to-end ML
using Object Goenka performance. This
pipeline necessary for automated data
Detection with method can be used as a prototype
acquisition and model-training,
YOLOv4 for future citywide self-
thereby allowing a Deep Learning
driving cars projects. It can also
model to derive input from the
be used exclusively, or in
hardware platform to control the
addition to conventional lane
car’s movements. This guides the car
detection, to further
autonomously and adapts well to
improve on accuracy of self-
real-time tracks without manual
driving cars.
feature-extraction.
6
2.3 SUMMARY
7
CHAPTER – 3
3.1 INTRODUCTION
This chapter deals with the necessary hardware and software for the
autonomous object detection and classification mechanism to be implemented
in the steering wheel. The operation of both the hardware and software has
been explained in detail.
Live
Camera Images Processing Steering Control
Module Unit Unit
Object
Detection
and
Classification
Steering
YOLO
Motor
algorithm
The processing unit is the core of the system. Here, the live feed from the camera module
is processed using YOLO (You Only Look Once) algorithm.
YOLO algorithm employs convolutional neural networks (CNN) to detect objects in real-
time. As the name suggests, the algorithm requires only a single forward propagation
through a neural network to detect objects.
This means that prediction in the entire image is done in a single algorithm run. The CNN
is used to predict various class probabilities and bounding boxes simultaneously.
Residual blocks
Bounding box regression
Intersection Over Union (IOU)
Residual blocks
First, the image is divided into various grids. Each grid has a dimension of S x S.
The following image shows how an input image is divided into grids.
9
Fig 3.2 Residual blocks
In Fig 3.2, there are many grid cells of equal dimension. Every grid cell will detect
objects that appear within them. For example, if an object center appears within a
certain grid cell, then this cell will be responsible for detecting it.
Width (bw)
Height (bh)
Class (for example, person, car, traffic light, etc.)- This is represented by the
letter c.
Bounding box center (bx,by)
The following image shows an example of a bounding box. The bounding box has
been represented by a yellow outline.
10
Fig 3.3 bounding box regression
YOLO uses a single bounding box regression to predict the height, width, center,
and class of objects. In the image above, represents the probability of an object
appearing in the bounding box.
Each grid cell is responsible for predicting the bounding boxes and their confidence
scores. The IOU is equal to 1 if the predicted bounding box is the same as the real box.
This mechanism eliminates bounding boxes that are not equal to the real box.
11
Fig 3.4 IoU
In the image above, there are two bounding boxes, one in green and the other one in blue.
The blue box is the predicted box while the green box is the real box. YOLO ensures that
the two bounding boxes are equal.
Fig 3.5 shows how the three techniques are applied to produce the final detection results.
12
Fig 3.5
First, the image is divided into grid cells. Each grid cell forecasts B bounding boxes and
provides their confidence scores. The cells predict the class probabilities to establish the
class of each object.
For example, we can notice at least three classes of objects: a car, a dog, and a bicycle. All
the predictions are made simultaneously using a single convolutional neural network.
Intersection over union ensures that the predicted bounding boxes are equal to the real
boxes of the objects. This phenomenon eliminates unnecessary bounding boxes that do
not meet the characteristics of the objects (like height and width). The final detection will
consist of unique bounding boxes that fit the objects perfectly.
For example, the car is surrounded by the pink bounding box while the bicycle is
surrounded by the yellow bounding box. The dog has been highlighted using the blue
bounding box.
13
The object is classified in the processing unit and the information is sent to the
steering control unit.
Here PWM pulses are generated accordingly and fed to the Steering motor.
3.2.4Steering Motor
The motor is connected to the steering column and turn the axis in accordance to
the signals received from the steering control unit.
14
3.3 HARDWARE DESCRIPTION
In the camera module, the camera used here is ESP32 CAM. The ESP32
CAM is a highly versatile camera module based on the ESP32 chip. It is widely
used in the fields of home automation, IoT devices, robotics, and surveillance
systems, among others. This module is designed for embedded applications and
provides high-quality image and video capabilities.
The reason the ESp32 Cam is chosen as a camera in the project as it has a
compact size which will decrease the total weight of the system. It is small and
lightweight, which makes it easy to integrate into a wide range of devices.
This module is equipped with a 2MP camera that can capture clear and high-
quality images and a Wi-Fi module that allows it to connect to the internet and send
images and video streams to remote servers.
15
THE SPECIFICATIONS OF ESP32 CAM IS GIVEN BELOW
The Arduino Uno features a USB interface, 6 analog input pins and 14
digital I/O ports used to interface to external electronic circuits. Of the 14 I/O
ports, 6 pins can be used for PWM output. It allows designers to control and
detect external electronic devices in the real world.
17
3.1 SOFTWARE DESCRIPTION
Over the years Arduino has been the brain of thousands of projects, from
everyday objects to complex scientific instruments. A worldwide community of
makers - students, hobbyists, artists, programmers, and professionals - has gathered
around this open-source platform, their contributions have added up to an incredible
amount of accessible knowledge that can be of great help to novices and experts
alike.
Arduino was born at the Ivrea Interaction Design Institute as an easy tool for
fast prototyping, aimed at students without a background in electronics and
programming. As soon as it reached a wider community, the Arduino board started
changing to adapt to new needs and challenges, differentiating its offer from simple
8-bit boards to products for IoT applications, wearable, 3D printing, and embedded
environments
18
3.1.2 ANACONDA – JUPYTER NOTEBOOK
-1
Focal Length (mm)
19
3.3 SUMMARY
4 This chapter discusses the block diagram, the connections of all devices in
the circuit diagram and how object classification works. The hardware and
software components used in the simulation and the hardware were also
discussed.
20
CHAPTER-4
4.1 INTRODUCTION
This chapter deals with necessary hardware and software implementation in real time for
object detection and identification for automatic steering wheel. The hardware operation
has been explained in detail.
4.2 HARDWARE
21
Fig 4.1 Capturing real time images using ESP
32 Camera module
In Fig 4.2, the live feed from the camera module is displayed on the computer.
Different objects are placed in front of the camera from identification and
classification.
22
Fig 4.3 Object Classification
23
The objects present in front of the camera module in fig 4.2 are classified using YOLO
algorithm as depicted in fig 4.3.
4.3 SUMMARY
In this chapter, the process of object detection and classification using a ESP32 camera
module has been detailed.
First, the camera module sets up a live stream. This stream is then transferred and
displayed onto a computer using WiFi.
Here, the objects in the stream are detected and classified using pre-trained data sets.
24
CHAPTER-5
CONCLUSION
This project has proposed an innovative technique to detect and classify objects in the
surrounding space. If trained properly using data sets of different environments, this
technique can be used for fully automated driving in automobiles.
In the agricultural sector, automated tractors can be implemented by training the A.I using
data sets of different agricultural fields.
FUTURE SCOPE
Object detection and classification is the first step of the initially proposed project
regarding automatic power steering mechanism.
Further work would include integration of this software with the control systems,
electrical components and mechanical chassis all of which constitute an automatic electric
power steering.
25
REFERNCES
[8] “Automated Image Processing Workflow for Unmanned Aerial Vehicles” Samuel
Oswald,Dries Raymaekers,Wouter Dierckx, Dominique DeMunck,Stephen
Kempenaers, Jens Verrydt,Dieter Meeus.
[10] “Real-time pedestrian and vehicle detection for autonomous driving” Zhiheng
Yang, Jun Li, Huiyun Li ,2018 IEEE intelligent vehicles Symposium (IV), 179-
184, 2018.
27
APPENDIX 1
#include "esp_camera.h"
#include <WiFi.h>
#define CAMERA_MODEL_AI_THINKER // Has PSRAM
#include "camera_pins.h"
const char* ssid = "idname";
const char* password = "password";
void startCameraServer();
void setupLedFlash(int pin);
void setup()
{ Serial.begin(115200);
Serial.setDebugOutput(true);
Serial.println();
camera_config_t config;
config.ledc_channel = LEDC_CHANNEL_0;
config.ledc_timer = LEDC_TIMER_0;
config.pin_d0 = Y2_GPIO_NUM;
config.pin_d1 = Y3_GPIO_NUM;
config.pin_d2 = Y4_GPIO_NUM;
config.pin_d3 = Y5_GPIO_NUM;
config.pin_d4 = Y6_GPIO_NUM;
config.pin_d5 = Y7_GPIO_NUM;
config.pin_d6 = Y8_GPIO_NUM;
config.pin_d7 = Y9_GPIO_NUM;
config.pin_xclk = XCLK_GPIO_NUM;
config.pin_pclk = PCLK_GPIO_NUM;
config.pin_vsync = VSYNC_GPIO_NUM;
28
config.pin_href = HREF_GPIO_NUM;
config.pin_sccb_sda = SIOD_GPIO_NUM;
config.pin_sccb_scl = SIOC_GPIO_NUM;
config.pin_pwdn = PWDN_GPIO_NUM;
config.pin_reset = RESET_GPIO_NUM;
config.xclk_freq_hz = 20000000;
config.frame_size = FRAMESIZE_UXGA;
config.pixel_format = PIXFORMAT_JPEG; // for streaming
//config.pixel_format = PIXFORMAT_RGB565; // for face detection/recognition
config.grab_mode = CAMERA_GRAB_WHEN_EMPTY;
config.fb_location = CAMERA_FB_IN_PSRAM;
config.jpeg_quality = 12;
config.fb_count = 1;
29
#if defined(CAMERA_MODEL_ESP_EYE)
pinMode(13, INPUT_PULLUP);
pinMode(14, INPUT_PULLUP);
#endif
esp_err_t err = esp_camera_init(&config);
if (err != ESP_OK) {
Serial.printf("Camera init failed with error 0x%x", err);
return;
}
sensor_t * s = esp_camera_sensor_get();
if (s->id.PID == OV3660_PID) {
s->set_vflip(s, 1); // flip it back
s->set_brightness(s, 1); // up the brightness just a bit
s->set_saturation(s, -2); // lower the saturation
}
if(config.pixel_format == PIXFORMAT_JPEG){
s->set_framesize(s, FRAMESIZE_QVGA);
}
#if defined(CAMERA_MODEL_M5STACK_WIDE) ||
defined(CAMERA_MODEL_M5STACK_ESP32CAM)
s->set_vflip(s, 1);
s->set_hmirror(s, 1);
#endif
#if defined(CAMERA_MODEL_ESP32S3_EYE)
s->set_vflip(s, 1);
#endif
#if defined(LED_GPIO_NUM)
setupLedFlash(LED_GPIO_NUM);
#endif
30
WiFi.begin(ssid, password);
WiFi.setSleep(false);
startCameraServer();
void loop()
{ delay(10000);
31
APPENDIX II
OBJECT DETECTION AND IDENTIFICATION
import sys sys.path.append(r'keras-
yolo3')
from yolo3_one_file_to_detect_them_all import * model =
make_yolov3_model()
weight_reader = WeightReader(r'yolov3.weights')
weight_reader.load_weights(model)
model.save('yolo_model_niranjan.h5')
rom keras.models import load_model
yolo_model=load_model('yolo_model_niranjan.h5')
yolo_model.summary()
net_h,net_w=416,416 obj_thresh,
nms_thresh = 0.7, 0.6 boxes = []
anchors = [[116,90, 156,198, 373,326], [30,61, 62,45, 59,119], [10,13,
16,30, 33,23]]
labels = ["person", "bicycle", "car", "motorbike", "aeroplane", "bus", "train", "truck",
\
"boat", "traffic light", "fire hydrant", "stop sign", "parking meter",
"bench", \
"bird", "cat", "dog", "horse", "sheep", "cow", "elephant", "bear", "zebra",
"giraffe", \
"backpack", "umbrella", "handbag", "tie", "suitcase", "frisbee", "skis",
"snowboard", \
"sports ball", "kite", "baseball bat", "baseball glove",
"skateboard", "surfboard", \
"tennis racket", "bottle", "wine glass", "cup", "fork", "knife",
"spoon", "bowl", "banana", \
"apple", "sandwich", "orange", "broccoli", "carrot", "hot dog", "pizza",
"donut", "cake", \
"chair", "sofa", "pottedplant", "bed", "diningtable", "toilet", "tvmonitor",
"laptop", "mouse", \
"remote", "keyboard", "cell phone", "microwave", "oven",
"toaster", "sink", "refrigerator", \
"book", "clock", "vase", "scissors", "teddy bear", "hair drier",
"toothbrush"]
import matplotlib.pyplot as plt imag=cv2.imread(r"N:\proj\test img\
istockphoto-1319467946- 170667a.jpg")
imag_h,imag_w,_=imag.shape
new_imag=preprocess_input(imag,net_h,net_w) plt.imshow(image)
boxes=[]
for i in range(len(yolo_pred)):
boxes += decode_netout(yolo_pred[i][0], anchors[i], obj_thresh,
nms_thresh, net_h, net_w) draw_boxes(imag,boxes,labels,obj_thresh)
cv2.imwrite('detected_niranjan.jpg',(imag).astype('uint8'))