- 我正在尝试用 10 个类对 MSTAR 数据集进行分类
- 我使用了包含 15 个时间步长的 DCNN 和 BILSTM 的模态
我的问题是:
- 如何克服错误
- 如何得到好的分类结果。
我的代码是:
inputs=Input(shape=(15,60,60,3))
model = Sequential()
# 1st Convolutional Layer
model.add(TimeDistributed(Conv2D(filters=16 ,kernel_size=(5,5), padding='valid'),input_shape=(15,60,60,3)))
model.add(TimeDistributed(Activation('relu')))
# Batch Normalisation
model.add(TimeDistributed(BatchNormalization()))
# Pooling
model.add(TimeDistributed(MaxPooling2D(pool_size=(2,2), strides=(2,2), padding='valid')))
# 2nd Convolutional Layer
model.add(TimeDistributed(Conv2D(filters=32, kernel_size=(5,5), padding='valid')))
model.add(TimeDistributed(Activation('relu')))
# Batch Normalisation
model.add(TimeDistributed(BatchNormalization()))
# Pooling
model.add(TimeDistributed(MaxPooling2D(pool_size=(2,2), strides=(2,2), padding='valid')))
# 3rd Convolutional Layer
model.add(TimeDistributed(Conv2D(filters=64, kernel_size=(5,5), padding='valid')))
model.add(Activation('relu'))
# Batch Normalisation
model.add(TimeDistributed(BatchNormalization()))
# Pooling
model.add(TimeDistributed(MaxPooling2D(pool_size=(2,2), strides=(2,2), padding='valid')))
# 4th Convolutional Layer
model.add(TimeDistributed(Conv2D(filters=128, kernel_size=(4,4), padding='valid')))
model.add(TimeDistributed(Activation('relu')))
# Batch Normalisation
model.add(TimeDistributed(BatchNormalization()))
model.add(TimeDistributed(Flatten()))
#add dropout
model.add(Dropout(0.0))
#bidirectional lstm
model.add(Bidirectional(LSTM(1024,activation='tanh',return_sequences=True)))
#2 nd bidirectional layer
model.add(Bidirectional(LSTM(1024,activation='tanh',return_sequences=False)))
# Output Layer
model.add(Dense(10))
model.add(Activation('softmax'))
# (4) Compile
model.compile(loss='categorical_crossentropy', optimizer='adam',\
metrics=['accuracy'])
model.summary()