This repository packages the checkpoint-19.pth model from the local AIDE training run at /home/meet/Aivsre_001/AIDE/output_multisource_run1/checkpoint-19.pth as a Hugging Face model repository. The exported weights are provided both as a safe deployment artifact in model.safetensors and, if uploaded, as the original PyTorch training snapshot checkpoint-19.pth.
The model is based on AIDE: a hybrid AI-generated image detector that combines frequency-forensic evidence and high-level semantic cues. In this run, the detector uses:
A fixed 30-filter SRM high-pass bank to expose subtle forensic residuals.
Two ResNet-50-style frequency encoders that process DCT-derived reconstructions.
A frozen OpenCLIP ConvNeXt-XXL visual trunk for high-level semantic/image-manifold features.
A final MLP fusion head that merges ConvNeXt and forensic embeddings into a binary classifier: real vs fake.
Build four DCT-based reconstructed views with data/dct.py:
x_minmin
x_maxmax
x_minmin1
x_maxmax1
Build a fifth view, x_0, from the normalized RGB image.
Pass the four DCT views through the fixed SRM high-pass filters and into two ResNet branches.
Pass the RGB view through the frozen OpenCLIP ConvNeXt-XXL trunk.
Project the ConvNeXt pooled embedding from 3072 -> 256.
Average the four ResNet forensic embeddings into a single 2048-dimensional frequency representation.
Concatenate [ConvNeXt_256, Forensic_2048] into a 2304-dimensional vector.
Classify with an MLP 2304 -> 1024 -> 2.
Important implementation details taken directly from the code:
The frequency branch uses HPF -> ResNet(Bottleneck, [3, 4, 6, 3]).
The ConvNeXt branch is constructed with open_clip.create_model_and_transforms("convnext_xxlarge", pretrained=None) and then populated from the checkpoint weights.
The ConvNeXt trunk is frozen in the model definition used for this checkpoint.
Inside the model, the RGB input is remapped from ImageNet normalization to CLIP normalization before entering the ConvNeXt visual trunk.
Input Preparation
Inference must follow the same preparation used during training/evaluation:
Convert the image to RGB.
Convert to tensor in [0, 1].
Use DCT_base_Rec_Module(window_size=32, stride=16, output=256, grade_N=6) to reconstruct four frequency-ranked views.
The upstream AIDE project is introduced in the paper "A Sanity Check for AI-generated Image Detection" and uses a hybrid design intended to improve robustness on challenging real-world AI-image detection settings.
Files In This Repo
model.safetensors: exported model state dict for safer deployment.
checkpoint-19.pth: original PyTorch training snapshot, if uploaded.
config.json: architecture and label metadata.
model.json: lightweight manifest for this packaged repo.
preprocessor_config.json: image normalization and DCT-view preparation metadata.
inference.py: local loading and prediction helper.
models/ and data/: source modules required to reconstruct the architecture.
Usage
Clone or download the repository, then install dependencies: