BLOG · 2026-08-04

如何使用 DeepSeek 大模型对 PaddleOCR 门牌识别小模型进行知识蒸馏训练

本文原发表于公众号「ET的生活体验」(2025 年 2 月),现移植到 RRLab 博客。内容为门牌 OCR 项目实战记录的第三篇。原计划有续篇,后未继续发布。

Originally published on the WeChat channel "ET's Life Experience" (February 2025), now migrated to the RRLab blog. This is the third installment in the doorplate OCR project series. A planned sequel was never published.

昨天写了使用 PaddleOCR 的目标识别模型裁剪门牌后,由 PPOCRLabel 完成自动标识。这样一来数据量的级别一下上了一个层次,从原来几千的数据量一下上升为十万级的数据量。但无论如何还只是一个小模型的训练集,这个训练集在对模糊的门牌地址的识别还是差强人意。

Yesterday I wrote about using PaddleOCR's detection model to crop doorplates, then having PPOCRLabel auto-label them. This pushed the data volume from thousands to the hundred-thousand level. But it's still just a small-model training set, and its recognition of blurry doorplate addresses remains unsatisfactory.

在等待 PPOCRLabel 处理几万张门牌自动标注的空挡,一直在思考怎么进一步提升对模糊门牌地址的识别能力……是否可以让大模型给小模型训练做指导?!

While waiting for PPOCRLabel to process tens of thousands of auto-labeling tasks, I kept thinking about how to further improve blurry doorplate recognition... Could a large model guide the training of a small model?!

答案是肯定的!大致理解就是利用 DeepSeek 等大模型作为教师模型,将其知识蒸馏到 PaddleOCR 的小模型中。通过这种方式,PaddleOCR 可以在保持较小模型规模的同时,获得接近大模型的识别精度。

The answer is yes! The rough idea: use DeepSeek or similar large models as a teacher model, distilling its knowledge into the smaller PaddleOCR model. This way, PaddleOCR can achieve near-large-model recognition accuracy while staying compact.

这就是"知识蒸馏训练",终于洋气了一把……哈哈!

That's "knowledge distillation training" — finally something fancy-sounding! Haha!

既然这样想,那就先问问 DeepSeek 是不是我的想法离谱。结果……结果 DeepSeek 第一反应是觉得我现有 9 万个数据量有点不够看,让我通过 DeepSeek 先合成 5 万个数据……

Having thought of this, I asked DeepSeek whether my idea was crazy. And... its first reaction was that 90,000 samples weren't quite enough, suggesting I use DeepSeek to synthesize 50,000 more...

这是生成式模型的惯性思维吗?真实数据量我有很多啊,根本不用合成!

Is this generative model inertial thinking? I have plenty of real data, no synthesis needed!

下一步了解下怎么建立教师模型和学生模型,因为 DeepSeek 的 API 受攻击,影响实际使用。我有想使用本地部署 DeepSeek 作为教师模型。

Next step: figure out how to set up the teacher-student model architecture. Since DeepSeek's API was under attack, affecting usability, I considered deploying DeepSeek locally as the teacher model.

这是推荐的系统配置。正常理解教师模型和学生模型是可以部署在同一部电脑上,首要条件是电脑配置够强悍!

Here's the recommended system config. Normally, teacher and student models can run on the same machine — the prerequisite being that the machine is beefy enough!

等等……我好像找到了更好的方法:各大云计算都已经部署了 DeepSeek 了。这样可以直接使用云计算部署的大模型,而且还能使用最大数据集的版本进行训练。

Wait... I think I found a better way: major cloud platforms have already deployed DeepSeek. This way I can use the cloud-hosted large model directly, and even train with the full dataset version.

查看了下费用,白菜价!

Checked the pricing — dirt cheap!

那问题就比较简单了,只要在云计算平台上配置学生模型就可以了!

So the problem simplifies: just configure the student model on the cloud platform!

未完待续……

To be continued...