M2M Day 195: The not-so-sexy part of deep learning — formatting spreadsheets of data

Max Deutsch
4 min readMay 15, 2017

--

This post is part of Month to Master, a 12-month accelerated learning project. For May, my goal is to build the software part of a self-driving car.

Yesterday, I tried to drive my self-driving car on new roads (from the Udacity dataset). However, the car wasn’t prepared for this, and virtually crashed repeatedly.

Clearly, the model as trained on the NVIDIA dataset isn’t suited for the Udacity dataset.

One reasonable explanation for this discrepancy is that, while both datasets feature forward-facing videos of the road, the videos noticeably differ in regards to viewing angle, framing, and lens distortion. As a result, a model trained from one view shouldn’t work well on the either (since the camera has been moved, zoomed in, and reframed).

Here’s a still frame from the NVIDIA dataset:

And here’s a still from Udacity’s dataset:

Clearly, these views of the road are different enough, where a model trained on one dataset isn’t usable from the other. (If both cars were shooting video from the same vantage point, theoretical the model would then be usable across both sets of data).

Thus, to continue forward, I must train the self-driving car model also on a section of the Udacity data, and then see how the model performs when tested on the rest of the new data.

Today’s task was to reformat Udacity’s dataset so that it can be used for training.

Yesterday, I completed part of this reformatting when I renamed the Udacity JPEGs from long, random numbers to sequentially-labelled images.

From this…

To this…

With the images prepared, I next needed to create a text file called “data.txt” for the Udacity dataset, which lists the correct steering angle next to the name of the corresponding image.

Here’s what NVIDIA’s data.txt file looks like:

This isn’t the most compelling screen grab, since the first 22 steering angles are zeroed.

Yet, the Udacity data was compiled in a spreadsheet like this:

So, to create the data.txt file for the Udacity dataset, I needed to accomplish two things: 1. Rename the frame_ids to match yesterday’s numbering scheme; 2. Figure out how to convert a spreadsheet into a text file without any of the table-style formatting.

Rather than using a Python script, I tried to figure out how to do both steps within Google Sheets (there is likely a more efficient way).

First, I typed out a small sequences of consecutive numbers, and then pulled down the sequence to populate the other ~5000 cells.

Next, I used the built-in functions TO_TEXT and CONCATENATE to convert the integers into strings and then concatenate those strings with the file extension .jpg.

On to Step 2 — Converting the table into an unformatted text document.

I used CONCATENATE again to combine the image names and the steering angles into a single cell (with a one space separator).

Then, I concatenated each cell with char(10), which is the character code for a line break. And lastly, concatenated all the cells into a single cell.

I copied the contents of this single cell into a text document, and my data.txt file was ready to go.

The one weird thing is that Udacity’s steering angle numbers seem very different than NVIDIA’s steering angle numbers.

It appears that the companies are using significantly different steering angle representations, but I’m not exactly sure how the two methods mathematically relate.

I may be able to successfully train the model without ever finding out this mathematical relationship, but I’m skeptical that’s the case.

I’ll explore this more tomorrow, and then start training the model on the Udacity data.

Read the next post. Read the previous post.

Max Deutsch is an obsessive learner, product builder, guinea pig for Month to Master, and founder at Openmind.

If you want to follow along with Max’s year-long accelerated learning project, make sure to follow this Medium account.

--

--