Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed because of a cast error
Error code:   DatasetGenerationCastError
Exception:    DatasetGenerationCastError
Message:      An error occurred while generating the dataset

All the data files must have the same columns, but at some point there are 3 new columns ({'category', 'source', 'full_path'}) and 3 missing columns ({'label', 'num_frames', 'path'}).

This happened while the csv dataset builder was generating data using

hf://datasets/huahua123313/AVH-Align/avh_sup/csv_metadata/favc/train_split.csv (at revision 64ccb37ccd5ff90c62cf7a0c8a841b4b9996935c), ['hf://datasets/huahua123313/AVH-Align@64ccb37ccd5ff90c62cf7a0c8a841b4b9996935c/av1m_metadata/train_metadata.csv', 'hf://datasets/huahua123313/AVH-Align@64ccb37ccd5ff90c62cf7a0c8a841b4b9996935c/avh_sup/csv_metadata/av1m/train_labels.csv', 'hf://datasets/huahua123313/AVH-Align@64ccb37ccd5ff90c62cf7a0c8a841b4b9996935c/avh_sup/csv_metadata/favc/train_split.csv']

Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)
Traceback:    Traceback (most recent call last):
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1837, in _prepare_split_single
                  writer.write_table(table)
                  ~~~~~~~~~~~~~~~~~~^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/arrow_writer.py", line 765, in write_table
                  self._write_table(pa_table, writer_batch_size=writer_batch_size)
                  ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/arrow_writer.py", line 773, in _write_table
                  pa_table = table_cast(pa_table, self._schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2369, in table_cast
                  return cast_table_to_schema(table, schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2297, in cast_table_to_schema
                  raise CastError(
                  ...<3 lines>...
                  )
              datasets.table.CastError: Couldn't cast
              source: string
              category: string
              full_path: string
              -- schema metadata --
              pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 627
              to
              {'path': Value('string'), 'label': Value('int64'), 'num_frames': Value('int64')}
              because column names don't match
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1369, in compute_config_parquet_and_info_response
                  parquet_operations, partial, estimated_dataset_info = stream_convert_to_parquet(
                                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~^
                      builder, max_dataset_size_bytes=max_dataset_size_bytes
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  )
                  ^
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 948, in stream_convert_to_parquet
                  builder._prepare_split(split_generator=splits_generators[split], file_format="parquet")
                  ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1683, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~^
                      gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  ):
                  ^
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1839, in _prepare_split_single
                  raise DatasetGenerationCastError.from_cast_error(
                  ...<4 lines>...
                  )
              datasets.exceptions.DatasetGenerationCastError: An error occurred while generating the dataset
              
              All the data files must have the same columns, but at some point there are 3 new columns ({'category', 'source', 'full_path'}) and 3 missing columns ({'label', 'num_frames', 'path'}).
              
              This happened while the csv dataset builder was generating data using
              
              hf://datasets/huahua123313/AVH-Align/avh_sup/csv_metadata/favc/train_split.csv (at revision 64ccb37ccd5ff90c62cf7a0c8a841b4b9996935c), ['hf://datasets/huahua123313/AVH-Align@64ccb37ccd5ff90c62cf7a0c8a841b4b9996935c/av1m_metadata/train_metadata.csv', 'hf://datasets/huahua123313/AVH-Align@64ccb37ccd5ff90c62cf7a0c8a841b4b9996935c/avh_sup/csv_metadata/av1m/train_labels.csv', 'hf://datasets/huahua123313/AVH-Align@64ccb37ccd5ff90c62cf7a0c8a841b4b9996935c/avh_sup/csv_metadata/favc/train_split.csv']
              
              Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

path
string
label
int64
num_frames
int64
id04260/YRj7yYjVBYU/00021/real.mp4
0
282
id00012/21Uxsk56VDQ/00003/real.mp4
0
249
id04261/na3muZ6D63Y/00137/real.mp4
0
220
id02722/qkT7oMgQWjY/00092/real.mp4
0
164
id04261/kab9umntCeI/00127/real.mp4
0
177
id07911/5DA4Zn_k3Rc/00038/real.mp4
0
267
id07911/5DA4Zn_k3Rc/00061/real.mp4
0
518
id04261/mF0vzzBvW5M/00130/real.mp4
0
232
id07911/5DA4Zn_k3Rc/00025/real.mp4
0
332
id04261/363ta7DRcxQ/00006/real.mp4
0
228
id04261/N0O_EFoj1zw/00048/real.mp4
0
433
id04261/N0O_EFoj1zw/00043/real.mp4
0
188
id05986/y-pi4B7M1rA/00420/real.mp4
0
302
id04261/N0O_EFoj1zw/00044/real.mp4
0
135
id05986/zD7OtungMLI/00476/real.mp4
0
149
id00012/OuYBFCAc6GE/00073/real.mp4
0
541
id04261/chGackvFSfs/00112/real.mp4
0
207
id04261/zymKk-WTku8/00193/real.mp4
0
345
id04261/zymKk-WTku8/00204/real.mp4
0
131
id04261/zymKk-WTku8/00201/real.mp4
0
190
id07911/jghty9VKpuE/00107/real.mp4
0
151
id04261/YA9QTu0Ni5E/00054/real.mp4
0
192
id05986/_ox_7f85tsw/00240/real.mp4
0
201
id04261/YA9QTu0Ni5E/00070/real.mp4
0
245
id01298/tMjwRF7TX9Q/00403/real.mp4
0
259
id02724/0fl1Tpakv1w/00001/real.mp4
0
271
id04261/p0ayIy6p1PY/00150/real.mp4
0
380
id07912/00INADgd5A8/00006/real.mp4
0
228
id00012/L5fo1OvuXIg/00058/real.mp4
0
255
id07912/QqIWDi8Aasg/00093/real.mp4
0
129
id07912/QqIWDi8Aasg/00090/real.mp4
0
230
id05986/Gq5paYFeD6A/00062/real.mp4
0
170
id04261/p0ayIy6p1PY/00152/real.mp4
0
165
id00012/L5fo1OvuXIg/00063/real.mp4
0
331
id04261/t-fIzch_YzY/00165/real.mp4
0
190
id07912/8TRxv_K5mE8/00041/real.mp4
0
126
id04261/t-fIzch_YzY/00169/real.mp4
0
232
id04261/1YcX_YO-sPM/00003/real.mp4
0
192
id00017/tIpW24N_Ysk/00195/real.mp4
0
131
id05986/WsRpYXJMGIg/00145/real.mp4
0
190
id04261/WoJb4xWIKK0/00052/real.mp4
0
151
id04261/MUAK9mP6lAQ/00023/real.mp4
0
218
id04261/MUAK9mP6lAQ/00018/real.mp4
0
156
id00017/7t6lfzvVaTM/00003/real.mp4
0
225
id02724/YBSFS1j4ems/00233/real.mp4
0
161
id07912/BZ2f5rK-Ew8/00047/real.mp4
0
132
id04261/MUAK9mP6lAQ/00016/real.mp4
0
218
id05986/WsRpYXJMGIg/00164/real.mp4
0
162
id04261/YtTaz-i7hZc/00089/real.mp4
0
188
id04261/YtTaz-i7hZc/00093/real.mp4
0
153
id02724/YBSFS1j4ems/00231/real.mp4
0
215
id02724/YBSFS1j4ems/00215/real.mp4
0
338
id01304/1Iz7WNcVt3Q/00002/real.mp4
0
161
id04262/qufwzVQbXeg/00023/real.mp4
0
160
id04262/qufwzVQbXeg/00027/real.mp4
0
228
id02724/tNHxVR1xuOM/00424/real.mp4
0
128
id01305/CK8zESqBCmA/00007/real.mp4
0
196
id01305/CK8zESqBCmA/00009/real.mp4
0
203
id04262/96JSsr9Q00k/00002/real.mp4
0
258
id00017/lZf1RB6l5Gs/00143/real.mp4
0
185
id04263/G_v27xhylRM/00042/real.mp4
0
163
id04263/G_v27xhylRM/00048/real.mp4
0
534
id04263/G_v27xhylRM/00043/real.mp4
0
146
id00017/b5TvWN3x0HA/00096/real.mp4
0
150
id00017/b5TvWN3x0HA/00098/real.mp4
0
145
id02724/JmDg_1V-Lg0/00077/real.mp4
0
498
id04263/G_v27xhylRM/00044/real.mp4
0
254
id04263/Z1VT9r7SPtI/00108/real.mp4
0
139
id05989/zVOlkhJQDiI/00467/real.mp4
0
308
id05989/zVOlkhJQDiI/00462/real.mp4
0
157
id04263/DG2OPUIplkA/00016/real.mp4
0
130
id04263/JbC0us-AY5k/00076/real.mp4
0
211
id04263/JbC0us-AY5k/00075/real.mp4
0
238
id05989/vQdcU42S4gk/00434/real.mp4
0
195
id01306/azHnWgtyR8s/00012/real.mp4
0
125
id04263/JbC0us-AY5k/00072/real.mp4
0
163
id02724/vTM0CbL7G34/00446/real.mp4
0
151
id05989/vQdcU42S4gk/00439/real.mp4
0
154
id02724/RH2cwm_SHyM/00138/real.mp4
0
165
id00018/tZStiZYpjhI/00187/real.mp4
0
143
id01306/RoKzceQ-EzM/00006/real.mp4
0
137
id04263/GlFNQQ2wGdQ/00059/real.mp4
0
163
id04263/GlFNQQ2wGdQ/00053/real.mp4
0
130
id04263/xMcMXq8D8_k/00145/real.mp4
0
151
id00018/31xSZXsKR9w/00003/real.mp4
0
209
id05989/UVqo1K_DaHQ/00223/real.mp4
0
178
id05989/3woq_sOn84o/00023/real.mp4
0
187
id02724/yB7ekF690GE/00467/real.mp4
0
634
id04263/_8QwBbbBrSM/00116/real.mp4
0
130
id01309/94xtJryqgEY/00011/real.mp4
0
128
id05989/Rnz95IJUSE0/00149/real.mp4
0
126
id02724/7c6VjvQrgr8/00010/real.mp4
0
376
id07958/nDxMrkFJOTg/00129/real.mp4
0
165
id02724/7c6VjvQrgr8/00019/real.mp4
0
215
id07958/i5eqbkQt1lE/00124/real.mp4
0
171
id02724/7c6VjvQrgr8/00016/real.mp4
0
215
id07958/PsltpwHxkXQ/00077/real.mp4
0
200
id04263/K_Xkh0QlxdM/00097/real.mp4
0
210
id02724/SxkxOtSKAvY/00171/real.mp4
0
132
id01309/oWjEXcmTUyc/00034/real.mp4
0
133
End of preview.

YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

AVH-Align

arXiv

Official PyTorch Implementation of the Paper:

Ștefan Smeu, Dragoș-Alexandru Boldisor, Dan Oneață and Elisabeta Oneață
Circumventing shortcuts in audio-visual deepfake detection datasets with unsupervised learning
CVPR, 2025

Data

To set up your data, follow these steps:

Download the datasets:

Set-up AV-Hubert

# clone/install AV-Hubert
git clone https://github.com/facebookresearch/av_hubert.git
cd av_hubert/avhubert
git submodule init
git submodule update
cd ../fairseq
pip install --editable ./
cd ../avhubert
# install additional files for AV-Hubert
mkdir -p content/data/misc/
wget http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2 -O content/data/misc/shape_predictor_68_face_landmarks.dat.bz2
bzip2 -d content/data/misc/shape_predictor_68_face_landmarks.dat.bz2
wget --content-disposition https://github.com/mpc001/Lipreading_using_Temporal_Convolutional_Networks/raw/master/preprocessing/20words_mean_face.npy -O content/data/misc/20words_mean_face.npy
cd ../../
# moving our feature extraction files into avhubert space
cp deepfake_feature_extraction.py av_hubert/avhubert/deepfake_feature_extraction.py 
cp deepfake_preprocess.py av_hubert/avhubert/deepfake_preprocess.py

# download avhubert checkpoint
wget https://dl.fbaipublicfiles.com/avhubert/model/lrs3_vox/vsr/self_large_vox_433h.pt
mv self_large_vox_433h.pt av_hubert/avhubert/self_large_vox_433h.pt

This repository also integrates code from the following repositories:

Installation

Main prerequisites:

  • Python 3.10.14
  • pytorch=2.2.0 (older version for compability with AVHubert)
  • pytorch-cuda=12.4
  • lightning=2.4.0
  • torchvision>=0.17
  • scikit-learn>=1.3.2
  • pandas>=2.1.1
  • numpy>=1.26.4
  • pillow>=10.0.1
  • librosa>=0.9.1
  • dlib>=19.24.9
  • skvideo>=1.1.10
  • ffmpeg>=4.3

Feature extraction

  1. Preprocess video files Run deepfake_preprocess.py from av_hubert/avhubert. Example for AV-Deepfake1M
python deepfake_preprocess.py \
    --dataset AV1M \
    --split train \
    --metadata /av1m_metadata/train_metadata.csv \
    --data_path /path/to/AV1M_root \
    --save_path /path/to/save/output_videos_and_audio

and FakeAVCeleb

python deepfake_preprocess.py \
    --dataset FakeAVCeleb \
    --metadata /path/to/FakeAVCeleb_metadata.csv \
    --data_path /path/to/FakeAVCeleb_root \
    --save_path /path/to/save/output_videos_and_audio
    --category all \
  1. Extract features Run deepfake_feature_extraction.py from av_hubert/avhubert. Example for AV-Deepfake1M
python deepfake_feature_extraction.py \
    --dataset AV1M \
    --split train \
    --metadata /av1m_metadata/train_metadata.csv \
    --ckpt_path self_large_vox_433h.pt \
    --data_path /path/to/preprocessed/data \
    --save_path /path/to/save/features

and FakeAVCeleb

python deepfake_feature_extraction.py \
    --dataset FakeAVCeleb \
    --metadata /path/to/FakeAVCeleb_metadata.csv \
    --ckpt_path self_large_vox_433h.pt \
    --data_path /path/to/preprocessed/data \
    --save_path /path/to/save/features \
    --category all

add --trimmed for the trimmed version of features

Train

To train the models mentioned in the article, follow:

Set up training and validation data paths in config.py or specify them as arguments when running the training routine as the example below:

python train.py --name=<experiment_name> --data_root_path=<path_to_the_features_data> --metadata_root_path=<path_to_the_folder_containing_the_dataset_metadata_files>

The model weights will be available at <save_path>/<name>.pt

Pretrained Models

We provide weights for our AVH-Align model trained on 45000 real videos from AV-Deepfake1M in checkpoints/AVH-Align_AV1M.pt.

Evaluation

To evaluate a model, use/modify the following example:

python eval.py \ 
    --checkpoint_path checkpoints/AVH-Align_AV1M.pt \ 
    --features_path /path/to/saved/features \ 
    --metadata /av1m_metadata/test_metadata.csv \ 
    --dataset AV1M 

License

The code is licensed under CC BY-NC-SA 4.0

Citation

If you find this work useful in your research, please cite it.

@InProceedings{AVH-Align,
    author    = {Smeu, Stefan and Boldisor, Dragos-Alexandru and Oneata, Dan and Oneata, Elisabeta},
    title     = {Circumventing shortcuts in audio-visual deepfake detection datasets with unsupervised learning localization},
    booktitle = {Proceedings of The IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
    year      = {2025}
}
Downloads last month
30

Paper for huahua123313/AVH-Align