Skip to page content
SAVRN
Search Plan a project

Open-weight model · Image classification

document-moire-detector-ONNX

by ONNX Community onnx-community/document-moire-detector-ONNX

document-moire-detector-ONNX is an open-weight model for image classification from ONNX Community, released under Apache License 2.0. Its published files total 240.0 MB.

This is an ONNX version of Jwalit/document-moire-detector. It was automatically converted and uploaded using this Hugging Face Space.

Parameters—
Context—
Weights240.0 MB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads—

Model Card

By ONNX Community, published under apache-2.0, revision aafb2400b79f.

This is an ONNX version of Jwalit/document-moire-detector. It was automatically converted and uploaded using this Hugging Face Space. See the pipeline documentation for image-classification: https://huggingface.co/docs/transformers.js/api/pipelines#modulepipelines.ImageClassificationPipeline A fine-tuned DeiT-small Vision Transformer for detecting moiré patterns in document images. (common from screen photography, scanning, or screen captures). - clean (0): No moiré patterns - moire (1): Moiré patterns detected 1. Resize aliasing — downscale+upscale with NEAREST interpolation + pattern overlay 2. Pattern overlay — sinusoidal interference with per-channel color variation 3. Multi-frequency…

Read ONNX Community's full model card

This is an ONNX version of Jwalit/document-moire-detector. It was automatically converted and uploaded using this Hugging Face Space.

Usage with Transformers.js

See the pipeline documentation for image-classification: https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.ImageClassificationPipeline


Document Moiré Detection Model (V2)

A fine-tuned DeiT-small Vision Transformer for detecting moiré patterns in document images.

Model Description

Binary classifier: detects whether a document image contains moiré artifacts (common from screen photography, scanning, or screen captures).

Labels: - clean (0): No moiré patterns - moire (1): Moiré patterns detected

V1 → V2 Comparison

V1 (DeiT-tiny) V2 (DeiT-small)
Parameters 5.5M 22M
Training samples 6,000 8,000
Moiré methods 4 6 (+subtle, +localized)
Label smoothing — 0.05
Accuracy 99.5% 99.1%
F1 Score 0.995 0.991
Precision 99.3% 98.5%
Recall 99.7% 99.8%

Note: V2 was evaluated on harder examples including subtle single-frequency moiré and localized moiré patterns that V1 never trained on. V2 achieves near-perfect recall (99.75%) — it catches virtually all moiré patterns including very subtle ones, at the cost of slightly lower precision.

Training Details

Parameter Value
Base model facebook/deit-small-patch16-224
Parameters 22M
Training samples 8,000 (4,000 clean + 4,000 moiré)
Eval samples 800 (400 clean + 400 moiré)
Epochs 5
Learning rate 3e-5 (cosine schedule)
Effective batch size 64
Label smoothing 0.05
Warmup steps 60
Best checkpoint Epoch 2 (by F1)

Moiré Generation Methods

  1. Resize aliasing — downscale+upscale with NEAREST interpolation + pattern overlay
  2. Pattern overlay — sinusoidal interference with per-channel color variation
  3. Multi-frequency — 2-4 patterns at different frequencies + color displacement
  4. Screen simulation — pixel grid + rotation + moiré overlay
  5. Subtle moiré — very low strength single-frequency (hard examples)
  6. Localized moiré — moiré in elliptical region with gaussian mask

Performance (Best Checkpoint)

Metric Value
Accuracy 99.12%
F1 Score 0.9913
Precision 98.52%
Recall 99.75%
Eval Loss 0.170

Training Progression

Epoch Eval Loss Accuracy F1 Precision Recall
1 0.173 99.0% 0.990 99.3% 98.8%
2 0.177 99.1% 0.991 99.0% 99.3%
3 0.154 99.1% 0.991 99.3% 99.0%
4 0.170 99.1% 0.991 98.5% 99.8%
5 0.168 99.0% 0.990 98.3% 99.8%

Usage

from transformers import pipeline

classifier = pipeline("image-classification", model="Jwalit/document-moire-detector")
result = classifier("path/to/document.jpg")
print(result)
# [{'label': 'clean', 'score': 0.99}, {'label': 'moire', 'score': 0.01}]

Or manually:

from transformers import AutoImageProcessor, AutoModelForImageClassification
from PIL import Image
import torch

processor = AutoImageProcessor.from_pretrained("Jwalit/document-moire-detector")
model = AutoModelForImageClassification.from_pretrained("Jwalit/document-moire-detector")

image = Image.open("document.jpg")
inputs = processor(image, return_tensors="pt")
with torch.no_grad():
    logits = model(**inputs).logits
    predicted = logits.argmax(-1).item()

print(model.config.id2label[predicted])  # 'clean' or 'moire'

Limitations

  • Trained on synthetic moiré patterns — may not capture all real-world moiré variations
  • Optimized for document images; performance on natural scene images may vary
  • Input images resized to 224×224; very subtle moiré in high-resolution images may be lost
  • Higher recall than precision — may occasionally flag clean images as moiré (false positive rate ~1.5%)

Configuration

Architecture
ViTForImageClassification
Layers
12
Hidden size
384
Feed-forward size
1,536
Attention heads
6
Model type
vit

Identity and Version

Repository
onnx-community/document-moire-detector-ONNX
Publisher
ONNX Community
Task
Image classification
Modality
Image
Library
transformers.js
Parameters
Not stated by the source
Languages
vit
Revision
aafb2400b79fc6d21f54dff112cf30948411285c
First published
2026-10-13
Last updated
2026-10-13

