Experimental ONNX conversion of kaloscope model.These need a re-export because i didnt specify dynamic axes during export which probably locked the model behind batch size = 1; otherwise they seem to work perfectly fine
25th oct: replaced existing onnx files with new exports that use dynamo=False and dynamic_axes={"input": {0: "batch_size"}, "output": {0: "batch_size"},} - scores seems to be same as original pytorch model and dynamo=True export
🤗 Space Demo for ONNX & PyTorch inference implementation (incl. timm+lsnet; OpenVINO accelerate CPU inference; no Triton required - refer to ska.py or here)
Barebones standalone ONNX inference script (no timm or lsnet; scores are a tiny bit different - probably different img preprocessing): onnx_barebones_inference.py
kaloscope_1-0.onnx: Exported frombest_checkpoint.pthoriginal Kaloscope release | dynamo=False, dynamic_axes={"input": {0: "batch_size"}, "output": {0: "batch_size"},}, opset_version=None (torch 2.8.0 used here defaults to 18 when None), optimization/constant folding enabledkaloscope_1-1.onnx: Exported from224-85.65/best_checkpoint.pthaka v1.1 | Same settings as v1.0
Conversion/Export script: colab notebook
theres an extra pytorch ema only version (best_checkpoint_ema.pth) of the model which is roughly 4 times smaller but seems to output different results; did not do extensive tests. ONNX version recommended over this (script used: save_ema.py)
Original description:
LSNet 艺术家风格分类模型 Model Card
模型概述
模型名称:
Kaloscope Artist Style Classification Model
模型版本: v1.0
发布日期: 2025年10月
模型类型: 图像分类 (艺术家风格识别)
架构: LSNet (See Large, Focus Small)
模型描述
本模型基于LSNet架构构建,专门用于识别和分类不同艺术家的绘画风格。LSNet是一个轻量级视觉模型,灵感来源于人类视觉系统的动态异尺度能力,即"看大局,聚焦细节"的特性。
架构特点
- 设计理念: 基于人类视觉系统的"See Large, Focus Small"原理
- 模型系列: 支持LSNet-T、LSNet-S、LSNet-B三种规模
- 参数量: 约100M参数
- 优化目标: 在保持高精度的同时实现高效推理
训练数据
数据来源
- 数据集: Danbooru数据集 (截止到2024年10月)
- 数据筛选: 选取图像数量在50张以上的艺术家
- 总分类数: 31,770个艺术家类别
- 数据采样策略:
- 图像数量超过100张的艺术家:选取ID最靠后的100张图像
- 图像数量50-100张的艺术家:使用全部图像
数据预处理
- 图像尺寸: 224×224像素
- 数据增强: 标准ImageNet预处理流程
- 验证集划分: 5%的数据用于验证
训练配置
硬件环境
- GPU配置: 8×H20 GPU
- 训练时长: 80个epoch
- 批次大小: 256 (每GPU)
训练参数
- 优化器: AdamW
- 学习率调度: Cosine Annealing
- 数据并行: 分布式训练 (8卡)
- 模型参数量: ~100M
性能指标
- 最终准确率: 84.2%
- 验证方式: Top-1准确率
- 评估数据: 验证集 (5%的数据)
模型性能
分类性能
| 指标 | 数值 |
|---|---|
| Top-1 准确率 | 84.2% |
| 总类别数 | 31,770 |
| 参数量 | ~100M |
| 训练轮数 | 80 epochs |
推理性能
- 输入格式: RGB图像,224×224像素
- 输出格式: 31,770维概率分布
- 推理速度: 高效推理 (具体数值取决于硬件)
使用方法
环境要求
pip install torch torchvision timm
基本使用
import torch
from timm.models import create_model
# 加载模型
model = create_model('lsnet_t_artist', pretrained=True, num_classes=31770)
model.eval()
# 推理
with torch.no_grad():
output = model(input_tensor)
probabilities = torch.softmax(output, dim=1)
Comfyui内使用
安装comfyui节点:https://github.com/spawner1145/comfyui-lsnet 下载本仓库模型即可使用
相关资源
- 论文: LSNet: See Large, Focus Small
- 代码仓库: (https://github.com/spawner1145/lsnet-test)
- 预训练模型: 可通过Hugging Face Hub获取
引用信息
@misc{wang2025lsnetlargefocussmall,
title={LSNet: See Large, Focus Small},
author={Ao Wang and Hui Chen and Zijia Lin and Jungong Han and Guiguang Ding},
year={2025},
eprint={2503.23135},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2503.23135},
}
更新日志
v1.0 (2025年10月)
- 初始版本发布
- 基于Danbooru数据集训练
- 支持31,770个艺术家类别
- 达到84.2%的分类准确率
v1.1 (2025年10月)
- 150epoch
- 达到85.6%的分类准确率
免责声明: 本模型仅供研究和教育用途。在商业应用中使用时,请确保遵守相关法律法规和伦理准则。
Model tree for DraconicDragon/Kaloscope-onnx
Base model
heathcliff01/Kaloscope