-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It seams that the DIRE tensor save format: jpg or png, determine the results of the resnet50 detector #30
Comments
additionally, the only modify of the code is the compute_dire.py:
add the line constrain to save the dire tensor to "png" format image file |
hello,i have trouble to use one gpu to run the compute-dire.py.only chnage CUDA_VISIBLE_DEVICES to 0 ,can it run on one gpu device? if you could answer me i couldn't be more apprecuated thanks |
I can run the script on one gpu device, could you provide the runtime error info in detail? |
i am in class. But i do experiment on windows ,did you do experiment on linux? |
yes, mine is linux |
I just changed the save format of the DIRE images to PNG, and it can no longer correctly classify real images. |
You can refer to these few references about dire problem:
1.
https://openaccess.thecvf.com/content/CVPR2024/html/Cazenavette_FakeInversion_Learning_to_Detect_Images_from_Unseen_Text-to-Image_Models_by_CVPR_2024_paper.html
2. http://arxiv.org/abs/2401.17879
in short, the DIRE results are all false (as noted in above papers). They
unfortunately preprocessed their data in such a way that all their “real”
DIRE images were JPEG compressed while all the “fake” DIRE images were
saved cleanly. So their model just learned to detect JPEG artifacts,
explaining the 100% accuracy on all their test sets…
…On Sun, Feb 23, 2025 at 3:59 PM xqy853174787 ***@***.***> wrote:
I also saved all the generated DIRE images in PNG format, instead of using
the input image format from the original code.
I seem to have encountered the same issue. When I use the DIRE images of
real images provided directly by the author for classification, the results
are good. However, when using Huawei's GenImage for out-of-domain testing,
it seems unable to distinguish real images.
2.png (view on web)
<https://github.com/user-attachments/assets/c86b1c7c-7cff-4b10-add3-719c2f37c21c>
—
Reply to this email directly, view it on GitHub
<#30 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BJEVDT6CBJHF4LXUXN4B24D2RF5XLAVCNFSM6AAAAABIFJPBPSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZWGY4TCNBYGI>
.
You are receiving this because you commented.Message ID:
***@***.***>
[image: xqy853174787]*xqy853174787* left a comment (ZhendongWang6/DIRE#30)
<#30 (comment)>
I also saved all the generated DIRE images in PNG format, instead of using
the input image format from the original code.
I seem to have encountered the same issue. When I use the DIRE images of
real images provided directly by the author for classification, the results
are good. However, when using Huawei's GenImage for out-of-domain testing,
it seems unable to distinguish real images.
2.png (view on web)
<https://github.com/user-attachments/assets/c86b1c7c-7cff-4b10-add3-719c2f37c21c>
—
Reply to this email directly, view it on GitHub
<#30 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BJEVDT6CBJHF4LXUXN4B24D2RF5XLAVCNFSM6AAAAABIFJPBPSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZWGY4TCNBYGI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
If, in the author's code, the computed dire = torch.abs(imgs - recons) is used directly for classification instead of generating DIRE images, would it still be able to classify successfully? and I noticed that in AI image detection datasets, real images are often stored in JPEG format, while AI-generated images are stored in PNG format. Could other detectors also be learning to distinguish JPEG and PNG images rather than identifying AI-generated and real images? |
some detectors notice this jpeg/png problem, often use jpeg quality=[70,
95 ] to compress the image in their training datasets, some papers show
this method can relieve the problem
in my practic, the data augment method, mentioned in paper:
http://arxiv.org/abs/2406.19435, is effective.
…On Mon, Feb 24, 2025 at 4:25 PM xqy853174787 ***@***.***> wrote:
You can refer to these few references about dire problem:
1.
https://openaccess.thecvf.com/content/CVPR2024/html/Cazenavette_FakeInversion_Learning_to_Detect_Images_from_Unseen_Text-to-Image_Models_by_CVPR_2024_paper.html
2. http://arxiv.org/abs/2401.17879
in short, the DIRE results are all false (as noted in above papers). They
unfortunately preprocessed their data in such a way that all their “real”
DIRE images were JPEG compressed while all the “fake” DIRE images were
saved cleanly. So their model just learned to detect JPEG artifacts,
explaining the 100% accuracy on all their test sets…
… <#m_4960959544012316101_>
If, in the author's code, the computed dire = torch.abs(imgs - recons) is
used directly for classification instead of generating DIRE images, would
it still be able to classify successfully?
and I noticed that in AI image detection datasets, real images are often
stored in JPEG format, while AI-generated images are stored in PNG format.
Could other detectors also be learning to distinguish JPEG and PNG images
rather than identifying AI-generated and real images?
—
Reply to this email directly, view it on GitHub
<#30 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BJEVDT6GHYBNZB5UIIEDUID2RLJPJAVCNFSM6AAAAABIFJPBPSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZXG4YTEMZZHE>
.
You are receiving this because you commented.Message ID:
***@***.***>
[image: xqy853174787]*xqy853174787* left a comment (ZhendongWang6/DIRE#30)
<#30 (comment)>
You can refer to these few references about dire problem:
1.
https://openaccess.thecvf.com/content/CVPR2024/html/Cazenavette_FakeInversion_Learning_to_Detect_Images_from_Unseen_Text-to-Image_Models_by_CVPR_2024_paper.html
2. http://arxiv.org/abs/2401.17879
in short, the DIRE results are all false (as noted in above papers). They
unfortunately preprocessed their data in such a way that all their “real”
DIRE images were JPEG compressed while all the “fake” DIRE images were
saved cleanly. So their model just learned to detect JPEG artifacts,
explaining the 100% accuracy on all their test sets…
… <#m_4960959544012316101_>
If, in the author's code, the computed dire = torch.abs(imgs - recons) is
used directly for classification instead of generating DIRE images, would
it still be able to classify successfully?
and I noticed that in AI image detection datasets, real images are often
stored in JPEG format, while AI-generated images are stored in PNG format.
Could other detectors also be learning to distinguish JPEG and PNG images
rather than identifying AI-generated and real images?
—
Reply to this email directly, view it on GitHub
<#30 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BJEVDT6GHYBNZB5UIIEDUID2RLJPJAVCNFSM6AAAAABIFJPBPSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZXG4YTEMZZHE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I noticed that in the paper 《A Sanity Check for AI-generated Image Detection》, they tested DIRE. DIRE should classify all PNG images as AI-generated and all JPG images as real images. However, the test results in the paper seem to be different. Could it be that they made a mistake in their testing? |
my computh_dir.sh is
the diffusion model is 256x256_diffusion_uncond.pt, but i also tried other models like lsun_bedroom.pt.
then I run computh_dir.py to get the DIRE img.
then I run the demo.py to use resnet50 cnn model which weights is lsun_adm.pt:
this scripts can get Prob of being synthetic.
In the test, the Fake image is png format, the real image is jpg format. these image is download from DiffusionForensics dataasets
My question is: when I using computh_dir.py to save the DIRE tensor to "PNG" format, the Prob of being synthetic always 1.0000; In the other hand, save to "JPG" format, the Prob of being synthetic always 0.0000, no matter whether fake or real image i use.
The text was updated successfully, but these errors were encountered: