softsys4ai / athena

Athena: A Framework for Defending Machine Learning Systems Against Adversarial Attacks
https://softsys4ai.github.io/athena/
MIT License
42 stars 9 forks source link

Tune and fix bugs for new transformations #22

Open MENG2010 opened 5 years ago

MENG2010 commented 5 years ago
  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.

pooyanjamshidi commented 5 years ago

some of them may only applicable to coloured images.

MENG2010 commented 5 years ago

Problems for new transformations.

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

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

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

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

StephenBaione commented 5 years ago

Here are the current states of the new transformations:

MENG2010 commented 5 years ago

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

MENG2010 commented 5 years ago

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 commented 5 years ago

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.


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

pooyanjamshidi commented 5 years ago

I fixed filter_meijering and added contrast, and brightness