Train model on labelled 2D measurement data

I have a dataset of several hundreds measurements each represented by an array of 2x60 datapoints. The measurements are categorized by labels into 8 different categories.

The data is structured as follows:
DATA = [
{‘labelA’: np.array([[0.0, 0.0], [1.1, 3.1], [2.5, 6.5], …, [0.1, 0.0]])},
{‘labelB’: np.array([[0.0, 0.0], [2.1, 1.1], [3.2, 4.5], …, [0.2, 0.0]])},
{‘labelA’: np.array([[0.0, 0.0], [1.1, 3.2], [2.5, 6.6], …, [0.1, 0.0]])},

{‘labelH’: np.array([[0.0, 0.0], [3.1, 1.1], [4.2, 4.2], …, [0.1, 0.0]])},
]

A single measurement can be represented in a graph:

I have two questions:

  1. What is the best way to load this data into a Tensorflow dataset?
  2. What Tensorflow model is best to use for this type of data? Since expanding my dataset is very time consuming I would like to make the most out of it.

Any reference to similar problems is appreciated!
Many thanks in advance.

Sure! Here are a few options:

  • Thanks for sharing! I’m also curious about the best approach for this type of data.
  • Interesting problem! I’ll look into similar use cases and get back to you.
  • This looks challenging. I’m not familiar with this, but I’m willing to learn.
1 Like

Hi @rvm, you can create a Tensorflow dataset in a way as shown in the below code. considering this as the raw data.

Initially you can get the labels and values from the data

label=[]
values=[]
for i in range(len(data)):
    label.append(list(data[i].keys())[0])
    values.append(list(data[i].values())[0])

and can create a tensorflow dataset using this

dataset = tf.data.Dataset.from_tensors((label, values))

please refer to this gist for working code example.

There are multiple options when it comes to building classification problem. you can use a fully connected neural network(FCNN), cnn, rnn’s etc. Thank You.

It doesn’t look like there are any action items.

1 Like

Thanks for your useful comment @Kiran_Sai_Ramineni!

Apperently loading the data was straightforward.

But still no clue how the build the right model. What layers do I need to add to the sequential model? What are the beste compile arguments to use?

Hi @rvm, when it comes to model building we cannot say this particular model architecture suites for this data without training and seeing the results. It’s an experimental thing.

when it comes to FCNN model the model includes dense layers. Please refer to this tutorial for training a FCNN model.

when it comes to CNN the model includes Convolution layers, max pooling, dense layer etc. Please refer to this tutorial for creating a CNN classification model.