I'm trying to use Tensorflow for signal classification. The signals are either normal or high-risk signals. For this purpose, I used convolutional neural networks. The length of signals are 685 and the architecture is:
- Convolution layer with 27 channels and 1 by 16 window size and stride 1.
- Max pooling layer with 1 by 2 window size and stride 2.
- Convolution layer with 14 channels and 1 by 32 window size and stride 1.
- Max pooling layer with 1 by 2 window size and stride 2.
- Convolution layer with 4 channels and 1 by 32 window size and stride 1.
- Max pooling layer with 1 by 2 window size and stride 2.
- Convolution layer with 3 channels and 1 by 10 window size and stride 1.
- Max pooling layer with 1 by 2 window size and stride 2.
- Fully connected layer with 20 neurons and dropout layer.
- Fully connected layer with 10 neurons and dropout layer.
- And finally Soft max layer.
After training the network using AdamOptimizer with learning rate 0.001 with 150000 signals the training accuracy is near 95 percent (batch training with 16 batch size is used), however testing accuracy using 20000 new signals is almost 50 percent. Since there is just 2 classes, this accuracy is no better than random guess.
model="conv1d-27-16-1,maxpool-2,conv1d-14-32-1,maxpool-2,conv1d-4-32-1,maxpool-2,conv1d-3-10-1,maxpool-2,full-20,full-10,softmax"
cnn=CNN_1D(model,input_size=685,n_classes=2,num_epochs=20,batch_size=16,dropout=0.75)
cnn.read_data('train_input','train_targets','test_input','test_targets')
cnn.build_model()
cnn.training(validation_set='all')
How can I improve the testing accuracy in my network?