cmj-chinese-aigc-text-detector
This repository provides a fine-tuned Chinese AIGC text detector with both PyTorch and ONNX weights.
Task
Binary classification for Chinese text:
The model is intended as an auxiliary signal for AIGC text detection. It should not be used as the only basis for punishment, academic misconduct decisions, identity judgment, or other high-stakes decisions.
Base Model And Upstream Sources
This model was fine-tuned from yuchuantian/AIGC_detector_zhv3.
Upstream references:
The upstream model and code pages are marked Apache-2.0. HC3-Chinese is marked CC-BY-SA-4.0 on its dataset page. This model card does not claim unconditional commercial use; downstream users should review the upstream model, code, data, generated-data, and hosting terms for their own use case.
Training Data
The selected model was trained with a 1:1 balanced Chinese dataset:
- human samples: 850 train / 150 validation
- AI samples: 850 train / 150 validation
- AI generation sources were balanced across five model families in the training split
- train and validation were split by
pair_id to reduce question-level leakage
The training data combined HC3-Chinese and authorized multi-model generated text. Full training and test data are not included in this model repository.
Training Parameters
1epochs: 1
2batch_size: 16
3validation_batch_size: 8
4max_length: 512
5learning_rate: 0.00002
6weight_decay: 0.01
7seed: 0
8optimizer: AdamW
9scheduler: no explicit scheduler found
10loss: classification loss + 0.4 * PU loss
11pu_type: dual_softmax_dyn_dtrun
12prior: 0.2
13length_threshold: 55
Files
PyTorch / Transformers files are stored at the repository root:
1config.json
2pytorch_model.bin
3tokenizer.json
4tokenizer_config.json
5special_tokens_map.json
6vocab.txt
ONNX files are stored under onnx/:
1onnx/model.onnx
2onnx/config.json
3onnx/tokenizer.json
4onnx/tokenizer_config.json
5onnx/special_tokens_map.json
6onnx/vocab.txt
Evaluation
Final balanced PyTorch model on fixed test sets:
| Evaluation set | Metric | Value |
|---|
| Human-only fixed test | Human accuracy | 91.60% |
| Human-only fixed test | Human false positive rate | 8.40% |
| AI-only fixed test | AI recall | 94.10% |
| Mixed fixed test | Accuracy | 92.85% |
HC3-Chinese 7,696-row test:
| Model | Overall accuracy | AI detection rate | Human false positive rate |
|---|
| Original zh-v3 baseline | 89.54% | 91.14% | 11.60% |
| This fine-tuned model | 91.84% | 92.78% | 8.84% |
ONNX consistency, verified in the original server environment:
1max absolute logits difference: 1.43e-6
2max absolute probability difference: 2.31e-7
3sample prediction labels: fully consistent
ONNX fixed test results:
| Evaluation set | Metric | Value |
|---|
| Human-only fixed test | Human accuracy | 91.60% |
| Human-only fixed test | Human false positive rate | 8.40% |
| AI-only fixed test | AI recall | 94.10% |
| Mixed fixed test | Accuracy | 92.85% |
ONNX Interface
ONNX export configuration used:
1inputs: input_ids, attention_mask, token_type_ids
2output: logits
3opset: 14
4dynamic batch: enabled
5dynamic sequence length: enabled
Known Limitations
- Performance reflects the tested data and current splits, not all Chinese domains.
- The model may be sensitive to text length, topic distribution, prompt style, and unseen generators.
- Error analysis showed weaker performance on
nlpcc_dbqa, with legal and finance categories also requiring more attention than medicine, encyclopedia, psychology, and open-question text.
- AIGC detection is probabilistic and should be combined with human review and other evidence.
License And Attribution
This repository includes Apache-2.0 license text because the upstream model and code pages are marked Apache-2.0. HC3-Chinese is marked CC-BY-SA-4.0. The model was trained from upstream work and should not be described as a from-scratch model.
Please preserve upstream attribution when reusing the model or code, and review all upstream and data licenses before redistribution or production use.