Files and Weights

12 files, 240.0 MB in total. The weights are 8 files totalling 240.0 MB in onnx.

Weights8 files · 240.0 MB
Configuration2 files · 1.0 KB
Documentation1 file · 4.7 KB
Repository1 file · 1.5 KB
Every file
FileTypeSizeSHA-256
onnx/model.onnxWeights86.9 MB 7bfa6147d3e1
onnx/model_bnb4.onnxWeights13.9 MB 7d8b483f67b4
onnx/model_fp16.onnxWeights43.6 MB 086dddb1a0df
onnx/model_int8.onnxWeights22.4 MB bb96b98912a4
onnx/model_q4.onnxWeights15.2 MB 19e6e624e91f
onnx/model_q4f16.onnxWeights13.1 MB 2f02753aa2fa
onnx/model_quantized.onnxWeights22.4 MB bb96b98912a4
onnx/model_uint8.onnxWeights22.4 MB b720d05c4f65
config.jsonConfiguration686 B —
preprocessor_config.jsonConfiguration351 B —
README.mdDocumentation4.7 KB —
.gitattributesRepository1.5 KB —

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
240.0 MB
Download from ONNX Community

Released by ONNX Community through its official repository on Hugging Face. Read the license.

Built From

  • Derived from Jwalit/document-moire-detector
  • Quantized from Jwalit/document-moire-detector
  • Trained on (disclosed) hf-tuner/rvl-cdip-document-classification

Memory Requirements

PrecisionWeights in memory
As published240.0 MB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About document-moire-detector-ONNX

Can I use document-moire-detector-ONNX commercially?

Yes. document-moire-detector-ONNX is released under Apache License 2.0. The Apache License 2.0 is a permissive open-source license. It permits commercial use, modification and redistribution. It requires keeping the license and copyright notices and any NOTICE file, stating significant changes, and it includes an express patent grant from contributors.

Similar Models

Model · Image classification

swinv2-tiny-patch4-window16-256

Microsoft

Swin Transformer v2 model pre-trained on ImageNet-1k at resolution 256x256. It was introduced in the paper Swin Transformer V2: Scaling Up Capacity and Resolution by Liu et al. and first released in this repository. Disclaimer: The team releasing Swin Transformer v2 did not write a model card for this model so this model card has been written by the Hugging Face team. The Swin Transformer is a type of Vision Transformer. It builds hierarchical feature maps by merging image patches (shown in gray) in deeper layers and has linear computation complexity to input image size due to computation of self-attention only within each local window (shown in red). It can thus serve as a general-purpose…

Open weights apache-2.0 transformers

Model · Image classification

AI-image-detector

Matthew Maybe

NOTE: Unless you are trying to detect imagery generated using older models such as VQGAN+CLIP, please use the updated version of this detector instead. This model is a proof-of-concept demonstration of using a ViT model to predict whether an artistic image was generated using AI. It was created in October 2022, and as such, the training data did not include any samples generated by Midjourney 5, SDXL, or DALLE-3. It still may be able to correctly identify samples from these more recent models due to being trained on outputs of their predecessors. Furthermore the intended scope of this tool is artistic images; that is to say, it is not a deepfake photo detector, and general computer imagery…

Open weights cc-by-4.0 transformers

Measured on device (edge-compat): Raspberry Pi 5 · LiteRT 2.2.0.dev20260804 · CPU/XNNPACK, 4 threads · 34.1 ms p50 (2026-08-31); browser · Chromium 151 (2026-08-11). Record: https://github.com/john-rocky/edge-compat/blob/main/cards/plantnet-300k-resnet18/CARD.md On-device fine-grained plant species identification — 1081 species — running fully on the LiteRT CompiledModel GPU delegate (no CPU fallback). A PlantNet-300K (NeurIPS 2021) ResNet18. ~16 ms/frame on a Pixel 8a. (mean [0.485,0.456,0.406], std [0.229,0.224,0.225]; center-crop then resize 224). Labels: class index i maps to the i-th species when the PlantNet-300K species-id strings are sorted (torchvision ImageFolder order); names…

Open weights apache-2.0 litert

Model · Image classification

traffic-sign-adverse-weather

Yy

Official model checkpoints for the solution in the Traffic Sign Recognition under Adverse Weather Competition. See classes.txt for the 25 traffic sign classes. For inference scripts, training code, and in-depth engineering retrospective, visit the GitHub Repository.

Open weights mit timm

Model · Image classification

tinyvit-5m-int8-imagenet

Core Epoch

TinyViT-5M (timm/tinyvit5m224.distin22kftin1k, Apache-2.0) quantized to INT8 with Kenosis — 128-image calibration, no retraining. 80.53% top-1 from a 9.2 MB single file, on ONNX Runtime or OpenVINO, CPU or GPU, no accelerator required. ImageNet-1K validation, 49,872 images (disjoint from the 128 calibration images). Measured on a CPU with AVX-VNNI; on CPUs without VNNI this model's INT8 top-1 sits ~0.9 below FP32 rather than 0.34. Input 1x3x224x224, RGB, /255, ImageNet mean/std. Output logits [1,1000], sorted-synset order. runclassify.py / evalimagenet.py reproduce the demo and table. tinyvit5m224int8kenosis.onnx (9,228,567 B) — SHA-256…

Open weights apache-2.0 onnx