[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-weinman--cnn_lstm_ctc_ocr":3,"tool-weinman--cnn_lstm_ctc_ocr":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",160015,2,"2026-04-18T11:30:52",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",109154,"2026-04-18T11:18:24",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":67,"readme_en":68,"readme_zh":69,"quickstart_zh":70,"use_case_zh":71,"hero_image_url":72,"owner_login":73,"owner_name":74,"owner_avatar_url":75,"owner_bio":76,"owner_company":77,"owner_location":78,"owner_email":79,"owner_twitter":79,"owner_website":80,"owner_url":81,"languages":82,"stars":91,"forks":92,"last_commit_at":93,"license":94,"difficulty_score":95,"env_os":96,"env_gpu":97,"env_ram":98,"env_deps":99,"category_tags":105,"github_topics":106,"view_count":32,"oss_zip_url":79,"oss_zip_packed_at":79,"status":17,"created_at":113,"updated_at":114,"faqs":115,"releases":151},9131,"weinman\u002Fcnn_lstm_ctc_ocr","cnn_lstm_ctc_ocr","Tensorflow-based  CNN+LSTM trained with CTC-loss for OCR","cnn_lstm_ctc_ocr 是一个基于 TensorFlow 构建的开源光学字符识别（OCR）模型，专注于提升单词级别的文本识别鲁棒性。它主要解决了传统 OCR 在处理复杂场景或合成数据时准确率不足的问题，通过结合卷积神经网络（CNN）与双向长短期记忆网络（LSTM），并利用 CTC 损失函数进行训练，实现了高精度的端到端文字识别。\n\n该工具特别适合 AI 开发者、研究人员以及对深度学习 OCR 技术感兴趣的学生使用。用户可以直接利用其提供的代码在经典的 MJSynth 合成数据集上进行训练和测试，复现先进的实验结果，或将其作为基础架构进行二次开发。\n\n在技术亮点方面，cnn_lstm_ctc_ocr 是对经典 CRNN 架构的深度优化版本。它创新性地融合了 VGG 网络思想，采用成对的 3x3 小卷积核堆叠替代单层卷积，既扩大了感受野又减少了参数量；同时，通过在水平方向限制池化操作，有效保留了字符识别所需的空间分辨率。此外，模型去除了首层卷积的零填充以避免边缘伪影，并引入批量归一化加速收敛。实验数据显示，其在特定测试集上的单词错误率低至 1.82%，表现优于原始 CRNN 模型","cnn_lstm_ctc_ocr 是一个基于 TensorFlow 构建的开源光学字符识别（OCR）模型，专注于提升单词级别的文本识别鲁棒性。它主要解决了传统 OCR 在处理复杂场景或合成数据时准确率不足的问题，通过结合卷积神经网络（CNN）与双向长短期记忆网络（LSTM），并利用 CTC 损失函数进行训练，实现了高精度的端到端文字识别。\n\n该工具特别适合 AI 开发者、研究人员以及对深度学习 OCR 技术感兴趣的学生使用。用户可以直接利用其提供的代码在经典的 MJSynth 合成数据集上进行训练和测试，复现先进的实验结果，或将其作为基础架构进行二次开发。\n\n在技术亮点方面，cnn_lstm_ctc_ocr 是对经典 CRNN 架构的深度优化版本。它创新性地融合了 VGG 网络思想，采用成对的 3x3 小卷积核堆叠替代单层卷积，既扩大了感受野又减少了参数量；同时，通过在水平方向限制池化操作，有效保留了字符识别所需的空间分辨率。此外，模型去除了首层卷积的零填充以避免边缘伪影，并引入批量归一化加速收敛。实验数据显示，其在特定测试集上的单词错误率低至 1.82%，表现优于原始 CRNN 模型，是研究序列识别任务的优秀参考实现。","# Overview\n\nThis collection demonstrates how to construct and train a deep,\nbidirectional stacked LSTM using CNN features as input with CTC loss\nto perform robust word recognition.\n\nThe model is a straightforward adaptation of Shi et al.'s CRNN\narchitecture ([arXiv:1507.0571](https:\u002F\u002Farxiv.org\u002Fabs\u002F1507.05717)).\nThe provided code downloads and trains using Jaderberg et al.'s\nsynthetic data ([IJCV 2016](http:\u002F\u002Fdx.doi.org\u002F10.1007\u002Fs11263-015-0823-z)), \nMJSynth.\n\nNotably, the model achieves a lower test word error rate (1.82%) than\n[CRNN]( https:\u002F\u002Fgithub.com\u002Fbgshih\u002Fcrnn) when trained and tested on\ncase-insensitive, closed vocabulary MJSynth data.\n\nWritten for Python 2.7. Requires TensorFlow >=1.10 (deprecation warnings \nexist for TF>1.10, but the code still works).\n\nThe model and subsequent experiments are more fully described in\n[Weinman et al. (ICDAR 2019)](https:\u002F\u002Fweinman.cs.grinnell.edu\u002Fpubs\u002Fweinman19deep.pdf)\n\n# Structure\n\nThe model as built is a hybrid of Shi et al.'s CRNN architecture\n(arXiv:1507.0571) and the VGG deep convnet, which reduces the number\nof parameters by stacking pairs of small 3x3 kernels. In addition, the\npooling is also limited in the horizontal direction to preserve\nresolution for character recognition. There must be at least one\nhorizontal element per character.\n\nAssuming one starts with a 32x32 image, the dimensions at each level\nof filtering are as follows:\n\n\n| Layer |  Op  | KrnSz | Stride(v,h) | OutDim |  H |  W  | PadOpt\n|:-----:|------|-------|:-----------:|--------|----|-----|--------------\n| 1     | Conv |   3   |   1         |   64   | 30 | 30  |    valid\n| 2     | Conv |   3   |   1         |   64   | 30 | 30  |    same\n|       | Pool |   2   |   2         |   64   | 15 | 15  | \n| 3     | Conv |   3   |   1         |  128   | 15 | 15  |    same\n| 4     | Conv |   3   |   1         |  128   | 15 | 15  |    same\n|       | Pool |   2   |   2,1       |  128   |  7 | 14  |       \n| 5     | Conv |   3   |   1         |  256   |  7 | 14  |    same\n| 6     | Conv |   3   |   1         |  256   |  7 | 14  |    same\n|       | Pool |   2   |   2,1       |  256   |  3 | 13  |       \n| 7     | Conv |   3   |   1         |  512   |  3 | 13  |    same\n| 8     | Conv |   3   |   1         |  512   |  3 | 13  |    same\n|       | Pool |   3   |   3,1       |  512   |  1 | 13  |     \n| 9     | LSTM |       |             |  512   |    |     |              \n| 10    | LSTM |       |             |  512   |    |     |              \n\nTo accelerate training, a batch normalization layer is included before\neach pooling layer and ReLU non-linearities are used throughout. Other\nmodel details should be easily identifiable in the code.\n\nThe default training mechanism uses the ADAM optimizer with learning\nrate decay.\n\n## Differences from CRNN\n\n### Deeper early convolutions\n\nThe original CRNN uses a single 3x3 convolution in the first two conv\u002Fpool\nstages, while this network uses a paired sequence of 3x3 kernels. This change\nincreases the theoretical receptive field of early stages of the network.\n\nAs a tradeoff, we omit the computationally expensive 2x2x512 final\nconvolutional layer of CRNN. In its place, this network vertically max pools over the\nremaining three rows of features to collapse to a single 512-dimensional\nfeature vector at each horizontal location.\n\nThe combination of these changes preserves the theoretical receptive field size\nof the final CNN layer, but reduces the number of convolution parameters to be\nlearned by 15%.\n\n### Padding\n\nAnother important difference is the lack of zero-padding in the first\nconvolutional layer, which can cause spurious strong filter responses around\nthe border. By trimming the first convolution to valid regions, this model\nerodes the outermost pixel of values from the response filter maps (reducing\nheight from 32 to 30 and reducing the width by two pixels).\n\nThis approach seems preferable to requiring the network to learn to ignore\nstrong Conv1 responses near the image edge (presumably by weakening the power\nof filters in subsequent convolutional layers).\n\n### Batch normalization\n\nWe include batch normalization after each pair of convolutions (i.e., after\nlayers 2, 4, 6, and 8 as numbered above). The CRNN does not include batch\nnormalization after its first two convolutional stages. Our model therefore\nrequires greater computation with an eye toward decreasing the number of\ntraining iterations required to reach converegence.\n\n### Subsampling\u002Fstride\n\nThe first two pooling stages of CRNN downsample the feature maps with a stride\nof two in both spatial dimensions. This model instead preserves sequence length\nby downsampling horizontally only after the first pooling stage.\n\nBecause the output feature map must have at least one timeslice per character\npredicted, overzealous downsampling can make it impossible to represent\u002Fpredict\nsequences of very compact or narrow characters. Reducing the horizontal\ndownsampling allows this model to recognize words in narrow fonts.\n\nThis increase in horizontal resolution does mean the LSTMs must capture more\ninformation. Hence this model uses 512 hidden units, rather than the 256 used\nby the CRNN. We found this larger number to be necessary for good performance.\n\n# Training\n\nTo completely train the model, you will need to download the mjsynth\ndataset and pack it into sharded TensorFlow records. Then you can start\nthe training process, a tensorboard monitor, and an ongoing evaluation\nthread. The individual commands are packaged in the accompanying `Makefile`.\n\n    make mjsynth-download\n    make mjsynth-tfrecord\n    make train &\n    make monitor &\n    make test\n\nTo monitor training, point your web browser to the url (e.g.,\n(http:\u002F\u002F127.0.1.1:8008)) given by the Tensorboard output.\n\nNote that it may take 4-12 hours to download the complete mjsynth data\nset. A very small set (0.1%) of packaged example data is included; to\nrun the small demo, skip the first two lines involving `mjsynth`.\n\nWith a GeForce GTX 1080, the demo takes about 20 minutes for the\nvalidation character error to reach 45% (using the default\nparameters); at one hour (roughly 7000 iterations), the validation\nerror is just over 20%.\n\nWith the full training data, by one million iterations the model\ntypically converges to around 5% training character error and 27.5%\nword error.\n\n## Checkpoints\n\n[Pre-trained model checkpoints](http:\u002F\u002Fhdl.handle.net\u002F11084\u002F23328) at\nDOI:[11084\u002F23328](http:\u002F\u002Fhdl.handle.net\u002F11084\u002F23328) are used to\nproduce results in the following paper:\n\n> Weinman, J. et al. (2019) Deep Neural Networks for Text Detection\n> and Recognition in Historical Maps. In Proc. ICDAR.\n\n# Testing\n\nThe evaluate script (`src\u002Fevaluate.py`) streams statistics for one\nbatch of validation (or evaluation) data. It prints the iteration,\nevaluation batch loss, label error (percentage of characters predicted\nincorrectly), and the sequence error (percentage of words—entire\nsequences—predicted incorrectly).\n\nThe test script (`src\u002Ftest.py`) tallies statistics, finally\nnormalizing for all data. It prints the loss, label error, total\nnumber of labels, sequence error, total number of sequences, and the\nlabel error rate and sequence error rate.\n\n# Validation\n\nTo see the output of a small set of instances, the validation script\n(`src\u002Fvalidation.py`) allows you to load a model and read an image one\nat a time via the process's standard input and print the decoded\noutput for each. For example\n\n    cd src ; python validate.py \u003C ~\u002Fpaths_to_images.txt\n\nAlternatively, you can run the program interactively by typing image\npaths in the terminal (one per line, type Control-D when you want the\nmodel to run the input entered so far).\n\n# Configuration\n\nThere are many command-line options to configure training\nparameters. Run `train.py` or `test.py` with the `--help` flag to see\nthem or inspect the scripts. Model parameters are not command-line\nconfigurable and need to be edited in the code (see `src\u002Fmodel.py`).\n\n# Dynamic training data\n\nDynamic data can be used for training or testing by setting the\n`--nostatic_data` flag.\n\nYou can use the `--ipc_synth` boolean flag [default=True] to determine\nwhether to use single-threaded or a buffered, multiprocess synthesis.\n\nThe `--synth_config_file` flag must be given with `--nostatic_data`.\n\nThe\n[MapTextSynthesizer](https:\u002F\u002Fgithub.com\u002Fweinman\u002FMapTextSynthesizer)\nlibrary supports training with dynamically synthesized data. The\nrelevant code can be found within\n[MapTextSynthesizer\u002Ftensorflow\u002Fgenerator](https:\u002F\u002Fgithub.com\u002Fweinman\u002FMapTextSynthesizer\u002Ftree\u002Fsrc\u002Ftensorflow\u002Fgenerator)\n\n# Using a lexicon\n\nBy default, recognition occurs in \"open vocabulary\" mode. That is, the\nsystem observes no constraints on producing the resulting output\nstrings. However, it also has a \"closed vocabulary\" mode that can\nefficiently limit output to a given word list as well as a \"mixed\nvocabulary\" mode that can produce either a vocabulary word from a given\nword list (lexicon) or a non-vocabulary word, depending on the value\nof a prior bias for lexicon words.\n\nUsing the closed or mixed vocabulary modes requires additional\nsoftware.  This repository is connected with a \n[fork of Harald Scheidl's CTCWordBeamSearch](https:\u002F\u002Fgithub.com\u002Fweinman\u002FCTCWordBeamSearch), obtainable as follows:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fweinman\u002FCTCWordBeamSearch\ncd CTCWordBeamSearch\ngit checkout var_seq_len\n```\n\nThen follow the build instructions, which may be as simple as running\n\n```bash\ncd cpp\u002Fproj\n.\u002FbuildTF.sh\n```\n\nTo use, make sure `CTCWordBeamSearch\u002Fcpp\u002Fproj` (the directory\ncontaining `TFWordBeamSearch.so`) is in the `LD_LIBRARY_PATH` when\nrunning `test.py` or `validate.py` (in this repository). \n\n# API Notes\n\nThis version uses the TensorFlow (v1.14)\n[Dataset](https:\u002F\u002Fwww.tensorflow.org\u002Fguide\u002Fdatasets) for fast\nI\u002FO. Training, testing, validation, and prediction use a custom\n[Estimator](https:\u002F\u002Fwww.tensorflow.org\u002Fguide\u002Festimators).\n\n# Citing this work\n\nPlease cite the following [paper](https:\u002F\u002Fweinman.cs.grinnell.edu\u002Fpubs\u002Fweinman19deep.pdf) if you use this code in your own research work:\n\n```text\n@inproceedings{ weinman19deep,\n    author = {Jerod Weinman and Ziwen Chen and Ben Gafford and Nathan Gifford and Abyaya Lamsal and Liam Niehus-Staab},\n    title = {Deep Neural Networks for Text Detection and Recognition in Historical Maps},\n    booktitle = {Proc. IAPR International Conference on Document Analysis and Recognition},\n    month = {Sep.},\n    year = {2019},\n    location = {Sydney, Australia},\n    doi = {10.1109\u002FICDAR.2019.00149}\n} \n```\n\n# Acknowledgment\n\nThis work was supported in part by the National Science Foundation\nunder grant Grant Number\n[1526350](http:\u002F\u002Fwww.nsf.gov\u002Fawardsearch\u002FshowAward.do?AwardNumber=1526350).\n","# 概述\n\n本集合展示了如何使用卷积神经网络特征作为输入，结合CTC损失函数，构建并训练一个深层、双向的堆叠LSTM模型，以实现鲁棒的单词识别。\n\n该模型是Shi等人提出的CRNN架构（arXiv:1507.0571）的直接改编。提供的代码会下载并使用Jaderberg等人的人工合成数据集（IJCV 2016，DOI: 10.1007\u002Fs11263-015-0823-z），即MJSynth数据集进行训练。\n\n值得注意的是，当在大小写不敏感且词汇表固定的MJSynth数据集上进行训练和测试时，该模型的测试单词错误率（1.82%）低于[CRNN](https:\u002F\u002Fgithub.com\u002Fbgshih\u002Fcrnn)。\n\n代码基于Python 2.7编写，需要TensorFlow >=1.10版本（虽然TF>1.10会出现弃用警告，但代码仍可正常运行）。\n\n该模型及其后续实验在[Weinman等人的ICDAR 2019论文](https:\u002F\u002Fweinman.cs.grinnell.edu\u002Fpubs\u002Fweinman19deep.pdf)中有更详细的描述。\n\n# 结构\n\n该模型结合了Shi等人的CRNN架构（arXiv:1507.0571）和VGG深度卷积网络的特点，通过堆叠成对的小型3x3卷积核来减少参数量。此外，池化操作也在水平方向上进行了限制，以保留用于字符识别的分辨率。每个字符至少需要一个水平方向上的特征元素。\n\n假设输入图像为32x32像素，各层的尺寸变化如下：\n\n| 层 | 操作   | 卷积核大小 | 步幅(v,h) | 输出尺寸 | H  | W  | 填充方式 |\n|:---:|--------|------------|-----------|----------|----|----|----------|\n| 1   | 卷积   | 3          | 1         | 64       | 30 | 30 | valid    |\n| 2   | 卷积   | 3          | 1         | 64       | 30 | 30 | same     |\n|     | 池化   | 2          | 2         | 64       | 15 | 15 |          |\n| 3   | 卷积   | 3          | 1         | 128      | 15 | 15 | same     |\n| 4   | 卷积   | 3          | 1         | 128      | 15 | 15 | same     |\n|     | 池化   | 2          | 2,1       | 128      | 7  | 14 |          |\n| 5   | 卷积   | 3          | 1         | 256      | 7  | 14 | same     |\n| 6   | 卷积   | 3          | 1         | 256      | 7  | 14 | same     |\n|     | 池化   | 2          | 2,1       | 256      | 3  | 13 |          |\n| 7   | 卷积   | 3          | 1         | 512      | 3  | 13 | same     |\n| 8   | 卷积   | 3          | 1         | 512      | 3  | 13 | same     |\n|     | 池化   | 3          | 3,1       | 512      | 1  | 13 |          |\n| 9   | LSTM   |            |           | 512      |    |    |          |\n| 10  | LSTM   |            |           | 512      |    |    |          |\n\n为了加速训练，在每个池化层之前加入了批归一化层，并在整个网络中使用ReLU非线性激活函数。其他模型细节可以在代码中轻松找到。\n\n默认的训练机制使用ADAM优化器，并配合学习率衰减策略。\n\n## 与CRNN的区别\n\n### 更深的早期卷积层\n原始CRNN在前两个卷积\u002F池化阶段仅使用单个3x3卷积层，而本网络则采用了成对的3x3卷积核序列。这一改动增加了网络早期阶段的理论感受野。\n\n作为权衡，我们省略了CRNN中计算开销较大的2x2x512最终卷积层。取而代之的是，本网络在剩余的三行特征上进行垂直最大池化，从而在每个水平位置上将特征压缩为一个512维的特征向量。\n\n这些改动的组合既保持了最终CNN层的理论感受野大小，又将需要学习的卷积参数数量减少了15%。\n\n### 填充方式\n另一个重要区别在于第一卷积层没有使用零填充，这可能会导致边缘区域出现虚假的强响应。通过将第一卷积限制在有效区域内，该模型会从响应特征图中去除最外层的像素值（高度从32减小到30，宽度减少两个像素）。\n\n这种方法似乎优于让网络去学习忽略靠近图像边缘的强卷积响应（可能通过削弱后续卷积层的滤波器强度来实现）。\n\n### 批归一化\n我们在每一对卷积之后都加入了批归一化层（即上述编号的第2、4、6和8层）。而CRNN在其前两个卷积阶段并未使用批归一化。因此，我们的模型需要更多的计算资源，以期减少达到收敛所需的训练迭代次数。\n\n### 下采样\u002F步幅\nCRNN的前两个池化阶段在两个空间维度上均以步幅2进行下采样。而本模型则只在第一个池化阶段之后进行水平方向的下采样，以保持序列长度。\n\n由于输出特征图必须为每个预测的字符提供至少一个时间切片，过度的下采样可能导致无法表示或预测非常紧凑或狭窄的字符序列。通过减少水平方向的下采样，本模型能够识别窄字体中的单词。\n\n然而，水平分辨率的提高也意味着LSTM需要捕捉更多信息。因此，本模型使用了512个隐藏单元，而CRNN仅使用256个。我们发现，更大的隐藏单元数对于获得良好的性能是必要的。\n\n# 训练\n\n要完整训练该模型，您需要下载MJSynth数据集并将其打包成分片的TensorFlow记录文件。然后可以启动训练进程、TensorBoard监控以及持续的评估线程。相关命令已封装在随附的`Makefile`中。\n\n    make mjsynth-download\n    make mjsynth-tfrecord\n    make train &\n    make monitor &\n    make test\n\n要监控训练过程，只需在浏览器中访问TensorBoard输出给出的URL（例如，http:\u002F\u002F127.0.1.1:8008）即可。\n\n请注意，下载完整的MJSynth数据集可能需要4至12小时。我们还包含了一个极小的数据子集（0.1%）的示例数据；若要运行小型演示，可跳过涉及`mjsynth`的前两行命令。\n\n在GeForce GTX 1080显卡上，演示大约需要20分钟才能使验证字符错误率达到45%（使用默认参数）；在一小时左右（约7000次迭代）时，验证错误率略高于20%。\n\n使用完整的训练数据，经过一百万次迭代后，模型通常会收敛到约5%的训练字符错误率和27.5%的单词错误率。\n\n## 检查点\n[预训练模型检查点](http:\u002F\u002Fhdl.handle.net\u002F11084\u002F23328)，DOI:[11084\u002F23328](http:\u002F\u002Fhdl.handle.net\u002F11084\u002F23328)，被用于生成以下论文中的结果：\n\n> Weinman, J. 等人 (2019) 深度神经网络在历史地图中文本检测与识别中的应用。载于ICDAR会议论文集。\n\n# 测试\n\n评估脚本（`src\u002Fevaluate.py`）会逐批流式输出验证（或评估）数据的统计信息。它会打印当前迭代次数、评估批次损失、标签错误率（预测错误的字符百分比）以及序列错误率（预测错误的整个单词序列百分比）。\n\n测试脚本（`src\u002Ftest.py`）则会汇总所有数据的统计信息，并最终进行归一化处理。它会打印损失值、标签错误率、总标签数、序列错误率、总序列数，以及标签错误率和序列错误率。\n\n# 验证\n\n为了查看一小部分样本的输出，验证脚本（`src\u002Fvalidation.py`）允许您加载模型，并通过进程的标准输入一次读取一张图像，然后为每张图像打印解码后的输出。例如：\n\n    cd src ; python validate.py \u003C ~\u002Fpaths_to_images.txt\n\n或者，您也可以在终端中逐行输入图像路径（每行一个路径），并在完成输入后按 Control-D 键来让模型对已输入的内容进行推理。\n\n# 配置\n\n有许多命令行选项可用于配置训练参数。运行 `train.py` 或 `test.py` 并加上 `--help` 标志即可查看这些选项，或者直接检查脚本代码。模型参数无法通过命令行配置，需要在代码中进行编辑（参见 `src\u002Fmodel.py`）。\n\n# 动态训练数据\n\n通过设置 `--nostatic_data` 标志，可以使用动态数据进行训练或测试。\n\n您可以使用 `--ipc_synth` 布尔标志 [默认值为 True] 来决定是使用单线程合成，还是使用带缓冲的多进程合成。\n\n当使用 `--nostatic_data` 时，必须同时指定 `--synth_config_file` 标志。\n\n[MapTextSynthesizer](https:\u002F\u002Fgithub.com\u002Fweinman\u002FMapTextSynthesizer) 库支持使用动态合成的数据进行训练。相关代码可以在 [MapTextSynthesizer\u002Ftensorflow\u002Fgenerator](https:\u002F\u002Fgithub.com\u002Fweinman\u002FMapTextSynthesizer\u002Ftree\u002Fsrc\u002Ftensorflow\u002Fgenerator) 中找到。\n\n# 使用词表\n\n默认情况下，识别以“开放词汇”模式进行。也就是说，系统对生成的输出字符串没有任何限制。不过，该系统还提供“封闭词汇”模式，可以将输出高效地限制在给定的词表范围内；以及“混合词汇”模式，可以根据预设的词表优先级，选择生成词表中的词汇或非词表词汇。\n\n使用封闭或混合词汇模式需要额外的软件。本仓库与 Harald Scheidl 的 CTCWordBeamSearch 的一个分支版本相连接，可通过以下方式获取：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fweinman\u002FCTCWordBeamSearch\ncd CTCWordBeamSearch\ngit checkout var_seq_len\n```\n\n然后按照构建说明操作，通常只需运行：\n\n```bash\ncd cpp\u002Fproj\n.\u002FbuildTF.sh\n```\n\n使用时，请确保在运行本仓库中的 `test.py` 或 `validate.py` 时，`CTCWordBeamSearch\u002Fcpp\u002Fproj` 目录（包含 `TFWordBeamSearch.so` 文件）位于 `LD_LIBRARY_PATH` 环境变量中。\n\n# API 注意事项\n\n此版本使用 TensorFlow (v1.14) 的 [Dataset](https:\u002F\u002Fwww.tensorflow.org\u002Fguide\u002Fdatasets) 接口实现高效的 I\u002FO 操作。训练、测试、验证和预测均采用自定义的 [Estimator](https:\u002F\u002Fwww.tensorflow.org\u002Fguide\u002Festimators) 实现。\n\n# 引用本工作\n\n如果您在自己的研究工作中使用了本代码，请引用以下论文：\n\n```text\n@inproceedings{ weinman19deep,\n    author = {Jerod Weinman and Ziwen Chen and Ben Gafford and Nathan Gifford and Abyaya Lamsal and Liam Niehus-Staab},\n    title = {Deep Neural Networks for Text Detection and Recognition in Historical Maps},\n    booktitle = {Proc. IAPR International Conference on Document Analysis and Recognition},\n    month = {Sep.},\n    year = {2019},\n    location = {Sydney, Australia},\n    doi = {10.1109\u002FICDAR.2019.00149}\n} \n```\n\n# 致谢\n\n本研究工作得到了美国国家科学基金会的部分资助，资助编号为 [1526350](http:\u002F\u002Fwww.nsf.gov\u002Fawardsearch\u002FshowAward.do?AwardNumber=1526350)。","# cnn_lstm_ctc_ocr 快速上手指南\n\n本指南基于 `cnn_lstm_ctc_ocr` 项目 README 整理，旨在帮助开发者快速构建并训练一个基于 CNN-LSTM-CTC 架构的鲁棒文字识别模型。该模型是 CRNN 架构的改进版，在 MJSynth 数据集上表现优异。\n\n## 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n*   **操作系统**: Linux 或 macOS (Windows 需配置相应兼容环境)\n*   **Python 版本**: Python 2.7 (注：项目原生为 Py2 编写，虽 TF>1.10 有警告但仍可运行。若需在 Python 3 运行，可能需要自行修改代码适配)\n*   **深度学习框架**: TensorFlow >= 1.10 (推荐 v1.14，利用 Dataset API 加速 I\u002FO)\n*   **硬件建议**: NVIDIA GPU (如 GeForce GTX 1080 或更高)，用于加速训练过程\n*   **构建工具**: `make`, `git`\n\n## 安装步骤\n\n### 1. 克隆代码库\n首先获取源代码：\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fweinman\u002Fcnn_lstm_ctc_ocr.git\ncd cnn_lstm_ctc_ocr\n```\n\n### 2. 准备数据与训练\n项目提供了 `Makefile` 来自动化数据处理和训练流程。\n\n**方案 A：完整训练（下载 MJSynth 数据集）**\n*注意：完整数据集下载可能需要 4-12 小时。*\n```bash\nmake mjsynth-download\nmake mjsynth-tfrecord\nmake train &\nmake monitor &\nmake test\n```\n\n**方案 B：快速演示（使用内置小样本）**\n如果仅想验证流程，可跳过大数据集下载，直接使用内置的 0.1% 示例数据：\n```bash\n# 直接运行训练和监控（跳过前两步 mjsynth 相关命令）\nmake train &\nmake monitor &\nmake test\n```\n*在 GTX 1080 上，演示模式约 20 分钟即可看到验证字符错误率下降。*\n\n### 3. 可选：安装词典搜索模块（封闭词表模式）\n默认情况下模型处于“开放词表”模式。若需使用“封闭词表”或“混合词表”模式以提高特定词汇表的识别率，需编译额外的 CTCWordBeamSearch 库：\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fweinman\u002FCTCWordBeamSearch\ncd CTCWordBeamSearch\ngit checkout var_seq_len\ncd cpp\u002Fproj\n.\u002FbuildTF.sh\n```\n编译完成后，确保运行测试时将生成的 `.so` 文件路径加入 `LD_LIBRARY_PATH`。\n\n## 基本使用\n\n### 监控训练进度\n启动训练后，可以通过 TensorBoard 实时监控损失和准确率。根据终端输出的 URL 访问（通常为本地地址）：\n```text\nhttp:\u002F\u002F127.0.1.1:8008\n```\n*(请在浏览器中打开实际输出的地址)*\n\n### 单张图片推理验证\n使用 `validate.py` 脚本加载模型并对单张或多张图片进行识别测试。\n\n**方法一：通过文件列表输入**\n创建一个包含图片路径的文件（例如 `paths_to_images.txt`），然后运行：\n```bash\ncd src\npython validate.py \u003C ~\u002Fpaths_to_images.txt\n```\n\n**方法二：交互式输入**\n直接在终端逐行输入图片路径，输入完成后按 `Ctrl+D` 执行识别：\n```bash\ncd src\npython validate.py\n# 输入图片路径...\n# 输入图片路径...\n# 按 Ctrl+D 结束输入并查看结果\n```\n\n### 评估模型性能\n若需统计整个验证集的详细指标（如字符错误率 CER、单词错误率 WER），可使用评估脚本：\n```bash\npython src\u002Fevaluate.py\n```\n或使用汇总统计脚本：\n```bash\npython src\u002Ftest.py\n```\n\n### 配置说明\n*   **训练参数**: 大多数超参数（如学习率、优化器等）可通过命令行 `--help` 查看并配置。\n*   **模型结构**: 网络层数、卷积核大小等核心架构参数需直接编辑 `src\u002Fmodel.py` 文件。\n*   **动态数据合成**: 若需使用动态合成数据训练，需添加 `--nostatic_data` 标志并配合 `MapTextSynthesizer` 库使用。","某物流科技公司正在开发自动化系统，旨在从每日数万张模糊、倾斜的快递面单图片中快速提取收件人姓名和地址信息。\n\n### 没有 cnn_lstm_ctc_ocr 时\n- **识别率低下**：传统 OCR 工具面对面单上常见的轻微形变或低分辨率字符时，错误率极高，导致大量数据需要人工二次核对。\n- **上下文缺失**：基于单字符识别的模型无法利用字母间的序列依赖关系，常将\"0\"误识为\"O\"，或将连笔字拆解为无意义的符号。\n- **预处理繁琐**：为了适配旧模型，工程师必须编写复杂的代码先对图像进行精确的字符分割和去噪，开发周期长且维护成本高。\n- **训练效果瓶颈**：即便尝试微调现有开源模型，由于网络结构较浅且缺乏针对序列优化的损失函数，在封闭词库下的单词错误率始终难以降至 5% 以下。\n\n### 使用 cnn_lstm_ctc_ocr 后\n- **鲁棒性显著提升**：借助 CNN 提取深层特征结合双向 LSTM 的序列建模能力，即使面对模糊或倾斜的面单，也能实现端到端的精准识别。\n- **语义纠错增强**：通过 CTC 损失函数训练，模型能自动学习字符间的上下文逻辑，有效纠正形近字错误，大幅降低单词级别的识别误差。\n- **流程极简高效**：无需再进行耗时的字符分割预处理，直接输入原始图像即可输出文本结果，系统将整体开发部署时间缩短了 60%。\n- **精度突破极限**：在类似 MJSynth 的合成数据及真实场景测试中，该模型将单词错误率成功压低到 1.82%，远超传统 CRNN 架构的表现。\n\ncnn_lstm_ctc_ocr 通过深度融合卷积特征与序列建模，以极低的单词错误率解决了复杂场景下非结构化文本的高精度提取难题。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fweinman_cnn_lstm_ctc_ocr_aa3cefda.png","weinman","Jerod Weinman","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fweinman_c0036ec4.jpg","Professor of Computer Science","Grinnell College, @grinnell-cs ","Grinnell, Iowa",null,"https:\u002F\u002Fweinman.cs.grinnell.edu","https:\u002F\u002Fgithub.com\u002Fweinman",[83,87],{"name":84,"color":85,"percentage":86},"Python","#3572A5",99.1,{"name":88,"color":89,"percentage":90},"Makefile","#427819",0.9,502,169,"2026-02-11T08:55:15","GPL-3.0",4,"Linux","需要 NVIDIA GPU (文中示例使用 GeForce GTX 1080)，显存未明确说明但建议 4GB+，CUDA 版本需与 TensorFlow >=1.10 兼容","未说明",{"notes":100,"python":101,"dependencies":102},"1. 代码主要为 Python 2.7 编写，虽在 TF>1.10 上有弃用警告但仍可运行。2. 完整训练需下载 MJSynth 数据集（耗时 4-12 小时），也可使用自带的 0.1% 示例数据运行演示。3. 若使用封闭或混合词表模式，需额外编译安装 CTCWordBeamSearch 库并配置 LD_LIBRARY_PATH。4. 演示训练在 GTX 1080 上约需 20 分钟至 1 小时可见初步效果，完整收敛需约一百万次迭代。","2.7",[103,104],"tensorflow>=1.10","CTCWordBeamSearch (可选，用于封闭词表模式)",[14,15],[107,108,109,110,111,112],"ocr","tensorflow","text-recognition","ctc","lstm","convolutional-neural-networks","2026-03-27T02:49:30.150509","2026-04-18T22:45:07.550166",[116,121,126,131,136,141,146],{"id":117,"question_zh":118,"answer_zh":119,"source_url":120},40980,"训练模型时经常错误识别字符 'u' 或数字 '8'、'9'，可能是什么原因？","这通常与训练超参数设置有关。建议调整衰减率（decay rate）为 1，并重新审视批次大小（batch size）、学习率（learning rate）以及最大步数（max number of steps）的设置。您可以参考相关讨论中的调度策略进行调整。","https:\u002F\u002Fgithub.com\u002Fweinman\u002Fcnn_lstm_ctc_ocr\u002Fissues\u002F42",{"id":122,"question_zh":123,"answer_zh":124,"source_url":125},40981,"使用 TensorFlow 1.12 训练时出现报错，如何解决？","这是一个类型问题。请在 `src\u002Ftrain.py` 文件中，将 `data_args` 字典里的 `batch_size` 值显式转换为整数。具体修改如下：\n将:\n`'batch_size': gpu_batch_size,`\n修改为:\n`'batch_size': int(gpu_batch_size),`\n这样可以修复该错误。","https:\u002F\u002Fgithub.com\u002Fweinman\u002Fcnn_lstm_ctc_ocr\u002Fissues\u002F49",{"id":127,"question_zh":128,"answer_zh":129,"source_url":130},40982,"是否有预训练的模型可以直接下载用于测试？","有的。基于 ICDAR 2019 论文并使用 MapTextSynth 数据集训练的模型检查点（checkpoint）已发布。下载地址为：https:\u002F\u002Fweinman.cs.grinnell.edu\u002Fdata\u002Fcnn_lstm_ctc_ocr_checkpoint_icdar19.tar.bz2","https:\u002F\u002Fgithub.com\u002Fweinman\u002Fcnn_lstm_ctc_ocr\u002Fissues\u002F40",{"id":132,"question_zh":133,"answer_zh":134,"source_url":135},40983,"运行 validate.py 进行验证时速度非常慢（每张图需 30 秒），如何加速？","速度慢的主要原因是解码器（decoder）在处理 logits 时耗时较长。此外，环境配置至关重要。强烈建议使用 Python 2.7 创建 Conda 虚拟环境，并安装 tensorflow-gpu 1.12.0，以确保与 CUDA 和 cuDNN 的兼容性。推荐命令如下：\n`conda create -n yourenvname python=2.7`\n`conda install -c anaconda tensorflow-gpu==1.12.0`\n最近的成功案例是在本地编译的 tf 1.12.0 (CUDA 9.2, CUDNN 7.1.4) 上运行的。","https:\u002F\u002Fgithub.com\u002Fweinman\u002Fcnn_lstm_ctc_ocr\u002Fissues\u002F31",{"id":137,"question_zh":138,"answer_zh":139,"source_url":140},40984,"在 Python 3 环境下运行 mjsynth-tfrecord.py 脚本报语法错误或读取错误，怎么办？","该脚本原本是为 Python 2 编写的。在 Python 3 中，除了需要将 `print` 语句改为函数形式（加括号）外，文件读取错误通常是因为默认以文本模式打开文件，而实际需要字节模式。请确保在打开文件时添加 `'b'` 标志（例如 `open(..., 'rb')`），以正确处理二进制数据。维护者已确认此修复方法有效并已更新代码。","https:\u002F\u002Fgithub.com\u002Fweinman\u002Fcnn_lstm_ctc_ocr\u002Fissues\u002F28",{"id":142,"question_zh":143,"answer_zh":144,"source_url":145},40985,"运行 validate.py 时遇到 \"TypeError: __init__() got an unexpected keyword argument 'session_config'\" 错误，如何解决？","这个问题通常是由于 TensorFlow 版本与 Python 版本不兼容导致的（特别是在 Windows 上使用较新版本的 Python 时）。最直接的解决方案是切换到 Python 2.7 环境运行代码。维护者指出这可能是 TensorFlow Python 3 版本的问题，而非仓库代码本身的问题。","https:\u002F\u002Fgithub.com\u002Fweinman\u002Fcnn_lstm_ctc_ocr\u002Fissues\u002F44",{"id":147,"question_zh":148,"answer_zh":149,"source_url":150},40986,"为什么在图像预处理函数中将像素值缩放到 [-0.5, 0.5] 而不是 [0, 1]？","虽然原始讨论被截断，但通常在深度学习 OCR 任务中，将输入数据归一化到均值为 0 的区间（如 [-0.5, 0.5] 或 [-1, 1]）有助于加速模型收敛并提高训练稳定性，这比缩放到 [0, 1] 更能满足某些激活函数（如 tanh）的输入分布需求。","https:\u002F\u002Fgithub.com\u002Fweinman\u002Fcnn_lstm_ctc_ocr\u002Fissues\u002F22",[]]