---
title: Shengoovlei-Vision-458M
canonical_url: "https://www.modelscope.cn/models/yLDeveloper/Shengoovlei-Vision-458M"
md_url: "https://www.modelscope.cn/models/yLDeveloper/Shengoovlei-Vision-458M.md"
repository: yLDeveloper/Shengoovlei-Vision-458M
chinese_name: Shengoovlei-Vision-458M
last_updated: 2026-07-05
pipeline_tag: image-text-to-text
tasks:
  - image-text-to-text
model_type:
  - shengoovlei-vqa
parameters: 85.8M
tensor_type:
  - F32
library_name:
  - safetensors
  - pytorch
frameworks:
  - Pytorch
downloads: 4
stars: 0
---

# Shengoovlei-Vision-458M

> Shengoovlei-Vision-458M - yLDeveloper 在 ModelScope 开源的模型。Shengoovlei-Vision-458M 是一个基于 GPT2 的轻量级 LLaVA 多模态理解 demo 模型，使用 CLIP ViT-B/16 、手搓亲自训练微调的 TransformerLM 文本模型和训练得到的视觉投影层组成。模型主要用于图片简短描述、简单颜色/形状识别，以及基础图文问答式交互，适合教学、实验和在线演示。

- **Repository**: yLDeveloper/Shengoovlei-Vision-458M
- **Tasks**: image-text-to-text
- **Parameters**: 85.8M
- **Downloads**: 4
- **Stars**: 0
- **Last updated**: 2026-07-05

Source: https://www.modelscope.cn/models/yLDeveloper/Shengoovlei-Vision-458M

---

# Shengoovlei-Vision-458M

Shengoovlei-Vision-458M 是一个轻量级多模态理解 demo 模型，主要面向图片简短描述、简单图文交互、颜色识别和形状识别。它不是强通用 VLM，而是一个从零训练文本基座后接入视觉 projector 的实验性模型。

- Blog: https://www.cnblogs.com/yldeveloper/p/20844773/m2mfull
- Online Demo: https://modelscope.cn/studios/yLDeveloper/Shengoovlei-Vision-458M
- GitHub: https://github.com/SolynAcVersion/Matmuls2mLLM

## 模型结构

- Vision encoder: `openai/clip-vit-base-patch16`
- Text model: 自训练 TransformerLM dense checkpoint
- Bridge: 两层 MLP vision projector
- Visual tokens: `64`
- Image size: `224x224`
- Total params: 约 `458M`

训练时冻结 CLIP ViT-B/16 和 TransformerLM，只训练 projector。图片经过 CLIP 得到 patch embeddings，选取视觉 tokens 后映射到文本 embedding 空间，再作为 visual prefix 拼接到文本 token 前面。

整体路径：

```text
image -> CLIP ViT-B/16 -> patch tokens -> projector -> visual prefix
text  -> tokenizer -> token embeddings
visual prefix + text embeddings -> frozen TransformerLM -> output text
```

## 适用场景

推荐 prompt：

```text
describe
describe this image
what is it?
what do you see?
what color is it?
what shape is it?
```

典型输出：

```text
A dog is playing in the snow.
A plate of food is on a table.
It is a blue rectangle.
```

不建议用于：

- 复杂 VQA
- OCR / 文档理解
- 精确计数
- 细粒度定位和 grounding
- 医疗、法律、金融等高风险判断

## 安装与运行

```bash
pip install -r requirements.txt
```

首次运行会尝试从源码编译 tokenizer C++ 扩展：

```text
bpe_fast.cpp
bpe_merge.cpp
```

因此环境需要 C++ 编译器、`pybind11`、`setuptools` 和 `wheel`。

交互模式：

```bash
python model.py --device cpu
```

单张图片推理：

```bash
python inference.py --device cpu --image demo.jpg --question "describe"
python inference.py --device cuda:0 --image demo.jpg --question "what do you see?"
```

文本-only 测试：

```bash
python inference.py --device cpu --question "hello"
```

默认 `temperature=0.2`。如果希望输出确定，可设为 `0`：

```bash
python inference.py --device cpu --image demo.jpg --question "describe" --temperature 0
```

## Python API

```python
from model import ShengoovleiVQA

model = ShengoovleiVQA(device="cpu")

print(model.predict("demo.jpg", "describe"))
print(model.predict("demo.jpg", "what is it?"))
print(model.predict(None, "hello"))
```

## ModelScope 在线体验

推荐使用 ModelScope Studio / Gradio 方式部署，入口文件为：

```text
app.py
```

本地测试：

```bash
python app.py
```

建议在线配置：

- SDK: `gradio`
- Prompt: `describe`
- Temperature: `0.2`
- CPU 可以运行但较慢
- GPU 体验更好

## 训练数据

最终发布版本主要使用：

- `color_shape` synthetic data：保持颜色、形状、颜色+形状描述能力。
- Flickr30k captions：用于早期自然图像描述训练。
- COCO 2017 captions：用于增强常见自然图片的短描述能力。

VQAv2 曾用于复杂视觉问答实验，但当前小模型在对象绑定、计数、细节定位和开放 VQA 上收益有限，最终发布版本选择 caption + color/shape 路线。

## 评估

使用 Flickr30k test 样本中的 `50` 张图片进行 demo-oriented caption bench。每张图片提供 `5` 条 reference captions，同一图片下三个模型的输出一起交给 DeepSeek 自动评分。

| Model | Params | Wins / 50 | Overall | Main object | Action/scene | Attributes | Low hallucination | Fluency |
| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
| Shengoovlei-Vision | 458M | 14 | 1.98 | 2.20 | 1.66 | 1.76 | 1.92 | 3.74 |
| MiniMind-3o | 213M | 3 | 1.62 | 1.78 | 1.56 | 1.42 | 1.32 | 2.32 |
| SmolVLM-256M-Instruct | 256M | 33 | 2.94 | 3.16 | 2.70 | 2.66 | 2.90 | 3.16 |

该评估不是标准学术 leaderboard，只用于观察模型在简单图片描述场景中的可用性。

## 局限性

- 输出容易受 caption 数据高频模板影响，例如人物、狗、球场、街道、桌子等。
- 复杂图片中可能只识别到大类主体，无法准确描述关系和细节。
- 可能产生不被图片支持的动作、位置、颜色或数量。
- OCR、图表、精确计数、复杂推理能力较弱。
- 文本基座本身较弱，text-only 常识问答能力有限。
- 主要训练英文输出，中文图像描述没有系统训练。

## 引用

```bibtex
@inproceedings{radford2021learning,
  title={Learning Transferable Visual Models From Natural Language Supervision},
  author={Radford, Alec and Kim, Jong Wook and Hallacy, Chris and others},
  booktitle={International Conference on Machine Learning},
  year={2021}
}
```

```bibtex
@misc{liu2023visual,
  title={Visual Instruction Tuning},
  author={Liu, Haotian and Li, Chunyuan and Wu, Qingyang and Lee, Yong Jae},
  year={2023},
  eprint={2304.08485},
  archivePrefix={arXiv},
  primaryClass={cs.CV}
}
```
