Posted in Self-Driving Car

YOLO-You only look once

YOLO hẳn đã rất quen thuộc với các bạn trẻ, chúng ta đã nghe từ này biết bao nhiêu lần, khi mà thằng bạn của bạn muốn đua xe đập đá mà bạn ngăn cản, nó sẽ lôi từ này để bật lại bạn, rằng mày chỉ sống có 1 lần thôi, yolo đi.

Câu đó thật ra cũng đúng trong hoàn cảnh bạn biết mình làm gì:)), và trong bài viết này mình cũng nói về YOLO, nhưng không phải về cụm từ kia, mà là một thành tựu lớn của neural network và Image Processing- YOLO( You Only Look One). Nghĩa là chỉ nhìn một lần thôi, lần đầu nghe câu này mình thấy buồn cười, thì hiển nhiên là nhìn một lần chứ mấy lần, còn thấy người đẹp muốn nhìn lại mấy lần thì nhìn chứ, ai cấm:)). Nhưng thật ra câu nói này không phải cho con người, mà là cho computer. Nếu bạn nào đã có kiến thức về Image Processing thì mời lướt qua, còn chưa thì mình diễn tả nôm na như sau: Máy tính nhìn một bức ảnh dưới dạng một ma trận số, và để thực hiện một số tính năng chỉnh sửa ảnh, đầu tiên ta phải xét đến một filter matrix hoặc còn gọi là convolution, convolution matrix này sẽ được nhân với một ô nhỏ trên cùng bên trái của tấm ảnh, sau đó ô này sẽ trượt theo chiều ngang và sau đó xuống dòng đến khi đi hết tấm ảnh. Do đó có thể nói máy tính nó không nhìn tấm ảnh một lần như chúng ta mà nó nhìn từ trái qua phải từ trên xuống dưới. Tất nhiên nhìn kĩ là tốt nhưng làm vậy rất tốn thời gian, trong khi chúng ta chỉ cần nhỉn tổng thể bức hình là có thể chỉ ra trong đó có gì, thì computer cần phải rà hàng trăm hàng ngàn tấm ảnh nhỏ mới làm được điều tương tự. YOLO ra đời để cho phép máy tính làm điều tương tự nhưng tốc độ được cải thiện đáng kể, chỉ quét một lần và nhận diện objects, cho đó nâng cao tốc độ xử lý ảnh lên đến 60 frames/s nhờ đó có thể đáp ứng nhu cầu real-time.

Dưới đây là một số chia sẻ của chính tác giả YOLO:

You only look once (YOLO) is a state-of-the-art, real-time object detection system. On a Pascal Titan X it processes images at 30 FPS and has a mAP of 57.9% on COCO test-dev.

Prior detection systems repurpose classifiers or localizers to perform detection. They apply the model to an image at multiple locations and scales. High scoring regions of the image are considered detections.

We use a totally different approach. We apply a single neural network to the full image. This network divides the image into regions and predicts bounding boxes and probabilities for each region. These bounding boxes are weighted by the predicted probabilities.

12
Comparison other detector

Về cách hoạt động của YOLO mình đã nói ở trên, còn hình bên dưới chính là kết quả hoành tráng mà nó tạo ra. Trong hình bạn có thể thất từng chiếc xe được theo dấu với những hộp bao quanh, và xác định nó là xe lên tới 99%. Không những vậy, đoạn code còn kết hợp với segmentation để nhận dạng đường biên của mỗi chiếc xe, giúp nhận diện chính xác hơn.

13

Nếu các bạn có hứng thú với đoạn code trong video bên trên, bạn có thể lấy code qua Github của mình, đoạn code được viết bằng Python và sử dụng tensorflow model.

Advertisement
Posted in Self-Driving Car

Tóm Tắt (Sumary) Cách hoạt động của xe tự lái (Self-driving vehicle)…và robot tự hành.

Mình sẽ viết đoạn này bằng tiếng Anh, tiếng việt các bạn có thể dùng tính năng translate nằm bên phải để dịch tiếng việt nhé. Hoặc mình sẽ dịch tiếng việt bên dưới

