What do you think about this segmentation problem?

So, I have a lot of things going on under the hood, but everything is pretty normal, no fancy stuff going on. It should be a pretty normal looking codebase.

With that in mind,
I have this smaaaaall model

In [178]: net
Out[178]: 
Model(
  (conv): Sequential(
    (0): Conv2d(3, 10, kernel_size=(1, 1), stride=(1, 1))
    (1): Conv2d(10, 2, kernel_size=(1, 1), stride=(1, 1))
  )
)

And this ONE image

And I have trained for over 2000+ epochs.

This isn’t converging.
I want to segment the sky.
Actually, I am debugging. And this obviously means there is some bug somewhere.

What are your thoughts?

Note that you are not using any non-linearity between the conv layers.
Given that and a kernel of a single pixel, it looks like your model captures the blue-ish color successfully.

1 Like

Yep! You are right! I added ReLU to get a better convergence.

But, still didn’t reached 0 loss. I increased the kernel_size upto 5x5 for both the Conv Layers. I went very close, but still didn’t converged. Shouldn’t the loss go to 0?

If the model has enough “capacity”, then the loss should converge towards zero.
Just for the sake of debugging this example, you could increase the number of kernels, their spatial size, or try a huge linear layer instead.