How wyczzy/aigi-holmes works
AIGI-Holmes targets AI-generated-image detection with human-verifiable explanations. Its documented workflow prepares image data, trains a visual expert, fine-tunes a multimodal language model (SFT, then preference optimization), and runs inference; collaborative decoding is a further documented strategy. The repository also contains the broader SWIFT toolkit for training, inference, evaluation, export, model adaptation, and serving. The README describes dataset annotation and quality control, but the supplied tree does not expose an implementation for that stage; sampled source covers only selected SWIFT modules.
Main entry points: main.py Command router · infer.py Inference · sft.py SFT training · rlhf.py Preference training
Components 19
Visual expert
- Image datasets
Baselines_AIGI/data/datasets.py - Visual pretraining
Baselines_AIGI/networks/trainer.py - Visual expert
Baselines_AIGI/models.py
MLLM training
- SFT training
swift/llm/sft.py - Data and templates
swift/llm/utils/preprocess.py - Model adapters
swift/tuners/lora.py - Trainer framework
swift/trainers/trainers.py - Preference training
swift/llm/rlhf.py
Inference runtime
- Inference
swift/llm/infer.py - Collaborative decoding
logits-processor-zoo/logits_processor_zoo/vllm - Model serving
swift/llm/deploy.py - Evaluation
swift/llm/eval.py - Model export
swift/llm/export.py - Logits processors
logits-processor-zoo/logits_processor_zoo/vllm
SWIFT toolkit
- Command router
swift/cli/main.py - Model utilities
swift/llm/utils/model.py - Model hub
swift/hub
Other components
- Researcher
- vLLM endpoint
Connections 22
- Researcher → Image datasets: prepares data
- Image datasets → Visual pretraining: trains on
- Visual pretraining → Visual expert: trains
- Researcher → Command router: invokes commands
- Command router → SFT training: routes SFT
- Command router → Preference training: routes RLHF
- SFT training → Data and templates: prepares examples
- SFT training → Model adapters: adapts model
- SFT training → Trainer framework: trains with
- Preference training → Data and templates: prepares examples
- Preference training → Trainer framework: trains with
- Command router → Inference: routes inference
- Inference → Model utilities: loads model
- Inference → Data and templates: formats inputs
- Inference → Visual expert: uses visual expert
- Inference → Collaborative decoding: supports decoding
- Collaborative decoding → Logits processors: processes logits
- Command router → Model serving: routes deployment
- Command router → Evaluation: routes evaluation
- Command router → Model export: routes export
- Model export → Model hub: publishes model
- Model serving → vLLM endpoint: serves requests