Table of results for CIFAR-10 dataset

本文汇总了CIFAR-10数据集上部分最佳模型的成果,包括多列深度神经网络、最大输出网络等,涵盖了从2010年到2012年的研究成果。

原文地址:http://zybler.blogspot.com/2011/02/table-of-results-for-cifar-10-dataset.html

 

Table of results for CIFAR-10 dataset

This is a table documenting some of the best results some paper obtained in CIFAR-10 dataset.

 

1.Multi-Column Deep Neural Networks for Image Classification (CVPR 2012)

Cited 15 times. 88.79%
Supplemental material,Technical Report

 

2.Maxout networks (ARXIV 2013)
Cited 0 times. 87.07%

 

3.Practical Bayesian Optimization of Machine Learning Algorithms (NIPS 2012)
Cited 9 times. 85.02%
Additional info: With
 data augmented with horizontal reflections and translations, 90.5% accuracy on  test set is achieved.

 

4. Stochastic Pooling for Regularization of Deep Convolutional Neural Networks (2013)
Cited 1 times. 84.88%
Additional info: Stochastic Pooling Stochastic-100 Pooling

 

5.Improving neural networks by preventing co-adaptation of feature detectors (2012)
Cited 4 times. 84.4%

 

6.Discriminative Learning of Sum-Product Networks (NIPS 2012)
Cited 0 time. 83.96%

 

7.Beyond Spatial Pyramids: Receptive Field Learning for Pooled Image Features (2012)
Cited 6 times. 83.11%

 

8.Learning Invariant Representations with Local Transformations (2012)
Cited 0 times. 82.2%
Additional info: TIOMP-1/T (combined, K= 4,000)

 

9.Learning Feature Representations with K-means (NNTOT 2012)
Cited 2 times. 82%

 

10.Selecting Receptive Fields in Deep Networks (NIPS 2011)
Cited 11 times. 82%

 

11.The Importance of Encoding Versus Training with Sparse Coding and Vector Quantization (ICML 2011)
Cited 54 times. 81.5%
Source code:
Adam Coates's web page

 

12.High-Performance Neural Networks for Visual Object Classification (2011)
Cited 14 times. 80.49%

 

13.Object Recognition with Hierarchical Kernel Descriptors (CVPR 2011)
Cited 19 times.
80%
Source code: 
Project web page

 

14.An Analysis of Single-Layer Networks in Unsupervised Feature Learning (NIPS Workshop 2010)
Cited 83 times. 79.6%
Additional info: K-means (Triangle, 4000 features)
Homepage:
Link

 

15.Making a Science of Model Search (2012)
Cited 0 time. 79.1%

 

16.Convolutional Deep Belief Networks on CIFAR-10 (2010)
Cited 20 times. 78.9%
Additional info: 2 layers

 

17. Spike-and-Slab Sparse Coding for Unsupervised Feature Discovery (2012)
Cited 2 times. 78.8%

 

18.Pooling-Invariant Image Feature Learning (ARXIV 2012)
Cited 0 times.  78.71%
Additional info: 1600 codes, learnt using 2x PDL

 

19.Semiparametric Latent Variable Models for Guided Representation (2011)
Cited 2 times. 77.9%

 

20.Learning Separable Filters (2012)
Cited 0 times. 76%

 

21.Kernel Descriptors for Visual Recognition (NIPS 2010)
Cited 28 times. 76%
Additional info: KDES-A
Source code:
Project web page

 

22.Image Descriptor Learning Using Deep Networks (2010)
Cited 0 times. 75.18%

 

23.Improved Local Coordinate Coding using Local Tangents (ICML 2010)
Cited 27 times. 74.5%
Additional info: Linear SVM with improved LCC

 

24.Tiled convolutional neural networks (NIPS 2010)
Cited 20 times. 73.1%
Additional info: Deep Tiled CNNs (s=4, with finetuning)
Source code: 
Quoc V. Le's web page

 

25.Semiparametric Latent Variable Models for Guided Representation (2011)
Cited 2 times. 72.28%
Additional info: Alpha = 0.01

 

26.Modelling Pixel Means and Covariances Using Factorized Third-Order Boltzmann Machines (CVPR 2010)
Cited 57 times. 71%
Additional info: mcRBM-DBN (11025-8192-8192), 3 layers, PCA’d images

 

