[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-yuanli2333--Teacher-free-Knowledge-Distillation":3,"tool-yuanli2333--Teacher-free-Knowledge-Distillation":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 真正成长为懂上",156804,2,"2026-04-15T11:34:33",[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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[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":76,"owner_email":76,"owner_twitter":76,"owner_website":78,"owner_url":79,"languages":80,"stars":85,"forks":86,"last_commit_at":87,"license":88,"difficulty_score":10,"env_os":89,"env_gpu":90,"env_ram":89,"env_deps":91,"category_tags":95,"github_topics":96,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":102,"updated_at":103,"faqs":104,"releases":140},7840,"yuanli2333\u002FTeacher-free-Knowledge-Distillation","Teacher-free-Knowledge-Distillation","Knowledge Distillation: CVPR2020 Oral, Revisiting Knowledge Distillation via Label Smoothing Regularization","Teacher-free-Knowledge-Distillation 是一个基于深度学习的开源项目，旨在解决传统知识蒸馏技术中必须依赖强大“教师模型”的痛点。在常规场景中，训练高性能的学生模型往往需要先耗费巨大算力去训练一个更强的教师模型，这在资源受限或学生模型本身已非常强大（如 ResNeXt101）时显得极不划算甚至无法实现。\n\n该项目源自 CVPR 2020 的口头报告论文，提出了一种创新的“无教师”框架。其核心亮点在于利用标签平滑正则化（Label Smoothing Regularization）和自训练策略，让模型在没有外部教师指导的情况下自我进化。实验证明，该方法能在不增加额外计算成本的前提下，显著提升现有强力模型的性能。例如，在 ImageNet 数据集上可将 ResNeXt101 的准确率进一步提升 0.48%，在 CIFAR100 上帮助 ResNeXt29 提升超过 1%。此外，项目还探讨了“反向蒸馏”等有趣现象，即小模型也能辅助大模型学习。\n\n这款工具非常适合人工智能研究人员、算法工程师以及需要优化模型性能但受限于计算资源的开发者使用。它提供了完整的 PyTo","Teacher-free-Knowledge-Distillation 是一个基于深度学习的开源项目，旨在解决传统知识蒸馏技术中必须依赖强大“教师模型”的痛点。在常规场景中，训练高性能的学生模型往往需要先耗费巨大算力去训练一个更强的教师模型，这在资源受限或学生模型本身已非常强大（如 ResNeXt101）时显得极不划算甚至无法实现。\n\n该项目源自 CVPR 2020 的口头报告论文，提出了一种创新的“无教师”框架。其核心亮点在于利用标签平滑正则化（Label Smoothing Regularization）和自训练策略，让模型在没有外部教师指导的情况下自我进化。实验证明，该方法能在不增加额外计算成本的前提下，显著提升现有强力模型的性能。例如，在 ImageNet 数据集上可将 ResNeXt101 的准确率进一步提升 0.48%，在 CIFAR100 上帮助 ResNeXt29 提升超过 1%。此外，项目还探讨了“反向蒸馏”等有趣现象，即小模型也能辅助大模型学习。\n\n这款工具非常适合人工智能研究人员、算法工程师以及需要优化模型性能但受限于计算资源的开发者使用。它提供了完整的 PyTorch 实现代码和预训练模型，支持 CIFAR 和 Tiny-ImageNet 等主流数据集，帮助用户轻松复现前沿研究成果，以更低成本挖掘模型的潜在能力。","# Teacher-free-Knowledge-Distillation\n## Implementation for our paper: Revisiting Knowledge Distillation via Label Smoothing Regularization, [arxiv](https:\u002F\u002Fscholar.google.com\u002Fscholar?hl=en&as_sdt=0%2C22&q=Revisit+Knowledge+Distillation%3A+a+Teacher-free+Framework+Yuan&btnG=) \n\nThe paper in arxiv and CVPR2020 has different titles: Revisiting Knowledge Distillation via Label Smoothing Regularization and Revisit Knowledge Distillation (CVPR) a Teacher-free Framework (arxiv), we will update the arxiv version with the correct title.\n\nOur work suggests that: when a neural network is too powerful to find stronger teacher models, or computation resource is limited to train teacher models, \"self-training\" or \"manually-designed regularization\" can be applied. \n\nFor example, ResNeXt101-32x8d is a powerful model with 88.79M parameters and 16.51G FLOPs on ImageNet, and it is hard or computation expensive to train a stronger teacher model for this student. Our strategy can further improve this powerful student model by 0.48\\% without extra computation on ImageNet. Similarly, when taking a powerful single model ResNeXt29-8x64d with 34.53M parameters as a student model, our self-training implementation achieves more than 1.0\\% improvement on CIFAR100 (from 81.03\\% to 82.08\\%).\n\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyuanli2333_Teacher-free-Knowledge-Distillation_readme_5f128b1ee70d.png)\n\n\n\n## 1. Preparations\n\nClone this repository:\n```\ngit clone https:\u002F\u002Fgithub.com\u002Fyuanli2333\u002FTeacher-free-Knowledge-Distillation.git\n```\n\n### 1.1 Environment\nBuild a new environment and install:\n```\npip install -r requirements.txt\n```\n\nBetter use: NVIDIA GPU + CUDA9.0 + Pytorch 1.2.0\n\nPlease do not use other versions of pytorch, otherwise, some experiment results may not be reproduced because some slight difference would make the hyper-parameters different. \n\n### 1.2 Dataset\n[CIFAR100](https:\u002F\u002Fwww.cs.toronto.edu\u002F~kriz\u002Fcifar.html), [CIFAR10](https:\u002F\u002Fwww.cs.toronto.edu\u002F~kriz\u002Fcifar.html) and [Tiny_ImageNet](https:\u002F\u002Ftiny-imagenet.herokuapp.com\u002F);\nFor CIFAR100 and CIFAR10, our codes will download the datasets automatically. For Tiny-ImageNet, you should download and put in the dir: \"data\u002F\". The follow instruction and commands are for CIFAR100.\n\n## 2. Train baseline models\nYou can skip this step by using our pre-trained models in [here](https:\u002F\u002Fgithub.com\u002Fyuanli2333\u002FTeacher-free-Knowledge-Distillation\u002Freleases\u002Fdownload\u002Fcheckpoint\u002Fpretrained_teacher_models.zip). Download and unzip to: experiments\u002Fpretrained_teacher_models\u002F\n\n\nUse ''--model_dir'' to specify the directory of \"parameters\", model saving and log saving.\n\nFor example, normally train ResNet18 to obtain the pre-trained teacher:\n```\nCUDA_VISIBLE_DEVICES=0 python main.py --model_dir experiments\u002Fbase_experiments\u002Fbase_resnet18\u002F\n```\nWe ignore the command ''CUDA_VISIBLE_DEVICES=gpu_id'' in the following commands\n\nNormally train MobileNetV2 to obtain the baseline model and baseline accuracy:\n```\npython main.py --model_dir experiments\u002Fbase_experiments\u002Fbase_mobilenetv2\u002F\n```\n\nNormally train ResNeXt29 to obtain the baseline model and baseline accuracy:\n```\npython main.py --model_dir experiments\u002Fbase_experiments\u002Fbase_resnext29\u002F\n```\nThe baseline accuracy (in %) on CIFAR100 is:\n\n| Model  |  Baseline Acc |\n| :---     |    :---:   | \n| MobileNetV2 |    68.38   |\n| ShuffleNetV2  |    70.34  |   \n| ResNet18 |    75.87   |   \n| ResNet50 |    78.16   |  \n| GoogLeNet |    78.72  | \n| Desenet121 |   79.04  |   \n| ResNeXt29 |   81.03  |   \n \n  \n\n## 3. Exploratory experiments (Section 2 in our paper)\n\n\n### 3.1 Reversed KD (Re-KD)\nNormal KD: ResNet18 teach MobileNetV2\n```\npython main.py --model_dir experiments\u002Fkd_experiments\u002Fmobilenet_v2_distill\u002Fresnet18_teacher\u002F\n```\n\n\nRe-KD: MobileNetV2 teach ResNet18\n```\npython main.py --model_dir experiments\u002Fkd_experiments\u002Fresnet18_distill\u002Fmobilenet_v2_teacher\u002F\n```\n\nRe-KD: ShuffleNetV2 teach ResNet18\n```\npython main.py --model_dir experiments\u002Fkd_experiments\u002Fresnet18_distill\u002Fshufflenet_v2_teacher\u002F\n```\n\nRe-KD experiment results on CIFAR100: \n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyuanli2333_Teacher-free-Knowledge-Distillation_readme_5262a911b500.png)\n\n### 3.2 Defective KD (De-KD)\nUse the arguments \"--pt_teacher\" to switch to Defective KD experiment.\n\nFor expample, use a pooly-trained Teacher ResNet18 with 15.48% accuracy (just trained one epoch) to teach MobileNetV2:\n\n```\npython main.py --model_dir experiments\u002Fkd_experiments\u002Fmobilenet_v2_distill\u002Fresnet18_teacher\u002F --pt_teacher\n```\n\nUse one-epoch trained teacher ResNet18 to teach ShuffleNetV2:\n```\npython main.py --model_dir experiments\u002Fkd_experiments\u002Fshufflenet_v2_distill\u002Fresnet18_teacher\u002F --pt_teacher\n```\n\nUse 50-epoch-trained teacher ResNet50 (acc:45.82%) to teach ShuffleNetV2:\n```\npython main.py --model_dir experiments\u002Fkd_experiments\u002Fshufflenet_v2_distill\u002Fresnet50_teacher\u002F --pt_teacher\n```\nUse 50-epoch-trained teacher ResNet50 (acc:45.82%) to teach ResNet18:\n```\npython main.py --model_dir experiments\u002Fkd_experiments\u002Fresnet18_distill\u002Fresnet50_teacher\u002F --pt_teacher\n```\nUse 50-epoch-trained teacher ResNeXt29 (acc:51.94%) to teach MobileNetV2:\n```\npython main.py --model_dir experiments\u002Fkd_experiments\u002Fmobilenet_v2_distill\u002Fresnext29_teacher\u002F --pt_teacher\n```\nDe-KD experiment results on CIFAR100: \n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyuanli2333_Teacher-free-Knowledge-Distillation_readme_6818fc93dc8c.png)\n\n## 4. Teacher-free KD (Tf-KD)  (Section 5 in our paper)\nWe have two implementations to achieve Tf-KD, the first one is self-training, the second one is manually-designed teacher(regularization)\n\n### 4.1 Tf-KD self-training\nUse the arguments ''--self_training'' to control this training. The --model_dir should be experiment dirctory, should be \"experiments\u002Fkd_experiments\u002Fstudent\u002Fstudent_self_teacher\"\n\nMobileNetV2 self training:\n```\npython main.py --model_dir experiments\u002Fkd_experiments\u002Fmobilenet_v2_distill\u002Fmobilenet_self_teacher\u002F --self_training\n```\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyuanli2333_Teacher-free-Knowledge-Distillation_readme_19d01c75d156.jpg)\n\nShuffleNetV2 self training:\n```\npython main.py --model_dir experiments\u002Fkd_experiments\u002Fshufflenet_v2_distill\u002Fshufflenet_self_teacher\u002F --self_training\n```\n\nResNet18 self training:\n```\npython main.py --model_dir experiments\u002Fkd_experiments\u002Fresnet18_distill\u002Fresnet18_self_teacher\u002F --self_training\n```\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyuanli2333_Teacher-free-Knowledge-Distillation_readme_fff441a84fea.jpg)\n\nOur method achieve more than 1.0% improvement for a big single model ResNeXt29, run self-training for ResNeXt29:\n```\npython main.py --model_dir experiments\u002Fkd_experiments\u002Fresnext29_distill\u002Fresnext29_self_teacher\u002F --self_training\n```\n\nTf-KD self-training experiment results on CIFAR100: \n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyuanli2333_Teacher-free-Knowledge-Distillation_readme_9543a9788ab4.png)\n\n\n### 4.2 Tf-KD manually-designed teacher(regularization)\n\nMobileNetV2 taught by mannually-designed regularization:\n```\npython main.py --model_dir experiments\u002Fbase_experiments\u002Fbase_mobilenetv2\u002F  --regularization\n```\n\nShuffleNetV2 taught by mannually-designed regularization:\n```\npython main.py --model_dir experiments\u002Fbase_experiments\u002Fbase_shufflenetv2\u002F --regularization\n```\n\n\nResNet18 taught by mannually-designed regularization:\n```\npython main.py --model_dir experiments\u002Fbase_experiments\u002Fbase_resnet18\u002F  --regularization\n```\n\nGoogLeNet taught by mannually-designed regularization:\n\n```\npython main.py --model_dir experiments\u002Fbase_experiments\u002Fbase_googlenet\u002F --regularization\n```\n\n\n### 4.3 Lable Smoothing Regularization\n\nMobileNetV2 Lable Smoothing:\n```\npython main.py --model_dir experiments\u002Fbase_experiments\u002Fbase_mobilenetv2\u002F  --label_smoothing\n```\n\nShuffleNetV2 Lable Smoothing:\n```\npython main.py --model_dir experiments\u002Fbase_experiments\u002Fbase_shufflenetv2\u002F --label_smoothing\n```\n\nTf-KD regularization and LSR experiment results on CIFAR100: \n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyuanli2333_Teacher-free-Knowledge-Distillation_readme_906404499fde.png)\n\n\n\n\n### Reference\nIf you find this repo useful, please consider citing:\n```\n@inproceedings{yuan2020revisiting,\n  title={Revisiting Knowledge Distillation via Label Smoothing Regularization},\n  author={Yuan, Li and Tay, Francis EH and Li, Guilin and Wang, Tao and Feng, Jiashi},\n  booktitle={Proceedings of the IEEE\u002FCVF Conference on Computer Vision and Pattern Recognition},\n  pages={3903--3911},\n  year={2020}\n}\n```\n","# 无教师知识蒸馏\n## 我们论文的实现：通过标签平滑正则化重访知识蒸馏，[arxiv](https:\u002F\u002Fscholar.google.com\u002Fscholar?hl=en&as_sdt=0%2C22&q=Revisit+Knowledge+Distillation%3A+a+Teacher-free+Framework+Yuan&btnG=) \n\narxiv和CVPR2020上的论文标题有所不同：分别为“通过标签平滑正则化重访知识蒸馏”和“重访知识蒸馏（CVPR）——一种无教师框架（arxiv）”，我们将更新arxiv版本以使用正确的标题。\n\n我们的工作表明：当神经网络过于强大以至于难以找到更强的教师模型时，或者计算资源有限而无法训练教师模型时，可以采用“自训练”或“手动设计的正则化”方法。\n\n例如，ResNeXt101-32x8d是一个强大的模型，在ImageNet上具有88.79M参数和16.51G FLOPs，因此为该学生模型训练一个更强的教师模型既困难又昂贵。而我们的策略可以在不增加额外计算量的情况下，使这个强大的学生模型在ImageNet上的准确率再提升0.48%。类似地，当以一个拥有34.53M参数的强大单模型ResNeXt29-8x64d作为学生模型时，我们的自训练实现能够在CIFAR100上带来超过1.0%的性能提升（从81.03%提高到82.08%）。\n\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyuanli2333_Teacher-free-Knowledge-Distillation_readme_5f128b1ee70d.png)\n\n\n\n## 1. 准备工作\n\n克隆本仓库：\n```\ngit clone https:\u002F\u002Fgithub.com\u002Fyuanli2333\u002FTeacher-free-Knowledge-Distillation.git\n```\n\n### 1.1 环境\n创建一个新的环境并安装依赖：\n```\npip install -r requirements.txt\n```\n\n推荐使用：NVIDIA GPU + CUDA9.0 + Pytorch 1.2.0\n\n请勿使用其他版本的PyTorch，否则部分实验结果可能无法复现，因为细微的差异会导致超参数设置不同。\n\n### 1.2 数据集\n[CIFAR100](https:\u002F\u002Fwww.cs.toronto.edu\u002F~kriz\u002Fcifar.html)、[CIFAR10](https:\u002F\u002Fwww.cs.toronto.edu\u002F~kriz\u002Fcifar.html)以及[Tiny_ImageNet](https:\u002F\u002Ftiny-imagenet.herokuapp.com\u002F)；\n对于CIFAR100和CIFAR10，我们的代码会自动下载数据集。而对于Tiny-ImageNet，您需要自行下载并放置在“data\u002F”目录下。以下说明和命令均以CIFAR100为例。\n\n## 2. 训练基线模型\n您也可以跳过此步骤，直接使用我们在此处提供的预训练模型：[这里](https:\u002F\u002Fgithub.com\u002Fyuanli2333\u002FTeacher-free-Knowledge-Distillation\u002Freleases\u002Fdownload\u002Fcheckpoint\u002Fpretrained_teacher_models.zip)。下载并解压至：experiments\u002Fpretrained_teacher_models\u002F\n\n\n使用“--model_dir”指定保存模型参数、模型及日志的目录。\n\n例如，正常训练ResNet18以获得预训练的教师模型：\n```\nCUDA_VISIBLE_DEVICES=0 python main.py --model_dir experiments\u002Fbase_experiments\u002Fbase_resnet18\u002F\n```\n在后续命令中，我们省略了“CUDA_VISIBLE_DEVICES=gpu_id”的部分。\n\n正常训练MobileNetV2以获得基线模型及其基线准确率：\n```\npython main.py --model_dir experiments\u002Fbase_experiments\u002Fbase_mobilenetv2\u002F\n```\n\n正常训练ResNeXt29以获得基线模型及其基线准确率：\n```\npython main.py --model_dir experiments\u002Fbase_experiments\u002Fbase_resnext29\u002F\n```\nCIFAR100上的基线准确率（%）如下：\n\n| 模型  | 基线准确率 |\n| :---     |    :---:   | \n| MobileNetV2 |    68.38   |\n| ShuffleNetV2  |    70.34  |   \n| ResNet18 |    75.87   |   \n| ResNet50 |    78.16   |  \n| GoogLeNet |    78.72  | \n| Desenet121 |   79.04  |   \n| ResNeXt29 |   81.03  |   \n\n  \n\n## 3. 探索性实验（我们论文的第2节）\n\n\n### 3.1 反向KD（Re-KD）\n常规KD：ResNet18教导MobileNetV2\n```\npython main.py --model_dir experiments\u002Fkd_experiments\u002Fmobilenet_v2_distill\u002Fresnet18_teacher\u002F\n```\n\n\n反向KD：MobileNetV2教导ResNet18\n```\npython main.py --model_dir experiments\u002Fkd_experiments\u002Fresnet18_distill\u002Fmobilenet_v2_teacher\u002F\n```\n\n反向KD：ShuffleNetV2教导ResNet18\n```\npython main.py --model_dir experiments\u002Fkd_experiments\u002Fresnet18_distill\u002Fshufflenet_v2_teacher\u002F\n```\n\nCIFAR100上的反向KD实验结果：\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyuanli2333_Teacher-free-Knowledge-Distillation_readme_5262a911b500.png)\n\n### 3.2 劣质KD（De-KD）\n使用“--pt_teacher”参数切换到劣质KD实验。\n\n例如，使用仅训练了一个epoch、准确率为15.48%的低质量教师ResNet18来教导MobileNetV2：\n\n```\npython main.py --model_dir experiments\u002Fkd_experiments\u002Fmobilenet_v2_distill\u002Fresnet18_teacher\u002F --pt_teacher\n```\n\n使用训练了一个epoch的教师ResNet18来教导ShuffleNetV2：\n```\npython main.py --model_dir experiments\u002Fkd_experiments\u002Fshufflenet_v2_distill\u002Fresnet18_teacher\u002F --pt_teacher\n```\n\n使用训练了50个epoch、准确率为45.82%的教师ResNet50来教导ShuffleNetV2：\n```\npython main.py --model_dir experiments\u002Fkd_experiments\u002Fshufflenet_v2_distill\u002Fresnet50_teacher\u002F --pt_teacher\n```\n\n使用训练了50个epoch、准确率为45.82%的教师ResNet50来教导ResNet18：\n```\npython main.py --model_dir experiments\u002Fkd_experiments\u002Fresnet18_distill\u002Fresnet50_teacher\u002F --pt_teacher\n```\n\n使用训练了50个epoch、准确率为51.94%的教师ResNeXt29来教导MobileNetV2：\n```\npython main.py --model_dir experiments\u002Fkd_experiments\u002Fmobilenet_v2_distill\u002Fresnext29_teacher\u002F --pt_teacher\n```\n\nCIFAR100上的劣质KD实验结果：\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyuanli2333_Teacher-free-Knowledge-Distillation_readme_6818fc93dc8c.png)\n\n## 4. 无教师KD（Tf-KD）（我们论文的第5节）\n我们有两种实现Tf-KD的方法，第一种是自训练，第二种是手动设计的教师（正则化）。\n\n### 4.1 Tf-KD 自训练\n使用“--self_training”参数控制此训练过程。--model_dir应指向实验目录，即“experiments\u002Fkd_experiments\u002Fstudent\u002Fstudent_self_teacher”。\n\nMobileNetV2自训练：\n```\npython main.py --model_dir experiments\u002Fkd_experiments\u002Fmobilenet_v2_distill\u002Fmobilenet_self_teacher\u002F --self_training\n```\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyuanli2333_Teacher-free-Knowledge-Distillation_readme_19d01c75d156.jpg)\n\nShuffleNetV2自训练：\n```\npython main.py --model_dir experiments\u002Fkd_experiments\u002Fshufflenet_v2_distill\u002Fshufflenet_self_teacher\u002F --self_training\n```\n\nResNet18自训练：\n```\npython main.py --model_dir experiments\u002Fkd_experiments\u002Fresnet18_distill\u002Fresnet18_self_teacher\u002F --self_training\n```\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyuanli2333_Teacher-free-Knowledge-Distillation_readme_fff441a84fea.jpg)\n\n对于大型单模型ResNeXt29，我们的方法实现了超过1.0%的性能提升，运行ResNeXt29的自训练：\n```\npython main.py --model_dir experiments\u002Fkd_experiments\u002Fresnext29_distill\u002Fresnext29_self_teacher\u002F --self_training\n```\n\nCIFAR100上的Tf-KD自训练实验结果：\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyuanli2333_Teacher-free-Knowledge-Distillation_readme_9543a9788ab4.png)\n\n### 4.2 Tf-KD 手动设计的教师模型（正则化）\n\n使用手动设计的正则化方法训练 MobileNetV2：\n```\npython main.py --model_dir experiments\u002Fbase_experiments\u002Fbase_mobilenetv2\u002F  --regularization\n```\n\n使用手动设计的正则化方法训练 ShuffleNetV2：\n```\npython main.py --model_dir experiments\u002Fbase_experiments\u002Fbase_shufflenetv2\u002F --regularization\n```\n\n\n使用手动设计的正则化方法训练 ResNet18：\n```\npython main.py --model_dir experiments\u002Fbase_experiments\u002Fbase_resnet18\u002F  --regularization\n```\n\n使用手动设计的正则化方法训练 GoogLeNet：\n\n```\npython main.py --model_dir experiments\u002Fbase_experiments\u002Fbase_googlenet\u002F --regularization\n```\n\n\n### 4.3 标签平滑正则化\n\nMobileNetV2 标签平滑：\n```\npython main.py --model_dir experiments\u002Fbase_experiments\u002Fbase_mobilenetv2\u002F  --label_smoothing\n```\n\nShuffleNetV2 标签平滑：\n```\npython main.py --model_dir experiments\u002Fbase_experiments\u002Fbase_shufflenetv2\u002F --label_smoothing\n```\n\n\nTf-KD 正则化和 LSR 在 CIFAR100 上的实验结果：\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyuanli2333_Teacher-free-Knowledge-Distillation_readme_906404499fde.png)\n\n\n\n\n### 参考文献\n如果您觉得本仓库对您有帮助，请考虑引用以下文献：\n```\n@inproceedings{yuan2020revisiting,\n  title={通过标签平滑正则化重新审视知识蒸馏},\n  author={Yuan, Li 和 Tay, Francis EH 和 Li, Guilin 和 Wang, Tao 和 Feng, Jiashi},\n  booktitle={IEEE\u002FCVF 计算机视觉与模式识别会议论文集},\n  pages={3903--3911},\n  year={2020}\n}\n```","# Teacher-free-Knowledge-Distillation 快速上手指南\n\n本指南帮助开发者快速部署并运行“无教师知识蒸馏”（Teacher-free Knowledge Distillation）框架。该框架适用于无法训练强大教师模型或计算资源受限的场景，通过自训练或人工设计的正则化提升模型性能。\n\n## 1. 环境准备\n\n### 系统要求\n- **操作系统**: Linux (推荐)\n- **GPU**: NVIDIA GPU\n- **CUDA**: 9.0 (严格建议，版本差异可能导致超参数失效，影响复现结果)\n- **Python**: 兼容 PyTorch 1.2.0 的版本\n\n### 前置依赖\n- **PyTorch**: 1.2.0 (请勿使用其他版本，以确保实验结果可复现)\n- **数据集**:\n  - CIFAR10\u002FCIFAR100：代码会自动下载。\n  - Tiny-ImageNet：需手动下载并放置于 `data\u002F` 目录下。\n\n## 2. 安装步骤\n\n### 2.1 克隆仓库\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fyuanli2333\u002FTeacher-free-Knowledge-Distillation.git\ncd Teacher-free-Knowledge-Distillation\n```\n\n### 2.2 安装依赖\n创建新环境并安装所需包：\n```bash\npip install -r requirements.txt\n```\n> **提示**：国内用户建议使用清华源或阿里源加速安装，例如：\n> `pip install -r requirements.txt -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple`\n\n### 2.3 准备预训练模型（可选）\n若跳过基线训练步骤，可下载官方提供的预训练教师模型：\n```bash\n# 下载并解压到 experiments\u002Fpretrained_teacher_models\u002F 目录\n# 链接：https:\u002F\u002Fgithub.com\u002Fyuanli2333\u002FTeacher-free-Knowledge-Distillation\u002Freleases\u002Fdownload\u002Fcheckpoint\u002Fpretrained_teacher_models.zip\n```\n\n## 3. 基本使用\n\n以下示例基于 **CIFAR100** 数据集。所有命令均通过 `--model_dir` 指定参数、模型保存及日志目录。\n\n### 3.1 训练基线模型\n正常训练一个模型（如 ResNet18）作为基准：\n```bash\nCUDA_VISIBLE_DEVICES=0 python main.py --model_dir experiments\u002Fbase_experiments\u002Fbase_resnet18\u002F\n```\n*注：后续命令省略 `CUDA_VISIBLE_DEVICES` 部分，请根据实际显卡 ID 添加。*\n\n### 3.2 无教师知识蒸馏 (Tf-KD)\n本框架提供两种核心实现方式：\n\n#### 方式一：自训练 (Self-Training)\n学生模型将自己作为教师进行蒸馏。以 MobileNetV2 为例：\n```bash\npython main.py --model_dir experiments\u002Fkd_experiments\u002Fmobilenet_v2_distill\u002Fmobilenet_self_teacher\u002F --self_training\n```\n\n对于大型单模型（如 ResNeXt29），该方法可带来超过 1.0% 的性能提升：\n```bash\npython main.py --model_dir experiments\u002Fkd_experiments\u002Fresnext29_distill\u002Fresnext29_self_teacher\u002F --self_training\n```\n\n#### 方式二：人工设计正则化 (Manually-designed Regularization)\n无需教师模型，直接通过正则化项模拟蒸馏效果。以 MobileNetV2 为例：\n```bash\npython main.py --model_dir experiments\u002Fbase_experiments\u002Fbase_mobilenetv2\u002F --regularization\n```\n\n### 3.3 标签平滑正则化 (Label Smoothing)\n作为对比或独立优化手段，可启用标签平滑：\n```bash\npython main.py --model_dir experiments\u002Fbase_experiments\u002Fbase_mobilenetv2\u002F --label_smoothing\n```\n\n### 3.4 探索性实验（可选）\n- **反向蒸馏 (Re-KD)**: 让小模型教大模型（如 MobileNetV2 教 ResNet18）：\n  ```bash\n  python main.py --model_dir experiments\u002Fkd_experiments\u002Fresnet18_distill\u002Fmobilenet_v2_teacher\u002F\n  ```\n- **缺陷蒸馏 (De-KD)**: 使用训练不充分（低精度）的教师模型：\n  ```bash\n  python main.py --model_dir experiments\u002Fkd_experiments\u002Fmobilenet_v2_distill\u002Fresnet18_teacher\u002F --pt_teacher\n  ```","某自动驾驶初创公司的算法团队正致力于将高精度的 ResNeXt 模型部署到算力受限的车载边缘设备上，需要在不增加额外训练成本的前提下进一步压榨模型性能。\n\n### 没有 Teacher-free-Knowledge-Distillation 时\n- **缺乏更强教师模型**：ResNeXt 本身已是团队能训练的最强模型，传统知识蒸馏因找不到更强大的“教师网”而无法实施。\n- **训练成本高昂**：若强行构建更大的教师模型进行指导，所需的 GPU 显存和计算时间将超出项目预算和周期限制。\n- **性能遭遇瓶颈**：基线模型在复杂路况下的识别准确率停滞在 81.03%，难以通过常规调参获得显著提升。\n- **正则化手段有限**：现有的手动设计正则化方法效果边际递减，无法有效挖掘模型自身的泛化潜力。\n\n### 使用 Teacher-free-Knowledge-Distillation 后\n- **实现自我蒸馏**：利用工具提供的自训练框架，让 ResNeXt 模型自己充当教师，无需外部更强模型即可启动蒸馏过程。\n- **零额外计算开销**：直接在现有训练流程中引入标签平滑正则化策略，未增加任何额外的推理或训练计算量（FLOPs）。\n- **精度显著突破**：在 CIFAR-100 数据集上，模型准确率从 81.03% 提升至 82.08%，实现了超过 1% 的免费性能增益。\n- **资源利用最大化**：在有限的硬件资源下，成功突破了单一模型的性能天花板，满足了车载端对高可靠性的严苛要求。\n\nTeacher-free-Knowledge-Distillation 的核心价值在于打破了知识蒸馏必须依赖强大教师模型的桎梏，让顶级模型也能通过“自我进化”以零成本实现性能跃迁。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyuanli2333_Teacher-free-Knowledge-Distillation_19d01c75.jpg","yuanli2333","YuanLi","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fyuanli2333_8e4f4e13.jpg",null,"PKU-Yuan-Lab","https:\u002F\u002Fyuanli2333.github.io\u002F","https:\u002F\u002Fgithub.com\u002Fyuanli2333",[81],{"name":82,"color":83,"percentage":84},"Python","#3572A5",100,584,67,"2026-03-21T13:42:24","MIT","未说明","必需 NVIDIA GPU，推荐 CUDA 9.0",{"notes":92,"python":89,"dependencies":93},"强烈建议使用 PyTorch 1.2.0 版本，使用其他版本可能导致超参数差异从而无法复现实验结果。数据集方面，CIFAR10\u002F100 会自动下载，Tiny-ImageNet 需手动下载并放入 'data\u002F' 目录。",[94],"torch==1.2.0",[14],[97,98,99,100,101],"knowledge-distillation","pytorch","teacher-free","paper-implementations","label-smoothing","2026-03-27T02:49:30.150509","2026-04-16T02:09:03.385559",[105,110,115,120,125,130,135],{"id":106,"question_zh":107,"answer_zh":108,"source_url":109},35136,"Tf-KD 的两种方法（自训练和正则化）与现有的 Born Again Network (BAN) 或标签平滑正则化 (LSR) 有什么区别？","第一种 Tf-KD 方法（自训练）本质上等同于 Born Again Network (BAN)。第二种方法（Tf-KD_reg）虽然形式上与标签平滑正则化 (LSR) 相似，都是单热分布与均匀分布的混合，但通过引入温度参数（temperature）软化分布，其核心思想是将一个随机准确率的“老师”（输出均匀分布）转化为一个更高准确率的“老师”。在 CIFAR100 数据集上，实践发现将目标模型的输出温度设为 1 效果更好，而在 Tiny-ImageNet 和 ImageNet 上则使用较高的温度参数。","https:\u002F\u002Fgithub.com\u002Fyuanli2333\u002FTeacher-free-Knowledge-Distillation\u002Fissues\u002F2",{"id":111,"question_zh":112,"answer_zh":113,"source_url":114},35137,"代码中计算 KL 散度损失时为什么没有使用 `batch_mean`？如果使用了会有什么影响？","未在代码中默认使用 `batch_mean` 并非错误。如果在计算损失时加入 `batch_mean`（即按批次大小取平均），算法仍然有效，但这会影响超参数的选择。具体来说，你需要重新搜索超参数（特别是 alpha 值），因为新的平均值会导致原有的超参数配置不再最优。如果直接使用提供的超参数（如 alpha=1）并开启 batch_mean 导致实验失败，这是正常现象，需要针对新的损失计算方式重新进行超参数调优。","https:\u002F\u002Fgithub.com\u002Fyuanli2333\u002FTeacher-free-Knowledge-Distillation\u002Fissues\u002F5",{"id":116,"question_zh":117,"answer_zh":118,"source_url":119},35138,"该方法是否适用于更深的网络架构（如 PreResNet-164 或 ResNeXt）？如何调整超参数？","该方法可以应用于更深的网络，但超参数（如温度 T 和 alpha）是依赖于具体模型架构的。论文中主要报告了较浅网络的结果，但这不代表方法不适用于深网络。用户可以通过编写 Python 或 Bash 脚本，遍历不同的 T 和 alpha 值传入 `main.py` 来自动搜索适合特定深网络模型的超参数。注意务必使用从训练集中划分出的验证集来进行超参数搜索。","https:\u002F\u002Fgithub.com\u002Fyuanli2333\u002FTeacher-free-Knowledge-Distillation\u002Fissues\u002F17",{"id":121,"question_zh":122,"answer_zh":123,"source_url":124},35139,"代码实现中的 KL 散度项 $D_{KL}(p^t_{\\tau}, p)$ 与论文公式中的 $D_{KL}(p^t_{\\tau}, p_{\\tau})$ 不一致（缺少温度参数），这会影响结果吗？","这种差异通常不会影响最终性能，因为缺失的温度参数部分在梯度计算中表现为常数，不会改变梯度方向。不过，针对不同数据集策略有所不同：在 CIFAR100 上，将目标模型的输出温度设为 1（即代码中的写法）效果反而更好；而在 Tiny-ImageNet 和 ImageNet 上，则应遵循论文使用较高的温度参数。这是一种基于实验观察的实践优化。","https:\u002F\u002Fgithub.com\u002Fyuanli2333\u002FTeacher-free-Knowledge-Distillation\u002Fissues\u002F3",{"id":126,"question_zh":127,"answer_zh":128,"source_url":129},35140,"为什么在部分 CIFAR100 的实验代码中，损失函数里有一个 'multiplier'（乘数）参数？它的作用是什么？","'multiplier' 参数仅用于 CIFAR100 数据集上的少数模型实验。由于 CIFAR100 的 100 个类别分为 20 个超类，许多不同类别的图像在粗粒度上非常相似，导致硬标签（hard labels）不够“准确”。在这种情况下，通过增加 multiplier 来增强正则化强度，可以让模型更多地从软标签（soft labels）中学习，而不是过度依赖有噪声的硬标签。对于大多数实验，该参数默认为 1（即不使用额外乘数）。","https:\u002F\u002Fgithub.com\u002Fyuanli2333\u002FTeacher-free-Knowledge-Distillation\u002Fissues\u002F6",{"id":131,"question_zh":132,"answer_zh":133,"source_url":134},35141,"项目代码中的 ResNet 架构与论文中描述的原始 ResNet 网络结构看起来不同，这是为什么？","这是因为数据集不同导致的架构差异。代码中的 `resnet.py` 是专门针对 CIFAR10 或 CIFAR100 数据集设计的版本，而论文中可能引用的是针对 ImageNet 的原始 ResNet。主要区别在于第一层：CIFAR 版本的 ResNet 通常使用较小的卷积核（如 3x3）且没有最大池化层，以适应 32x32 的小分辨率输入；而 ImageNet 版本第一层通常是 7x7 卷积加池化，适用于 224x224 的大分辨率输入。这是 ResNet 在不同数据集上的标准变体。","https:\u002F\u002Fgithub.com\u002Fyuanli2333\u002FTeacher-free-Knowledge-Distillation\u002Fissues\u002F13",{"id":136,"question_zh":137,"answer_zh":138,"source_url":139},35142,"我在 arXiv 上找不到论文标题提到的 \"Revisiting Knowledge Distillation via Label Smoothing Regularization\"，只找到了 \"Revisit Knowledge Distillation: a Teacher-free Framework\"，它们是同一篇论文吗？","是的，这是同一篇论文。作者在向 CVPR 投稿时更改了论文标题。仓库中提到的旧标题是早期版本使用的，新标题 \"Revisit Knowledge Distillation: a Teacher-free Framework\" 是正式发表在 CVPR 2020 后的最终标题。","https:\u002F\u002Fgithub.com\u002Fyuanli2333\u002FTeacher-free-Knowledge-Distillation\u002Fissues\u002F10",[141],{"id":142,"version":143,"summary_zh":76,"released_at":144},280150,"checkpoint","2022-02-11T14:04:28"]