civicbench 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- civicbench-0.1.0/LICENSE +202 -0
- civicbench-0.1.0/MANIFEST.in +2 -0
- civicbench-0.1.0/NOTICE +4 -0
- civicbench-0.1.0/PKG-INFO +230 -0
- civicbench-0.1.0/README.md +184 -0
- civicbench-0.1.0/pyproject.toml +52 -0
- civicbench-0.1.0/setup.cfg +4 -0
- civicbench-0.1.0/src/civicbench/__init__.py +29 -0
- civicbench-0.1.0/src/civicbench/__main__.py +5 -0
- civicbench-0.1.0/src/civicbench/_progress.py +256 -0
- civicbench-0.1.0/src/civicbench/attacks.py +220 -0
- civicbench-0.1.0/src/civicbench/cli.py +95 -0
- civicbench-0.1.0/src/civicbench/core.py +379 -0
- civicbench-0.1.0/src/civicbench/data.py +179 -0
- civicbench-0.1.0/src/civicbench/frames.py +49 -0
- civicbench-0.1.0/src/civicbench/margin.py +114 -0
- civicbench-0.1.0/src/civicbench/metrics.py +50 -0
- civicbench-0.1.0/src/civicbench/sweep.py +59 -0
- civicbench-0.1.0/src/civicbench/target.py +99 -0
- civicbench-0.1.0/src/civicbench.egg-info/PKG-INFO +230 -0
- civicbench-0.1.0/src/civicbench.egg-info/SOURCES.txt +23 -0
- civicbench-0.1.0/src/civicbench.egg-info/dependency_links.txt +1 -0
- civicbench-0.1.0/src/civicbench.egg-info/entry_points.txt +2 -0
- civicbench-0.1.0/src/civicbench.egg-info/requires.txt +24 -0
- civicbench-0.1.0/src/civicbench.egg-info/top_level.txt +1 -0
civicbench-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
civicbench-0.1.0/NOTICE
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: civicbench
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Load CivicBench and attack your own video detector with the benchmark's protocol (PGD, APGD and Square on the 8-bit grid).
|
|
5
|
+
Author: Mert Onur Cakiroglu, Elham Buxton, Mehmet Dalkilic, Hasan Kurban
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/KurbanIntelligenceLab/CivicBench
|
|
8
|
+
Project-URL: Documentation, https://github.com/KurbanIntelligenceLab/CivicBench/blob/main/docs/toolkit.md
|
|
9
|
+
Project-URL: Dataset, https://huggingface.co/datasets/kurbanintelligencelab/CivicBench
|
|
10
|
+
Project-URL: Issues, https://github.com/KurbanIntelligenceLab/CivicBench/issues
|
|
11
|
+
Keywords: video,deepfake detection,adversarial robustness,benchmark,generated video
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Multimedia :: Video
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
License-File: NOTICE
|
|
26
|
+
Requires-Dist: numpy>=1.21
|
|
27
|
+
Requires-Dist: torch>=1.13
|
|
28
|
+
Provides-Extra: data
|
|
29
|
+
Requires-Dist: pyarrow>=10; extra == "data"
|
|
30
|
+
Requires-Dist: Pillow>=9; extra == "data"
|
|
31
|
+
Requires-Dist: datasets>=2.14; extra == "data"
|
|
32
|
+
Provides-Extra: fancy
|
|
33
|
+
Requires-Dist: rich>=13; extra == "fancy"
|
|
34
|
+
Provides-Extra: test
|
|
35
|
+
Requires-Dist: pytest>=7; extra == "test"
|
|
36
|
+
Provides-Extra: tau-anchor
|
|
37
|
+
Requires-Dist: torch>=2.0; extra == "tau-anchor"
|
|
38
|
+
Requires-Dist: huggingface_hub>=0.20; extra == "tau-anchor"
|
|
39
|
+
Provides-Extra: tau-anchor-train
|
|
40
|
+
Requires-Dist: torch>=2.0; extra == "tau-anchor-train"
|
|
41
|
+
Requires-Dist: huggingface_hub>=0.20; extra == "tau-anchor-train"
|
|
42
|
+
Requires-Dist: scikit-learn>=1.0; extra == "tau-anchor-train"
|
|
43
|
+
Requires-Dist: av>=10; extra == "tau-anchor-train"
|
|
44
|
+
Requires-Dist: Pillow>=9; extra == "tau-anchor-train"
|
|
45
|
+
Dynamic: license-file
|
|
46
|
+
|
|
47
|
+
<p align="center">
|
|
48
|
+
<picture>
|
|
49
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/KurbanIntelligenceLab/CivicBench/b3d19f73b17d3aa552dba2639568fa5b49b24805/docs/assets/banner-dark.jpg">
|
|
50
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/KurbanIntelligenceLab/CivicBench/b3d19f73b17d3aa552dba2639568fa5b49b24805/docs/assets/banner-light.jpg">
|
|
51
|
+
<img alt="CivicBench. Hiding fakes. Framing real footage." src="https://raw.githubusercontent.com/KurbanIntelligenceLab/CivicBench/b3d19f73b17d3aa552dba2639568fa5b49b24805/docs/assets/banner-light.jpg" width="100%">
|
|
52
|
+
</picture>
|
|
53
|
+
</p>
|
|
54
|
+
|
|
55
|
+
<h3 align="center">CivicBench: Robust Detection of AI-Generated Political Video</h3>
|
|
56
|
+
|
|
57
|
+
<p align="center">
|
|
58
|
+
<b>Mert Onur Cakiroglu</b><sup>1</sup> ·
|
|
59
|
+
<b>Elham Buxton</b><sup>2</sup> ·
|
|
60
|
+
<b>Mehmet Dalkilic</b><sup>1</sup> ·
|
|
61
|
+
<b>Hasan Kurban</b><sup>3,*</sup>
|
|
62
|
+
<br>
|
|
63
|
+
<sup>1</sup>Indiana University Bloomington
|
|
64
|
+
<sup>2</sup>University of Illinois Springfield
|
|
65
|
+
<sup>3</sup>Hamad Bin Khalifa University
|
|
66
|
+
<br>
|
|
67
|
+
<sub><sup>*</sup>Corresponding author · Kurban Intelligence Lab</sub>
|
|
68
|
+
</p>
|
|
69
|
+
|
|
70
|
+
<p align="center">
|
|
71
|
+
<a href="#citation"><img alt="Paper" src="https://img.shields.io/badge/Paper-arXiv-B31B1B?style=flat-square&logo=arxiv&logoColor=white"></a>
|
|
72
|
+
<a href="https://huggingface.co/datasets/kurbanintelligencelab/CivicBench"><img alt="Dataset" src="https://img.shields.io/badge/Dataset-Hugging%20Face-FFD21E?style=flat-square&logo=huggingface&logoColor=black"></a>
|
|
73
|
+
<a href="https://pypi.org/project/civicbench/"><img alt="PyPI" src="https://img.shields.io/badge/pip%20install-civicbench-3775A9?style=flat-square&logo=pypi&logoColor=white"></a>
|
|
74
|
+
<a href="https://github.com/KurbanIntelligenceLab/CivicBench/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/badge/License-Apache%202.0-0A7BBB?style=flat-square"></a>
|
|
75
|
+
<img alt="Python" src="https://img.shields.io/badge/Python-3.10%2B-3776AB?style=flat-square&logo=python&logoColor=white">
|
|
76
|
+
</p>
|
|
77
|
+
|
|
78
|
+
<p align="center">
|
|
79
|
+
<a href="#quick-start"><b>Quick start</b></a> ·
|
|
80
|
+
<a href="#data"><b>Data</b></a> ·
|
|
81
|
+
<a href="https://github.com/KurbanIntelligenceLab/CivicBench/blob/main/docs/toolkit.md"><b>Toolkit guide</b></a> ·
|
|
82
|
+
<a href="#leaderboard"><b>Leaderboard</b></a> ·
|
|
83
|
+
<a href="https://github.com/KurbanIntelligenceLab/CivicBench/tree/main/tau_anchor"><b>Tau-Anchor</b></a> ·
|
|
84
|
+
<a href="#citation"><b>Citation</b></a>
|
|
85
|
+
</p>
|
|
86
|
+
|
|
87
|
+
<br>
|
|
88
|
+
|
|
89
|
+
**CivicBench** tests detectors of AI-generated political video against the two attacks that matter in an election.
|
|
90
|
+
An attacker can change each pixel of a fake by a gray level or two, so that the detector passes it as real
|
|
91
|
+
(**evasion**). The same small change can make the detector flag real footage as generated (**framing**). Anyone who
|
|
92
|
+
wants to dismiss a real video can then point to the detector's verdict.
|
|
93
|
+
|
|
94
|
+
CivicBench measures both, on clips that can be shared, and one command runs it on your own detector.
|
|
95
|
+
|
|
96
|
+
<p align="center">
|
|
97
|
+
<img alt="Attacks on political video in both directions" src="https://raw.githubusercontent.com/KurbanIntelligenceLab/CivicBench/b3d19f73b17d3aa552dba2639568fa5b49b24805/docs/assets/teaser.jpg" width="100%">
|
|
98
|
+
</p>
|
|
99
|
+
|
|
100
|
+
## Highlights
|
|
101
|
+
|
|
102
|
+
- **Two-sided by design.** Every detector is attacked in both directions, at the threshold where it is deployed.
|
|
103
|
+
At one gray level, four published detectors lose every fake they flagged and flag nearly every attacked real clip.
|
|
104
|
+
- **Political and shareable.** 10,800 clips of invented politicians, parties and countries, from 8 open generators
|
|
105
|
+
and 1,350 prompts across 9 kinds of civic scenes, next to 2,632 real clips under open licenses.
|
|
106
|
+
- **One command.** `civicbench evaluate` runs PGD, APGD and Square at any budget and prints the paper's table.
|
|
107
|
+
Every attacked clip is checked after rounding to 8 bits, as a viewer would see it.
|
|
108
|
+
- **Predictive.** A cheap attack of one gray level predicts how many clips keep their label at four.
|
|
109
|
+
|
|
110
|
+
## Install
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
pip install civicbench # core: numpy and torch
|
|
114
|
+
pip install "civicbench[data]" # + loading from Hugging Face
|
|
115
|
+
pip install "civicbench[fancy]" # + the rich progress display
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Python 3.10 or newer.
|
|
119
|
+
|
|
120
|
+
## Quick start
|
|
121
|
+
|
|
122
|
+
```python
|
|
123
|
+
import civicbench
|
|
124
|
+
|
|
125
|
+
clips = civicbench.load() # official test inputs and labels
|
|
126
|
+
results = civicbench.evaluate(my_detector, clips) # AUC, TPR, evasion and framing at 1, 2 and 4 gray levels
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Or from the command line, at any budgets:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
civicbench evaluate --detector my_lab.detector:build --budgets 1,2,4,8,16 --out results.json
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
<p align="center">
|
|
136
|
+
<img alt="civicbench in a terminal" src="https://raw.githubusercontent.com/KurbanIntelligenceLab/CivicBench/b3d19f73b17d3aa552dba2639568fa5b49b24805/docs/assets/terminal.png" width="100%">
|
|
137
|
+
</p>
|
|
138
|
+
|
|
139
|
+
<sub>Output of <code>examples/demo_toy.py</code>: a toy detector on synthetic clips, so the numbers carry no meaning.
|
|
140
|
+
It runs in under a minute with no downloads.</sub>
|
|
141
|
+
|
|
142
|
+
### Bring your own detector
|
|
143
|
+
|
|
144
|
+
A detector is any callable that maps frames to one score.
|
|
145
|
+
|
|
146
|
+
| | |
|
|
147
|
+
|---|---|
|
|
148
|
+
| **Input** | `torch.float32` tensor `[T, 3, H, W]`, RGB in [0, 1]. The official input is 11 frames of 512 x 512. |
|
|
149
|
+
| **Output** | One score. Higher means generated. A clip is flagged when its score reaches the threshold. |
|
|
150
|
+
| **Gradients** | PGD and APGD need a differentiable score. Square needs scores only. |
|
|
151
|
+
|
|
152
|
+
The [toolkit guide](https://github.com/KurbanIntelligenceLab/CivicBench/blob/main/docs/toolkit.md) covers single-clip attacks, custom budgets, the survival prediction and every
|
|
153
|
+
difference from the paper's code.
|
|
154
|
+
|
|
155
|
+
## Data
|
|
156
|
+
|
|
157
|
+
One open dataset, [kurbanintelligencelab/CivicBench](https://huggingface.co/datasets/kurbanintelligencelab/CivicBench), with no login and no form.
|
|
158
|
+
|
|
159
|
+
| | Clips | License |
|
|
160
|
+
|---|---|---|
|
|
161
|
+
| **Real** | 2,632 clips of briefings, speeches, legislatures, and protests | Each clip's own: public domain, CC BY or CC BY-SA |
|
|
162
|
+
| **Generated** | 10,800 clips from eight open text-to-video generators, with prompts, seeds, and settings | Research on detection, with each generator's terms (see the dataset card) |
|
|
163
|
+
|
|
164
|
+
Each real clip lists its creator, license, source page, start time and the changes we made. The official test input is
|
|
165
|
+
11 frames of 512 x 512 per clip, stored as lossless PNG with checksums.
|
|
166
|
+
|
|
167
|
+
## Leaderboard
|
|
168
|
+
|
|
169
|
+
CivicBench at the threshold that flags 5% of real clips. Evasion is the TPR under attack, higher is better. Framing is
|
|
170
|
+
the false-alarm rate on attacked real clips, lower is better. Budgets are in gray levels on the 0 to 255 scale.
|
|
171
|
+
|
|
172
|
+
| Detector | AUC | TPR | Evasion 1 | Evasion 2 | Evasion 4 | Framing 1 | Framing 2 | Framing 4 |
|
|
173
|
+
|:---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
|
|
174
|
+
| **Tau-Anchor** (ours) | **.941** | **.779** | **.731** | **.668** | **.585** | .124 | .141 | .222 |
|
|
175
|
+
| Mavali et al., R4 | .774 | .394 | .339 | .289 | .239 | .217 | .304 | .623 |
|
|
176
|
+
| Mavali et al., R2 | .768 | .381 | .236 | .164 | .135 | .261 | .536 | .884 |
|
|
177
|
+
| Mavali et al., ΔCLIP | .638 | .182 | .135 | .130 | .099 | **.046** | **.046** | **.101** |
|
|
178
|
+
| MV-MobileNet | .587 | .086 | .045 | .043 | .035 | .348 | .493 | .565 |
|
|
179
|
+
| STREAM-MV | .602 | .111 | .018 | .013 | .011 | .768 | .783 | .812 |
|
|
180
|
+
| Shahjahan et al. | .709 | .233 | .023 | .000 | .000 | .913 | .971 | .986 |
|
|
181
|
+
| CLIP probe | .781 | .364 | .000 | .000 | .000 | 1.000 | 1.000 | 1.000 |
|
|
182
|
+
| STREAM | .714 | .309 | .000 | .000 | .000 | 1.000 | 1.000 | 1.000 |
|
|
183
|
+
| D3 | .475 | .028 | .000 | .000 | .000 | 1.000 | 1.000 | 1.000 |
|
|
184
|
+
| ReStraV | .448 | .009 | .000 | .000 | .000 | .986 | 1.000 | 1.000 |
|
|
185
|
+
|
|
186
|
+
Sorted by TPR under evasion at 2 gray levels, then at 1, then by AUC. The paper adds confidence intervals, two general benchmarks and
|
|
187
|
+
external political footage. To add a detector, open a pull request with the `results.json` that
|
|
188
|
+
`civicbench evaluate --out` writes.
|
|
189
|
+
|
|
190
|
+
## Tau-Anchor
|
|
191
|
+
|
|
192
|
+
Tau-Anchor is the detector from the paper. It fine-tunes an image encoder that was pre-trained on attacked images,
|
|
193
|
+
attacks real and generated clips during training, and adds a margin term for the fakes nearest its deployed threshold.
|
|
194
|
+
Its code, exact training recipe and model card are in [`tau_anchor/`](https://github.com/KurbanIntelligenceLab/CivicBench/tree/main/tau_anchor). The weights are on
|
|
195
|
+
Hugging Face at [`kurbanintelligencelab/Tau-Anchor`](https://huggingface.co/kurbanintelligencelab/Tau-Anchor).
|
|
196
|
+
|
|
197
|
+
## Repository layout
|
|
198
|
+
|
|
199
|
+
```
|
|
200
|
+
src/civicbench/ the pip package: load, attack, evaluate, predict_survival, CLI
|
|
201
|
+
tests/ unit tests and a golden test against the paper's attack code
|
|
202
|
+
examples/ demo_toy.py, a one-minute end-to-end run with no downloads
|
|
203
|
+
tau_anchor/ Tau-Anchor training and inference
|
|
204
|
+
docs/ toolkit guide and assets
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Responsible use
|
|
208
|
+
|
|
209
|
+
The release contains no attacked real clips, and thus no ready-made forgeries of real footage. The generated clips show invented people. If a clip resembles a real person, report it
|
|
210
|
+
through the contact on the dataset card and we will remove it.
|
|
211
|
+
|
|
212
|
+
## Citation
|
|
213
|
+
|
|
214
|
+
```bibtex
|
|
215
|
+
@misc{cakiroglu2026civicbench,
|
|
216
|
+
title = {CivicBench: Robust Detection of AI-Generated Political Video},
|
|
217
|
+
author = {Cakiroglu, Mert Onur and Buxton, Elham and Dalkilic, Mehmet and Kurban, Hasan},
|
|
218
|
+
year = {2026}
|
|
219
|
+
}
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## License
|
|
223
|
+
|
|
224
|
+
The code is released under the [Apache License 2.0](https://github.com/KurbanIntelligenceLab/CivicBench/blob/main/LICENSE). The data follow the licenses in the table above and on
|
|
225
|
+
each dataset card. Generated clips also follow the terms of the generator that rendered them.
|
|
226
|
+
|
|
227
|
+
## Acknowledgements
|
|
228
|
+
|
|
229
|
+
We thank the creators of the openly licensed footage, credited clip by clip in the dataset, and the developers of
|
|
230
|
+
CogVideoX1.5, HunyuanVideo-1.5, Kandinsky 5, LTX-Video, Mochi, SANA-Video, Wan2.1 and Wan2.2.
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/KurbanIntelligenceLab/CivicBench/b3d19f73b17d3aa552dba2639568fa5b49b24805/docs/assets/banner-dark.jpg">
|
|
4
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/KurbanIntelligenceLab/CivicBench/b3d19f73b17d3aa552dba2639568fa5b49b24805/docs/assets/banner-light.jpg">
|
|
5
|
+
<img alt="CivicBench. Hiding fakes. Framing real footage." src="https://raw.githubusercontent.com/KurbanIntelligenceLab/CivicBench/b3d19f73b17d3aa552dba2639568fa5b49b24805/docs/assets/banner-light.jpg" width="100%">
|
|
6
|
+
</picture>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<h3 align="center">CivicBench: Robust Detection of AI-Generated Political Video</h3>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<b>Mert Onur Cakiroglu</b><sup>1</sup> ·
|
|
13
|
+
<b>Elham Buxton</b><sup>2</sup> ·
|
|
14
|
+
<b>Mehmet Dalkilic</b><sup>1</sup> ·
|
|
15
|
+
<b>Hasan Kurban</b><sup>3,*</sup>
|
|
16
|
+
<br>
|
|
17
|
+
<sup>1</sup>Indiana University Bloomington
|
|
18
|
+
<sup>2</sup>University of Illinois Springfield
|
|
19
|
+
<sup>3</sup>Hamad Bin Khalifa University
|
|
20
|
+
<br>
|
|
21
|
+
<sub><sup>*</sup>Corresponding author · Kurban Intelligence Lab</sub>
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
<p align="center">
|
|
25
|
+
<a href="#citation"><img alt="Paper" src="https://img.shields.io/badge/Paper-arXiv-B31B1B?style=flat-square&logo=arxiv&logoColor=white"></a>
|
|
26
|
+
<a href="https://huggingface.co/datasets/kurbanintelligencelab/CivicBench"><img alt="Dataset" src="https://img.shields.io/badge/Dataset-Hugging%20Face-FFD21E?style=flat-square&logo=huggingface&logoColor=black"></a>
|
|
27
|
+
<a href="https://pypi.org/project/civicbench/"><img alt="PyPI" src="https://img.shields.io/badge/pip%20install-civicbench-3775A9?style=flat-square&logo=pypi&logoColor=white"></a>
|
|
28
|
+
<a href="https://github.com/KurbanIntelligenceLab/CivicBench/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/badge/License-Apache%202.0-0A7BBB?style=flat-square"></a>
|
|
29
|
+
<img alt="Python" src="https://img.shields.io/badge/Python-3.10%2B-3776AB?style=flat-square&logo=python&logoColor=white">
|
|
30
|
+
</p>
|
|
31
|
+
|
|
32
|
+
<p align="center">
|
|
33
|
+
<a href="#quick-start"><b>Quick start</b></a> ·
|
|
34
|
+
<a href="#data"><b>Data</b></a> ·
|
|
35
|
+
<a href="https://github.com/KurbanIntelligenceLab/CivicBench/blob/main/docs/toolkit.md"><b>Toolkit guide</b></a> ·
|
|
36
|
+
<a href="#leaderboard"><b>Leaderboard</b></a> ·
|
|
37
|
+
<a href="https://github.com/KurbanIntelligenceLab/CivicBench/tree/main/tau_anchor"><b>Tau-Anchor</b></a> ·
|
|
38
|
+
<a href="#citation"><b>Citation</b></a>
|
|
39
|
+
</p>
|
|
40
|
+
|
|
41
|
+
<br>
|
|
42
|
+
|
|
43
|
+
**CivicBench** tests detectors of AI-generated political video against the two attacks that matter in an election.
|
|
44
|
+
An attacker can change each pixel of a fake by a gray level or two, so that the detector passes it as real
|
|
45
|
+
(**evasion**). The same small change can make the detector flag real footage as generated (**framing**). Anyone who
|
|
46
|
+
wants to dismiss a real video can then point to the detector's verdict.
|
|
47
|
+
|
|
48
|
+
CivicBench measures both, on clips that can be shared, and one command runs it on your own detector.
|
|
49
|
+
|
|
50
|
+
<p align="center">
|
|
51
|
+
<img alt="Attacks on political video in both directions" src="https://raw.githubusercontent.com/KurbanIntelligenceLab/CivicBench/b3d19f73b17d3aa552dba2639568fa5b49b24805/docs/assets/teaser.jpg" width="100%">
|
|
52
|
+
</p>
|
|
53
|
+
|
|
54
|
+
## Highlights
|
|
55
|
+
|
|
56
|
+
- **Two-sided by design.** Every detector is attacked in both directions, at the threshold where it is deployed.
|
|
57
|
+
At one gray level, four published detectors lose every fake they flagged and flag nearly every attacked real clip.
|
|
58
|
+
- **Political and shareable.** 10,800 clips of invented politicians, parties and countries, from 8 open generators
|
|
59
|
+
and 1,350 prompts across 9 kinds of civic scenes, next to 2,632 real clips under open licenses.
|
|
60
|
+
- **One command.** `civicbench evaluate` runs PGD, APGD and Square at any budget and prints the paper's table.
|
|
61
|
+
Every attacked clip is checked after rounding to 8 bits, as a viewer would see it.
|
|
62
|
+
- **Predictive.** A cheap attack of one gray level predicts how many clips keep their label at four.
|
|
63
|
+
|
|
64
|
+
## Install
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
pip install civicbench # core: numpy and torch
|
|
68
|
+
pip install "civicbench[data]" # + loading from Hugging Face
|
|
69
|
+
pip install "civicbench[fancy]" # + the rich progress display
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Python 3.10 or newer.
|
|
73
|
+
|
|
74
|
+
## Quick start
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
import civicbench
|
|
78
|
+
|
|
79
|
+
clips = civicbench.load() # official test inputs and labels
|
|
80
|
+
results = civicbench.evaluate(my_detector, clips) # AUC, TPR, evasion and framing at 1, 2 and 4 gray levels
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Or from the command line, at any budgets:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
civicbench evaluate --detector my_lab.detector:build --budgets 1,2,4,8,16 --out results.json
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
<p align="center">
|
|
90
|
+
<img alt="civicbench in a terminal" src="https://raw.githubusercontent.com/KurbanIntelligenceLab/CivicBench/b3d19f73b17d3aa552dba2639568fa5b49b24805/docs/assets/terminal.png" width="100%">
|
|
91
|
+
</p>
|
|
92
|
+
|
|
93
|
+
<sub>Output of <code>examples/demo_toy.py</code>: a toy detector on synthetic clips, so the numbers carry no meaning.
|
|
94
|
+
It runs in under a minute with no downloads.</sub>
|
|
95
|
+
|
|
96
|
+
### Bring your own detector
|
|
97
|
+
|
|
98
|
+
A detector is any callable that maps frames to one score.
|
|
99
|
+
|
|
100
|
+
| | |
|
|
101
|
+
|---|---|
|
|
102
|
+
| **Input** | `torch.float32` tensor `[T, 3, H, W]`, RGB in [0, 1]. The official input is 11 frames of 512 x 512. |
|
|
103
|
+
| **Output** | One score. Higher means generated. A clip is flagged when its score reaches the threshold. |
|
|
104
|
+
| **Gradients** | PGD and APGD need a differentiable score. Square needs scores only. |
|
|
105
|
+
|
|
106
|
+
The [toolkit guide](https://github.com/KurbanIntelligenceLab/CivicBench/blob/main/docs/toolkit.md) covers single-clip attacks, custom budgets, the survival prediction and every
|
|
107
|
+
difference from the paper's code.
|
|
108
|
+
|
|
109
|
+
## Data
|
|
110
|
+
|
|
111
|
+
One open dataset, [kurbanintelligencelab/CivicBench](https://huggingface.co/datasets/kurbanintelligencelab/CivicBench), with no login and no form.
|
|
112
|
+
|
|
113
|
+
| | Clips | License |
|
|
114
|
+
|---|---|---|
|
|
115
|
+
| **Real** | 2,632 clips of briefings, speeches, legislatures, and protests | Each clip's own: public domain, CC BY or CC BY-SA |
|
|
116
|
+
| **Generated** | 10,800 clips from eight open text-to-video generators, with prompts, seeds, and settings | Research on detection, with each generator's terms (see the dataset card) |
|
|
117
|
+
|
|
118
|
+
Each real clip lists its creator, license, source page, start time and the changes we made. The official test input is
|
|
119
|
+
11 frames of 512 x 512 per clip, stored as lossless PNG with checksums.
|
|
120
|
+
|
|
121
|
+
## Leaderboard
|
|
122
|
+
|
|
123
|
+
CivicBench at the threshold that flags 5% of real clips. Evasion is the TPR under attack, higher is better. Framing is
|
|
124
|
+
the false-alarm rate on attacked real clips, lower is better. Budgets are in gray levels on the 0 to 255 scale.
|
|
125
|
+
|
|
126
|
+
| Detector | AUC | TPR | Evasion 1 | Evasion 2 | Evasion 4 | Framing 1 | Framing 2 | Framing 4 |
|
|
127
|
+
|:---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
|
|
128
|
+
| **Tau-Anchor** (ours) | **.941** | **.779** | **.731** | **.668** | **.585** | .124 | .141 | .222 |
|
|
129
|
+
| Mavali et al., R4 | .774 | .394 | .339 | .289 | .239 | .217 | .304 | .623 |
|
|
130
|
+
| Mavali et al., R2 | .768 | .381 | .236 | .164 | .135 | .261 | .536 | .884 |
|
|
131
|
+
| Mavali et al., ΔCLIP | .638 | .182 | .135 | .130 | .099 | **.046** | **.046** | **.101** |
|
|
132
|
+
| MV-MobileNet | .587 | .086 | .045 | .043 | .035 | .348 | .493 | .565 |
|
|
133
|
+
| STREAM-MV | .602 | .111 | .018 | .013 | .011 | .768 | .783 | .812 |
|
|
134
|
+
| Shahjahan et al. | .709 | .233 | .023 | .000 | .000 | .913 | .971 | .986 |
|
|
135
|
+
| CLIP probe | .781 | .364 | .000 | .000 | .000 | 1.000 | 1.000 | 1.000 |
|
|
136
|
+
| STREAM | .714 | .309 | .000 | .000 | .000 | 1.000 | 1.000 | 1.000 |
|
|
137
|
+
| D3 | .475 | .028 | .000 | .000 | .000 | 1.000 | 1.000 | 1.000 |
|
|
138
|
+
| ReStraV | .448 | .009 | .000 | .000 | .000 | .986 | 1.000 | 1.000 |
|
|
139
|
+
|
|
140
|
+
Sorted by TPR under evasion at 2 gray levels, then at 1, then by AUC. The paper adds confidence intervals, two general benchmarks and
|
|
141
|
+
external political footage. To add a detector, open a pull request with the `results.json` that
|
|
142
|
+
`civicbench evaluate --out` writes.
|
|
143
|
+
|
|
144
|
+
## Tau-Anchor
|
|
145
|
+
|
|
146
|
+
Tau-Anchor is the detector from the paper. It fine-tunes an image encoder that was pre-trained on attacked images,
|
|
147
|
+
attacks real and generated clips during training, and adds a margin term for the fakes nearest its deployed threshold.
|
|
148
|
+
Its code, exact training recipe and model card are in [`tau_anchor/`](https://github.com/KurbanIntelligenceLab/CivicBench/tree/main/tau_anchor). The weights are on
|
|
149
|
+
Hugging Face at [`kurbanintelligencelab/Tau-Anchor`](https://huggingface.co/kurbanintelligencelab/Tau-Anchor).
|
|
150
|
+
|
|
151
|
+
## Repository layout
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
src/civicbench/ the pip package: load, attack, evaluate, predict_survival, CLI
|
|
155
|
+
tests/ unit tests and a golden test against the paper's attack code
|
|
156
|
+
examples/ demo_toy.py, a one-minute end-to-end run with no downloads
|
|
157
|
+
tau_anchor/ Tau-Anchor training and inference
|
|
158
|
+
docs/ toolkit guide and assets
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Responsible use
|
|
162
|
+
|
|
163
|
+
The release contains no attacked real clips, and thus no ready-made forgeries of real footage. The generated clips show invented people. If a clip resembles a real person, report it
|
|
164
|
+
through the contact on the dataset card and we will remove it.
|
|
165
|
+
|
|
166
|
+
## Citation
|
|
167
|
+
|
|
168
|
+
```bibtex
|
|
169
|
+
@misc{cakiroglu2026civicbench,
|
|
170
|
+
title = {CivicBench: Robust Detection of AI-Generated Political Video},
|
|
171
|
+
author = {Cakiroglu, Mert Onur and Buxton, Elham and Dalkilic, Mehmet and Kurban, Hasan},
|
|
172
|
+
year = {2026}
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## License
|
|
177
|
+
|
|
178
|
+
The code is released under the [Apache License 2.0](https://github.com/KurbanIntelligenceLab/CivicBench/blob/main/LICENSE). The data follow the licenses in the table above and on
|
|
179
|
+
each dataset card. Generated clips also follow the terms of the generator that rendered them.
|
|
180
|
+
|
|
181
|
+
## Acknowledgements
|
|
182
|
+
|
|
183
|
+
We thank the creators of the openly licensed footage, credited clip by clip in the dataset, and the developers of
|
|
184
|
+
CogVideoX1.5, HunyuanVideo-1.5, Kandinsky 5, LTX-Video, Mochi, SANA-Video, Wan2.1 and Wan2.2.
|