If your impulse is performing poorly, these could be the culprits:
- There is not enough data. Neural networks need to learn patterns in data sets, and the more data the better. You can also lower the window increase (in the Create Impulse screen) to create more overlap from windows, but this does not lead to more variance in your data set. More data is thus always better.
- The data does not look like other data the network has seen before. This is common when someone uses the device in a way that you didn't add to the test set. If you see this in the test set or during live classification you can push the sample to the training set by clicking
⋮, then selecting Move to training set. Make sure to update the label before training.
- The model has not been trained enough. Up the number of training cycles and see if performance increases. If there's no difference then you probably don't have enough data, or the data does not separate well enough.
- If you have a high accuracy on your neural network, but the model performs poorly on new data, then your model might be overfitting. It has learned the features in your dataset too well. Try adding more data, or reduce the learning rate.
- The neural network architecture is not a great fit for your data. Play with the number of layers and neurons and see if performance improves.
If you have much more data in one class than for other classes, say 90% of your data is labeled as "idle" and only 10% as "wave", your neural network will have trouble learning due to class imbalance. If this is the case your best bet is to increase the amount of data in the misrepresented class. However, if this is not possible you can try to rebalance your dataset during training. To do this:
- On the Neural Network page click
Switch to Keras (expert) mode.
- Below the imports (the lines starting with
from sklearn.utils.class_weight import compute_class_weight class_weights = dict(enumerate(compute_class_weight('balanced', np.unique(np.argmax(Y_train, axis=1)), np.argmax(Y_train, axis=1))))
- At the last line (where
fit()is called), add
model.fit(X_train, Y_train, batch_size=50, epochs=200, validation_data=(X_test, Y_test), class_weight=class_weights)
If you still have issues, the community might be able to help through the forums.
Updated 11 months ago