Skip to content

Conversation

jemrobinson
Copy link
Member

@jemrobinson jemrobinson commented Sep 9, 2025

  • Further simplify the naive linear encoder/decoder
  • Add a non-linear CNN with activation functions

Testing

The following validation results come from the same minimal training (Dec 2019) and validation (Jan01-Jan15 2020) data.

I'm a bit worried about the fact that 500 epochs and 20 epochs look essentially the same, but perhaps this is due to the very small amount of training data?

Thoughts @marianovitasari20 @louisavz ?
Should we be doing some sort of normalisation at data-loading/data-prep time?

naive-null-naive: 781 params

  | Name      | Type               | Params | Mode
---------------------------------------------------------
0 | encoder_0 | NaiveLinearEncoder | 700    | train
1 | encoder_1 | NaiveLinearEncoder | 40     | train
2 | processor | NullProcessor      | 0      | train
3 | decoder   | NaiveLinearDecoder | 41     | train
---------------------------------------------------------
781       Trainable params
0         Non-trainable params
781       Total params
0.003     Total estimated model params size (MB)
14        Modules in train mode
0         Modules in eval mode

20 epochs

media_images_sea-ice_concentration-static-maps_0_7af4f583bbaa43c82447

500 epochs

sea-ice_concentration-static-maps_0_86a172b8cee2c183f726

cnn-null-cnn: 1.8M params

  | Name      | Type          | Params | Mode
----------------------------------------------------
0 | encoder_0 | CNNEncoder    | 1.3 M  | train
1 | encoder_1 | CNNEncoder    | 1.4 K  | train
2 | processor | NullProcessor | 0      | train
3 | decoder   | CNNDecoder    | 937    | train
----------------------------------------------------
1.3 M     Trainable params
0         Non-trainable params
1.3 M     Total params
5.286     Total estimated model params size (MB)
95        Modules in train mode
0         Modules in eval mode

20 epochs

sea-ice_concentration-static-maps_0_7952c2b73d4a517da08b

500 epochs

sea-ice_concentration-static-maps_0_3a9925cfa25e18d1c9e8

naive-unet-naive: 11M params

  | Name      | Type               | Params | Mode
---------------------------------------------------------
0 | encoder_0 | NaiveLinearEncoder | 700    | train
1 | encoder_1 | NaiveLinearEncoder | 40     | train
2 | processor | UNetProcessor      | 11.0 M | train
3 | decoder   | NaiveLinearDecoder | 41     | train
---------------------------------------------------------
11.0 M    Trainable params
0         Non-trainable params
11.0 M    Total params
43.901    Total estimated model params size (MB)
102       Modules in train mode
0         Modules in eval mode
https://wandb.ai/turing-seaice/leaderboard/runs/aizqh771

20 epochs

media_images_sea-ice_concentration-static-maps_0_680f19e0583b1348bd22

500 epochs

sea-ice_concentration-static-maps_0_eee9235d21ec8f57c46b

cnn-unet-cnn: 12.8M params

  | Name      | Type          | Params | Mode
----------------------------------------------------
0 | encoder_0 | CNNEncoder    | 1.3 M  | train
1 | encoder_1 | CNNEncoder    | 1.4 K  | train
2 | processor | UNetProcessor | 11.0 M | train
3 | decoder   | CNNDecoder    | 937    | train
----------------------------------------------------
12.3 M    Trainable params
0         Non-trainable params
12.3 M    Total params
49.184    Total estimated model params size (MB)
183       Modules in train mode
0         Modules in eval mode

20 epochs

sea-ice_concentration-static-maps_0_d914aba2473456ae47f2

500 epochs

sea-ice_concentration-static-maps_0_b05c21a410d986073ea7

Copy link

github-actions bot commented Sep 9, 2025

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  ice_station_zebra/models/common
  __init__.py
  conv_block_downsample.py
  conv_block_upsample.py
  resizing_average_pool_2d.py
  ice_station_zebra/models/decoders
  __init__.py
  base_decoder.py
  cnn_decoder.py
  naive_linear_decoder.py
  ice_station_zebra/models/encoders
  __init__.py
  base_encoder.py
  cnn_encoder.py
  naive_linear_encoder.py
Project Total  

This report was generated by python-coverage-comment-action

@jemrobinson jemrobinson force-pushed the 45-add-convolutional-encoder branch from 528a25c to 0f61efc Compare September 12, 2025 12:48
@jemrobinson
Copy link
Member Author

jemrobinson commented Sep 15, 2025

Latent space visualisation

I've done some quick visualisations of the latent space for NaiveLinear and CNN encoders.

Naive linear

latent_space_channel_0_era5-south latent_space_channel_0_osisaf-south

CNN

latent_space_channel_0_era5-south latent_space_channel_0_osisaf-south

Normalisation

Now we can see that the CNN has actually lost some information during the encoding process, let's try adding a normalisation layer as the first step of the encoder.

1_gat8a-TUnopoYN_veGEi0w

CNN with initial BatchNorm

latent_space_channel_0_era5-south latent_space_channel_0_osisaf-south

latent_space_channel_19_era5-south latent_space_channel_19_osisaf-south

CNN with initial LayerNorm

latent_space_channel_0_era5-south latent_space_channel_0_osisaf-south

latent_space_channel_19_era5-south latent_space_channel_19_osisaf-south

CNN with initial InstanceNorm2d

latent_space_channel_0_era5-south latent_space_channel_0_osisaf-south

latent_space_channel_19_era5-south latent_space_channel_19_osisaf-south

@jemrobinson
Copy link
Member Author

After adding a normalisation layer and running for 20 epochs

cnn-unet-cnn

media_images_sea-ice_concentration-static-maps_0_52979194e3758d2a8340

naive-unet-naive

media_images_sea-ice_concentration-static-maps_0_ad40b52f99d54facc23d

@jemrobinson jemrobinson requested review from IFenton and a team September 15, 2025 15:06
@IFenton
Copy link
Contributor

IFenton commented Sep 16, 2025

Looking at this, I'm wondering about whether we need to do any regridding / reprojecting. At the moment, the SIC is centred round the south pole (-90 lat, 0 long), but I assume the ERA5 data is centred on something like -45 lat, 0 long?

@IFenton
Copy link
Contributor

IFenton commented Sep 16, 2025

Reviewing this

@jemrobinson
Copy link
Member Author

jemrobinson commented Sep 16, 2025

@IFenton: I could see that the different scales/grids for ERA5 and OSISAF might mean that we end up depending more heavily on OSISAF but not that we can't produce anything at all. I wonder whether there's an additional issue in the decoder?

@IFenton
Copy link
Contributor

IFenton commented Sep 16, 2025

@jemrobinson Curiously, I've just done a couple of runs of naive_unet_naive, and it's producing pretty good results, e.g. https://wandb.ai/turing-seaice/leaderboard/runs/3g3iduk3?nw=nwuserifenton. It's just running on the defaults, so not quite sure what's going on

Copy link
Contributor

@IFenton IFenton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -0,0 +1,22 @@
_target_: ice_station_zebra.models.EncodeProcessDecode

name: encode-ddpm-decode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name: encode-ddpm-decode
name: cnn-ddpm-cnn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants