SorourMo / Cloud-Net-A-semantic-segmentation-CNN-for-cloud-detection

A semantic segmentation CNN for cloud detection
GNU General Public License v3.0
94 stars 28 forks source link

Model code optimization #3

Closed AndreyK641 closed 3 years ago

AndreyK641 commented 3 years ago

Hello! In the functions improve_ff_block is it correct to replace code

for ix in range(1):
    if ix == 0:
        x1 = input_tensor1
    x1 = concatenate([x1, input_tensor1], axis=3)
x1 = MaxPooling2D(pool_size=(2, 2))(x1)

by

x1 = MaxPooling2D(pool_size=(2, 2))(input_tensor1)
x1 = concatenate([x1, x1], axis=3)

and

for ix in range(3):
    if ix == 0:
        x2 = input_tensor2
    x2 = concatenate([x2, input_tensor2], axis=3)
 x2 = MaxPooling2D(pool_size=(4, 4))(x2)

by

x2 = x = MaxPooling2D(pool_size=(4, 4))(input_tensor2)
 for ix in range(3):
    x2 = concatenate([x2, x], axis=3)

?

I think it is possible to apply this approach for x3 and x4 calculation.

Silengcewang commented 3 years ago

Hello! In the functions improve_ff_block is it correct to replace code

for ix in range(1):
    if ix == 0:
        x1 = input_tensor1
    x1 = concatenate([x1, input_tensor1], axis=3)
x1 = MaxPooling2D(pool_size=(2, 2))(x1)

by

x1 = MaxPooling2D(pool_size=(2, 2))(input_tensor1)
x1 = concatenate([x1, x1], axis=3)

and

for ix in range(3):
    if ix == 0:
        x2 = input_tensor2
    x2 = concatenate([x2, input_tensor2], axis=3)
 x2 = MaxPooling2D(pool_size=(4, 4))(x2)

by

x2 = x = MaxPooling2D(pool_size=(4, 4))(input_tensor2)
 for ix in range(3):
    x2 = concatenate([x2, x], axis=3)

?

I think it is possible to apply this approach for x3 and x4 calculation.

Hello! I have a question that why the evaluation index of same method in the cloudnet and cloudnet++ are different

SorourMo commented 3 years ago

Please refer to https://github.com/SorourMo/38-Cloud-A-Cloud-Segmentation-Dataset/issues/7

SorourMo commented 3 years ago

Hello! In the functions improve_ff_block is it correct to replace code

for ix in range(1):
    if ix == 0:
        x1 = input_tensor1
    x1 = concatenate([x1, input_tensor1], axis=3)
x1 = MaxPooling2D(pool_size=(2, 2))(x1)

by

x1 = MaxPooling2D(pool_size=(2, 2))(input_tensor1)
x1 = concatenate([x1, x1], axis=3)

and

for ix in range(3):
    if ix == 0:
        x2 = input_tensor2
    x2 = concatenate([x2, input_tensor2], axis=3)
 x2 = MaxPooling2D(pool_size=(4, 4))(x2)

by

x2 = x = MaxPooling2D(pool_size=(4, 4))(input_tensor2)
 for ix in range(3):
    x2 = concatenate([x2, x], axis=3)

?

I think it is possible to apply this approach for x3 and x4 calculation.

Yes, they are equivalent.