pp-nsfw_Inspector is an image content moderation pipeline running on the Axera NPU. It combines OCR, NSFW detection, QR code scanning, and keyword rule matching to classify images as PASS / REVIEW / REJECT.
Pipeline Overview
mermaid
1flowchart TD
2 A[Input Image]--> B[Preprocess Layer<br/>Scene Classification + Image Processing + Long Image Slicing]3 B --> C{Process by Slice}45 C --> D[Image Branch<br/>NSFW + QR Code]6 C --> E{OCR Routing}78 E -->|SCREENSHOT| F[PP-OCRv5]9 E -->|DOCUMENT / POSTER / UNKNOWN| G[PP-DocLayout-S]10 G --> H[Text Region OCR]11 G --> I[Figure Region Extraction]12 I --> J[Figure Region NSFW]1314 F --> K[OCR Result<br/>blocks + avg_score + text_state]15 H --> K
16 D --> L[Image Signals<br/>nsfw / qr]17 J --> L
1819 K --> M[Understanding Layer<br/>Text Normalization + Strong/Weak Rules]20 M --> N[Text Signals<br/>rule_hits]21 L --> O[Decision Layer]22 K --> O
23 N --> O
2425 O --> P{Final Action}26 P -->|PASS| Q[Release]27 P -->|REVIEW| R[Review]28 P -->|REJECT| S[Reject]
All models are exported in w8a16 quantization for Axera NPU as .axmodel format. The following data is measured with ax_run_model -r 100 -w 10 (single-model benchmark, 100 iterations, 10 warmup).
Note: For safety, only partial keyword anomaly detection is enabled in this public release. For the complete illegal keyword list, please file an issue or contact us through official channels.