Most of self-driving car on the world work as follow:

Cách mà một chiếc xe tự lái hoạt động được cấu trúc như biểu đồ phía dưới:

Computer Vision(Kỹ thuật xử lý ảnh) + Sensor Fusion(kết hợp sensor: các bạn tạm hiểu là cách hợp các tín hiệu cảm biến lại để đưa ra thông tin chính xác nhất) để đưa ra vị trí chính xác của xe nằm ở đâu trong map. Từ đó xe dùng các thật toán tìm đường Path Planning  để đi tới đích, bước cuối cùng là truyền lệnh cho động cơ xe để yêu cầu chạy tốc độ bao nhiêu bẻ lái như thế nào:

Tổng quát chỉ có vậy, nếu các bạn muốn hiểu chi tiết thì hãy đọc đoạn tiếng anh bên dưới(có thế translate nếu muốn)

Howcarselfdriving.png

I/ Generally

Computer vision is how we use images to figure out what the world around us look like. Sensor fusion is how we in-cooperate data from other sensor like laser, Lidars, radar, to get richer understanding out of environment. Once we’ve build this deep understanding of what the world looks like we use path planning to chart a course through the world to get us to where we would like to go. The final step is how we actually turn the sterring wheel and hit the throttle, and the brake in oder to execute the trajectory that we build during path planning.

II/ Computer Vision

Computer Vision using the camera mounted in front of the car, to detect lane and other vehicle. It looking for color and edges and gradient to find the lane on the road and then train a deep neural network to draw the bounding box around the other vehicle on the road.

Deep neural network and deep learning is exciting new part of machine leaning and artificial intelligent. And this is the way that computer can learn what cars and other object look like by simply sending them lots and lots of data they see lots of cars and this is pretty similar to what advance driving assistance system do on the road today.

II/ Sensor Fusion

Once we know what world look like by images, the next steps is augment that understanding of the world using other sensor so radar and laser to get measurement that are difficult for the camera alone to understand so things like distance between our car and other car and how fast other object in the environment moving.

A  Lidar which has an array of laser doing a 360 degrees scan to to world and seeing the different object in that environment looks like and how they move.

So once we understand both what the world look like and how to measure it and we cooperate those understanding together to get rich picture of our surrounding environment, the next step is to localize ourself in that environment.

III/ Localization

Maybe people think GPS today can localize ourself in cellphone. we absolute now where we are but it not really like that, because GPS uncertainty is about 1 to 2 meter. And in self-driving we need the absolute accuracy, because if a small mistake happen, it very dangerous for your car if you running on the hight way with 150 to 200km/h. So we have to use much sophisticated mathematical algorithm as well as hight definition map to localize our vehicle precisely in it environment to single digits centimeter level accuracy.

Using particle filter is very good way to localize a vehicle in an know environment. Measuring distance from various landmarks ans it’s figuring how far is it from these landmark and where it see the landmark and comparing that to the map and using that to figure out precisely where it is in the world , those landmark might be things like streetlight, or traffic sign, mail boxes or even manhole covers.

IV/ Path Planning

When we know how the world look like and where were are in this world, the next step is to actually chart a path plan through that world to figure out how to get where we want to go, and this is path planning. This program cerate a path planner which predict where the other vehicles on the road are going to and then figures out the maneuver our vehicle should take in response and finally build and series of way points those are the green points in the video for the car driver through that’s the trajectory the car should follow and you see if the vehicle comes up on other traffic it has to figure out should it slow down and stay in it lane or should it shift right or should shift left. And this is the type of decision that real self-driving car had to make all the time subject to constraints like speed limit and acceleration limit.

V/ Control

Final step in the pipeline is control. Control is how we actually turn the steering wheel and hit the throttle and hit the brake in oder to execute that trajectory that we build during path planning.

If you want to go in detail, you can apply to Udacity self-driving car program, there you will be learn theories, programming skill with the best professors and the best engineers form over the world