Skip to content

Learning Blocks

2D Convolutional (CNN)

A convolutional network that treats a motion window as a small picture of time × axes.

Try it in Studio
On this page

What is this learning block?

2D Convolutional (CNN) is a neural network that slides small square filters over a two-dimensional grid of numbers. In Studio it appears as 2D Convolutional (CNN) in the Add a learning block list.

What does it do?

It looks at one window as a small grid, with time in one direction and the sensor axes in the other, and gives a score for every label.

How does it learn?

Each filter is a small 3 × 3 pattern. Training adjusts the filters so they react to patterns that appear across time and across axes at the same moment, for example "accX rises while accZ falls". It learns like the other blocks: guess, measure the loss, adjust with Adam, and stop early if validation accuracy stops improving for 20 training cycles.

What model architecture does it use?

The default network for a Motion project is:

  1. 1InputWindow samples × axes × 1
  2. 2Conv2D 16Kernel 3, ReLU, then MaxPooling2D 2
  3. 3Conv2D 32Kernel 3, ReLU, then MaxPooling2D 2
  4. 4Conv2D 64Kernel 3, ReLU
  5. 5FlattenTurns the grid into a list
  6. 6Dense 64 + Dropout 0.2Combines the patterns
  7. 7OutputOne score per label
Default 2D Convolutional network

You can change the layers in the architecture editor on the training page, and go back with Revert to default topology.

What settings can I configure?

SettingDefaultWhat it does
Training cycles60Passes over the training data
Learning rate0.001Size of each weight adjustment
ProcessorCPUWhere training runs (GPU only if your server offers it)
Batch size (Advanced Settings)32Windows per weight adjustment
Validation split (Advanced Settings)0.2Share of training data kept aside to check progress
ArchitectureDefault topology aboveLayers, filters, kernel sizes

What problems can it solve?

  • Movements where several axes change together in a typical way.
  • Experiments when 1D Convolutional or Classification don't reach the accuracy you need.

Simple example

You record twist and tilt with a 6-axis sensor (accelerometer and gyroscope). A twist shows up mostly in the gyroscope axes, a tilt mostly in the accelerometer axes. The 2D filters can learn which axes move together for each label.

How do I understand the training results?

The same as for Classification: accuracy per window and per recording, a confusion matrix, and loss and accuracy graphs. See Evaluating a Motion model.