[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-yukimasano--self-label":3,"tool-yukimasano--self-label":62},[4,18,26,35,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},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,2,"2026-04-10T11:39:34",[14,15,13],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":32,"last_commit_at":41,"category_tags":42,"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",[43,13,15,14],"插件",{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":10,"last_commit_at":50,"category_tags":51,"status":17},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,"2026-04-06T11:19:32",[52,15,13,14],"语言模型",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":10,"last_commit_at":59,"category_tags":60,"status":17},4292,"Deep-Live-Cam","hacksider\u002FDeep-Live-Cam","Deep-Live-Cam 是一款专注于实时换脸与视频生成的开源工具，用户仅需一张静态照片，即可通过“一键操作”实现摄像头画面的即时变脸或制作深度伪造视频。它有效解决了传统换脸技术流程繁琐、对硬件配置要求极高以及难以实时预览的痛点，让高质量的数字内容创作变得触手可及。\n\n这款工具不仅适合开发者和技术研究人员探索算法边界，更因其极简的操作逻辑（仅需三步：选脸、选摄像头、启动），广泛适用于普通用户、内容创作者、设计师及直播主播。无论是为了动画角色定制、服装展示模特替换，还是制作趣味短视频和直播互动，Deep-Live-Cam 都能提供流畅的支持。\n\n其核心技术亮点在于强大的实时处理能力，支持口型遮罩（Mouth Mask）以保留使用者原始的嘴部动作，确保表情自然精准；同时具备“人脸映射”功能，可同时对画面中的多个主体应用不同面孔。此外，项目内置了严格的内容安全过滤机制，自动拦截涉及裸露、暴力等不当素材，并倡导用户在获得授权及明确标注的前提下合规使用，体现了技术发展与伦理责任的平衡。",88924,"2026-04-06T03:28:53",[14,15,13,61],"视频",{"id":63,"github_repo":64,"name":65,"description_en":66,"description_zh":67,"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":80,"owner_website":81,"owner_url":82,"languages":83,"stars":92,"forks":93,"last_commit_at":94,"license":95,"difficulty_score":10,"env_os":96,"env_gpu":97,"env_ram":98,"env_deps":99,"category_tags":107,"github_topics":109,"view_count":32,"oss_zip_url":79,"oss_zip_packed_at":79,"status":17,"created_at":116,"updated_at":117,"faqs":118,"releases":119},6235,"yukimasano\u002Fself-label","self-label","Self-labelling via simultaneous clustering and representation learning. (ICLR 2020)","self-label 是一款基于深度学习的开源工具，旨在无需人工标注的情况下，自动为图像数据生成高质量标签。它核心解决了无监督学习中“聚类”与“特征表示学习”难以协同优化的难题：传统方法简单结合两者往往导致模型退化或陷入局部最优解，而 self-label 通过最大化标签与输入数据索引间的互信息，将问题转化为可高效求解的最优传输问题。\n\n该工具特别适合人工智能研究人员和开发者使用，尤其是那些希望在缺乏标注数据的环境下（如医学影像、特定领域数据集）训练高性能图像分类模型的技术团队。其独特技术亮点在于创新性地引入了 Sinkhorn-Knopp 算法的快速变体，使其能够从容应对百万级图像和数千类别的大规模训练场景。在 ImageNet、CIFAR 等主流基准测试中，self-label 助力 AlexNet 和 ResNet-50 等经典架构取得了当时领先的无监督表征学习性能。此外，项目近期还集成了更先进的数据增强策略（源自 MoCov2），进一步提升了模型的泛化能力和聚类准确度，让研究者能更便捷地复现前沿成果并探索无监督学习的边界。","# Self-labelling via simultaneous clustering and representation learning\n\n🆗🆗🎉 _NEW models (20th August 2020): Added standard SeLa pretrained torchvision ResNet models to make loading much easier + added baselines using better MoCov2 augmentation (~69% LP performance) + added evaluation with K=1000 for ImageNet \"unuspervised clustering\"_\n\n🆕✅🎉 _updated code: 23rd April 2020: bug fixes + CIFAR code + evaluation for resnet & alexnet._\n\nCheckout our [blogpost](http:\u002F\u002Fwww.robots.ox.ac.uk\u002F~vgg\u002Fblog\u002Fself-labelling-via-simultaneous-clustering-and-representation-learning.html) for a quick non-technical overview and an interactive visualization of our clusters.\n\n## Self-Label\n\nThis code is the official implementation of the ICLR 2020 paper [Self-labelling via simultaneous clustering and representation learning](https:\u002F\u002Fopenreview.net\u002Fforum?id=Hyx-jyBFPr).\n\n### Abstract\nCombining clustering and representation learning is one of the most promising\napproaches for unsupervised learning of deep neural networks. However, doing\nso naively leads to ill posed learning problems with degenerate solutions. In this\npaper, we propose a novel and principled learning formulation that addresses\nthese issues. The method is obtained by maximizing the information between\nlabels and input data indices. We show that this criterion extends standard crossentropy minimization to an optimal transport problem, which we solve efficiently\nfor millions of input images and thousands of labels using a fast variant of the\nSinkhorn-Knopp algorithm. The resulting method is able to self-label visual data\nso as to train highly competitive image representations without manual labels. Our\nmethod achieves state of the art representation learning performance for AlexNet\nand ResNet-50 on SVHN, CIFAR-10, CIFAR-100 and ImageNet.\n\n### Results at a glance\n\n|                     | NMI(%) | aNMI(%) | ARI(%) | LP Acc (%) | \n|---------------------|--------|---------|--------|------------|\n| AlexNet 1k          | 50.5   | 12.2    | 2.7    | 42.1       |  \n| AlexNet 10k         | 66.4   | 4.7     | 4.7    | 43.8       |  \n| R50 10x3k           | 54.2   | 34.4    | 7.2    | 61.5       |  \n\n#### With better augmentations (all single crop)\n\n|                      | Label-Acc  | NMI(%) | aNMI(%) | ARI(%) | LP Acc (%) | model_weights |\n|----------------------|------|--------|---------|--------|------------|---------------|\n| Aug++ R18  1k (new)  | 26.9 | 62.7   | 36.4    | 12.5   | 53.3       | [here](http:\u002F\u002Fwww.robots.ox.ac.uk\u002F~vgg\u002Fresearch\u002Fself-label\u002Fasset\u002Fnew_models\u002Fresnet18-1k_pp.pth) |\n| Aug++ R50  1k (new)  | 30.5 | 65.7   | 42.0    | 16.2   | 63.5       | [here](http:\u002F\u002Fwww.robots.ox.ac.uk\u002F~vgg\u002Fresearch\u002Fself-label\u002Fasset\u002Fnew_models\u002Fresnet50-1k_pp.pth) |\n| Aug++ R50 10x3k (new)| 38.1 |75.7   | 52.8    | 27.6   | 68.8       | [here](http:\u002F\u002Fwww.robots.ox.ac.uk\u002F~vgg\u002Fresearch\u002Fself-label\u002Fasset\u002Fnew_models\u002Fresnet50-10x3k_pp.pth) |\n|(MoCo-v2 + k-means**, K=3k)      |  |71.4   | 39.6    | 15.8   | 71.1       |               |\n\n* \"Aug++\" refers to the better augmentations used in SimCLR, taken from the [MoCo-v2 repo](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fmoco\u002Fblob\u002Fmaster\u002Fmain_moco.py#L225), but I still only trained for 280 epochs, with three lr-drops as in [CMC](https:\u002F\u002Fgithub.com\u002FHobbitLong\u002FCMC\u002Fblob\u002Fmaster\u002Ftrain_CMC.py#L50).\n* There are still further improvements to be made with a MLP or training 800 epochs (I train 280), as done in SimCLR, [MoCov2](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fmoco) and [SwAV](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fswav).\n* **MoCo-v2 uses 800 epochs, MLP and cos-lr-schedule. On MoCo-v2 I run k-means (K=3000) on the avg-pooled features (after the MLP-head it's pretty much the same performance) to obtain NMI, aNMI and ARI numbers.\n* Models above use standard torchvision ResNet backbones so loading is now super easy:\n```\nimport torch, torchvision\nmodel = torchvision.models.resnet50(pretrained=False, num_classes=3000)\nckpt = torch.load('resnet50-10x3k_pp.pth')\nmodel.load_state_dict(ckpt['state_dict'])\npseudolabels = ckpt['labels']\n```\n* note on improvement potential: by just using \"aug+\": I get LP-accuracy of 67.2% after 200 epochs. MoCo-v2 with \"aug+\" only has 63.4% after 200 epochs.\n\n## Clusters that were discovered by our method\n*Sorted*\n\n![Imagenet validation images with clusters sorted by imagenet purity](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyukimasano_self-label_readme_3260d6b0f4d8.png)\n\n*Random*\n\n![Imagenet validation images with random clusters](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyukimasano_self-label_readme_2e18b23bbce8.png)\n\nThe edge-colors encode the true imagenet classes (which are not used for training).\nYou can view all clusters [here](http:\u002F\u002Fwww.robots.ox.ac.uk\u002F~vgg\u002Fblog\u002Fself-labelling-via-simultaneous-clustering-and-representation-learning.html).\n\n## Requirements\n* Python >3.6\n* PyTorch > 1.0\n* CUDA\n* Numpy, SciPy\n* also, see requirements.txt\n* (optional:) TensorboardX\n\n## Running our code\nRun the self-supervised training of an AlexNet with the command\n```\n$.\u002Fscripts\u002Falexnet.sh\n```\nor train a ResNet-50 with\n```\n$.\u002Fscripts\u002Fresnet.sh\n```\nNote: you need to specify your dataset directory (it expects a format just like ImageNet with \"train\" and \"val\" folders). You also need to give the code enough GPUs to allow for storage of activations on the GPU. Otherwise you need to use the CPU variant which is significantly slower.\n\nFull documentation of the unsupervised training code `main.py`:\n```\nusage: main.py [-h] [--epochs EPOCHS] [--batch-size BATCH_SIZE] [--lr LR]\n               [--lrdrop LRDROP] [--wd WD] [--dtype {f64,f32}] [--nopts NOPTS]\n               [--augs AUGS] [--paugs PAUGS] [--lamb LAMB] [--cpu]\n               [--arch ARCH] [--archspec {big,small}] [--ncl NCL] [--hc HC]\n               [--device DEVICE] [--modeldevice MODELDEVICE] [--exp EXP]\n               [--workers WORKERS] [--imagenet-path IMAGENET_PATH]\n               [--comment COMMENT] [--log-intv LOG_INTV] [--log-iter LOG_ITER]\n\nPyTorch Implementation of Self-Label\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --epochs EPOCHS       number of epochs\n  --batch-size BATCH_SIZE\n                        batch size (default: 256)\n  --lr LR               initial learning rate (default: 0.05)\n  --lrdrop LRDROP       multiply LR by 0.1 every (default: 150 epochs)\n  --wd WD               weight decay pow (default: (-5)\n  --dtype {f64,f32}     SK-algo dtype (default: f64)\n  --nopts NOPTS         number of pseudo-opts (default: 100)\n  --augs AUGS           augmentation level (default: 3)\n  --paugs PAUGS         for pseudoopt: augmentation level (default: 3)\n  --lamb LAMB           for pseudoopt: lambda (default:25)\n  --cpu                 use CPU variant (slow) (default: off)\n  --arch ARCH           alexnet or resnet (default: alexnet)\n  --archspec {big,small}\n                        alexnet variant (default:big)\n  --ncl NCL             number of clusters per head (default: 3000)\n  --hc HC               number of heads (default: 1)\n  --device DEVICE       GPU devices to use for storage and model\n  --modeldevice MODELDEVICE\n                        GPU numbers on which the CNN runs\n  --exp EXP             path to experiment directory\n  --workers WORKERS     number workers (default: 6)\n  --imagenet-path IMAGENET_PATH\n                        path to folder that contains `train` and `val`\n  --comment COMMENT     name for tensorboardX\n  --log-intv LOG_INTV   save stuff every x epochs (default: 1)\n  --log-iter LOG_ITER   log every x-th batch (default: 200)\n```\n\n## Evaluation\n### Linear Evaluation\nWe provide the linear evaluation methods in this repo.\nSimply download the models via `. .\u002Fscripts\u002Fdownload_models.sh` and then either run `scripts\u002Feval-alexnet.sh` or `scripts\u002Feval-resnet.sh`.\n\n### Pascal VOC\nWe follow the standard evaluation protocols for self-supervised visual representation learning.\n* for Classification: we follow the PyTorch implementation of [DeepCluster](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fdeepcluster) with frozen BatchNorm.\n* for Segmentation: we follow the implmentation from the [Colorization paper](https:\u002F\u002Fgithub.com\u002Frichzhang\u002Fcolorization) which uses the [FCN repo](https:\u002F\u002Fgithub.com\u002Fshelhamer\u002Ffcn.berkeleyvision.org). Note: requires the Caffe framework\n* for Detection: we follow [Krähenbühl et al.'s implementation](https:\u002F\u002Fwww.philkr.net\u002F2001\u002F02\u002F01\u002Fpub\u002F)\nbased on the [Faster RCNN](https:\u002F\u002Fgithub.com\u002Frbgirshick\u002Fpy-faster-rcnn). Note: requires the Caffe framework\n\n## Our extracted pseudolabels\nAs we show in the paper, the pseudolabels we generate from our training can be used to quickly train a neural network with regular cross-entropy.\nMoreover they seem to correctly group together similar images. Hence we provide the labels for everyone to use.\n### AlexNet\nYou can download the pseudolabels from our best (raw) AlexNet model with 10x3000 clusters [here](http:\u002F\u002Fwww.robots.ox.ac.uk\u002F~vgg\u002Fresearch\u002Fself-label\u002Fasset\u002Falexnet-labels.csv).\n### ResNet\nYou can download the pseudolabels from our best ResNet model with 10x3000 clusters [here](http:\u002F\u002Fwww.robots.ox.ac.uk\u002F~vgg\u002Fresearch\u002Fself-label\u002Fasset\u002Fresnet-labels.csv).\n\n## Trained models\nYou can also download our trained models by running\n```\n$.\u002Fscripts\u002Fdownload_models.sh\n```\nUse them like this:\n```\nimport torch\nimport models\nd = torch.load('self-label_models\u002Fresnet-10x3k.pth')\nm = models.resnet(num_classes = [3000]*10)\nm.load_state_dict(d)\n\nd = torch.load('self-label_models\u002Falexnet-10x3k-wRot.pth')\nm = models.alexnet(num_classes = [3000]*10)\nm.load_state_dict(d)\n\n```\n\n## Reference\n\nIf you use this code etc., please cite the following paper:\n\nYuki M. Asano, Christian Rupprecht and Andrea Vedaldi.  \"Self-labelling via simultaneous clustering and representation learning.\" Proc. ICLR (2020)\n\n```\n@inproceedings{asano2020self,\n  title={Self-labelling via simultaneous clustering and representation learning},\n  author={Asano, Yuki M. and Rupprecht, Christian and Vedaldi, Andrea},\n  booktitle={International Conference on Learning Representations (ICLR)},\n  year={2020},\n}\n```\n","# 通过同时进行聚类和表示学习实现自标签化\n\n🆗🆗🎉 _新增模型（2020年8月20日）：添加了标准的 SeLa 预训练 torchvision ResNet 模型，使加载更加方便；增加了使用更优 MoCov2 数据增强的基线模型（无监督学习性能约 69%）；为 ImageNet 的“无监督聚类”任务添加了 K=1000 的评估。_\n\n🆕✅🎉 _更新代码：2020年4月23日：修复了若干 bug + 添加了 CIFAR 数据集的代码 + 为 resnet 和 alexnet 提供了评估功能。_\n\n请查看我们的 [博客文章](http:\u002F\u002Fwww.robots.ox.ac.uk\u002F~vgg\u002Fblog\u002Fself-labelling-via-simultaneous-clustering-and-representation-learning.html)，其中提供了简短的非技术性概述以及我们聚类结果的交互式可视化。\n\n## 自标签化\n\n本代码是 ICLR 2020 论文《通过同时进行聚类和表示学习实现自标签化》的官方实现，论文链接：[https:\u002F\u002Fopenreview.net\u002Fforum?id=Hyx-jyBFPr](https:\u002F\u002Fopenreview.net\u002Fforum?id=Hyx-jyBFPr)。\n\n### 摘要\n将聚类与表示学习相结合，是深度神经网络无监督学习中最有前景的方法之一。然而，若以简单粗暴的方式直接结合，往往会导致病态的学习问题，并产生退化解。在本文中，我们提出了一种新颖且具有理论基础的学习框架，以解决这些问题。该方法的核心思想是最大化标签与输入数据索引之间的互信息。我们证明，这一准则可以将标准的交叉熵最小化扩展为一个最优传输问题，而我们则利用 Sinkhorn-Knopp 算法的高效变体，能够快速求解包含数百万张图像和数千个类别的大规模问题。最终得到的算法能够自动为视觉数据打上标签，从而在无需人工标注的情况下训练出极具竞争力的图像表示模型。我们的方法在 SVHN、CIFAR-10、CIFAR-100 和 ImageNet 数据集上，分别针对 AlexNet 和 ResNet-50 模型，均取得了当前最先进的表示学习性能。\n\n### 结果概览\n\n|                     | NMI(%) | aNMI(%) | ARI(%) | LP 准确率 (%) | \n|---------------------|--------|---------|--------|------------|\n| AlexNet 1k          | 50.5   | 12.2    | 2.7    | 42.1       |  \n| AlexNet 10k         | 66.4   | 4.7     | 4.7    | 43.8       |  \n| R50 10x3k           | 54.2   | 34.4    | 7.2    | 61.5       |  \n\n#### 使用更优数据增强（均为单裁剪）\n\n|                      | 标签准确率 | NMI(%) | aNMI(%) | ARI(%) | LP 准确率 (%) | 模型权重 |\n|----------------------|------|--------|---------|--------|------------|---------------|\n| Aug++ R18  1k (新)  | 26.9 | 62.7   | 36.4    | 12.5   | 53.3       | [此处](http:\u002F\u002Fwww.robots.ox.ac.uk\u002F~vgg\u002Fresearch\u002Fself-label\u002Fasset\u002Fnew_models\u002Fresnet18-1k_pp.pth) |\n| Aug++ R50  1k (新)  | 30.5 | 65.7   | 42.0    | 16.2   | 63.5       | [此处](http:\u002F\u002Fwww.robots.ox.ac.uk\u002F~vgg\u002Fresearch\u002Fself-label\u002Fasset\u002Fnew_models\u002Fresnet50-1k_pp.pth) |\n| Aug++ R50 10x3k (新)| 38.1 |75.7   | 52.8    | 27.6   | 68.8       | [此处](http:\u002F\u002Fwww.robots.ox.ac.uk\u002F~vgg\u002Fresearch\u002Fself-label\u002Fasset\u002Fnew_models\u002Fresnet50-10x3k_pp.pth) |\n|(MoCo-v2 + k-means**, K=3k)      |  |71.4   | 39.6    | 15.8   | 71.1       |               |\n\n* “Aug++” 指的是 SimCLR 中使用的更优数据增强策略，源自 [MoCo-v2 仓库](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fmoco\u002Fblob\u002Fmaster\u002Fmain_moco.py#L225)，但我仍然只训练了 280 个 epoch，并按照 [CMC](https:\u002F\u002Fgithub.com\u002FHobbitLong\u002FCMC\u002Fblob\u002Fmaster\u002Ftrain_CMC.py#L50) 的方式进行了三次学习率衰减。\n* 如果采用 MLP 或训练 800 个 epoch（我只训练了 280 个），并参考 SimCLR、[MoCov2](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fmoco) 和 [SwAV](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fswav) 的做法，仍有进一步提升的空间。\n* **MoCo-v2 使用 800 个 epoch、MLP 和余弦退火学习率调度。在 MoCo-v2 中，我会对平均池化的特征（经过 MLP 头后性能基本一致）运行 k-means 聚类（K=3000），以获得 NMI、aNMI 和 ARI 指标。\n* 上述模型均使用标准的 torchvision ResNet 主干网络，因此加载变得非常简便：\n```\nimport torch, torchvision\nmodel = torchvision.models.resnet50(pretrained=False, num_classes=3000)\nckpt = torch.load('resnet50-10x3k_pp.pth')\nmodel.load_state_dict(ckpt['state_dict'])\npseudolabels = ckpt['labels']\n```\n* 关于改进潜力的说明：仅使用“Aug++”数据增强时，我在训练 200 个 epoch 后获得了 67.2% 的 LP 准确率。而同样使用“Aug++”但训练 200 个 epoch 的 MoCo-v2，其 LP 准确率仅为 63.4%。\n\n## 我们方法发现的聚类\n*按纯度排序*\n\n![按 ImageNet 纯度排序的 ImageNet 验证集图像聚类](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyukimasano_self-label_readme_3260d6b0f4d8.png)\n\n*随机排列*\n\n![ImageNet 验证集图像的随机聚类](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyukimasano_self-label_readme_2e18b23bbce8.png)\n\n图中边的颜色编码了真实的 ImageNet 类别标签（这些标签并未用于训练）。您可以在 [这里](http:\u002F\u002Fwww.robots.ox.ac.uk\u002F~vgg\u002Fblog\u002Fself-labelling-via-simultaneous-clustering-and-representation-learning.html) 查看所有聚类。\n\n## 系统要求\n* Python >3.6\n* PyTorch > 1.0\n* CUDA\n* Numpy、SciPy\n* 另外，请参阅 requirements.txt 文件\n* （可选）TensorboardX\n\n## 运行我们的代码\n运行 AlexNet 的自监督训练，使用以下命令：\n```\n$.\u002Fscripts\u002Falexnet.sh\n```\n或者训练 ResNet-50，使用：\n```\n$.\u002Fscripts\u002Fresnet.sh\n```\n注意：你需要指定数据集目录（它期望的格式与 ImageNet 相同，包含 “train” 和 “val” 文件夹）。此外，你还需要为代码分配足够的 GPU，以便在 GPU 上存储激活值。否则，你将需要使用 CPU 版本，但其速度会显著慢得多。\n\n无监督训练代码 `main.py` 的完整文档如下：\n```\n用法: main.py [-h] [--epochs EPOCHS] [--batch-size BATCH_SIZE] [--lr LR]\n               [--lrdrop LRDROP] [--wd WD] [--dtype {f64,f32}] [--nopts NOPTS]\n               [--augs AUGS] [--paugs PAUGS] [--lamb LAMB] [--cpu]\n               [--arch ARCH] [--archspec {big,small}] [--ncl NCL] [--hc HC]\n               [--device DEVICE] [--modeldevice MODELDEVICE] [--exp EXP]\n               [--workers WORKERS] [--imagenet-path IMAGENET_PATH]\n               [--comment COMMENT] [--log-intv LOG_INTV] [--log-iter LOG_ITER]\n\nPyTorch 实现的自标签方法\n\n可选参数:\n  -h, --help            显示此帮助信息并退出\n  --epochs EPOCHS       训练轮数\n  --batch-size BATCH_SIZE\n                        批量大小（默认：256）\n  --lr LR               初始学习率（默认：0.05）\n  --lrdrop LRDROP       每隔一定轮数将学习率乘以 0.1（默认：每 150 轮）\n  --wd WD               权重衰减指数（默认：-5）\n  --dtype {f64,f32}     SK 算法的数据类型（默认：f64）\n  --nopts NOPTS         伪选项的数量（默认：100）\n  --augs AUGS           数据增强级别（默认：3）\n  --paugs PAUGS         对于伪选项：数据增强级别（默认：3）\n  --lamb LAMB           对于伪选项：lambda 参数（默认：25）\n  --cpu                 使用 CPU 版本（较慢）（默认：关闭）\n  --arch ARCH           使用 AlexNet 或 ResNet（默认：AlexNet）\n  --archspec {big,small}\n                        AlexNet 的变体（默认：big）\n  --ncl NCL             每个头的聚类数量（默认：3000）\n  --hc HC               头的数量（默认：1）\n  --device DEVICE       用于存储和模型计算的 GPU 设备\n  --modeldevice MODELDEVICE\n                        CNN 在其上运行的 GPU 编号\n  --exp EXP             实验目录路径\n  --workers WORKERS     工作线程数（默认：6）\n  --imagenet-path IMAGENET_PATH\n                        包含 `train` 和 `val` 文件夹的路径\n  --comment COMMENT     tensorboardX 的名称\n  --log-intv LOG_INTV   每隔 x 轮保存一次日志（默认：1）\n  --log-iter LOG_ITER   每隔 x 批次记录一次日志（默认：200）\n```\n\n## 评估\n### 线性评估\n我们在该仓库中提供了线性评估的方法。只需通过 `. .\u002Fscripts\u002Fdownload_models.sh` 下载模型，然后运行 `scripts\u002Feval-alexnet.sh` 或 `scripts\u002Feval-resnet.sh` 即可。\n\n### Pascal VOC\n我们遵循自监督视觉表征学习的标准评估协议。\n* 对于分类任务：我们采用 [DeepCluster](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fdeepcluster) 的 PyTorch 实现，并冻结 BatchNorm 层。\n* 对于分割任务：我们使用 [Colorization 论文](https:\u002F\u002Fgithub.com\u002Frichzhang\u002Fcolorization) 中的实现，该实现基于 [FCN 仓库](https:\u002F\u002Fgithub.com\u002Fshelhamer\u002Ffcn.berkeleyvision.org)。注意：需要 Caffe 框架。\n* 对于检测任务：我们遵循 [Krähenbühl 等人](https:\u002F\u002Fwww.philkr.net\u002F2001\u002F02\u002F01\u002Fpub\u002F) 基于 [Faster RCNN](https:\u002F\u002Fgithub.com\u002Frbgirshick\u002Fpy-faster-rcnn) 的实现。注意：需要 Caffe 框架。\n\n## 我们的提取的伪标签\n如论文所示，我们从训练中生成的伪标签可用于快速训练具有常规交叉熵损失的神经网络。此外，这些标签似乎能够正确地将相似的图像归为一类。因此，我们提供这些标签供所有人使用。\n### AlexNet\n你可以从我们最好的（原始）AlexNet 模型下载伪标签，该模型使用 10 组 3000 个聚类，下载链接为：[这里](http:\u002F\u002Fwww.robots.ox.ac.uk\u002F~vgg\u002Fresearch\u002Fself-label\u002Fasset\u002Falexnet-labels.csv)。\n### ResNet\n你可以从我们最好的 ResNet 模型下载伪标签，该模型使用 10 组 3000 个聚类，下载链接为：[这里](http:\u002F\u002Fwww.robots.ox.ac.uk\u002F~vgg\u002Fresearch\u002Fself-label\u002Fasset\u002Fresnet-labels.csv)。\n\n## 训练好的模型\n你也可以通过运行以下命令下载我们训练好的模型：\n```\n$.\u002Fscripts\u002Fdownload_models.sh\n```\n使用方法如下：\n```\nimport torch\nimport models\nd = torch.load('self-label_models\u002Fresnet-10x3k.pth')\nm = models.resnet(num_classes = [3000]*10)\nm.load_state_dict(d)\n\nd = torch.load('self-label_models\u002Falexnet-10x3k-wRot.pth')\nm = models.alexnet(num_classes = [3000]*10)\nm.load_state_dict(d)\n\n```\n\n## 参考文献\n\n如果你使用了这段代码等，请引用以下论文：\n\nYuki M. Asano, Christian Rupprecht 和 Andrea Vedaldi. “通过同时进行聚类和表征学习实现自标签。” ICLR 会议论文集（2020 年）\n\n```\n@inproceedings{asano2020self,\n  title={Self-labelling via simultaneous clustering and representation learning},\n  author={Asano, Yuki M. and Rupprecht, Christian and Vedaldi, Andrea},\n  booktitle={International Conference on Learning Representations (ICLR)},\n  year={2020},\n}\n```","# Self-Label 快速上手指南\n\nSelf-Label 是 ICLR 2020 论文《Self-labelling via simultaneous clustering and representation learning》的官方实现。该工具通过同时进行的聚类和表示学习，在无监督条件下为图像数据生成伪标签，从而训练出具有竞争力的图像表征模型（如 AlexNet, ResNet）。\n\n## 环境准备\n\n在开始之前，请确保您的系统满足以下要求：\n\n*   **操作系统**: Linux (推荐，需支持 CUDA)\n*   **Python**: > 3.6\n*   **深度学习框架**: PyTorch > 1.0\n*   **硬件**: NVIDIA GPU 及对应的 CUDA 环境（CPU 模式显著较慢，仅用于调试）\n*   **核心依赖**:\n    *   NumPy\n    *   SciPy\n    *   TensorboardX (可选，用于可视化日志)\n\n建议创建独立的虚拟环境并安装依赖：\n\n```bash\npip install torch torchvision numpy scipy tensorboardx\n# 或者使用 requirements.txt\npip install -r requirements.txt\n```\n\n> **提示**：国内开发者可使用清华或阿里镜像源加速安装：\n> `pip install -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple torch torchvision numpy scipy tensorboardx`\n\n## 安装步骤\n\n本项目无需复杂的编译安装过程，直接克隆仓库即可使用。\n\n1.  **克隆代码库**\n    ```bash\n    git clone https:\u002F\u002Fgithub.com\u002Fvaleoai\u002Fself-label.git\n    cd self-label\n    ```\n\n2.  **下载预训练模型（可选）**\n    如果您想直接评估或使用作者提供的预训练权重（包含标准的 torchvision ResNet 骨干网络），可以运行以下脚本：\n    ```bash\n    .\u002Fscripts\u002Fdownload_models.sh\n    ```\n\n3.  **准备数据集**\n    代码期望的数据集格式与 ImageNet 标准格式一致，即根目录下包含 `train` 和 `val` 文件夹。\n    *   示例结构：\n        ```text\n        \u002Fpath\u002Fto\u002Fimagenet\u002F\n            ├── train\u002F\n            │   ├── n01440764\u002F\n            │   └── ...\n            └── val\u002F\n                ├── n01440764\u002F\n                └── ...\n        ```\n\n## 基本使用\n\n### 1. 无监督训练\n\n您可以使用提供的脚本快速启动训练。请根据您的硬件资源修改脚本中的数据集路径。\n\n**训练 AlexNet:**\n```bash\n.\u002Fscripts\u002Falexnet.sh\n```\n\n**训练 ResNet-50:**\n```bash\n.\u002Fscripts\u002Fresnet.sh\n```\n\n> **注意**：\n> *   您需要在脚本中指定 `--imagenet-path` 参数指向您的数据集目录。\n> *   训练需要足够的 GPU 显存来存储激活值。如果显存不足，可添加 `--cpu` 参数（速度会非常慢）。\n> *   默认配置针对多 GPU 环境优化。\n\n**自定义训练参数示例：**\n若需手动调整参数（如聚类数量、架构等），可直接调用 `main.py`：\n\n```bash\npython main.py \\\n  --arch resnet \\\n  --ncl 3000 \\\n  --epochs 280 \\\n  --batch-size 256 \\\n  --imagenet-path \u002Fpath\u002Fto\u002Fyour\u002Fdataset \\\n  --exp .\u002Fexperiments\u002Fmy_self_label_run\n```\n\n### 2. 加载预训练模型进行推理\n\n如果您下载了预训练模型，可以使用标准的 PyTorch 方式加载。以下是加载新版 ResNet-50 模型的示例：\n\n```python\nimport torch\nimport torchvision\n\n# 初始化模型 (注意 num_classes 需与预训练时的聚类数一致，此处为 3000)\nmodel = torchvision.models.resnet50(pretrained=False, num_classes=3000)\n\n# 加载权重\nckpt = torch.load('resnet50-10x3k_pp.pth') # 确保文件在当前目录或提供完整路径\nmodel.load_state_dict(ckpt['state_dict'])\n\n# 获取对应的伪标签 (如果需要)\npseudolabels = ckpt['labels']\n\n# 将模型设置为评估模式\nmodel.eval()\n```\n\n### 3. 线性评估 (Linear Evaluation)\n\n训练完成后，通常需要进行线性评估以验证表征质量。\n\n1.  确保已下载模型（参考“安装步骤”）。\n2.  运行评估脚本：\n    ```bash\n    # 评估 AlexNet\n    .\u002Fscripts\u002Feval-alexnet.sh\n    \n    # 评估 ResNet\n    .\u002Fscripts\u002Feval-resnet.sh\n    ```\n\n### 4. 使用生成的伪标签\n\nSelf-Label 生成的伪标签可用于通过常规交叉熵损失快速微调神经网络。您可以直接从作者提供的链接下载 CSV 格式的标签文件（AlexNet 或 ResNet 版本），并在您的自定义训练循环中作为 Ground Truth 使用。","某电商初创公司的算法团队正试图利用仓库中积累的百万级未标注商品图片，训练一个能够自动分类的视觉模型以优化库存管理。\n\n### 没有 self-label 时\n- **人工标注成本高昂**：面对海量无标签数据，团队需雇佣大量兼职人员手动打标，耗时数月且预算严重超支。\n- **模型性能遭遇瓶颈**：直接采用传统无监督聚类方法（如 K-means）往往得到退化解，导致提取的特征表示能力差，下游分类准确率极低。\n- **数据长尾难以处理**：对于种类繁多的长尾商品，人工定义类别困难，且容易因标注标准不一引入噪声，干扰模型训练。\n- **迭代周期漫长**：每次调整数据策略都需重新进行人工标注，导致模型迭代周期以周为单位，无法快速响应业务需求。\n\n### 使用 self-label 后\n- **实现全自动伪标签生成**：self-label 通过同时优化聚类与表征学习，利用 Sinkhorn-Knopp 算法自动为百万级图片分配高质量伪标签，完全省去了人工标注环节。\n- **特征表达能力显著提升**：该方法将交叉熵最小化扩展为最优传输问题，避免了退化解，在 ImageNet 等数据集上实现了接近有监督学习的特征提取效果（LP Acc 达 68.8%）。\n- **自适应发现潜在类别**：无需预先定义具体类别数量，self-label 能根据数据分布自动挖掘潜在的商品簇，有效覆盖了长尾商品种类。\n- **研发效率大幅飞跃**：团队可直接加载预训练的 ResNet 权重启动训练，将原本数周的标注与调优过程缩短至几天内完成，加速了模型上线进程。\n\nself-label 通过将聚类与表征学习深度融合，让企业在零人工标注成本下，也能训练出具备业界领先竞争力的视觉模型。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyukimasano_self-label_3260d6b0.png","yukimasano","Yuki M. Asano","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fyukimasano_26d9a036.png","I'm an Computer Vision researcher at the University of Amsterdam. Did my PhD at the Visual Geometry Group in Oxford. ","University of Oxford ","Oxford",null,"y_m_asano","https:\u002F\u002Fyukimasano.github.io\u002F","https:\u002F\u002Fgithub.com\u002Fyukimasano",[84,88],{"name":85,"color":86,"percentage":87},"Python","#3572A5",96.7,{"name":89,"color":90,"percentage":91},"Shell","#89e051",3.3,546,53,"2026-04-06T10:37:18","MIT","Linux","必需 NVIDIA GPU。README 指出需要足够的 GPU 数量以在显存中存储激活值，否则需使用显著较慢的 CPU 模式。未明确具体显存大小和 CUDA 版本，但需支持 PyTorch > 1.0。","未说明",{"notes":100,"python":101,"dependencies":102},"1. 数据集格式要求：需指定数据集目录，格式必须与 ImageNet 类似，包含'train'和'val'文件夹。\n2. 性能警告：如果 GPU 显存不足以存储激活值，代码将回退到 CPU 模式，速度会显著变慢。\n3. 部分评估任务（如分割和检测）依赖 Caffe 框架。\n4. 具体的依赖包列表请参阅项目中的 requirements.txt 文件。",">3.6",[103,104,105,106],"PyTorch>1.0","Numpy","SciPy","TensorboardX (可选)",[15,108],"其他",[110,111,112,113,114,115],"iclr2020","self-supervised-learning","representation-learning","clustering","resnet","resnet-v2","2026-03-27T02:49:30.150509","2026-04-10T20:46:13.407706",[],[]]