athena icon indicating copy to clipboard operation
athena copied to clipboard

Tune and fix bugs for new transformations

Open MENG2010 opened this issue 6 years ago • 7 comments

  1. Some causes crash while some generated black images. list: new filter transformations, denoising transformations, geo transformations, seg transformations.

  2. Rename some of the existing transformation types to organize all transformations better.

MENG2010 avatar Aug 26 '19 05:08 MENG2010

some of them may only applicable to coloured images.

pooyanjamshidi avatar Aug 26 '19 11:08 pooyanjamshidi

Problems for new transformations.

  • augmentation zca_whitening = zca_whitening; need to tune parameters on both grayscales and color images

  • filter

filter_entropy = filter_entropy; crash on both grayscales and color images filter_roberts = filter_roberts; crash on both grayscales and color images filter_scharr = filter_scharr; crash on both grayscales and color images filter_prewitt = filter_prewitt; crash on both grayscales and color images filter_meijering = filter_meijering; crash on grayscales and tune parameters for color images. filter_sato = filter_sato; crash on grayscales and tune parameters for color images. filter_frangi = filter_frangi; crash on grayscales and tune parameters for color images. filter_hessian = filter_hessian; crash on grayscales and tune parameters for color images. filter_skeletonize = filter_skeletonize; to implement filter_thin = filter_thin; to implement

  • denoising

denoise_tv_chambolle = denoise_tv_chambolle; crash on both grayscales and color images denoise_tv_bregman = denoise_tv_bregman; crash on both grayscales and color images denoise_bilateral = denoise_bilateral; crash on both grayscales and color images denoise_wavelet = denoise_wavelet;crash on both grayscales and color images denoise_nl_means = denoise_nl_means;crash on both grayscales and color images denoise_nl_fast = denoise_nl_means_fast;crash on both grayscales and color images

  • geometric

geo_swirl = geo_swirl; crash on both grayscales and color images geo_random = geo_random; crash on both grayscales and color images geo_iradon = geo_iradon; crash on both grayscales and color images geo_iradon_sart = geo_iradon_sart; crash on both grayscales and color images

  • segmentation

seg_gradient = seg_gradient; crash on both grayscales and color images seg_watershed = seg_watershed; crash on both grayscales and color images

MENG2010 avatar Aug 27 '19 01:08 MENG2010

Here are the current states of the new transformations:

  • Working

    • filter_entropy
    • filter_roberts
    • filter_scharr
    • filter_prewitt
    • denoise_tv_chambolle
    • denoise_tv_bregman
    • denoise_wavelet
    • denoise_nl_means
    • denoise_nl_fast
    • geo_swirl
    • geo_random
    • geo_iradon
    • seg_gradient
  • Questionable

    • zca_whitening: brightness_level might still need some tuning, especially for cifar
    • filter_skeletonize only works for mnist (Needs parameter tuning for cifar)
    • filter_thin only works for mnist (Needs parameter tuning for cifar)
  • Not working

    • filter_meijering crashes for mnist: "Unsupported depth of input_image" (Questionable for cifar) 
    • filter_sato crashes for mnist - "Unsupported depth of input image" (Black images for cifar)
    • filter_frangi crashes for mnist - "Unsupported depth of input image" (Black images for cifar)
    • filter_hessian crashes for mnist - "Unsupported depth of input image" (Black images for cifar)
    • denoise_bilateral - "ValueError: Buffer dtype mismatch, expected 'float32_t' but got 'double'"
    • geo_iradon_sart - "ValueError: Buffer dtype mismatch, expected 'double_t' but got 'float'"
    • seg_watershed - Seems to be working for most of mnist (Black images for cifar)

StephenBaione avatar Aug 28 '19 02:08 StephenBaione

The fix for new transformations leads to regression bugs in existed transformations. Please roll back your last commit.

MENG2010 avatar Aug 28 '19 19:08 MENG2010

no need to roll back the commit. By taking back if (transformation == TRANSFORMATION.filter_sobel): for img in original_images: if (nb_channels == 3): img = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY) the introduced crash can be solved.

I will suggest converting images (gray to color, and color to gray) in each transformation branch, to decouple the transformation process from the two functions: transformation_color and transformation_gray,

MENG2010 avatar Aug 28 '19 21:08 MENG2010

Fixed bugs and tuned parameters for the following transformations.

  1. We should NOT change the shape of the input dataset after applied transformations, otherwise, the transformed dataset cannot be used to train models (the input shape will be wrong).
  2. We should not distort the images too much after applied transformations. i.e., we should not change the ground truth of the image.

The following transformations are working and ready for model training.

  • filter_entropy
  • filter_roberts
  • filter_scharr
  • filter_prewitt
  • denoise_tv_chambolle
  • denoise_tv_bregman
  • denoise_wavelet
  • denoise_nl_means
  • denoise_nl_fast
  • geo_swirl
  • geo_iradon
  • geo_iradon_sart
  • seg_gradient

geo_radon will never output an image which can be identified. I'd suggest to remove it from our list.

MENG2010 avatar Aug 30 '19 08:08 MENG2010

I fixed filter_meijering and added contrast, and brightness

pooyanjamshidi avatar Sep 08 '19 14:09 pooyanjamshidi