What hyper parameters should i give to get better results on autoencodes for internet traffic classification

by Arti   Last Updated September 11, 2019 09:02 AM - source

My dataset consists of rows as instances/packets and have 7 ip attributes for columns.

X = data.iloc[ : , [0,1,2,3,4,5,6]].values
X = X.reshape([instances,flow_size,attributes])

# Getting label values
Y = data['label'].values
# Reshaping into an array with each row having a number representing one of num_classes elements
Y = Y.reshape(-1,1)

# OneHot encoding
onehot_encoder = OneHotEncoder(sparse=False, categories='auto')
onehot_encoded = onehot_encoder.fit_transform(Y)
Y = onehot_encoded
Y.shape   

This is how I have shaped my data and need a alternate method as I'm getting 33.33% accuracy for 3 labels which means there is some issue with the feature selection of the autoencoder. Following is my autoencoder code

input_dim = X_train.shape[1] encoding_dim=7

input_layer = Input(shape=(input_dim, ))
encoder = Dense(encoding_dim, activation="tanh", activity_regularizer=regularizers.l1(10e-5))(input_layer)
encoder = Dense(int(encoding_dim), activation="relu")(encoder)
#encoder = Dense(int(encoding_dim-2), activation="relu")(encoder)
code = Dense(int(encoding_dim-4), activation='tanh')(encoder)
#decoder = Dense(int(encoding_dim-2), activation='tanh')(code)
decoder = Dense(int(encoding_dim), activation='tanh')(code)
decoder = Dense(7, activation='relu')(decoder)
autoencoder = Model(inputs=input_layer, outputs=decoder)

autoencoder.compile(loss = 'categorical_crossentropy', optimizer='adam',metrics = ['accuracy'])
#model.add(Dense(num_classes,activation='softmax'))
print(autoencoder.summary())
Tags : traffic


Related Questions


how to collect netflow traffic from ubuntu server

Updated July 08, 2017 07:02 AM

mqprio qdisc not working

Updated January 24, 2019 10:02 AM

Packet Loss Counter

Updated May 23, 2019 08:02 AM