# venus-guangjian/sica_openmmsec architecture

> Architecture diagram of the GitHub repository venus-guangjian/sica_openmmsec, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/venus-guangjian/sica_openmmsec
- Repository: https://github.com/venus-guangjian/sica_openmmsec

## Overview

This repository provides SICA fake-image inference and its model implementation, alongside documentation for the OpenMMSec dataset and retraining. The main workflow accepts an image and checkpoint, constructs the model, preprocesses the image, runs prediction, and prints a probability. Internally, the model combines a vision backbone, configurable LoRA adaptation, and a prediction head with an optional training loss. Dataset scale and training-framework links are documented, but their implementations are not present in the tree; those links reflect README statements, not inspected code.

Main entry points: [`inference.py`](https://github.com/venus-guangjian/sica_openmmsec/blob/main/inference.py) (Inference CLI), [`model.py`](https://github.com/venus-guangjian/sica_openmmsec/blob/main/model.py) (SICA model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inference["Inference workflow"]
  node_inference_cli["Inference CLI<br/>[inference.py]"]
  node_preprocessing["Image preprocessing<br/>[model.py]"]
  node_prediction["Prediction probability<br/>[inference.py]"]
end

subgraph group_model["SICA model"]
  node_sica_model["SICA model<br/>[model.py]"]
  node_vision_backbone["Vision backbone<br/>[model.py]"]
  node_lora["LoRA adaptation<br/>[model.py]"]
  node_prediction_head["Prediction head<br/>[model.py]"]
  node_training_loss["Training loss<br/>[model.py]"]
end

subgraph group_data["Dataset and training"]
  node_openmmsec[("OpenMMSec dataset")]
  node_forensichub["ForensicHub training"]
end

node_user(("Researcher"))
node_image["Input image"]
node_checkpoint["Model checkpoint"]

node_user -->|"runs"| node_inference_cli
node_image -->|"provides path"| node_inference_cli
node_checkpoint -->|"provides weights"| node_inference_cli
node_inference_cli -->|"constructs"| node_sica_model
node_inference_cli -->|"calls"| node_preprocessing
node_inference_cli -->|"loads weights"| node_sica_model
node_sica_model -->|"initializes and calls"| node_vision_backbone
node_sica_model -->|"injects and configures"| node_lora
node_sica_model -->|"applies"| node_prediction_head
node_vision_backbone -->|"returns features"| node_prediction_head
node_sica_model -->|"computes when labeled"| node_training_loss
node_inference_cli -->|"prints"| node_prediction
node_openmmsec -.->|"supplies training data"| node_sica_model
node_forensichub -.->|"trains on"| node_openmmsec

click node_inference_cli "https://github.com/venus-guangjian/sica_openmmsec/blob/main/inference.py"
click node_preprocessing "https://github.com/venus-guangjian/sica_openmmsec/blob/main/model.py"
click node_prediction "https://github.com/venus-guangjian/sica_openmmsec/blob/main/inference.py"
click node_sica_model "https://github.com/venus-guangjian/sica_openmmsec/blob/main/model.py"
click node_vision_backbone "https://github.com/venus-guangjian/sica_openmmsec/blob/main/model.py"
click node_lora "https://github.com/venus-guangjian/sica_openmmsec/blob/main/model.py"
click node_prediction_head "https://github.com/venus-guangjian/sica_openmmsec/blob/main/model.py"
click node_training_loss "https://github.com/venus-guangjian/sica_openmmsec/blob/main/model.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_inference_cli,node_preprocessing,node_prediction toneBlue
class node_sica_model,node_vision_backbone,node_lora,node_prediction_head,node_training_loss toneAmber
class node_openmmsec,node_forensichub toneMint
class node_user,node_image,node_checkpoint toneIndigo
```

## Components

### Inference workflow

- [Inference CLI](https://github.com/venus-guangjian/sica_openmmsec/blob/main/inference.py): `inference.py`
- [Image preprocessing](https://github.com/venus-guangjian/sica_openmmsec/blob/main/model.py): `model.py`
- [Prediction probability](https://github.com/venus-guangjian/sica_openmmsec/blob/main/inference.py): `inference.py`

### SICA model

- [SICA model](https://github.com/venus-guangjian/sica_openmmsec/blob/main/model.py): `model.py`
- [Vision backbone](https://github.com/venus-guangjian/sica_openmmsec/blob/main/model.py): `model.py`
- [LoRA adaptation](https://github.com/venus-guangjian/sica_openmmsec/blob/main/model.py): `model.py`
- [Prediction head](https://github.com/venus-guangjian/sica_openmmsec/blob/main/model.py): `model.py`
- [Training loss](https://github.com/venus-guangjian/sica_openmmsec/blob/main/model.py): `model.py`

### Dataset and training

- **OpenMMSec dataset**
- **ForensicHub training**

### Other components

- **Researcher**
- **Input image**
- **Model checkpoint**

## Connections

- Researcher → Inference CLI: runs (evidence: `README.md`)
- Input image → Inference CLI: provides path (evidence: `inference.py`)
- Model checkpoint → Inference CLI: provides weights (evidence: `inference.py`)
- Inference CLI → SICA model: constructs (evidence: `inference.py`)
- Inference CLI → Image preprocessing: calls (evidence: `inference.py`)
- Inference CLI → SICA model: loads weights (evidence: `inference.py`)
- SICA model → Vision backbone: initializes and calls (evidence: `model.py`)
- SICA model → LoRA adaptation: injects and configures (evidence: `model.py`)
- SICA model → Prediction head: applies (evidence: `model.py`)
- Vision backbone → Prediction head: returns features (evidence: `model.py`)
- SICA model → Training loss: computes when labeled (evidence: `model.py`)
- Inference CLI → Prediction probability: prints (evidence: `inference.py`)
- OpenMMSec dataset → SICA model: supplies training data (evidence: `README.md`)
- ForensicHub training → OpenMMSec dataset: trains on (evidence: `README.md`)
