├── .gitignore
├── LICENSE
├── assets
├── Imagenet-Patch-schema.png
├── Imagenet_Patch.png
├── Imagenet_Patch_Predictions.png
├── LICENSE
├── data
│ ├── n01440764
│ │ ├── ILSVRC2012_val_00009111.JPEG
│ │ ├── ILSVRC2012_val_00021740.JPEG
│ │ ├── n01440764_2751.JPEG
│ │ ├── n01440764_341.JPEG
│ │ ├── n01440764_490.JPEG
│ │ ├── n01440764_5911.JPEG
│ │ ├── n01440764_650.JPEG
│ │ ├── n01440764_6500.JPEG
│ │ ├── n01440764_6570.JPEG
│ │ └── n01440764_910.JPEG
│ ├── n02102040
│ │ ├── ILSVRC2012_val_00004650.JPEG
│ │ ├── ILSVRC2012_val_00017370.JPEG
│ │ ├── ILSVRC2012_val_00036282.JPEG
│ │ ├── ILSVRC2012_val_00037182.JPEG
│ │ ├── n02102040_171.JPEG
│ │ ├── n02102040_202.JPEG
│ │ ├── n02102040_352.JPEG
│ │ ├── n02102040_371.JPEG
│ │ ├── n02102040_451.JPEG
│ │ └── n02102040_460.JPEG
│ ├── n02979186
│ │ ├── ILSVRC2012_val_00008651.JPEG
│ │ ├── ILSVRC2012_val_00020400.JPEG
│ │ ├── ILSVRC2012_val_00028911.JPEG
│ │ ├── ILSVRC2012_val_00035160.JPEG
│ │ ├── ILSVRC2012_val_00042482.JPEG
│ │ ├── ILSVRC2012_val_00042982.JPEG
│ │ ├── ILSVRC2012_val_00043121.JPEG
│ │ ├── ILSVRC2012_val_00043731.JPEG
│ │ ├── ILSVRC2012_val_00045110.JPEG
│ │ └── n02979186_40.JPEG
│ ├── n03000684
│ │ ├── ILSVRC2012_val_00025890.JPEG
│ │ ├── ILSVRC2012_val_00029211.JPEG
│ │ ├── ILSVRC2012_val_00045501.JPEG
│ │ ├── n03000684_2102.JPEG
│ │ ├── n03000684_410.JPEG
│ │ ├── n03000684_590.JPEG
│ │ ├── n03000684_711.JPEG
│ │ ├── n03000684_731.JPEG
│ │ ├── n03000684_900.JPEG
│ │ └── n03000684_931.JPEG
│ └── n03028079
│ │ ├── ILSVRC2012_val_00023291.JPEG
│ │ ├── ILSVRC2012_val_00026451.JPEG
│ │ ├── ILSVRC2012_val_00028310.JPEG
│ │ ├── ILSVRC2012_val_00029870.JPEG
│ │ ├── ILSVRC2012_val_00034220.JPEG
│ │ ├── ILSVRC2012_val_00046232.JPEG
│ │ ├── ILSVRC2012_val_00046550.JPEG
│ │ ├── n03028079_102.JPEG
│ │ ├── n03028079_151.JPEG
│ │ └── n03028079_80.JPEG
├── imagenet1000_clsidx_to_labels.txt
└── imagenet_patch.gz
├── example.py
├── imagenet_patch_example.ipynb
├── readme.md
├── requirements.txt
├── transforms
├── __init__.py
├── apply_patch.py
└── my_random_affine.py
└── utils
├── __init__.py
├── utils.py
└── visualization.py
/.gitignore:
--------------------------------------------------------------------------------
1 | /venv/
2 | /.idea
3 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/assets/Imagenet-Patch-schema.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/Imagenet-Patch-schema.png
--------------------------------------------------------------------------------
/assets/Imagenet_Patch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/Imagenet_Patch.png
--------------------------------------------------------------------------------
/assets/Imagenet_Patch_Predictions.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/Imagenet_Patch_Predictions.png
--------------------------------------------------------------------------------
/assets/LICENSE:
--------------------------------------------------------------------------------
1 | Attribution 4.0 International
2 |
3 | =======================================================================
4 |
5 | Creative Commons Corporation ("Creative Commons") is not a law firm and
6 | does not provide legal services or legal advice. Distribution of
7 | Creative Commons public licenses does not create a lawyer-client or
8 | other relationship. Creative Commons makes its licenses and related
9 | information available on an "as-is" basis. Creative Commons gives no
10 | warranties regarding its licenses, any material licensed under their
11 | terms and conditions, or any related information. Creative Commons
12 | disclaims all liability for damages resulting from their use to the
13 | fullest extent possible.
14 |
15 | Using Creative Commons Public Licenses
16 |
17 | Creative Commons public licenses provide a standard set of terms and
18 | conditions that creators and other rights holders may use to share
19 | original works of authorship and other material subject to copyright
20 | and certain other rights specified in the public license below. The
21 | following considerations are for informational purposes only, are not
22 | exhaustive, and do not form part of our licenses.
23 |
24 | Considerations for licensors: Our public licenses are
25 | intended for use by those authorized to give the public
26 | permission to use material in ways otherwise restricted by
27 | copyright and certain other rights. Our licenses are
28 | irrevocable. Licensors should read and understand the terms
29 | and conditions of the license they choose before applying it.
30 | Licensors should also secure all rights necessary before
31 | applying our licenses so that the public can reuse the
32 | material as expected. Licensors should clearly mark any
33 | material not subject to the license. This includes other CC-
34 | licensed material, or material used under an exception or
35 | limitation to copyright. More considerations for licensors:
36 | wiki.creativecommons.org/Considerations_for_licensors
37 |
38 | Considerations for the public: By using one of our public
39 | licenses, a licensor grants the public permission to use the
40 | licensed material under specified terms and conditions. If
41 | the licensor's permission is not necessary for any reason--for
42 | example, because of any applicable exception or limitation to
43 | copyright--then that use is not regulated by the license. Our
44 | licenses grant only permissions under copyright and certain
45 | other rights that a licensor has authority to grant. Use of
46 | the licensed material may still be restricted for other
47 | reasons, including because others have copyright or other
48 | rights in the material. A licensor may make special requests,
49 | such as asking that all changes be marked or described.
50 | Although not required by our licenses, you are encouraged to
51 | respect those requests where reasonable. More_considerations
52 | for the public:
53 | wiki.creativecommons.org/Considerations_for_licensees
54 |
55 | =======================================================================
56 |
57 | Creative Commons Attribution 4.0 International Public License
58 |
59 | By exercising the Licensed Rights (defined below), You accept and agree
60 | to be bound by the terms and conditions of this Creative Commons
61 | Attribution 4.0 International Public License ("Public License"). To the
62 | extent this Public License may be interpreted as a contract, You are
63 | granted the Licensed Rights in consideration of Your acceptance of
64 | these terms and conditions, and the Licensor grants You such rights in
65 | consideration of benefits the Licensor receives from making the
66 | Licensed Material available under these terms and conditions.
67 |
68 |
69 | Section 1 -- Definitions.
70 |
71 | a. Adapted Material means material subject to Copyright and Similar
72 | Rights that is derived from or based upon the Licensed Material
73 | and in which the Licensed Material is translated, altered,
74 | arranged, transformed, or otherwise modified in a manner requiring
75 | permission under the Copyright and Similar Rights held by the
76 | Licensor. For purposes of this Public License, where the Licensed
77 | Material is a musical work, performance, or sound recording,
78 | Adapted Material is always produced where the Licensed Material is
79 | synched in timed relation with a moving image.
80 |
81 | b. Adapter's License means the license You apply to Your Copyright
82 | and Similar Rights in Your contributions to Adapted Material in
83 | accordance with the terms and conditions of this Public License.
84 |
85 | c. Copyright and Similar Rights means copyright and/or similar rights
86 | closely related to copyright including, without limitation,
87 | performance, broadcast, sound recording, and Sui Generis Database
88 | Rights, without regard to how the rights are labeled or
89 | categorized. For purposes of this Public License, the rights
90 | specified in Section 2(b)(1)-(2) are not Copyright and Similar
91 | Rights.
92 |
93 | d. Effective Technological Measures means those measures that, in the
94 | absence of proper authority, may not be circumvented under laws
95 | fulfilling obligations under Article 11 of the WIPO Copyright
96 | Treaty adopted on December 20, 1996, and/or similar international
97 | agreements.
98 |
99 | e. Exceptions and Limitations means fair use, fair dealing, and/or
100 | any other exception or limitation to Copyright and Similar Rights
101 | that applies to Your use of the Licensed Material.
102 |
103 | f. Licensed Material means the artistic or literary work, database,
104 | or other material to which the Licensor applied this Public
105 | License.
106 |
107 | g. Licensed Rights means the rights granted to You subject to the
108 | terms and conditions of this Public License, which are limited to
109 | all Copyright and Similar Rights that apply to Your use of the
110 | Licensed Material and that the Licensor has authority to license.
111 |
112 | h. Licensor means the individual(s) or entity(ies) granting rights
113 | under this Public License.
114 |
115 | i. Share means to provide material to the public by any means or
116 | process that requires permission under the Licensed Rights, such
117 | as reproduction, public display, public performance, distribution,
118 | dissemination, communication, or importation, and to make material
119 | available to the public including in ways that members of the
120 | public may access the material from a place and at a time
121 | individually chosen by them.
122 |
123 | j. Sui Generis Database Rights means rights other than copyright
124 | resulting from Directive 96/9/EC of the European Parliament and of
125 | the Council of 11 March 1996 on the legal protection of databases,
126 | as amended and/or succeeded, as well as other essentially
127 | equivalent rights anywhere in the world.
128 |
129 | k. You means the individual or entity exercising the Licensed Rights
130 | under this Public License. Your has a corresponding meaning.
131 |
132 |
133 | Section 2 -- Scope.
134 |
135 | a. License grant.
136 |
137 | 1. Subject to the terms and conditions of this Public License,
138 | the Licensor hereby grants You a worldwide, royalty-free,
139 | non-sublicensable, non-exclusive, irrevocable license to
140 | exercise the Licensed Rights in the Licensed Material to:
141 |
142 | a. reproduce and Share the Licensed Material, in whole or
143 | in part; and
144 |
145 | b. produce, reproduce, and Share Adapted Material.
146 |
147 | 2. Exceptions and Limitations. For the avoidance of doubt, where
148 | Exceptions and Limitations apply to Your use, this Public
149 | License does not apply, and You do not need to comply with
150 | its terms and conditions.
151 |
152 | 3. Term. The term of this Public License is specified in Section
153 | 6(a).
154 |
155 | 4. Media and formats; technical modifications allowed. The
156 | Licensor authorizes You to exercise the Licensed Rights in
157 | all media and formats whether now known or hereafter created,
158 | and to make technical modifications necessary to do so. The
159 | Licensor waives and/or agrees not to assert any right or
160 | authority to forbid You from making technical modifications
161 | necessary to exercise the Licensed Rights, including
162 | technical modifications necessary to circumvent Effective
163 | Technological Measures. For purposes of this Public License,
164 | simply making modifications authorized by this Section 2(a)
165 | (4) never produces Adapted Material.
166 |
167 | 5. Downstream recipients.
168 |
169 | a. Offer from the Licensor -- Licensed Material. Every
170 | recipient of the Licensed Material automatically
171 | receives an offer from the Licensor to exercise the
172 | Licensed Rights under the terms and conditions of this
173 | Public License.
174 |
175 | b. No downstream restrictions. You may not offer or impose
176 | any additional or different terms or conditions on, or
177 | apply any Effective Technological Measures to, the
178 | Licensed Material if doing so restricts exercise of the
179 | Licensed Rights by any recipient of the Licensed
180 | Material.
181 |
182 | 6. No endorsement. Nothing in this Public License constitutes or
183 | may be construed as permission to assert or imply that You
184 | are, or that Your use of the Licensed Material is, connected
185 | with, or sponsored, endorsed, or granted official status by,
186 | the Licensor or others designated to receive attribution as
187 | provided in Section 3(a)(1)(A)(i).
188 |
189 | b. Other rights.
190 |
191 | 1. Moral rights, such as the right of integrity, are not
192 | licensed under this Public License, nor are publicity,
193 | privacy, and/or other similar personality rights; however, to
194 | the extent possible, the Licensor waives and/or agrees not to
195 | assert any such rights held by the Licensor to the limited
196 | extent necessary to allow You to exercise the Licensed
197 | Rights, but not otherwise.
198 |
199 | 2. Patent and trademark rights are not licensed under this
200 | Public License.
201 |
202 | 3. To the extent possible, the Licensor waives any right to
203 | collect royalties from You for the exercise of the Licensed
204 | Rights, whether directly or through a collecting society
205 | under any voluntary or waivable statutory or compulsory
206 | licensing scheme. In all other cases the Licensor expressly
207 | reserves any right to collect such royalties.
208 |
209 |
210 | Section 3 -- License Conditions.
211 |
212 | Your exercise of the Licensed Rights is expressly made subject to the
213 | following conditions.
214 |
215 | a. Attribution.
216 |
217 | 1. If You Share the Licensed Material (including in modified
218 | form), You must:
219 |
220 | a. retain the following if it is supplied by the Licensor
221 | with the Licensed Material:
222 |
223 | i. identification of the creator(s) of the Licensed
224 | Material and any others designated to receive
225 | attribution, in any reasonable manner requested by
226 | the Licensor (including by pseudonym if
227 | designated);
228 |
229 | ii. a copyright notice;
230 |
231 | iii. a notice that refers to this Public License;
232 |
233 | iv. a notice that refers to the disclaimer of
234 | warranties;
235 |
236 | v. a URI or hyperlink to the Licensed Material to the
237 | extent reasonably practicable;
238 |
239 | b. indicate if You modified the Licensed Material and
240 | retain an indication of any previous modifications; and
241 |
242 | c. indicate the Licensed Material is licensed under this
243 | Public License, and include the text of, or the URI or
244 | hyperlink to, this Public License.
245 |
246 | 2. You may satisfy the conditions in Section 3(a)(1) in any
247 | reasonable manner based on the medium, means, and context in
248 | which You Share the Licensed Material. For example, it may be
249 | reasonable to satisfy the conditions by providing a URI or
250 | hyperlink to a resource that includes the required
251 | information.
252 |
253 | 3. If requested by the Licensor, You must remove any of the
254 | information required by Section 3(a)(1)(A) to the extent
255 | reasonably practicable.
256 |
257 | 4. If You Share Adapted Material You produce, the Adapter's
258 | License You apply must not prevent recipients of the Adapted
259 | Material from complying with this Public License.
260 |
261 |
262 | Section 4 -- Sui Generis Database Rights.
263 |
264 | Where the Licensed Rights include Sui Generis Database Rights that
265 | apply to Your use of the Licensed Material:
266 |
267 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right
268 | to extract, reuse, reproduce, and Share all or a substantial
269 | portion of the contents of the database;
270 |
271 | b. if You include all or a substantial portion of the database
272 | contents in a database in which You have Sui Generis Database
273 | Rights, then the database in which You have Sui Generis Database
274 | Rights (but not its individual contents) is Adapted Material; and
275 |
276 | c. You must comply with the conditions in Section 3(a) if You Share
277 | all or a substantial portion of the contents of the database.
278 |
279 | For the avoidance of doubt, this Section 4 supplements and does not
280 | replace Your obligations under this Public License where the Licensed
281 | Rights include other Copyright and Similar Rights.
282 |
283 |
284 | Section 5 -- Disclaimer of Warranties and Limitation of Liability.
285 |
286 | a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
287 | EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
288 | AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
289 | ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
290 | IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
291 | WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
292 | PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
293 | ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
294 | KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
295 | ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
296 |
297 | b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
298 | TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
299 | NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
300 | INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
301 | COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
302 | USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
303 | ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
304 | DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
305 | IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
306 |
307 | c. The disclaimer of warranties and limitation of liability provided
308 | above shall be interpreted in a manner that, to the extent
309 | possible, most closely approximates an absolute disclaimer and
310 | waiver of all liability.
311 |
312 |
313 | Section 6 -- Term and Termination.
314 |
315 | a. This Public License applies for the term of the Copyright and
316 | Similar Rights licensed here. However, if You fail to comply with
317 | this Public License, then Your rights under this Public License
318 | terminate automatically.
319 |
320 | b. Where Your right to use the Licensed Material has terminated under
321 | Section 6(a), it reinstates:
322 |
323 | 1. automatically as of the date the violation is cured, provided
324 | it is cured within 30 days of Your discovery of the
325 | violation; or
326 |
327 | 2. upon express reinstatement by the Licensor.
328 |
329 | For the avoidance of doubt, this Section 6(b) does not affect any
330 | right the Licensor may have to seek remedies for Your violations
331 | of this Public License.
332 |
333 | c. For the avoidance of doubt, the Licensor may also offer the
334 | Licensed Material under separate terms or conditions or stop
335 | distributing the Licensed Material at any time; however, doing so
336 | will not terminate this Public License.
337 |
338 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
339 | License.
340 |
341 |
342 | Section 7 -- Other Terms and Conditions.
343 |
344 | a. The Licensor shall not be bound by any additional or different
345 | terms or conditions communicated by You unless expressly agreed.
346 |
347 | b. Any arrangements, understandings, or agreements regarding the
348 | Licensed Material not stated herein are separate from and
349 | independent of the terms and conditions of this Public License.
350 |
351 |
352 | Section 8 -- Interpretation.
353 |
354 | a. For the avoidance of doubt, this Public License does not, and
355 | shall not be interpreted to, reduce, limit, restrict, or impose
356 | conditions on any use of the Licensed Material that could lawfully
357 | be made without permission under this Public License.
358 |
359 | b. To the extent possible, if any provision of this Public License is
360 | deemed unenforceable, it shall be automatically reformed to the
361 | minimum extent necessary to make it enforceable. If the provision
362 | cannot be reformed, it shall be severed from this Public License
363 | without affecting the enforceability of the remaining terms and
364 | conditions.
365 |
366 | c. No term or condition of this Public License will be waived and no
367 | failure to comply consented to unless expressly agreed to by the
368 | Licensor.
369 |
370 | d. Nothing in this Public License constitutes or may be interpreted
371 | as a limitation upon, or waiver of, any privileges and immunities
372 | that apply to the Licensor or You, including from the legal
373 | processes of any jurisdiction or authority.
374 |
375 |
376 | =======================================================================
377 |
378 | Creative Commons is not a party to its public
379 | licenses. Notwithstanding, Creative Commons may elect to apply one of
380 | its public licenses to material it publishes and in those instances
381 | will be considered the “Licensor.” The text of the Creative Commons
382 | public licenses is dedicated to the public domain under the CC0 Public
383 | Domain Dedication. Except for the limited purpose of indicating that
384 | material is shared under a Creative Commons public license or as
385 | otherwise permitted by the Creative Commons policies published at
386 | creativecommons.org/policies, Creative Commons does not authorize the
387 | use of the trademark "Creative Commons" or any other trademark or logo
388 | of Creative Commons without its prior written consent including,
389 | without limitation, in connection with any unauthorized modifications
390 | to any of its public licenses or any other arrangements,
391 | understandings, or agreements concerning use of licensed material. For
392 | the avoidance of doubt, this paragraph does not form part of the
393 | public licenses.
394 |
395 | Creative Commons may be contacted at creativecommons.org.
396 |
--------------------------------------------------------------------------------
/assets/data/n01440764/ILSVRC2012_val_00009111.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n01440764/ILSVRC2012_val_00009111.JPEG
--------------------------------------------------------------------------------
/assets/data/n01440764/ILSVRC2012_val_00021740.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n01440764/ILSVRC2012_val_00021740.JPEG
--------------------------------------------------------------------------------
/assets/data/n01440764/n01440764_2751.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n01440764/n01440764_2751.JPEG
--------------------------------------------------------------------------------
/assets/data/n01440764/n01440764_341.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n01440764/n01440764_341.JPEG
--------------------------------------------------------------------------------
/assets/data/n01440764/n01440764_490.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n01440764/n01440764_490.JPEG
--------------------------------------------------------------------------------
/assets/data/n01440764/n01440764_5911.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n01440764/n01440764_5911.JPEG
--------------------------------------------------------------------------------
/assets/data/n01440764/n01440764_650.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n01440764/n01440764_650.JPEG
--------------------------------------------------------------------------------
/assets/data/n01440764/n01440764_6500.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n01440764/n01440764_6500.JPEG
--------------------------------------------------------------------------------
/assets/data/n01440764/n01440764_6570.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n01440764/n01440764_6570.JPEG
--------------------------------------------------------------------------------
/assets/data/n01440764/n01440764_910.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n01440764/n01440764_910.JPEG
--------------------------------------------------------------------------------
/assets/data/n02102040/ILSVRC2012_val_00004650.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n02102040/ILSVRC2012_val_00004650.JPEG
--------------------------------------------------------------------------------
/assets/data/n02102040/ILSVRC2012_val_00017370.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n02102040/ILSVRC2012_val_00017370.JPEG
--------------------------------------------------------------------------------
/assets/data/n02102040/ILSVRC2012_val_00036282.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n02102040/ILSVRC2012_val_00036282.JPEG
--------------------------------------------------------------------------------
/assets/data/n02102040/ILSVRC2012_val_00037182.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n02102040/ILSVRC2012_val_00037182.JPEG
--------------------------------------------------------------------------------
/assets/data/n02102040/n02102040_171.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n02102040/n02102040_171.JPEG
--------------------------------------------------------------------------------
/assets/data/n02102040/n02102040_202.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n02102040/n02102040_202.JPEG
--------------------------------------------------------------------------------
/assets/data/n02102040/n02102040_352.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n02102040/n02102040_352.JPEG
--------------------------------------------------------------------------------
/assets/data/n02102040/n02102040_371.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n02102040/n02102040_371.JPEG
--------------------------------------------------------------------------------
/assets/data/n02102040/n02102040_451.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n02102040/n02102040_451.JPEG
--------------------------------------------------------------------------------
/assets/data/n02102040/n02102040_460.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n02102040/n02102040_460.JPEG
--------------------------------------------------------------------------------
/assets/data/n02979186/ILSVRC2012_val_00008651.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n02979186/ILSVRC2012_val_00008651.JPEG
--------------------------------------------------------------------------------
/assets/data/n02979186/ILSVRC2012_val_00020400.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n02979186/ILSVRC2012_val_00020400.JPEG
--------------------------------------------------------------------------------
/assets/data/n02979186/ILSVRC2012_val_00028911.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n02979186/ILSVRC2012_val_00028911.JPEG
--------------------------------------------------------------------------------
/assets/data/n02979186/ILSVRC2012_val_00035160.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n02979186/ILSVRC2012_val_00035160.JPEG
--------------------------------------------------------------------------------
/assets/data/n02979186/ILSVRC2012_val_00042482.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n02979186/ILSVRC2012_val_00042482.JPEG
--------------------------------------------------------------------------------
/assets/data/n02979186/ILSVRC2012_val_00042982.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n02979186/ILSVRC2012_val_00042982.JPEG
--------------------------------------------------------------------------------
/assets/data/n02979186/ILSVRC2012_val_00043121.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n02979186/ILSVRC2012_val_00043121.JPEG
--------------------------------------------------------------------------------
/assets/data/n02979186/ILSVRC2012_val_00043731.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n02979186/ILSVRC2012_val_00043731.JPEG
--------------------------------------------------------------------------------
/assets/data/n02979186/ILSVRC2012_val_00045110.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n02979186/ILSVRC2012_val_00045110.JPEG
--------------------------------------------------------------------------------
/assets/data/n02979186/n02979186_40.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n02979186/n02979186_40.JPEG
--------------------------------------------------------------------------------
/assets/data/n03000684/ILSVRC2012_val_00025890.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n03000684/ILSVRC2012_val_00025890.JPEG
--------------------------------------------------------------------------------
/assets/data/n03000684/ILSVRC2012_val_00029211.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n03000684/ILSVRC2012_val_00029211.JPEG
--------------------------------------------------------------------------------
/assets/data/n03000684/ILSVRC2012_val_00045501.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n03000684/ILSVRC2012_val_00045501.JPEG
--------------------------------------------------------------------------------
/assets/data/n03000684/n03000684_2102.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n03000684/n03000684_2102.JPEG
--------------------------------------------------------------------------------
/assets/data/n03000684/n03000684_410.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n03000684/n03000684_410.JPEG
--------------------------------------------------------------------------------
/assets/data/n03000684/n03000684_590.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n03000684/n03000684_590.JPEG
--------------------------------------------------------------------------------
/assets/data/n03000684/n03000684_711.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n03000684/n03000684_711.JPEG
--------------------------------------------------------------------------------
/assets/data/n03000684/n03000684_731.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n03000684/n03000684_731.JPEG
--------------------------------------------------------------------------------
/assets/data/n03000684/n03000684_900.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n03000684/n03000684_900.JPEG
--------------------------------------------------------------------------------
/assets/data/n03000684/n03000684_931.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n03000684/n03000684_931.JPEG
--------------------------------------------------------------------------------
/assets/data/n03028079/ILSVRC2012_val_00023291.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n03028079/ILSVRC2012_val_00023291.JPEG
--------------------------------------------------------------------------------
/assets/data/n03028079/ILSVRC2012_val_00026451.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n03028079/ILSVRC2012_val_00026451.JPEG
--------------------------------------------------------------------------------
/assets/data/n03028079/ILSVRC2012_val_00028310.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n03028079/ILSVRC2012_val_00028310.JPEG
--------------------------------------------------------------------------------
/assets/data/n03028079/ILSVRC2012_val_00029870.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n03028079/ILSVRC2012_val_00029870.JPEG
--------------------------------------------------------------------------------
/assets/data/n03028079/ILSVRC2012_val_00034220.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n03028079/ILSVRC2012_val_00034220.JPEG
--------------------------------------------------------------------------------
/assets/data/n03028079/ILSVRC2012_val_00046232.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n03028079/ILSVRC2012_val_00046232.JPEG
--------------------------------------------------------------------------------
/assets/data/n03028079/ILSVRC2012_val_00046550.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n03028079/ILSVRC2012_val_00046550.JPEG
--------------------------------------------------------------------------------
/assets/data/n03028079/n03028079_102.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n03028079/n03028079_102.JPEG
--------------------------------------------------------------------------------
/assets/data/n03028079/n03028079_151.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n03028079/n03028079_151.JPEG
--------------------------------------------------------------------------------
/assets/data/n03028079/n03028079_80.JPEG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/data/n03028079/n03028079_80.JPEG
--------------------------------------------------------------------------------
/assets/imagenet1000_clsidx_to_labels.txt:
--------------------------------------------------------------------------------
1 | {0: 'tench, Tinca tinca',
2 | 1: 'goldfish, Carassius auratus',
3 | 2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
4 | 3: 'tiger shark, Galeocerdo cuvieri',
5 | 4: 'hammerhead, hammerhead shark',
6 | 5: 'electric ray, crampfish, numbfish, torpedo',
7 | 6: 'stingray',
8 | 7: 'cock',
9 | 8: 'hen',
10 | 9: 'ostrich, Struthio camelus',
11 | 10: 'brambling, Fringilla montifringilla',
12 | 11: 'goldfinch, Carduelis carduelis',
13 | 12: 'house finch, linnet, Carpodacus mexicanus',
14 | 13: 'junco, snowbird',
15 | 14: 'indigo bunting, indigo finch, indigo bird, Passerina cyanea',
16 | 15: 'robin, American robin, Turdus migratorius',
17 | 16: 'bulbul',
18 | 17: 'jay',
19 | 18: 'magpie',
20 | 19: 'chickadee',
21 | 20: 'water ouzel, dipper',
22 | 21: 'kite',
23 | 22: 'bald eagle, American eagle, Haliaeetus leucocephalus',
24 | 23: 'vulture',
25 | 24: 'great grey owl, great gray owl, Strix nebulosa',
26 | 25: 'European fire salamander, Salamandra salamandra',
27 | 26: 'common newt, Triturus vulgaris',
28 | 27: 'eft',
29 | 28: 'spotted salamander, Ambystoma maculatum',
30 | 29: 'axolotl, mud puppy, Ambystoma mexicanum',
31 | 30: 'bullfrog, Rana catesbeiana',
32 | 31: 'tree frog, tree-frog',
33 | 32: 'tailed frog, bell toad, ribbed toad, tailed toad, Ascaphus trui',
34 | 33: 'loggerhead, loggerhead turtle, Caretta caretta',
35 | 34: 'leatherback turtle, leatherback, leathery turtle, Dermochelys coriacea',
36 | 35: 'mud turtle',
37 | 36: 'terrapin',
38 | 37: 'box turtle, box tortoise',
39 | 38: 'banded gecko',
40 | 39: 'common iguana, iguana, Iguana iguana',
41 | 40: 'American chameleon, anole, Anolis carolinensis',
42 | 41: 'whiptail, whiptail lizard',
43 | 42: 'agama',
44 | 43: 'frilled lizard, Chlamydosaurus kingi',
45 | 44: 'alligator lizard',
46 | 45: 'Gila monster, Heloderma suspectum',
47 | 46: 'green lizard, Lacerta viridis',
48 | 47: 'African chameleon, Chamaeleo chamaeleon',
49 | 48: 'Komodo dragon, Komodo lizard, dragon lizard, giant lizard, Varanus komodoensis',
50 | 49: 'African crocodile, Nile crocodile, Crocodylus niloticus',
51 | 50: 'American alligator, Alligator mississipiensis',
52 | 51: 'triceratops',
53 | 52: 'thunder snake, worm snake, Carphophis amoenus',
54 | 53: 'ringneck snake, ring-necked snake, ring snake',
55 | 54: 'hognose snake, puff adder, sand viper',
56 | 55: 'green snake, grass snake',
57 | 56: 'king snake, kingsnake',
58 | 57: 'garter snake, grass snake',
59 | 58: 'water snake',
60 | 59: 'vine snake',
61 | 60: 'night snake, Hypsiglena torquata',
62 | 61: 'boa constrictor, Constrictor constrictor',
63 | 62: 'rock python, rock snake, Python sebae',
64 | 63: 'Indian cobra, Naja naja',
65 | 64: 'green mamba',
66 | 65: 'sea snake',
67 | 66: 'horned viper, cerastes, sand viper, horned asp, Cerastes cornutus',
68 | 67: 'diamondback, diamondback rattlesnake, Crotalus adamanteus',
69 | 68: 'sidewinder, horned rattlesnake, Crotalus cerastes',
70 | 69: 'trilobite',
71 | 70: 'harvestman, daddy longlegs, Phalangium opilio',
72 | 71: 'scorpion',
73 | 72: 'black and gold garden spider, Argiope aurantia',
74 | 73: 'barn spider, Araneus cavaticus',
75 | 74: 'garden spider, Aranea diademata',
76 | 75: 'black widow, Latrodectus mactans',
77 | 76: 'tarantula',
78 | 77: 'wolf spider, hunting spider',
79 | 78: 'tick',
80 | 79: 'centipede',
81 | 80: 'black grouse',
82 | 81: 'ptarmigan',
83 | 82: 'ruffed grouse, partridge, Bonasa umbellus',
84 | 83: 'prairie chicken, prairie grouse, prairie fowl',
85 | 84: 'peacock',
86 | 85: 'quail',
87 | 86: 'partridge',
88 | 87: 'African grey, African gray, Psittacus erithacus',
89 | 88: 'macaw',
90 | 89: 'sulphur-crested cockatoo, Kakatoe galerita, Cacatua galerita',
91 | 90: 'lorikeet',
92 | 91: 'coucal',
93 | 92: 'bee eater',
94 | 93: 'hornbill',
95 | 94: 'hummingbird',
96 | 95: 'jacamar',
97 | 96: 'toucan',
98 | 97: 'drake',
99 | 98: 'red-breasted merganser, Mergus serrator',
100 | 99: 'goose',
101 | 100: 'black swan, Cygnus atratus',
102 | 101: 'tusker',
103 | 102: 'echidna, spiny anteater, anteater',
104 | 103: 'platypus, duckbill, duckbilled platypus, duck-billed platypus, Ornithorhynchus anatinus',
105 | 104: 'wallaby, brush kangaroo',
106 | 105: 'koala, koala bear, kangaroo bear, native bear, Phascolarctos cinereus',
107 | 106: 'wombat',
108 | 107: 'jellyfish',
109 | 108: 'sea anemone, anemone',
110 | 109: 'brain coral',
111 | 110: 'flatworm, platyhelminth',
112 | 111: 'nematode, nematode worm, roundworm',
113 | 112: 'conch',
114 | 113: 'snail',
115 | 114: 'slug',
116 | 115: 'sea slug, nudibranch',
117 | 116: 'chiton, coat-of-mail shell, sea cradle, polyplacophore',
118 | 117: 'chambered nautilus, pearly nautilus, nautilus',
119 | 118: 'Dungeness crab, Cancer magister',
120 | 119: 'rock crab, Cancer irroratus',
121 | 120: 'fiddler crab',
122 | 121: 'king crab, Alaska crab, Alaskan king crab, Alaska king crab, Paralithodes camtschatica',
123 | 122: 'American lobster, Northern lobster, Maine lobster, Homarus americanus',
124 | 123: 'spiny lobster, langouste, rock lobster, crawfish, crayfish, sea crawfish',
125 | 124: 'crayfish, crawfish, crawdad, crawdaddy',
126 | 125: 'hermit crab',
127 | 126: 'isopod',
128 | 127: 'white stork, Ciconia ciconia',
129 | 128: 'black stork, Ciconia nigra',
130 | 129: 'spoonbill',
131 | 130: 'flamingo',
132 | 131: 'little blue heron, Egretta caerulea',
133 | 132: 'American egret, great white heron, Egretta albus',
134 | 133: 'bittern',
135 | 134: 'crane',
136 | 135: 'limpkin, Aramus pictus',
137 | 136: 'European gallinule, Porphyrio porphyrio',
138 | 137: 'American coot, marsh hen, mud hen, water hen, Fulica americana',
139 | 138: 'bustard',
140 | 139: 'ruddy turnstone, Arenaria interpres',
141 | 140: 'red-backed sandpiper, dunlin, Erolia alpina',
142 | 141: 'redshank, Tringa totanus',
143 | 142: 'dowitcher',
144 | 143: 'oystercatcher, oyster catcher',
145 | 144: 'pelican',
146 | 145: 'king penguin, Aptenodytes patagonica',
147 | 146: 'albatross, mollymawk',
148 | 147: 'grey whale, gray whale, devilfish, Eschrichtius gibbosus, Eschrichtius robustus',
149 | 148: 'killer whale, killer, orca, grampus, sea wolf, Orcinus orca',
150 | 149: 'dugong, Dugong dugon',
151 | 150: 'sea lion',
152 | 151: 'Chihuahua',
153 | 152: 'Japanese spaniel',
154 | 153: 'Maltese dog, Maltese terrier, Maltese',
155 | 154: 'Pekinese, Pekingese, Peke',
156 | 155: 'Shih-Tzu',
157 | 156: 'Blenheim spaniel',
158 | 157: 'papillon',
159 | 158: 'toy terrier',
160 | 159: 'Rhodesian ridgeback',
161 | 160: 'Afghan hound, Afghan',
162 | 161: 'basset, basset hound',
163 | 162: 'beagle',
164 | 163: 'bloodhound, sleuthhound',
165 | 164: 'bluetick',
166 | 165: 'black-and-tan coonhound',
167 | 166: 'Walker hound, Walker foxhound',
168 | 167: 'English foxhound',
169 | 168: 'redbone',
170 | 169: 'borzoi, Russian wolfhound',
171 | 170: 'Irish wolfhound',
172 | 171: 'Italian greyhound',
173 | 172: 'whippet',
174 | 173: 'Ibizan hound, Ibizan Podenco',
175 | 174: 'Norwegian elkhound, elkhound',
176 | 175: 'otterhound, otter hound',
177 | 176: 'Saluki, gazelle hound',
178 | 177: 'Scottish deerhound, deerhound',
179 | 178: 'Weimaraner',
180 | 179: 'Staffordshire bullterrier, Staffordshire bull terrier',
181 | 180: 'American Staffordshire terrier, Staffordshire terrier, American pit bull terrier, pit bull terrier',
182 | 181: 'Bedlington terrier',
183 | 182: 'Border terrier',
184 | 183: 'Kerry blue terrier',
185 | 184: 'Irish terrier',
186 | 185: 'Norfolk terrier',
187 | 186: 'Norwich terrier',
188 | 187: 'Yorkshire terrier',
189 | 188: 'wire-haired fox terrier',
190 | 189: 'Lakeland terrier',
191 | 190: 'Sealyham terrier, Sealyham',
192 | 191: 'Airedale, Airedale terrier',
193 | 192: 'cairn, cairn terrier',
194 | 193: 'Australian terrier',
195 | 194: 'Dandie Dinmont, Dandie Dinmont terrier',
196 | 195: 'Boston bull, Boston terrier',
197 | 196: 'miniature schnauzer',
198 | 197: 'giant schnauzer',
199 | 198: 'standard schnauzer',
200 | 199: 'Scotch terrier, Scottish terrier, Scottie',
201 | 200: 'Tibetan terrier, chrysanthemum dog',
202 | 201: 'silky terrier, Sydney silky',
203 | 202: 'soft-coated wheaten terrier',
204 | 203: 'West Highland white terrier',
205 | 204: 'Lhasa, Lhasa apso',
206 | 205: 'flat-coated retriever',
207 | 206: 'curly-coated retriever',
208 | 207: 'golden retriever',
209 | 208: 'Labrador retriever',
210 | 209: 'Chesapeake Bay retriever',
211 | 210: 'German short-haired pointer',
212 | 211: 'vizsla, Hungarian pointer',
213 | 212: 'English setter',
214 | 213: 'Irish setter, red setter',
215 | 214: 'Gordon setter',
216 | 215: 'Brittany spaniel',
217 | 216: 'clumber, clumber spaniel',
218 | 217: 'English springer, English springer spaniel',
219 | 218: 'Welsh springer spaniel',
220 | 219: 'cocker spaniel, English cocker spaniel, cocker',
221 | 220: 'Sussex spaniel',
222 | 221: 'Irish water spaniel',
223 | 222: 'kuvasz',
224 | 223: 'schipperke',
225 | 224: 'groenendael',
226 | 225: 'malinois',
227 | 226: 'briard',
228 | 227: 'kelpie',
229 | 228: 'komondor',
230 | 229: 'Old English sheepdog, bobtail',
231 | 230: 'Shetland sheepdog, Shetland sheep dog, Shetland',
232 | 231: 'collie',
233 | 232: 'Border collie',
234 | 233: 'Bouvier des Flandres, Bouviers des Flandres',
235 | 234: 'Rottweiler',
236 | 235: 'German shepherd, German shepherd dog, German police dog, alsatian',
237 | 236: 'Doberman, Doberman pinscher',
238 | 237: 'miniature pinscher',
239 | 238: 'Greater Swiss Mountain dog',
240 | 239: 'Bernese mountain dog',
241 | 240: 'Appenzeller',
242 | 241: 'EntleBucher',
243 | 242: 'boxer',
244 | 243: 'bull mastiff',
245 | 244: 'Tibetan mastiff',
246 | 245: 'French bulldog',
247 | 246: 'Great Dane',
248 | 247: 'Saint Bernard, St Bernard',
249 | 248: 'Eskimo dog, husky',
250 | 249: 'malamute, malemute, Alaskan malamute',
251 | 250: 'Siberian husky',
252 | 251: 'dalmatian, coach dog, carriage dog',
253 | 252: 'affenpinscher, monkey pinscher, monkey dog',
254 | 253: 'basenji',
255 | 254: 'pug, pug-dog',
256 | 255: 'Leonberg',
257 | 256: 'Newfoundland, Newfoundland dog',
258 | 257: 'Great Pyrenees',
259 | 258: 'Samoyed, Samoyede',
260 | 259: 'Pomeranian',
261 | 260: 'chow, chow chow',
262 | 261: 'keeshond',
263 | 262: 'Brabancon griffon',
264 | 263: 'Pembroke, Pembroke Welsh corgi',
265 | 264: 'Cardigan, Cardigan Welsh corgi',
266 | 265: 'toy poodle',
267 | 266: 'miniature poodle',
268 | 267: 'standard poodle',
269 | 268: 'Mexican hairless',
270 | 269: 'timber wolf, grey wolf, gray wolf, Canis lupus',
271 | 270: 'white wolf, Arctic wolf, Canis lupus tundrarum',
272 | 271: 'red wolf, maned wolf, Canis rufus, Canis niger',
273 | 272: 'coyote, prairie wolf, brush wolf, Canis latrans',
274 | 273: 'dingo, warrigal, warragal, Canis dingo',
275 | 274: 'dhole, Cuon alpinus',
276 | 275: 'African hunting dog, hyena dog, Cape hunting dog, Lycaon pictus',
277 | 276: 'hyena, hyaena',
278 | 277: 'red fox, Vulpes vulpes',
279 | 278: 'kit fox, Vulpes macrotis',
280 | 279: 'Arctic fox, white fox, Alopex lagopus',
281 | 280: 'grey fox, gray fox, Urocyon cinereoargenteus',
282 | 281: 'tabby, tabby cat',
283 | 282: 'tiger cat',
284 | 283: 'Persian cat',
285 | 284: 'Siamese cat, Siamese',
286 | 285: 'Egyptian cat',
287 | 286: 'cougar, puma, catamount, mountain lion, painter, panther, Felis concolor',
288 | 287: 'lynx, catamount',
289 | 288: 'leopard, Panthera pardus',
290 | 289: 'snow leopard, ounce, Panthera uncia',
291 | 290: 'jaguar, panther, Panthera onca, Felis onca',
292 | 291: 'lion, king of beasts, Panthera leo',
293 | 292: 'tiger, Panthera tigris',
294 | 293: 'cheetah, chetah, Acinonyx jubatus',
295 | 294: 'brown bear, bruin, Ursus arctos',
296 | 295: 'American black bear, black bear, Ursus americanus, Euarctos americanus',
297 | 296: 'ice bear, polar bear, Ursus Maritimus, Thalarctos maritimus',
298 | 297: 'sloth bear, Melursus ursinus, Ursus ursinus',
299 | 298: 'mongoose',
300 | 299: 'meerkat, mierkat',
301 | 300: 'tiger beetle',
302 | 301: 'ladybug, ladybeetle, lady beetle, ladybird, ladybird beetle',
303 | 302: 'ground beetle, carabid beetle',
304 | 303: 'long-horned beetle, longicorn, longicorn beetle',
305 | 304: 'leaf beetle, chrysomelid',
306 | 305: 'dung beetle',
307 | 306: 'rhinoceros beetle',
308 | 307: 'weevil',
309 | 308: 'fly',
310 | 309: 'bee',
311 | 310: 'ant, emmet, pismire',
312 | 311: 'grasshopper, hopper',
313 | 312: 'cricket',
314 | 313: 'walking stick, walkingstick, stick insect',
315 | 314: 'cockroach, roach',
316 | 315: 'mantis, mantid',
317 | 316: 'cicada, cicala',
318 | 317: 'leafhopper',
319 | 318: 'lacewing, lacewing fly',
320 | 319: "dragonfly, darning needle, devil's darning needle, sewing needle, snake feeder, snake doctor, mosquito hawk, skeeter hawk",
321 | 320: 'damselfly',
322 | 321: 'admiral',
323 | 322: 'ringlet, ringlet butterfly',
324 | 323: 'monarch, monarch butterfly, milkweed butterfly, Danaus plexippus',
325 | 324: 'cabbage butterfly',
326 | 325: 'sulphur butterfly, sulfur butterfly',
327 | 326: 'lycaenid, lycaenid butterfly',
328 | 327: 'starfish, sea star',
329 | 328: 'sea urchin',
330 | 329: 'sea cucumber, holothurian',
331 | 330: 'wood rabbit, cottontail, cottontail rabbit',
332 | 331: 'hare',
333 | 332: 'Angora, Angora rabbit',
334 | 333: 'hamster',
335 | 334: 'porcupine, hedgehog',
336 | 335: 'fox squirrel, eastern fox squirrel, Sciurus niger',
337 | 336: 'marmot',
338 | 337: 'beaver',
339 | 338: 'guinea pig, Cavia cobaya',
340 | 339: 'sorrel',
341 | 340: 'zebra',
342 | 341: 'hog, pig, grunter, squealer, Sus scrofa',
343 | 342: 'wild boar, boar, Sus scrofa',
344 | 343: 'warthog',
345 | 344: 'hippopotamus, hippo, river horse, Hippopotamus amphibius',
346 | 345: 'ox',
347 | 346: 'water buffalo, water ox, Asiatic buffalo, Bubalus bubalis',
348 | 347: 'bison',
349 | 348: 'ram, tup',
350 | 349: 'bighorn, bighorn sheep, cimarron, Rocky Mountain bighorn, Rocky Mountain sheep, Ovis canadensis',
351 | 350: 'ibex, Capra ibex',
352 | 351: 'hartebeest',
353 | 352: 'impala, Aepyceros melampus',
354 | 353: 'gazelle',
355 | 354: 'Arabian camel, dromedary, Camelus dromedarius',
356 | 355: 'llama',
357 | 356: 'weasel',
358 | 357: 'mink',
359 | 358: 'polecat, fitch, foulmart, foumart, Mustela putorius',
360 | 359: 'black-footed ferret, ferret, Mustela nigripes',
361 | 360: 'otter',
362 | 361: 'skunk, polecat, wood pussy',
363 | 362: 'badger',
364 | 363: 'armadillo',
365 | 364: 'three-toed sloth, ai, Bradypus tridactylus',
366 | 365: 'orangutan, orang, orangutang, Pongo pygmaeus',
367 | 366: 'gorilla, Gorilla gorilla',
368 | 367: 'chimpanzee, chimp, Pan troglodytes',
369 | 368: 'gibbon, Hylobates lar',
370 | 369: 'siamang, Hylobates syndactylus, Symphalangus syndactylus',
371 | 370: 'guenon, guenon monkey',
372 | 371: 'patas, hussar monkey, Erythrocebus patas',
373 | 372: 'baboon',
374 | 373: 'macaque',
375 | 374: 'langur',
376 | 375: 'colobus, colobus monkey',
377 | 376: 'proboscis monkey, Nasalis larvatus',
378 | 377: 'marmoset',
379 | 378: 'capuchin, ringtail, Cebus capucinus',
380 | 379: 'howler monkey, howler',
381 | 380: 'titi, titi monkey',
382 | 381: 'spider monkey, Ateles geoffroyi',
383 | 382: 'squirrel monkey, Saimiri sciureus',
384 | 383: 'Madagascar cat, ring-tailed lemur, Lemur catta',
385 | 384: 'indri, indris, Indri indri, Indri brevicaudatus',
386 | 385: 'Indian elephant, Elephas maximus',
387 | 386: 'African elephant, Loxodonta africana',
388 | 387: 'lesser panda, red panda, panda, bear cat, cat bear, Ailurus fulgens',
389 | 388: 'giant panda, panda, panda bear, coon bear, Ailuropoda melanoleuca',
390 | 389: 'barracouta, snoek',
391 | 390: 'eel',
392 | 391: 'coho, cohoe, coho salmon, blue jack, silver salmon, Oncorhynchus kisutch',
393 | 392: 'rock beauty, Holocanthus tricolor',
394 | 393: 'anemone fish',
395 | 394: 'sturgeon',
396 | 395: 'gar, garfish, garpike, billfish, Lepisosteus osseus',
397 | 396: 'lionfish',
398 | 397: 'puffer, pufferfish, blowfish, globefish',
399 | 398: 'abacus',
400 | 399: 'abaya',
401 | 400: "academic gown, academic robe, judge's robe",
402 | 401: 'accordion, piano accordion, squeeze box',
403 | 402: 'acoustic guitar',
404 | 403: 'aircraft carrier, carrier, flattop, attack aircraft carrier',
405 | 404: 'airliner',
406 | 405: 'airship, dirigible',
407 | 406: 'altar',
408 | 407: 'ambulance',
409 | 408: 'amphibian, amphibious vehicle',
410 | 409: 'analog clock',
411 | 410: 'apiary, bee house',
412 | 411: 'apron',
413 | 412: 'ashcan, trash can, garbage can, wastebin, ash bin, ash-bin, ashbin, dustbin, trash barrel, trash bin',
414 | 413: 'assault rifle, assault gun',
415 | 414: 'backpack, back pack, knapsack, packsack, rucksack, haversack',
416 | 415: 'bakery, bakeshop, bakehouse',
417 | 416: 'balance beam, beam',
418 | 417: 'balloon',
419 | 418: 'ballpoint, ballpoint pen, ballpen, Biro',
420 | 419: 'Band Aid',
421 | 420: 'banjo',
422 | 421: 'bannister, banister, balustrade, balusters, handrail',
423 | 422: 'barbell',
424 | 423: 'barber chair',
425 | 424: 'barbershop',
426 | 425: 'barn',
427 | 426: 'barometer',
428 | 427: 'barrel, cask',
429 | 428: 'barrow, garden cart, lawn cart, wheelbarrow',
430 | 429: 'baseball',
431 | 430: 'basketball',
432 | 431: 'bassinet',
433 | 432: 'bassoon',
434 | 433: 'bathing cap, swimming cap',
435 | 434: 'bath towel',
436 | 435: 'bathtub, bathing tub, bath, tub',
437 | 436: 'beach wagon, station wagon, wagon, estate car, beach waggon, station waggon, waggon',
438 | 437: 'beacon, lighthouse, beacon light, pharos',
439 | 438: 'beaker',
440 | 439: 'bearskin, busby, shako',
441 | 440: 'beer bottle',
442 | 441: 'beer glass',
443 | 442: 'bell cote, bell cot',
444 | 443: 'bib',
445 | 444: 'bicycle-built-for-two, tandem bicycle, tandem',
446 | 445: 'bikini, two-piece',
447 | 446: 'binder, ring-binder',
448 | 447: 'binoculars, field glasses, opera glasses',
449 | 448: 'birdhouse',
450 | 449: 'boathouse',
451 | 450: 'bobsled, bobsleigh, bob',
452 | 451: 'bolo tie, bolo, bola tie, bola',
453 | 452: 'bonnet, poke bonnet',
454 | 453: 'bookcase',
455 | 454: 'bookshop, bookstore, bookstall',
456 | 455: 'bottlecap',
457 | 456: 'bow',
458 | 457: 'bow tie, bow-tie, bowtie',
459 | 458: 'brass, memorial tablet, plaque',
460 | 459: 'brassiere, bra, bandeau',
461 | 460: 'breakwater, groin, groyne, mole, bulwark, seawall, jetty',
462 | 461: 'breastplate, aegis, egis',
463 | 462: 'broom',
464 | 463: 'bucket, pail',
465 | 464: 'buckle',
466 | 465: 'bulletproof vest',
467 | 466: 'bullet train, bullet',
468 | 467: 'butcher shop, meat market',
469 | 468: 'cab, hack, taxi, taxicab',
470 | 469: 'caldron, cauldron',
471 | 470: 'candle, taper, wax light',
472 | 471: 'cannon',
473 | 472: 'canoe',
474 | 473: 'can opener, tin opener',
475 | 474: 'cardigan',
476 | 475: 'car mirror',
477 | 476: 'carousel, carrousel, merry-go-round, roundabout, whirligig',
478 | 477: "carpenter's kit, tool kit",
479 | 478: 'carton',
480 | 479: 'car wheel',
481 | 480: 'cash machine, cash dispenser, automated teller machine, automatic teller machine, automated teller, automatic teller, ATM',
482 | 481: 'cassette',
483 | 482: 'cassette player',
484 | 483: 'castle',
485 | 484: 'catamaran',
486 | 485: 'CD player',
487 | 486: 'cello, violoncello',
488 | 487: 'cellular telephone, cellular phone, cellphone, cell, mobile phone',
489 | 488: 'chain',
490 | 489: 'chainlink fence',
491 | 490: 'chain mail, ring mail, mail, chain armor, chain armour, ring armor, ring armour',
492 | 491: 'chain saw, chainsaw',
493 | 492: 'chest',
494 | 493: 'chiffonier, commode',
495 | 494: 'chime, bell, gong',
496 | 495: 'china cabinet, china closet',
497 | 496: 'Christmas stocking',
498 | 497: 'church, church building',
499 | 498: 'cinema, movie theater, movie theatre, movie house, picture palace',
500 | 499: 'cleaver, meat cleaver, chopper',
501 | 500: 'cliff dwelling',
502 | 501: 'cloak',
503 | 502: 'clog, geta, patten, sabot',
504 | 503: 'cocktail shaker',
505 | 504: 'coffee mug',
506 | 505: 'coffeepot',
507 | 506: 'coil, spiral, volute, whorl, helix',
508 | 507: 'combination lock',
509 | 508: 'computer keyboard, keypad',
510 | 509: 'confectionery, confectionary, candy store',
511 | 510: 'container ship, containership, container vessel',
512 | 511: 'convertible',
513 | 512: 'corkscrew, bottle screw',
514 | 513: 'cornet, horn, trumpet, trump',
515 | 514: 'cowboy boot',
516 | 515: 'cowboy hat, ten-gallon hat',
517 | 516: 'cradle',
518 | 517: 'crane',
519 | 518: 'crash helmet',
520 | 519: 'crate',
521 | 520: 'crib, cot',
522 | 521: 'Crock Pot',
523 | 522: 'croquet ball',
524 | 523: 'crutch',
525 | 524: 'cuirass',
526 | 525: 'dam, dike, dyke',
527 | 526: 'desk',
528 | 527: 'desktop computer',
529 | 528: 'dial telephone, dial phone',
530 | 529: 'diaper, nappy, napkin',
531 | 530: 'digital clock',
532 | 531: 'digital watch',
533 | 532: 'dining table, board',
534 | 533: 'dishrag, dishcloth',
535 | 534: 'dishwasher, dish washer, dishwashing machine',
536 | 535: 'disk brake, disc brake',
537 | 536: 'dock, dockage, docking facility',
538 | 537: 'dogsled, dog sled, dog sleigh',
539 | 538: 'dome',
540 | 539: 'doormat, welcome mat',
541 | 540: 'drilling platform, offshore rig',
542 | 541: 'drum, membranophone, tympan',
543 | 542: 'drumstick',
544 | 543: 'dumbbell',
545 | 544: 'Dutch oven',
546 | 545: 'electric fan, blower',
547 | 546: 'electric guitar',
548 | 547: 'electric locomotive',
549 | 548: 'entertainment center',
550 | 549: 'envelope',
551 | 550: 'espresso maker',
552 | 551: 'face powder',
553 | 552: 'feather boa, boa',
554 | 553: 'file, file cabinet, filing cabinet',
555 | 554: 'fireboat',
556 | 555: 'fire engine, fire truck',
557 | 556: 'fire screen, fireguard',
558 | 557: 'flagpole, flagstaff',
559 | 558: 'flute, transverse flute',
560 | 559: 'folding chair',
561 | 560: 'football helmet',
562 | 561: 'forklift',
563 | 562: 'fountain',
564 | 563: 'fountain pen',
565 | 564: 'four-poster',
566 | 565: 'freight car',
567 | 566: 'French horn, horn',
568 | 567: 'frying pan, frypan, skillet',
569 | 568: 'fur coat',
570 | 569: 'garbage truck, dustcart',
571 | 570: 'gasmask, respirator, gas helmet',
572 | 571: 'gas pump, gasoline pump, petrol pump, island dispenser',
573 | 572: 'goblet',
574 | 573: 'go-kart',
575 | 574: 'golf ball',
576 | 575: 'golfcart, golf cart',
577 | 576: 'gondola',
578 | 577: 'gong, tam-tam',
579 | 578: 'gown',
580 | 579: 'grand piano, grand',
581 | 580: 'greenhouse, nursery, glasshouse',
582 | 581: 'grille, radiator grille',
583 | 582: 'grocery store, grocery, food market, market',
584 | 583: 'guillotine',
585 | 584: 'hair slide',
586 | 585: 'hair spray',
587 | 586: 'half track',
588 | 587: 'hammer',
589 | 588: 'hamper',
590 | 589: 'hand blower, blow dryer, blow drier, hair dryer, hair drier',
591 | 590: 'hand-held computer, hand-held microcomputer',
592 | 591: 'handkerchief, hankie, hanky, hankey',
593 | 592: 'hard disc, hard disk, fixed disk',
594 | 593: 'harmonica, mouth organ, harp, mouth harp',
595 | 594: 'harp',
596 | 595: 'harvester, reaper',
597 | 596: 'hatchet',
598 | 597: 'holster',
599 | 598: 'home theater, home theatre',
600 | 599: 'honeycomb',
601 | 600: 'hook, claw',
602 | 601: 'hoopskirt, crinoline',
603 | 602: 'horizontal bar, high bar',
604 | 603: 'horse cart, horse-cart',
605 | 604: 'hourglass',
606 | 605: 'iPod',
607 | 606: 'iron, smoothing iron',
608 | 607: "jack-o'-lantern",
609 | 608: 'jean, blue jean, denim',
610 | 609: 'jeep, landrover',
611 | 610: 'jersey, T-shirt, tee shirt',
612 | 611: 'jigsaw puzzle',
613 | 612: 'jinrikisha, ricksha, rickshaw',
614 | 613: 'joystick',
615 | 614: 'kimono',
616 | 615: 'knee pad',
617 | 616: 'knot',
618 | 617: 'lab coat, laboratory coat',
619 | 618: 'ladle',
620 | 619: 'lampshade, lamp shade',
621 | 620: 'laptop, laptop computer',
622 | 621: 'lawn mower, mower',
623 | 622: 'lens cap, lens cover',
624 | 623: 'letter opener, paper knife, paperknife',
625 | 624: 'library',
626 | 625: 'lifeboat',
627 | 626: 'lighter, light, igniter, ignitor',
628 | 627: 'limousine, limo',
629 | 628: 'liner, ocean liner',
630 | 629: 'lipstick, lip rouge',
631 | 630: 'Loafer',
632 | 631: 'lotion',
633 | 632: 'loudspeaker, speaker, speaker unit, loudspeaker system, speaker system',
634 | 633: "loupe, jeweler's loupe",
635 | 634: 'lumbermill, sawmill',
636 | 635: 'magnetic compass',
637 | 636: 'mailbag, postbag',
638 | 637: 'mailbox, letter box',
639 | 638: 'maillot',
640 | 639: 'maillot, tank suit',
641 | 640: 'manhole cover',
642 | 641: 'maraca',
643 | 642: 'marimba, xylophone',
644 | 643: 'mask',
645 | 644: 'matchstick',
646 | 645: 'maypole',
647 | 646: 'maze, labyrinth',
648 | 647: 'measuring cup',
649 | 648: 'medicine chest, medicine cabinet',
650 | 649: 'megalith, megalithic structure',
651 | 650: 'microphone, mike',
652 | 651: 'microwave, microwave oven',
653 | 652: 'military uniform',
654 | 653: 'milk can',
655 | 654: 'minibus',
656 | 655: 'miniskirt, mini',
657 | 656: 'minivan',
658 | 657: 'missile',
659 | 658: 'mitten',
660 | 659: 'mixing bowl',
661 | 660: 'mobile home, manufactured home',
662 | 661: 'Model T',
663 | 662: 'modem',
664 | 663: 'monastery',
665 | 664: 'monitor',
666 | 665: 'moped',
667 | 666: 'mortar',
668 | 667: 'mortarboard',
669 | 668: 'mosque',
670 | 669: 'mosquito net',
671 | 670: 'motor scooter, scooter',
672 | 671: 'mountain bike, all-terrain bike, off-roader',
673 | 672: 'mountain tent',
674 | 673: 'mouse, computer mouse',
675 | 674: 'mousetrap',
676 | 675: 'moving van',
677 | 676: 'muzzle',
678 | 677: 'nail',
679 | 678: 'neck brace',
680 | 679: 'necklace',
681 | 680: 'nipple',
682 | 681: 'notebook, notebook computer',
683 | 682: 'obelisk',
684 | 683: 'oboe, hautboy, hautbois',
685 | 684: 'ocarina, sweet potato',
686 | 685: 'odometer, hodometer, mileometer, milometer',
687 | 686: 'oil filter',
688 | 687: 'organ, pipe organ',
689 | 688: 'oscilloscope, scope, cathode-ray oscilloscope, CRO',
690 | 689: 'overskirt',
691 | 690: 'oxcart',
692 | 691: 'oxygen mask',
693 | 692: 'packet',
694 | 693: 'paddle, boat paddle',
695 | 694: 'paddlewheel, paddle wheel',
696 | 695: 'padlock',
697 | 696: 'paintbrush',
698 | 697: "pajama, pyjama, pj's, jammies",
699 | 698: 'palace',
700 | 699: 'panpipe, pandean pipe, syrinx',
701 | 700: 'paper towel',
702 | 701: 'parachute, chute',
703 | 702: 'parallel bars, bars',
704 | 703: 'park bench',
705 | 704: 'parking meter',
706 | 705: 'passenger car, coach, carriage',
707 | 706: 'patio, terrace',
708 | 707: 'pay-phone, pay-station',
709 | 708: 'pedestal, plinth, footstall',
710 | 709: 'pencil box, pencil case',
711 | 710: 'pencil sharpener',
712 | 711: 'perfume, essence',
713 | 712: 'Petri dish',
714 | 713: 'photocopier',
715 | 714: 'pick, plectrum, plectron',
716 | 715: 'pickelhaube',
717 | 716: 'picket fence, paling',
718 | 717: 'pickup, pickup truck',
719 | 718: 'pier',
720 | 719: 'piggy bank, penny bank',
721 | 720: 'pill bottle',
722 | 721: 'pillow',
723 | 722: 'ping-pong ball',
724 | 723: 'pinwheel',
725 | 724: 'pirate, pirate ship',
726 | 725: 'pitcher, ewer',
727 | 726: "plane, carpenter's plane, woodworking plane",
728 | 727: 'planetarium',
729 | 728: 'plastic bag',
730 | 729: 'plate rack',
731 | 730: 'plow, plough',
732 | 731: "plunger, plumber's helper",
733 | 732: 'Polaroid camera, Polaroid Land camera',
734 | 733: 'pole',
735 | 734: 'police van, police wagon, paddy wagon, patrol wagon, wagon, black Maria',
736 | 735: 'poncho',
737 | 736: 'pool table, billiard table, snooker table',
738 | 737: 'pop bottle, soda bottle',
739 | 738: 'pot, flowerpot',
740 | 739: "potter's wheel",
741 | 740: 'power drill',
742 | 741: 'prayer rug, prayer mat',
743 | 742: 'printer',
744 | 743: 'prison, prison house',
745 | 744: 'projectile, missile',
746 | 745: 'projector',
747 | 746: 'puck, hockey puck',
748 | 747: 'punching bag, punch bag, punching ball, punchball',
749 | 748: 'purse',
750 | 749: 'quill, quill pen',
751 | 750: 'quilt, comforter, comfort, puff',
752 | 751: 'racer, race car, racing car',
753 | 752: 'racket, racquet',
754 | 753: 'radiator',
755 | 754: 'radio, wireless',
756 | 755: 'radio telescope, radio reflector',
757 | 756: 'rain barrel',
758 | 757: 'recreational vehicle, RV, R.V.',
759 | 758: 'reel',
760 | 759: 'reflex camera',
761 | 760: 'refrigerator, icebox',
762 | 761: 'remote control, remote',
763 | 762: 'restaurant, eating house, eating place, eatery',
764 | 763: 'revolver, six-gun, six-shooter',
765 | 764: 'rifle',
766 | 765: 'rocking chair, rocker',
767 | 766: 'rotisserie',
768 | 767: 'rubber eraser, rubber, pencil eraser',
769 | 768: 'rugby ball',
770 | 769: 'rule, ruler',
771 | 770: 'running shoe',
772 | 771: 'safe',
773 | 772: 'safety pin',
774 | 773: 'saltshaker, salt shaker',
775 | 774: 'sandal',
776 | 775: 'sarong',
777 | 776: 'sax, saxophone',
778 | 777: 'scabbard',
779 | 778: 'scale, weighing machine',
780 | 779: 'school bus',
781 | 780: 'schooner',
782 | 781: 'scoreboard',
783 | 782: 'screen, CRT screen',
784 | 783: 'screw',
785 | 784: 'screwdriver',
786 | 785: 'seat belt, seatbelt',
787 | 786: 'sewing machine',
788 | 787: 'shield, buckler',
789 | 788: 'shoe shop, shoe-shop, shoe store',
790 | 789: 'shoji',
791 | 790: 'shopping basket',
792 | 791: 'shopping cart',
793 | 792: 'shovel',
794 | 793: 'shower cap',
795 | 794: 'shower curtain',
796 | 795: 'ski',
797 | 796: 'ski mask',
798 | 797: 'sleeping bag',
799 | 798: 'slide rule, slipstick',
800 | 799: 'sliding door',
801 | 800: 'slot, one-armed bandit',
802 | 801: 'snorkel',
803 | 802: 'snowmobile',
804 | 803: 'snowplow, snowplough',
805 | 804: 'soap dispenser',
806 | 805: 'soccer ball',
807 | 806: 'sock',
808 | 807: 'solar dish, solar collector, solar furnace',
809 | 808: 'sombrero',
810 | 809: 'soup bowl',
811 | 810: 'space bar',
812 | 811: 'space heater',
813 | 812: 'space shuttle',
814 | 813: 'spatula',
815 | 814: 'speedboat',
816 | 815: "spider web, spider's web",
817 | 816: 'spindle',
818 | 817: 'sports car, sport car',
819 | 818: 'spotlight, spot',
820 | 819: 'stage',
821 | 820: 'steam locomotive',
822 | 821: 'steel arch bridge',
823 | 822: 'steel drum',
824 | 823: 'stethoscope',
825 | 824: 'stole',
826 | 825: 'stone wall',
827 | 826: 'stopwatch, stop watch',
828 | 827: 'stove',
829 | 828: 'strainer',
830 | 829: 'streetcar, tram, tramcar, trolley, trolley car',
831 | 830: 'stretcher',
832 | 831: 'studio couch, day bed',
833 | 832: 'stupa, tope',
834 | 833: 'submarine, pigboat, sub, U-boat',
835 | 834: 'suit, suit of clothes',
836 | 835: 'sundial',
837 | 836: 'sunglass',
838 | 837: 'sunglasses, dark glasses, shades',
839 | 838: 'sunscreen, sunblock, sun blocker',
840 | 839: 'suspension bridge',
841 | 840: 'swab, swob, mop',
842 | 841: 'sweatshirt',
843 | 842: 'swimming trunks, bathing trunks',
844 | 843: 'swing',
845 | 844: 'switch, electric switch, electrical switch',
846 | 845: 'syringe',
847 | 846: 'table lamp',
848 | 847: 'tank, army tank, armored combat vehicle, armoured combat vehicle',
849 | 848: 'tape player',
850 | 849: 'teapot',
851 | 850: 'teddy, teddy bear',
852 | 851: 'television, television system',
853 | 852: 'tennis ball',
854 | 853: 'thatch, thatched roof',
855 | 854: 'theater curtain, theatre curtain',
856 | 855: 'thimble',
857 | 856: 'thresher, thrasher, threshing machine',
858 | 857: 'throne',
859 | 858: 'tile roof',
860 | 859: 'toaster',
861 | 860: 'tobacco shop, tobacconist shop, tobacconist',
862 | 861: 'toilet seat',
863 | 862: 'torch',
864 | 863: 'totem pole',
865 | 864: 'tow truck, tow car, wrecker',
866 | 865: 'toyshop',
867 | 866: 'tractor',
868 | 867: 'trailer truck, tractor trailer, trucking rig, rig, articulated lorry, semi',
869 | 868: 'tray',
870 | 869: 'trench coat',
871 | 870: 'tricycle, trike, velocipede',
872 | 871: 'trimaran',
873 | 872: 'tripod',
874 | 873: 'triumphal arch',
875 | 874: 'trolleybus, trolley coach, trackless trolley',
876 | 875: 'trombone',
877 | 876: 'tub, vat',
878 | 877: 'turnstile',
879 | 878: 'typewriter keyboard',
880 | 879: 'umbrella',
881 | 880: 'unicycle, monocycle',
882 | 881: 'upright, upright piano',
883 | 882: 'vacuum, vacuum cleaner',
884 | 883: 'vase',
885 | 884: 'vault',
886 | 885: 'velvet',
887 | 886: 'vending machine',
888 | 887: 'vestment',
889 | 888: 'viaduct',
890 | 889: 'violin, fiddle',
891 | 890: 'volleyball',
892 | 891: 'waffle iron',
893 | 892: 'wall clock',
894 | 893: 'wallet, billfold, notecase, pocketbook',
895 | 894: 'wardrobe, closet, press',
896 | 895: 'warplane, military plane',
897 | 896: 'washbasin, handbasin, washbowl, lavabo, wash-hand basin',
898 | 897: 'washer, automatic washer, washing machine',
899 | 898: 'water bottle',
900 | 899: 'water jug',
901 | 900: 'water tower',
902 | 901: 'whiskey jug',
903 | 902: 'whistle',
904 | 903: 'wig',
905 | 904: 'window screen',
906 | 905: 'window shade',
907 | 906: 'Windsor tie',
908 | 907: 'wine bottle',
909 | 908: 'wing',
910 | 909: 'wok',
911 | 910: 'wooden spoon',
912 | 911: 'wool, woolen, woollen',
913 | 912: 'worm fence, snake fence, snake-rail fence, Virginia fence',
914 | 913: 'wreck',
915 | 914: 'yawl',
916 | 915: 'yurt',
917 | 916: 'web site, website, internet site, site',
918 | 917: 'comic book',
919 | 918: 'crossword puzzle, crossword',
920 | 919: 'street sign',
921 | 920: 'traffic light, traffic signal, stoplight',
922 | 921: 'book jacket, dust cover, dust jacket, dust wrapper',
923 | 922: 'menu',
924 | 923: 'plate',
925 | 924: 'guacamole',
926 | 925: 'consomme',
927 | 926: 'hot pot, hotpot',
928 | 927: 'trifle',
929 | 928: 'ice cream, icecream',
930 | 929: 'ice lolly, lolly, lollipop, popsicle',
931 | 930: 'French loaf',
932 | 931: 'bagel, beigel',
933 | 932: 'pretzel',
934 | 933: 'cheeseburger',
935 | 934: 'hotdog, hot dog, red hot',
936 | 935: 'mashed potato',
937 | 936: 'head cabbage',
938 | 937: 'broccoli',
939 | 938: 'cauliflower',
940 | 939: 'zucchini, courgette',
941 | 940: 'spaghetti squash',
942 | 941: 'acorn squash',
943 | 942: 'butternut squash',
944 | 943: 'cucumber, cuke',
945 | 944: 'artichoke, globe artichoke',
946 | 945: 'bell pepper',
947 | 946: 'cardoon',
948 | 947: 'mushroom',
949 | 948: 'Granny Smith',
950 | 949: 'strawberry',
951 | 950: 'orange',
952 | 951: 'lemon',
953 | 952: 'fig',
954 | 953: 'pineapple, ananas',
955 | 954: 'banana',
956 | 955: 'jackfruit, jak, jack',
957 | 956: 'custard apple',
958 | 957: 'pomegranate',
959 | 958: 'hay',
960 | 959: 'carbonara',
961 | 960: 'chocolate sauce, chocolate syrup',
962 | 961: 'dough',
963 | 962: 'meat loaf, meatloaf',
964 | 963: 'pizza, pizza pie',
965 | 964: 'potpie',
966 | 965: 'burrito',
967 | 966: 'red wine',
968 | 967: 'espresso',
969 | 968: 'cup',
970 | 969: 'eggnog',
971 | 970: 'alp',
972 | 971: 'bubble',
973 | 972: 'cliff, drop, drop-off',
974 | 973: 'coral reef',
975 | 974: 'geyser',
976 | 975: 'lakeside, lakeshore',
977 | 976: 'promontory, headland, head, foreland',
978 | 977: 'sandbar, sand bar',
979 | 978: 'seashore, coast, seacoast, sea-coast',
980 | 979: 'valley, vale',
981 | 980: 'volcano',
982 | 981: 'ballplayer, baseball player',
983 | 982: 'groom, bridegroom',
984 | 983: 'scuba diver',
985 | 984: 'rapeseed',
986 | 985: 'daisy',
987 | 986: "yellow lady's slipper, yellow lady-slipper, Cypripedium calceolus, Cypripedium parviflorum",
988 | 987: 'corn',
989 | 988: 'acorn',
990 | 989: 'hip, rose hip, rosehip',
991 | 990: 'buckeye, horse chestnut, conker',
992 | 991: 'coral fungus',
993 | 992: 'agaric',
994 | 993: 'gyromitra',
995 | 994: 'stinkhorn, carrion fungus',
996 | 995: 'earthstar',
997 | 996: 'hen-of-the-woods, hen of the woods, Polyporus frondosus, Grifola frondosa',
998 | 997: 'bolete',
999 | 998: 'ear, spike, capitulum',
1000 | 999: 'toilet tissue, toilet paper, bathroom tissue'}
--------------------------------------------------------------------------------
/assets/imagenet_patch.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/assets/imagenet_patch.gz
--------------------------------------------------------------------------------
/example.py:
--------------------------------------------------------------------------------
1 | import torch
2 | from torch.utils.data import DataLoader
3 |
4 | import torchvision
5 | from torchvision.datasets import ImageFolder
6 |
7 | from torchvision.transforms import Compose, Resize, CenterCrop, ToTensor, \
8 | Normalize
9 | import torchvision.models as models
10 |
11 | from utils.visualization import imshow
12 | from utils.utils import set_all_seed
13 | from utils.utils import target_transforms
14 |
15 | from transforms.apply_patch import ApplyPatch
16 |
17 | import gzip
18 | import pickle
19 |
20 | import os
21 |
22 |
23 | set_all_seed(0)
24 |
25 | # Choose an integer in the range 0-9 to select the patch
26 | patch_id = 1
27 |
28 | # dictionary with the ImageNet label names
29 | with open(os.path.join(os.getcwd(), "assets/imagenet1000_clsidx_to_labels.txt")) as f:
30 | target_to_classname = eval(f.read())
31 |
32 | # Load the patches
33 | with gzip.open(os.path.join(os.getcwd(), "assets/imagenet_patch.gz"), 'rb') as f:
34 | imagenet_patch = pickle.load(f)
35 | patches, targets, info = imagenet_patch
36 | patch = patches[patch_id] # get the patch with id=1
37 |
38 | print(f"Target class: {target_to_classname[targets[patch_id].item()].split(',')[0]}")
39 |
40 | # Instantiate the ApplyPatch module setting the patch and the affine transformation that will be applied
41 | apply_patch = ApplyPatch(patch, patch_size=info['patch_size'],
42 | translation_range=(.2, .2), # translation fraction wrt image dimensions
43 | rotation_range=45, # maximum absolute value of the rotation in degree
44 | scale_range=(0.7, 1) # scale range wrt image dimensions
45 | )
46 |
47 | # For convenience the preprocessing steps are splitted to compute also the clean predictions
48 | normalizer = Normalize(mean=[0.485, 0.456, 0.406],
49 | std=[0.229, 0.224, 0.225])
50 | patch_normalizer = Compose([apply_patch, normalizer])
51 |
52 | # Load the data
53 | preprocess = Compose([Resize(256), CenterCrop(224), ToTensor()]) # ensure images are 224x224
54 | dataset = ImageFolder(os.path.join(os.getcwd(), "assets/data"),
55 | transform=preprocess,
56 | target_transform=target_transforms)
57 | data_loader = DataLoader(dataset, batch_size=10, shuffle=True)
58 | x, y = next(iter(data_loader)) # load a mini-batch
59 | x_clean = normalizer(x)
60 | x_adv = patch_normalizer(x)
61 |
62 | imshow(torchvision.utils.make_grid(x_adv.cpu().detach(), nrow=5), transforms=patch_normalizer)
63 |
64 | # Load model
65 | model = models.alexnet(pretrained=True)
66 | model.eval()
67 |
68 | # Test the model with the clean images
69 | output_clean = model(x_clean)
70 | clean_predictions = torch.argmax(output_clean, dim=1).cpu().detach().numpy()
71 |
72 | # Test the model with the images corrupted by the patch
73 | output_adv = model(x_adv)
74 | adv_predictions = torch.argmax(output_adv, dim=1).cpu().detach().numpy()
75 |
76 | print("\nPredictions:")
77 | for true_label, clean_pred, adv_pred in list(zip(y, clean_predictions, adv_predictions)):
78 | print(f"True label: {target_to_classname[true_label.item()].split(',')[0]} -> "
79 | f"Clean: {target_to_classname[clean_pred].split(',')[0]} -> "
80 | f"Adv.: {target_to_classname[adv_pred].split(',')[0]}")
81 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | # **ImageNet-Patch: A Dataset for Benchmarking Machine Learning Robustness against Adversarial Patches**
2 |
3 | The demo code for the application of the generated patches on a batch from the Imagenet dataset.
4 |
5 |
6 |
9 |
10 |
11 | ## :world_map: Documentation
12 |
13 | **Paper**: Preprint available at https://arxiv.org/abs/2203.04412
14 |
15 | **Tutorial**: You can find a detailed example of how to use ImageNet-Patch in your model predictions in [this script](./example.py) and our [tutorial notebook](./imagenet_patch_example.ipynb).
16 |
17 | # :joystick: Example
18 |
19 | ### How can I load the patches?
20 |
21 |
22 |
25 |
26 |
27 | You can find the patches saved in assets/patches.gz in the form (patches, targets),
28 | where patches and targets are pytorch tensors respectively with shape (10, 3, 224, 224) and (10,).
29 | To load them you can simply run the following code snippet and select your favourite one :)
30 |
31 | ```python
32 | # Load the patches
33 | with gzip.open(os.path.join(os.getcwd(), "assets/patches.gz"), 'rb') as f:
34 | patches, targets = pickle.load(f)
35 | patch = patches[1] # get the patch with id=1
36 | target = targets[1]
37 | ```
38 |
39 |
40 | ### How can I use them to make predictions?
41 |
42 | Once a patch is selected it can be used
43 | instantiating the ApplyPatch module in the preprocessing stack, just before the normalizer!
44 | To do that you have to specify the patch tensor and the affine transformations
45 | ranges (translation_range, rotation_range, scale_range), for which the parameters will be random sampled when an image is taken.
46 |
47 |
48 | ```python
49 | from transforms.apply_patch import ApplyPatch
50 | from torchvision.transforms import Resize, CenterCrop, ToTensor, Normalize, Compose
51 |
52 | # Instantiate the ApplyPatch layer, setting patch, target and transforms
53 | apply_patch = ApplyPatch(patch,
54 | translation_range=(.2, .2), # translation fraction wrt image dimensions
55 | rotation_range=45, # maximum absolute value of the rotation in degree
56 | scale_range=(0.5, 1) # scale range wrt image dimensions
57 | )
58 |
59 | # Build the preprocessing stack with ApplyPatch before the normalization step
60 | preprocess = Compose([Resize(256), CenterCrop(224), ToTensor(),
61 | apply_patch,
62 | Normalize(mean=[0.485, 0.456, 0.406],
63 | std=[0.229, 0.224, 0.225])
64 | ])
65 | ```
66 |
67 |
68 |
69 |
70 |
73 |
74 |
75 | Note: for our experiments we used the same subset of images used in RobustBench, extracted from the ImageNet validation set. The list of images can be found [here](https://github.com/RobustBench/robustbench/blob/master/robustbench/data/imagenet_test_image_ids.txt).
76 |
77 | # :printer: Printed Patches applied to Real-World Objects
78 | As an additional experiment, we print and apply our 10 adversarial patches on 3 different real-world objects, with 3 different roto-translations, thus acquiring 90 photos that can be [downloaded here](https://www.dropbox.com/scl/fo/6pin19joxsu3yp5sjzm0u/h?dl=0&rlkey=60eor85ral2bmytnuty397en6).
79 |
80 |
81 | # :newspaper: Citation
82 |
83 | If you use Imagenet-Patch in your work, please cite us using the following BibTeX entry:
84 |
85 | ```
86 | @article{pintor2023imagenet,
87 | title={ImageNet-Patch: A dataset for benchmarking machine learning robustness against adversarial patches},
88 | author={Pintor, Maura and Angioni, Daniele and Sotgiu, Angelo and Demetrio, Luca and Demontis, Ambra and Biggio, Battista and Roli, Fabio},
89 | journal={Pattern Recognition},
90 | volume={134},
91 | pages={109064},
92 | year={2023},
93 | publisher={Elsevier}
94 | }
95 | ```
96 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | cycler==0.11.0
2 | fonttools==4.30.0
3 | kiwisolver==1.3.2
4 | matplotlib==3.5.1
5 | numpy==1.22.3
6 | packaging==21.3
7 | Pillow==9.0.1
8 | pyparsing==3.0.7
9 | python-dateutil==2.8.2
10 | six==1.16.0
11 | torch==1.10.2
12 | torchvision==0.11.3
13 | typing_extensions==4.1.1
14 |
--------------------------------------------------------------------------------
/transforms/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/transforms/__init__.py
--------------------------------------------------------------------------------
/transforms/apply_patch.py:
--------------------------------------------------------------------------------
1 | import torch
2 | from transforms.my_random_affine import MyRandomAffine
3 |
4 |
5 | class ApplyPatch(torch.nn.Module):
6 |
7 | def __init__(self, patch, translation_range=(.2, .2), rotation_range=45,
8 | scale_range=(0.5, 1), patch_size=50):
9 | super().__init__()
10 | self.patch_size = patch_size
11 | self.translation_range = translation_range
12 | self.rotation_range = rotation_range
13 | self.scale_range = scale_range
14 |
15 | self._transforms = None
16 | self._patch = None
17 | self._input_shape = None
18 | self._mask = None
19 |
20 | self.set_transforms(translation_range, rotation_range, scale_range)
21 | self.set_patch(patch)
22 |
23 | @property
24 | def mask(self):
25 | return self._mask
26 |
27 | @property
28 | def transforms(self):
29 | return self._transforms
30 |
31 | def set_patch(self, patch):
32 | self._patch = patch
33 | self._input_shape = self._patch.shape
34 | self._mask = self._generate_mask()
35 |
36 | def _generate_mask(self):
37 | mask = torch.ones(self._input_shape)
38 | upp_l_x = self._input_shape[2] // 2 - self.patch_size // 2
39 | upp_l_y = self._input_shape[1] // 2 - self.patch_size // 2
40 | bott_r_x = self._input_shape[2] // 2 + self.patch_size // 2
41 | bott_r_y = self._input_shape[1] // 2 + self.patch_size // 2
42 | mask[:, :upp_l_x, :] = 0
43 | mask[:, :, :upp_l_y] = 0
44 | mask[:, bott_r_x:, :] = 0
45 | mask[:, :, bott_r_y:] = 0
46 |
47 | return mask
48 |
49 | def set_transforms(self, translation_range, rotation_range,
50 | scale_range):
51 | self._transforms = MyRandomAffine(
52 | rotation_range, translation_range, scale_range)
53 |
54 | def forward(self, img):
55 | patch, mask = self.transforms(self._patch, self._mask)
56 | inv_mask = torch.zeros_like(mask)
57 | inv_mask[mask == 0] = 1
58 | return img * inv_mask + patch * mask
59 |
--------------------------------------------------------------------------------
/transforms/my_random_affine.py:
--------------------------------------------------------------------------------
1 | import torchvision
2 | from torch import Tensor
3 | from torchvision.transforms import functional as F
4 |
5 |
6 | class MyRandomAffine(torchvision.transforms.RandomAffine):
7 | def forward(self, img, mask):
8 | fill = self.fill
9 | if isinstance(img, Tensor):
10 | if isinstance(fill, (int, float)):
11 | try:
12 | fill = [float(fill)] * F.get_image_num_channels(img)
13 | except:
14 | fill = [float(fill)] * F._get_image_num_channels(img)
15 | else:
16 | fill = [float(f) for f in fill]
17 | try:
18 | img_size = F.get_image_size(img)
19 | except:
20 | img_size = F._get_image_size(img)
21 | ret = self.get_params(self.degrees, self.translate, self.scale,
22 | self.shear, img_size)
23 | transf_img = F.affine(img, *ret, interpolation=self.interpolation,
24 | fill=fill)
25 | transf_mask = F.affine(mask, *ret, interpolation=self.interpolation,
26 | fill=fill)
27 | return transf_img, transf_mask
28 |
--------------------------------------------------------------------------------
/utils/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pralab/ImageNet-Patch/1a8600c6aa20b640bc179cbb812b20fb5b11ae29/utils/__init__.py
--------------------------------------------------------------------------------
/utils/utils.py:
--------------------------------------------------------------------------------
1 | import torch
2 | import numpy as np
3 | import random
4 |
5 | def set_all_seed(seed):
6 | torch.manual_seed(seed)
7 | torch.cuda.manual_seed(seed)
8 | torch.backends.cudnn.benchmark = False
9 | np.random.seed(seed)
10 | random.seed(seed)
11 |
12 | _imagenette_classes = [0, 217, 482, 491, 497]
13 | target_transforms = lambda y: _imagenette_classes[y]
--------------------------------------------------------------------------------
/utils/visualization.py:
--------------------------------------------------------------------------------
1 | from torchvision.transforms import Normalize
2 | from torchvision.utils import make_grid
3 | import numpy as np
4 | import matplotlib.pyplot as plt
5 | import os
6 |
7 | class InvNormalize(Normalize):
8 | def __init__(self, normalizer):
9 | inv_mean = [-mean / std for mean, std in list(zip(normalizer.mean, normalizer.std))]
10 | inv_std = [1 / std for std in normalizer.std]
11 | super().__init__(inv_mean, inv_std)
12 |
13 | def _tensor_to_show(img, transforms=None):
14 | if transforms is not None:
15 | for transform in transforms.transforms:
16 | if isinstance(transform, Normalize):
17 | normalizer = transform
18 | break
19 | inverse_transform = InvNormalize(normalizer)
20 | img = inverse_transform(img)
21 |
22 | npimg = img.numpy()
23 | npimg = np.transpose(npimg, (1, 2, 0))
24 | return npimg
25 |
26 | def imshow(img, transforms=None, figsize=(10, 20)):
27 | npimg = _tensor_to_show(img, transforms)
28 | plt.figure(figsize=figsize)
29 | plt.imshow(npimg, interpolation=None)
30 |
31 | upp_l_x = 224 // 2 - 50 // 2
32 | upp_l_y = 224 // 2 - 50 // 2
33 | bott_r_x = 224 // 2 + 50 // 2
34 | bott_r_y = 224 // 2 + 50 // 2
35 |
36 | # dictionary with the ImageNet label names
37 | with open(os.path.join(os.getcwd(), "assets/imagenet1000_clsidx_to_labels.txt")) as f:
38 | target_to_classname = eval(f.read())
39 |
40 | def show_imagenet_patch(patches, targets):
41 | fig = plt.figure(figsize=(10, 5))
42 |
43 | for i, (patch, target) in enumerate(list(zip(patches, targets))):
44 | patch = np.transpose(patch, (1, 2, 0))
45 | patch = patch[upp_l_x:bott_r_x, upp_l_y:bott_r_y, :]
46 |
47 | plt.subplot(2, 5, i+1)
48 | plt.title(target_to_classname[int(target.item())].split(",")[0])
49 | plt.imshow(patch)
50 | plt.axis('off')
51 | plt.show()
52 |
53 |
54 | def show_batch_with_patch(x, transforms=None, figsize=(10, 20)):
55 | imshow(make_grid(x.cpu().detach(), nrow=5),
56 | transforms=transforms, figsize=figsize)
57 | plt.axis('off')
58 | plt.show()
59 |
60 |
61 | def plot_patch_predictions(x_clean, x_adv, clean_pred, adv_pred,
62 | true_label, target, figsize=(5, 20),
63 | normalizer=None):
64 | N_IMAGES = x_clean.shape[0]
65 |
66 | fig, ax = plt.subplots(2, N_IMAGES, figsize=figsize)
67 |
68 | if normalizer is not None:
69 | inverse_transform = InvNormalize(normalizer)
70 | x_clean = inverse_transform(x_clean)
71 | x_adv = inverse_transform(x_adv)
72 | x_clean_img = np.transpose(x_clean.detach().cpu().numpy(), (0, 2, 3, 1))
73 | x_adv_img = np.transpose(x_adv.detach().cpu().numpy(), (0, 2, 3, 1))
74 |
75 | # plot clean samples in first row
76 | for j in range(N_IMAGES):
77 | true_j = true_label[j]
78 | true = target_to_classname[true_j].split(",")[0]
79 | clean_j = clean_pred[j]
80 | clean = target_to_classname[clean_j].split(",")[0]
81 | ax[0, j].imshow(x_clean_img[j])
82 | ax[0, j].set_title(f"Pred.: {clean}\nTrue: {true}")
83 | ax[0, j].set_xticks([])
84 | ax[0, j].set_yticks([])
85 |
86 | for j in range(N_IMAGES):
87 | ax[1, j].imshow(x_adv_img[j])
88 | p_i = adv_pred[j].item()
89 | p = target_to_classname[p_i].split(",")[0]
90 | true_i = true_label[j].item()
91 | true = target_to_classname[true_i].split(",")[0]
92 |
93 | if p_i == target:
94 | color = 'r'
95 | elif p_i != true_i:
96 | color = 'b'
97 | else:
98 | color = 'g'
99 | ax[1, j].set_title(f"Pred.: {p}", color=color)
100 | ax[1, j].set_xticks([])
101 | ax[1, j].set_yticks([])
102 |
103 | ax[1, 0].set_ylabel(target_to_classname[target].split(",")[0])
104 | ax[0, 0].set_ylabel("Clean")
105 | plt.show()
--------------------------------------------------------------------------------