Adversarial Learning for a regression problem
3 次查看(过去 30 天)
显示 更早的评论
Hi everyone!
I have studied the example on Mathworks "Train Image Classification Network Robust to Adversarial Examples". In my specific case, I'm facing not a classification problem, but a regression problem in which every image of the dataset is associated to a numeric value. So basically I am wondering how to solve this problem, how to apply adversarial learning to my regression problem. I have created the XTrain,the YTrain and the regression CNN for my dataset, but of course, since it's not a classification problem, I have no classes. Any advice to perform A.L.?
Thank you very much.
0 个评论
回答(1 个)
Ranjeet
2023-4-14
Hi Daniele,
From your description, I understand that you are trying to achieve Image regression. In the example script that you pointed to “Train Image classification network robust to adversarial examples”, I suggest you to modify the CNN network by removing Softmax layer and add a FullyConnectedLayer with n inputs and single output so that you get a number as output from your network.
Also, depending upon the range on training labels (the numbers associated with an image), if the output is expected to be between 0 and 1, you may use sigmoid function as final layer. If output is expected to be between 0 and any number N, you may use max(0, N) which is ReLu.
Also, do refer the following answer to have training labels as categorical input-
I assume that you already have adversarial examples in your dataset, the trained network should be robust to adversarial examples.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Deep Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!