Turning Object Detection into Low Light Object Detection

Rishi Mehta
4 min readDec 11, 2019

How does it work?

Getting the image

The obvious just like with any other algorithm. A camera would ideally be placed in the front of a car and a live video stream would be fed through a computer.

That video file is then broken up into frames for the rest of the algorithm to analyze.

Step 1: Converting the image from low light to normal environments

There are quite a few ways to perform object detection. However, it’s difficult to just perform it on the lowlight image without changing the appearance of it. This is why we first have to take the image and turn it into a normal, daytime photo.

It’s much easier to see the image on the right which is exactly why we convert the image.

For my algorithm, I preprocessed a sample image and then ran it through a Convolutional Neural Network. I added a total of 5 layers to further maximize this part of the program.

A sample of 4/5 of the CNN layers

Step 2: Performing Object Detection On The Regular Image

Now, we make it much easier to perform object detection because there are visible objects. Programming the algorithm in this specific way shows major improvement in things like simplicity and accuracy.

If we were to run a normal object detection algorithm on a dark image it would be significantly harder. In the example above, you can’t see the cars on the left side of the road. Computers can see things that you and I can’t!

For my algorithm, I used YOLO (You Only Look Once) to detect objects in a frame/image. YOLO is what is known as a single-stage detector.

In general, single-stage detectors tend to be less accurate than two-stage detectors but are significantly faster. As the name suggests, single-stage only goes through one step while two-stage goes through two.

How YOLO Works

These algorithms treat object detection as a regression problem. It takes a given input image and applies boundary boxes by assigning corresponding class label probabilities.

The YOLO library is trained on the COCO (Common Objects in Context) dataset. The COCO dataset consists of 80 labels. Some of the major ones include:

  • People
  • Bicycles
  • Cars and trucks
  • Airplanes
  • Stop signs and fire hydrants
  • Animals, including cats, dogs, birds, horses, cows, and sheep, to name a few
  • Kitchen and dining objects, such as wine glasses, cups, forks, knives, spoons, etc.
  • …and much more!

Wait, don’t we have Lidar and Radar sensors for that?

Well yeah, Lidar sensors can be used in night environments to help see better but at the same time companies like Tesla don’t use Lidar for reasons which include the expense.

But at the same time, Lidar is so incredibly useful and innovative that it’s hard to disregard. So we can just make the best of both worlds by having Lidar and Low light object detection.

After all, it doesn’t require more space and is a good alternative for situations where there is no Lidar.

My biggest takeaways

Working on this project for a while, there were so many important things I learned that I think other people should really internalize.

One of the biggest ones was the idea that there are so many different ways to approach making something like this. It really does show how far technology and programming have come over the years.

The other one was my overall experience in programming something of this difficulty. It was incredibly hard to consistently code with all the other events that I had to focus on.

For me, I think this whole Autonomous Vehicle passion is just one huge risk. A lot of other things had to suffer in order for me to perform at my best. I really do think if I can start to understand who I really am, I can finally balance everything and make a direct path to my future.

--

--

Rishi Mehta

17 y/o working on building a fall detection system for seniors | fallyx.com