helibu / Airbus-ship-detection-web

Flask and python website for a kaggle competition
4 stars 4 forks source link

Some review of your classification network #1

Open duanzhiihao opened 5 years ago

duanzhiihao commented 5 years ago
model = Sequential()

model.add(Convolution2D(32, (3, 3),
                       input_shape=(256, 256, 3),
                       strides = (1,1), 
                       padding = 'same',
                       kernel_initializer='he_normal',
                       activation='relu'))
model.add(BatchNormalization())
model.add(AvgPool2D(pool_size=(2, 2)))

model.add(Convolution2D(32, (3, 3),
                       input_shape=(256, 256, 3),
                       strides = (1,1), 
                       padding = 'same',
                       activation='relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))

model.add(Convolution2D(32, (3, 3),
                       input_shape=(256, 256, 3),
                       strides = (1,1), 
                       padding = 'same',
                       activation='relu'))

model.add(MaxPooling2D(pool_size=(2, 2)))

model.add(Convolution2D(32, (3, 3),
                       input_shape=(256, 256, 3),
                       strides = (1,1), 
                       padding = 'same',
                       activation='relu'))

model.add(MaxPooling2D(pool_size=(2, 2)))

model.add(Flatten())

model.add(Dense(units=128, activation='relu', kernel_initializer='normal'))
model.add(Dense(units=1, activation='sigmoid', kernel_initializer='normal'))

model.compile(optimizer='adam',
             loss='binary_crossentropy',
             metrics=['accuracy'])
model.summary()
  1. You want to use a simple network to speed up the classification process. But I think the size of convolutional layer may not increase the parameter number very much. Maybe you can try deeper convolutionala layers, or just simply use a well-build net architecture, like googlenet.
  2. I can't find input_shape parameter in the Keras doc of Conv2d. And strides = (1,1) is the default value. Maybe you don't need to add these two lines in every conv2d layer.
  3. You talk about you are considering about the overfitting. I notice that there are no dropout and input data augmentation in your network, maybe you can try add these features.
  4. The ship detection on Kaggle is a image segmentation task, while you just classifying. Maybe you should start working on U-net. Hope to see you on the Kaggle leaderboard :)
helibu commented 5 years ago

Thanks for commenting.

  1. We will add dropout and use more data to overcome the overfiting and to improve this model.
  2. For googlenet, do you mean google inception v4 or google inception ResNet? We will look into it and compare with the result of U-net.
  3. We are working on the U-net to do the segmentation part.
duanzhiihao commented 5 years ago

Actually I don't know which is better, the performance of different network may depend on the dataset. You can try them all, here is the codes https://github.com/titu1994/Inception-v4

helibu commented 5 years ago

Sure, I will try them to figure out which is better. Thanks for the advice.

minaahmed commented 3 years ago

Hello, I get out of memory error when running UNET model? MemoryError: Unable to allocate 6.75 MiB for an array with shape (3, 768, 768) and data type float32