15-03

I've checked the output of the previous training run which was the first one that used TrivialAugument. It looks way better than previously and it is clearly visible that adding random transform helps with generalization.

This is how outputs on the validation dataset look like:

net output on the validation set

net output on the validation set

And this is how they look like on the training set:

net output on the training set

net output on the training set

Same Tversky setup as before (alpha = 0.3, beta = 0.7). The net is less glued to whatever orientation the original files happened to have, which is exactly what I was hoping for when I started stuffing rotate / translate / scale into the pipeline. There are still misses and the mask edges are not pretty, but this is the first time the val grid doesn't immediately make me want to throw the run out.

So far TrivialAugument has only those three ops and I still don't have a clean picture of what each of them actually does to a single ultrasound.

plan for the future

  • write a script that runs every transform from TrivialAugument on one chosen input image and arranges all the outputs on a grid
  • make TrivialAugument keep a copy of the dataset in Tensor form so deformations can be written purely in tinygrad
  • add a smooth deformation transform
  • run training with smooth deformation enabled

The grid is mostly so I can catch dumb bugs before they poison another 500-epoch run. If zoom is just cropping the tumor out of the frame or rotate is filling the corners with black that the net then treats as background, I'd rather see that on one picture than in a val set.

Keeping the tensors around is the other half of last week's Pillow complaint. The conversions are still the slow part and they get in the way of anything that wants to live on GPU. If every sample already has a Tensor copy, a deformation doesn't have to roundtrip through numpy. It would be great if we could drop Pillow later; today I just don't want the new op to depend on it.

Smooth deformation is the one I actually care about for generalization. Rotate / translate / scale change where the lesion is. They don't really change its shape the way tissue does in a real scan. If the grid looks sane I'll wire deformation in and train with it on. I don't expect miracles, I just want to know whether the val set keeps improving or whether we start smearing the labels into mush.