26、主成分分析(PCA)在图像数据处理中的应用

主成分分析(PCA)在图像数据处理中的应用

1. 超参数 k 的选择

在机器学习中,字母 k 用于许多不同的算法,这可能会造成混淆,因此在看到 k 时,关注上下文至关重要。在数据压缩方面,压缩不足会导致训练和评估步骤效率低下,而过度压缩则可能会消除重要信息。为了选择超参数 k 的最佳值,通常会尝试几个不同的值,观察它们的效果,然后选择效果最好的那个。许多库提供了超参数搜索技术,可以自动化这一搜索过程。

操作步骤:
1. 定义一组可能的 k 值,例如 [5, 10, 15, 20]。
2. 对于每个 k 值,使用该值进行数据压缩,并进行训练和评估。
3. 记录每个 k 值对应的评估指标,如准确率、召回率等。
4. 选择评估指标最佳的 k 值。

2. PCA 在简单图像上的应用

2.1 简单图像的表示

以一组六个灰度图像为例,每个图像边长为 1000 像素,即每个图像包含 100 万个像素。这些图像可以由三个图像按不同比例缩放后相加重建得到。例如,第一个图像可以由 20% 的圆形、70% 的垂直矩形和 40% 的水平矩形相加得到,这些缩放因子称为权重。

图像编号 圆形权重 垂直矩形权重 水平矩形权重
1 0.2 0.7 0.4

相关推荐

A tutorial on Principal Components Analysis - 主成分分析(PCA)教程

A tutorial on Principal Components Analysis 原著:Lindsay I Smith, A tutorial on Principal Components Analysis, February 26, 2002. 翻译:houchaoqun. 时间:2017/01/18. 出处:http://blog.csdn.net/houchaoqun_xmu

爱无止尽的博客 1692

【图像融合】主成分分析PCA遥感图像融合【含Matlab源码 8040期】

主成分分析PCA遥感图像融合 完整代码,包运行;可提供运行操作视频!适合小白!

订阅付费专栏Matlab(奶茶价版),可赠送奶茶价版付费专栏指定代码1份; 1056

【图像融合】基于matlab主成分分析PCA遥感图像融合【含Matlab源码 8040期】

主成分分析PCA遥感图像融合 完整代码,包运行;可提供运行操作视频!适合小白!

订阅付费专栏Matlab(奶茶价版),可赠送奶茶价版付费专栏指定代码1份; 1215

【图像重建】基于matlab主成分分析图像压缩重建【含Matlab源码 1173期】

主成分分析图像压缩重建 完整的代码,方可运行;可提供运行操作视频!适合小白!

订阅付费专栏Matlab(奶茶价版),可赠送奶茶价版付费专栏指定代码1份; 2702

【图像重建】基于matlab主成分分析PCA图像重建【含Matlab源码 2465期】

主成分分析PCA图像重建 完整的代码,方可运行;可提供运行操作视频!适合小白!

订阅付费专栏Matlab(奶茶价版),可赠送奶茶价版付费专栏指定代码1份; 574

若依(ruoyivue)实现文档在线查看

1、Kkfileview部署 第一步:从kkfileview官方发行版本下载安装包,安装包下载路径: https://gitee.com/kekingcn/file-online-preview/releases, 第二步:解压kkFileView-x.x.x文件(Windows用.zip包,Linux/MacOS用.tar.gz包) 第三步:打开解压后文件夹的bin目录,运行startup脚本(Windows下以管理员身份运行startup.bat,Linux以root用户运行startup.sh) 第四

weixin_46953697的博客 9685

智能车竞赛卡丁快跑组:自动驾驶与人车交互技术实战解析

本文深入解析了智能车竞赛卡丁快跑组的技术核心,重点探讨了自动驾驶与人车交互两大模块的实战方案。文章详细拆解了从环境感知、路径规划到语音识别、命令执行的完整流程,并分享了基于单片机平台的调试心法与赛场经验,为参赛者提供了一套从零开始、分步攻坚的系统性备赛指南。

f0g1h2的博客 1187

从零搭建智能视觉小车:OpenART图像处理+增强现实避坑指南

本文详细指导如何从零搭建智能视觉小车,重点介绍OpenART图像处理与增强现实技术在AprilTag识别中的应用。涵盖硬件选型、环境配置、算法优化及实战调试全流程,特别分享智能汽车竞赛中的避坑技巧和优化方案,帮助开发者构建稳定高效的视觉系统。

yhn456789的博客 1058

STLink驱动安装全攻略:从卸载到Keil配置的完整避坑指南

本文提供了STLink驱动安装与Keil环境配置的完整避坑指南。详细讲解了从驱动卸载、重装到Keil调试器设置的每一步,并针对常见的设备无法识别、连接不稳定等问题给出了深度解决方案,帮助开发者快速搭建稳定的STM32开发环境。

weixin_29182481的博客 431

华大HC32F460 ADC+DMA高效数据采集实战解析

本文深入解析了华大HC32F460微控制器中ADC与DMA协同工作的高效数据采集方案。通过实战代码演示,详细阐述了如何配置硬件触发、序列扫描及AOS事件联动,实现后台自动采集,从而解放CPU资源,提升系统实时性与可靠性,适用于传感器数据采集、音频处理等多种场景。

weixin_29189373的博客 184

Jetson Thor平台JP7.0版本96712 GMSL相机驱动调试记录

摘要:本文档记录了在Thor Custom Board (JP7.0GA)上配置GMSL摄像头时遇到的视频流问题及调试过程。问题表现为视频设备(/dev/video11)能正常创建,但获取视频时出现"Internal data stream error",而相同配置在AGX Orin JP6.0上运行正常。通过梳理硬件拓扑、v4l2-ctl测试、提升时钟频率及分析内核日志,发现VI引擎未接收到帧数据包。调试步骤包括检查设备树冲突、调整I2C总线配置、修正通道名称,最终通过屏蔽传感器启动时

jzwjzw19900922的博客 1117

Simulink进行无人机飞行力学建模与仿真

摘要:本文详细介绍了使用MATLAB/Simulink进行四旋翼无人机飞行力学建模与仿真的步骤。内容包括准备工作、动力学方程概述、模型构建(使用State-Space或Simscape Multibody)、可选控制器设计、仿真参数配置及结果分析。教程强调理解飞行力学原理和坐标系转换的重要性,建议根据需求选择模型复杂度,并推荐查阅学术文献获取更深入的建模方法。通过本教程,读者可掌握无人机动力学建模基础,为控制系统开发和性能优化奠定基础。

amy_mhd的博客 277

学Simulink--基础微电网场景实例:基于Simulink的微电网并网/孤岛无缝切换控制仿真

本文完成了基于 Simulink 的微电网并网/孤岛无缝切换控制仿真,实现了:✅ 构建含双模式逆变器的微电网模型✅ 实现预同步 + Stateflow 逻辑的智能切换✅ 验证计划与非计划切换的性能边界✅ 证明“无缝”在工程上是可实现的。

amy_mhd的博客 111

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

上一篇: 23、Scream:高效软件流密码的解析与应用
下一篇: 8、虚拟化与基础设施即服务(IaaS)详解
java5
博客等级 码龄22年 85粉丝 2103原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值
⌂ 换网址