Hi @rmwkwok,
How are you doing Raymond?
Following our discussions, I created a notebook to make a prototype using image segmentation.
imageSegmNN1.ipynb (40.0 KB)
My end goal is to use image segementation (UNet) to get species probabilities. In the notebook prototype, I used:
- X: The origin data is a single predictor matrix of shape (10’000, 10’000, 4). Each channel being a predictor. From this X origin matrix, extractions are done on the fly to generate “3’798’601 images” of shape (512, 512, 4) that will then be used as X data for training. The extraction of image of height and width of 512 is done to match the input size of the UNet architecture.
- Y: The origin is a single response matrix of shape (10’000, 10’000, 2). Each channel is a species with values (0: present, 1: absent, 2: NA). From the Y origin matrix, extractions are done on the fly to generate “3’798’601 images” of shape (512, 512, 4) that will then be used as Y data
- Prediction objectives: Train a segmentation network (UNet) to be able to input the X predictors with shape (512, 512, 4) and output the probabilities of presence with shape (512, 512, 2). Each channel being a species, containing the values of the probabilities of presence within each cell.
- UNet architecture: I replicated the original UNet architecture, the idea being to change the output to suit my needs.
Questions
-
Dataset pipeline: I was thinking about optimizing the dataset pipeline. The process I used for extraction and generation of images on the fly works on small data sets, but fails for larger data set. (see the point 1.3 convert_to_tensor) Furthermore, keeping 3 millions generated images of 512x512x4 in memory is not optimal either. I was wondering if I should save them on disk, but this would have the disadvantage to replicate data and consume a lot of space.
-
Output UNet: the idea is to have one layer by species with probabilities of presences. So I guess that my number of class in the UNet should be 2, in the current example at point 3.3.3, if I am not mistaking.
-
Model dimensions: In 3.3.2, I did some test to ensure that shapes are right. For some reason, why when I check the dims of the model in 3.3.3, the channel depths are wrong.
Any ideas or suggestions ?
Thanks a lot!
Manu