Code Monkey home page Code Monkey logo

perc-adversarial's Introduction

Hi there 👋

I am Zhengyu Zhao, an Associate Professor at Xi’an Jiaotong University (XJTU), China. My general research interest is Machine Learning Security; Most of my work has concentrated on analyzing the vulnerability of deep neural networks to various attacks, e.g., (test-time) adversarial examples and (training-time) data poisons.

Daniel's github stats

perc-adversarial's People

Contributors

dependabot[bot] avatar liuzrcc avatar zhengyuzhao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

perc-adversarial's Issues

关于Perceptual Color distance Alternating Loss问题

您好,我在做关于图像增强方面的工作(颜色,亮度),请问您提出来的这个loss可以用来做类似任务计算损失,比较两张图片的差异性吗,我看到的目前有比较两张图像差异性的有psnr,ssim,lpips,您有做过该方面的对比吗,多谢

LAB=>RGB conversion

Hi,
It's not an issue but maybe you could help.
I'm doing research on adversarial attacks, and I need both conversions (lab=>rgb, rgb=>lab), so I took your code for rgb=>lab, and implemented the other way around using both your code and other sources (skimage package, wikipedia).
for some reason it didn't work for me. I did notice a fixed per-channel shift in the intermediate xyz representations so once I add the following values [1.6836, 1.7713, 1.9287] after the lab=>xyz conversion (and before the xyz=>rgb) - it works perfectly for most pixels, but still not for the darker pixels.
Adding my code here, maybe you'll see what I did wrong...

`def lab2rgb(lab_image, device):
y = (lab_image[:,0,:,:] + 16.) / 116.
x = (lab_image[:,1,:,:] / 500.) + y
z = y - (lab_image[:,2,:,:] / 200.)

assert torch.all(z >= 0)

xyz = torch.stack([x,y,z], dim=1)

mask1 = xyz > 0.2068966
mask1_not = torch.logical_not(mask1)

xyz = (mask1 * xyz) ** 3. + (mask1_not * xyz - 16.0 / 116.) / 7.787

xyz[:,0,:,:] *= 95.0489
xyz[:,1,:,:] *= 100.
xyz[:,2,:,:] *= 108.8840

# here's the shift I added (have no idea why but it works for most pixels)
xyz[:,0,:,:] += 1.6836
xyz[:,1,:,:] += 1.7713
xyz[:,2,:,:] += 1.9287

mt = torch.tensor([[0.4124, 0.3576, 0.1805],
                   [0.2126, 0.7152, 0.0722],
                   [0.0193, 0.1192, 0.9504]]).to(device)
mt_inv = torch.inverse(mt)

rgb = torch.matmul(mt_inv, xyz.permute(1, 0, 2, 3).contiguous().view(3, -1)).view(3, xyz.size(0),
                                                                                   xyz.size(2),
                                                                                   xyz.size(3)).permute(1, 0, 2, 3)
rgb /= 100.
mask2 = rgb > 0.0031308
mask2_not = torch.logical_not(mask2)
rgb = 1.055 * (mask2 * rgb) ** (1/2.4) - 0.055 + mask2_not * rgb * 12.92

return torch.clamp(rgb, 0, 1)`

Thanks in advance :)
Itai

您好,有问题想问您

您好,我是中南大学的一名本科生,无意间在csdn上看到了您的这个方法。因为自己是对抗样本领域的门外汉,虽然将您的源码成功运行,但结果是“进程已结束,退出代码0”。
所以想问您运行结果是正常的吗?有成功生成对抗样本了吗?
希望能得到您的答复,谢谢。

figure1

你好!我想知道关于图1是如何从原图上截取一块并放大的,可以发我一份代码吗?邮箱[email protected]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.