27.On Autoencoders and Score Matching for Energy Based Models (ICML 2011)
Cited 4 times. 65.5%

 

28.Factored 3-Way Restricted Boltzmann Machines For Modeling Natural Images (JMLR 2010)
Cited 14 times. 65.3%
Additional info: 4,096 3-Way, 3 layer, ZCA’d images

 

29.Learning invariant features through local space contraction (2011)
Cited 2 times. 52.14%

 

欢迎来到我的优快云博客:http://blog.youkuaiyun.com/anshan1984/

 

import torch import torch.nn as nn import torch.optim as optim import torchvision import torchvision.transforms as transforms from torch.utils.data import DataLoader import numpy as np import matplotlib.pyplot as plt import pandas as pd from thop import profile import time import os from torch.utils.tensorboard import SummaryWriter # 设备配置 device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') print(f"使用设备: {device}") # 数据预处理 def get_cifar100_dataloaders(batch_size=128, resolution=32): """获取CIFAR-100数据集加载器""" transform_train = transforms.Compose([ transforms.Resize((resolution, resolution)), transforms.RandomCrop(resolution, padding=4), transforms.RandomHorizontalFlip(), transforms.ToTensor(), transforms.Normalize((0.5071, 0.4867, 0.4408), (0.2675, 0.2565, 0.2761)) ]) transform_test = transforms.Compose([ transforms.Resize((resolution, resolution)), transforms.ToTensor(), transforms.Normalize((0.5071, 0.4867, 0.4408), (0.2675, 0.2565, 0.2761)) ]) # 使用用户指定的路径 data_path = r'C:\Users\89373\Desktop\imagenet\cifar-100-python' train_set = torchvision.datasets.CIFAR100( root=data_path, train=True, download=False, transform=transform_train) test_set = torchvision.datasets.CIFAR100( root=data_path, train=False, download=False, transform=transform_test) train_loader = DataLoader(train_set, batch_size=batch_size, shuffle=True, num_workers=4, pin_memory=True) test_loader = DataLoader(test_set, batch_size=batch_size, shuffle=False, num_workers=4, pin_memory=True) return train_loader, test_loader # 深度可分离卷积模块 class DepthwiseSeparableConv(nn.Module): """深度可分离卷积实现""" def __init__(self, in_channels, out_channels, stride): super().__init__() # 深度卷积 (DW卷积) self.depthwise = nn.Sequential( nn.Conv2d(in_channels, in_channels, 3, stride, 1, groups=in_channels, bias=False), nn.BatchNorm2d(in_channels), nn.ReLU6(inplace=True) ) # 逐点卷积 (1x1卷积) self.pointwise = nn.Sequential( nn.Conv2d(in_channels, out_channels, 1, 1, 0, bias=False), nn.BatchNorm2d(out_channels), nn.ReLU6(inplace=True) ) def forward(self, x): x = self.depthwise(x) return self.pointwise(x) # 针对CIFAR-100调整的MobileNet v1 class MobileNetV1_CIFAR100(nn.Module): """针对CIFAR-100调整的MobileNet v1架构""" def __init__(self, alpha=1.0, num_classes=100): super().__init__() def c(channels): return int(channels * alpha) # 宽度乘数α控制通道数 # 针对32x32输入调整的网络结构 self.features = nn.Sequential( # 初始卷积层 (调整stride为1以适应小尺寸图像) nn.Conv2d(3, c(32), 3, 1, 1, bias=False), nn.BatchNorm2d(c(32)), nn.ReLU6(inplace=True), # 深度可分离卷积层 (减少下采样次数) DepthwiseSeparableConv(c(32), c(64), 1), DepthwiseSeparableConv(c(64), c(128), 2), DepthwiseSeparableConv(c(128), c(128), 1), DepthwiseSeparableConv(c(128), c(256), 2), DepthwiseSeparableConv(c(256), c(256), 1), DepthwiseSeparableConv(c(256), c(512), 1), # 调整为stride=1 *[DepthwiseSeparableConv(c(512), c(512), 1) for _ in range(2)], # 减少层数 DepthwiseSeparableConv(c(512), c(1024), 2), DepthwiseSeparableConv(c(1024), c(1024), 1), nn.AdaptiveAvgPool2d(1) ) self.classifier = nn.Linear(c(1024), num_classes) def forward(self, x): x = self.features(x) x = x.view(x.size(0), -1) return self.classifier(x) # 标准卷积网络用于比较 class StandardConvNet(nn.Module): """标准卷积网络用于与深度可分离卷积比较""" def __init__(self, num_classes=100): super().__init__() self.features = nn.Sequential( nn.Conv2d(3, 32, 3, 1, 1, bias=False), nn.BatchNorm2d(32), nn.ReLU6(inplace=True), nn.Conv2d(32, 64, 3, 1, 1, bias=False), nn.BatchNorm2d(64), nn.ReLU6(inplace=True), nn.Conv2d(64, 128, 3, 2, 1, bias=False), nn.BatchNorm2d(128), nn.ReLU6(inplace=True), nn.Conv2d(128, 128, 3, 1, 1, bias=False), nn.BatchNorm2d(128), nn.ReLU6(inplace=True), nn.Conv2d(128, 256, 3, 2, 1, bias=False), nn.BatchNorm2d(256), nn.ReLU6(inplace=True), nn.Conv2d(256, 256, 3, 1, 1, bias=False), nn.BatchNorm2d(256), nn.ReLU6(inplace=True), nn.Conv2d(256, 512, 3, 1, 1, bias=False), nn.BatchNorm2d(512), nn.ReLU6(inplace=True), nn.Conv2d(512, 512, 3, 1, 1, bias=False), nn.BatchNorm2d(512), nn.ReLU6(inplace=True), nn.Conv2d(512, 1024, 3, 2, 1, bias=False), nn.BatchNorm2d(1024), nn.ReLU6(inplace=True), nn.Conv2d(1024, 1024, 3, 1, 1, bias=False), nn.BatchNorm2d(1024), nn.ReLU6(inplace=True), nn.AdaptiveAvgPool2d(1) ) self.classifier = nn.Linear(1024, num_classes) def forward(self, x): x = self.features(x) x = x.view(x.size(0), -1) return self.classifier(x) # 训练函数 def train_model(model, train_loader, test_loader, epochs=100, lr=0.01, experiment_name="baseline"): """训练并评估模型""" # 创建日志目录 log_dir = f"logs/{experiment_name}_{time.strftime('%Y%m%d_%H%M%S')}" os.makedirs(log_dir, exist_ok=True) writer = SummaryWriter(log_dir) model = model.to(device) optimizer = optim.RMSprop(model.parameters(), lr=lr, momentum=0.9, weight_decay=1e-5) scheduler = optim.lr_scheduler.ReduceLROnPlateau(optimizer, 'max', patience=5, factor=0.5, verbose=True) criterion = nn.CrossEntropyLoss() best_acc = 0.0 history = {'train_loss': [], 'test_acc': []} for epoch in range(epochs): model.train() running_loss = 0.0 for i, (images, labels) in enumerate(train_loader): images, labels = images.to(device), labels.to(device) optimizer.zero_grad() outputs = model(images) loss = criterion(outputs, labels) loss.backward() optimizer.step() running_loss += loss.item() if (i + 1) % 100 == 0: print(f'Epoch [{epoch + 1}/{epochs}], Step [{i + 1}/{len(train_loader)}], Loss: {loss.item():.4f}') # 计算平均训练损失 avg_train_loss = running_loss / len(train_loader) history['train_loss'].append(avg_train_loss) writer.add_scalar('Loss/train', avg_train_loss, epoch) # 验证评估 model.eval() total, correct = 0, 0 with torch.no_grad(): for images, labels in test_loader: images, labels = images.to(device), labels.to(device) outputs = model(images) _, preds = torch.max(outputs, 1) total += labels.size(0) correct += (preds == labels).sum().item() acc = 100 * correct / total history['test_acc'].append(acc) writer.add_scalar('Accuracy/test', acc, epoch) print(f'Epoch {epoch + 1}/{epochs} | Train Loss: {avg_train_loss:.4f} | Test Acc: {acc:.2f}%') # 更新学习率 scheduler.step(acc) # 保存最佳模型 if acc > best_acc: best_acc = acc torch.save(model.state_dict(), f"{log_dir}/best_model.pth") writer.close() return best_acc, history # 评估函数 def evaluate_model(model, test_loader): """评估模型性能""" model.eval() total, correct = 0, 0 with torch.no_grad(): for images, labels in test_loader: images, labels = images.to(device), labels.to(device) outputs = model(images) _, preds = torch.max(outputs, 1) total += labels.size(0) correct += (preds == labels).sum().item() return 100 * correct / total # 计算模型复杂度和性能 def calculate_model_stats(model, input_size=(1, 3, 32, 32)): """计算模型参数和FLOPs""" input_tensor = torch.randn(input_size).to(device) model = model.to(device) # 计算FLOPs和参数 flops, params = profile(model, inputs=(input_tensor,), verbose=False) flops_m = flops / 1e6 # 百万FLOPs params_m = params / 1e6 # 百万参数 return flops_m, params_m # 生成实验结果表格 def generate_results_table(): """生成论文中的实验表格""" results = [] train_loader, test_loader = get_cifar100_dataloaders(resolution=32) # 实验1: 标准卷积 vs 深度可分离卷积 print("\n实验1: 标准卷积 vs 深度可分离卷积") # 标准卷积模型 std_model = StandardConvNet() std_flops, std_params = calculate_model_stats(std_model) std_acc = train_model(std_model, train_loader, test_loader, epochs=50, experiment_name="std_conv")[0] # 深度可分离卷积模型 ds_model = MobileNetV1_CIFAR100(alpha=1.0) ds_flops, ds_params = calculate_model_stats(ds_model) ds_acc = train_model(ds_model, train_loader, test_loader, epochs=50, experiment_name="ds_conv")[0] results.append({ '实验': '卷积类型比较', '模型': '标准卷积', '准确率(%)': std_acc, '参数(M)': f'{std_params:.2f}', 'FLOPs(M)': f'{std_flops:.1f}' }) results.append({ '实验': '卷积类型比较', '模型': '深度可分离', '准确率(%)': ds_acc, '参数(M)': f'{ds_params:.2f}', 'FLOPs(M)': f'{ds_flops:.1f}' }) # 实验2: 宽度乘数α的影响 print("\n实验2: 宽度乘数α的影响") for alpha in [1.0, 0.75, 0.5, 0.25]: model = MobileNetV1_CIFAR100(alpha=alpha) flops, params = calculate_model_stats(model) # 实际训练获取准确率 acc = train_model(model, train_loader, test_loader, epochs=50, experiment_name=f"alpha_{alpha}")[0] results.append({ '实验': '宽度乘数α', '模型': f'α={alpha}', '准确率(%)': acc, '参数(M)': f'{params:.2f}', 'FLOPs(M)': f'{flops:.1f}' }) # 实验3: 分辨率乘数β的影响 print("\n实验3: 分辨率乘数β的影响") base_model = MobileNetV1_CIFAR100(alpha=1.0) for resolution in [32, 24, 16]: # 加载不同分辨率的数据 res_train_loader, res_test_loader = get_cifar100_dataloaders(resolution=resolution) # 创建新模型实例 model = MobileNetV1_CIFAR100(alpha=1.0) flops, params = calculate_model_stats(model, input_size=(1, 3, resolution, resolution)) # 实际训练获取准确率 acc = train_model(model, res_train_loader, res_test_loader, epochs=50, experiment_name=f"res_{resolution}")[0] results.append({ '实验': '分辨率乘数β', '模型': f'β={resolution}', '准确率(%)': acc, '参数(M)': '1.00', # 参数数量不变 'FLOPs(M)': f'{flops:.1f}' }) return pd.DataFrame(results) # 可视化实验结果 def visualize_results(results_df): """可视化实验结果""" plt.figure(figsize=(15, 10)) # 卷积类型比较 plt.subplot(2, 2, 1) conv_df = results_df[results_df['实验'] == '卷积类型比较'] plt.bar(conv_df['模型'], conv_df['准确率(%)'], color=['blue', 'green']) plt.title('卷积类型比较 - 准确率') plt.ylabel('准确率(%)') # 宽度乘数影响 plt.subplot(2, 2, 2) alpha_df = results_df[results_df['实验'] == '宽度乘数α'] plt.plot(alpha_df['模型'], alpha_df['准确率(%)'], 'o-', label='准确率') plt.plot(alpha_df['模型'], alpha_df['参数(M)'].astype(float), 's--', label='参数(M)') plt.plot(alpha_df['模型'], alpha_df['FLOPs(M)'].astype(float), 'd-.', label='FLOPs(M)') plt.title('宽度乘数α的影响') plt.legend() # 分辨率乘数影响 plt.subplot(2, 2, 3) res_df = results_df[results_df['实验'] == '分辨率乘数β'] plt.plot(res_df['模型'], res_df['准确率(%)'], 'o-', label='准确率') plt.plot(res_df['模型'], res_df['FLOPs(M)'].astype(float), 's--', label='FLOPs(M)') plt.title('分辨率乘数β的影响') plt.legend() # 准确率-FLOPs权衡 plt.subplot(2, 2, 4) plt.scatter(results_df['FLOPs(M)'].astype(float), results_df['准确率(%)'], s=100) for i, row in results_df.iterrows(): plt.annotate(row['模型'], (float(row['FLOPs(M)']), row['准确率(%)']), xytext=(5, 5), textcoords='offset points') plt.xlabel('FLOPs(M)') plt.ylabel('准确率(%)') plt.title('准确率-FLOPs权衡') plt.tight_layout() plt.savefig('mobilenet_cifar100_results.png') plt.show() # 主函数 def main(): # 生成结果表格 results_df = generate_results_table() # 保存结果 results_df.to_csv('mobilenet_cifar100_results.csv', index=False) print(results_df) # 可视化结果 visualize_results(results_df) print("实验完成!结果已保存到mobilenet_cifar100_results.csv和mobilenet_cifar100_results.png") if __name__ == '__main__': main() D:\anaconda\python.exe D:\杨杏丽作业\pythonProject\ImageNet.py 2025-06-18 10:19:16.836858: I tensorflow/core/util/port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`. 2025-06-18 10:19:18.662333: I tensorflow/core/util/port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`. 使用设备: cpu Traceback (most recent call last): File "D:\杨杏丽作业\pythonProject\ImageNet.py", line 399, in <module> main() File "D:\杨杏丽作业\pythonProject\ImageNet.py", line 386, in main results_df = generate_results_table() ^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\杨杏丽作业\pythonProject\ImageNet.py", line 264, in generate_results_table train_loader, test_loader = get_cifar100_dataloaders(resolution=32) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\杨杏丽作业\pythonProject\ImageNet.py", line 40, in get_cifar100_dataloaders train_set = torchvision.datasets.CIFAR100( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\anaconda\Lib\site-packages\torchvision\datasets\cifar.py", line 69, in __init__ raise RuntimeError("Dataset not found or corrupted. You can use download=True to download it") RuntimeError: Dataset not found or corrupted. You can use download=True to download it 进程已结束,退出代码为 1
06-19
先展示下效果 https://pan.quark.cn/s/a4b39357ea24 遗传算法 - 简书 遗传算法的理论是根据达尔文进化论而设计出来的算法: 人类是朝着好的方向(最优解)进化,进化过程中,会自动选择优良基因,淘汰劣等基因。 遗传算法(英语:genetic algorithm (GA) )是计算数学中用于解决最佳化的搜索算法,是进化算法的一种。 进化算法最初是借鉴了进化生物学中的一些现象而发展起来的,这些现象包括遗传、突变、自然选择、杂交等。 搜索算法的共同特征为: 首先组成一组候选解 依据某些适应性条件测算这些候选解的适应度 根据适应度保留某些候选解,放弃其他候选解 对保留的候选解进行某些操作,生成新的候选解 遗传算法流程 遗传算法的一般步骤 my_fitness函数 评估每条染色体所对应个体的适应度 升序排列适应度评估值,选出 前 parent_number 个 个体作为 待选 parent 种群(适应度函数的值越小越好) 从 待选 parent 种群 中随机选择 2 个个体作为父方和母方。 抽取父母双方的染色体,进行交叉,产生 2 个子代。 (交叉概率) 对子代(parent + 生成的 child)的染色体进行变异。 (变异概率) 重复3,4,5步骤,直到新种群(parentnumber + childnumber)的产生。 循环以上步骤直至找到满意的解。 名词解释 交叉概率:两个个体进行交配的概率。 例如,交配概率为0.8,则80%的“夫妻”会生育后代。 变异概率:所有的基因中发生变异的占总体的比例。 GA函数 适应度函数 适应度函数由解决的问题决定。 举一个平方和的例子。 简单的平方和问题 求函数的最小值,其中每个变量的取值区间都是 [-1, ...
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值