Skip to content
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

Download ImageNet images automatically #3

Open
Hyperparticle opened this issue Mar 31, 2018 · 4 comments
Open

Download ImageNet images automatically #3

Hyperparticle opened this issue Mar 31, 2018 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@Hyperparticle
Copy link
Owner

Hyperparticle commented Mar 31, 2018

Modify 2_one-pixel-attack-imagenet.ipynb to download a sample subset of ImageNet files with appropriate labels. The files should be preprocessed as to be ready for the attack.

@Hyperparticle Hyperparticle added help wanted Extra attention is needed enhancement New feature or request labels Mar 31, 2018
@Hyperparticle Hyperparticle added the good first issue Good for newcomers label Mar 31, 2018
@CloudFlyCN
Copy link

Hi,I also download a sample subset of ImageNet files by the given file 'imagenet_urls.txt', but some problems to be found:

  1. some pics' urls has been invalid
  2. the model cannot recognize the image correctly even without attack...
    Thanks for your attention!

@Hyperparticle
Copy link
Owner Author

Hyperparticle commented May 7, 2018

imagenet_urls.txt is just a sample file with some example URLs and is by no means finished or ideal for testing.

  1. About the URLs being invalid: yes, this is a very common occurrence in the ImageNet files, and there should be additional logic that simply ignores images that fail to download.
  2. Make sure you are processing the images similar to what is shown in the existing Python code. Also, note that the current model (keras.applications.MobileNet) is not particularly accurate, so you may get inaccurate results on a small sample image set.

It would also be nice if we had more URLs. This can be accomplished by downloading the URL files from the ImageNet database and sampling them randomly. Something under 5 MB of URLs could suffice. The labels for each of the images would also need to be stored somehow.

Thanks for checking it out. If you have any more questions I'd be happy to answer.

@CloudFlyCN
Copy link

I am very glad to get your reply so soon!
Coincidently,I have the same idea to refine the valid URLs by adding some logic and it works,but it comes out a new problem that some label(s)(e.g."n09337253") are not within the ImageNet1000.As the result,I finally just download very few images successfully.

@Hyperparticle
Copy link
Owner Author

Hyperparticle commented May 7, 2018

Finding a good set of URLs with valid labels would be necessary. Unfortunately, I have not found any easy automated tools to do this, so it needs some manual work. Send a pull request if you are able.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants