[{"data":1,"prerenderedAt":260},["ShallowReactive",2],{"content-query-HZwP9Bixsn":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"cover":11,"type":12,"category":13,"body":14,"_type":254,"_id":255,"_source":256,"_file":257,"_stem":258,"_extension":259},"/technology-blogs/zh/2586","zh",false,"","论文精讲 | 基于昇思MindSpore Quantum实现FRQI及其压缩形式并用于图像分类任务","分享人：白琪 ｜学校：浙江大学 博士研究生","2023-06-26","https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2023/06/29/ccc408cbf6db4494abb2943cc9795242.png","technology-blogs","实践",{"type":15,"children":16,"toc":251},"root",[17,25,37,45,50,58,63,68,78,86,100,108,121,129,136,144,152,157,164,172,182,189,194,199,204,211,218,226,231,238,243],{"type":18,"tag":19,"props":20,"children":22},"element","h1",{"id":21},"论文精讲-基于昇思mindspore-quantum实现frqi及其压缩形式并用于图像分类任务",[23],{"type":24,"value":8},"text",{"type":18,"tag":26,"props":27,"children":28},"p",{},[29,35],{"type":18,"tag":30,"props":31,"children":32},"strong",{},[33],{"type":24,"value":34},"分享人：白琪",{"type":24,"value":36}," ｜学校**：浙江大学 博士研究生**",{"type":18,"tag":26,"props":38,"children":39},{},[40],{"type":18,"tag":30,"props":41,"children":42},{},[43],{"type":24,"value":44},"内容简介",{"type":18,"tag":26,"props":46,"children":47},{},[48],{"type":24,"value":49},"该论文提出了一个基于量子神经网络分类大图像的框架。此框架中的图像编码采用FRQI方法，并基于此提出了一种压缩方式。论文中还提出了两种量子神经网络层CRADL和CRAML。原文作者在MNIST中的3和6上验证算法的有效性，并在笔记本电脑上实现对8x8和16x16图像的模拟。",{"type":18,"tag":26,"props":51,"children":52},{},[53],{"type":18,"tag":30,"props":54,"children":55},{},[56],{"type":24,"value":57},"相关论文",{"type":18,"tag":26,"props":59,"children":60},{},[61],{"type":24,"value":62},"**标题：**Image Compression and Classification Using Qubits and Quantum Deep Learning",{"type":18,"tag":26,"props":64,"children":65},{},[66],{"type":24,"value":67},"**作者：**Ali Mohsen, Mo Tiwari",{"type":18,"tag":26,"props":69,"children":70},{},[71,76],{"type":18,"tag":30,"props":72,"children":73},{},[74],{"type":24,"value":75},"arXiv:",{"type":24,"value":77}," 2110.05476（2021年10月8日）",{"type":18,"tag":26,"props":79,"children":80},{},[81],{"type":18,"tag":30,"props":82,"children":83},{},[84],{"type":24,"value":85},"论文复现代码",{"type":18,"tag":26,"props":87,"children":88},{},[89,91],{"type":24,"value":90},"**代码链接：**",{"type":18,"tag":92,"props":93,"children":97},"a",{"href":94,"rel":95},"https://gitee.com/mindspore/mindquantum/tree/research/paper%5C_recurrence/2023/47%5C_richybai",[96],"nofollow",[98],{"type":24,"value":99},"https://gitee.com/mindspore/mindquantum/tree/research/paper\\_recurrence/2023/47\\_richybai",{"type":18,"tag":26,"props":101,"children":102},{},[103],{"type":18,"tag":30,"props":104,"children":105},{},[106],{"type":24,"value":107},"点击下方链接观看视频：",{"type":18,"tag":26,"props":109,"children":110},{},[111],{"type":18,"tag":30,"props":112,"children":113},{},[114],{"type":18,"tag":92,"props":115,"children":118},{"href":116,"rel":117},"http://mp.weixin.qq.com/s?__biz=MzI3NjAzMjA0NA==&mid=2247500123&idx=1&sn=6a5a4be871c41a2c8a543b7d245896cc&chksm=eb793e18dc0eb70eed7bec7cdb94808128a672cb156387cf23e468c19d2ce7237a6473ca60a3&scene=21#wechat_redirect",[96],[119],{"type":24,"value":120},"【直播】量子计算组会一起开 | 基于昇思MindSpore Quantum实现FRQI及其压缩形式并用于图像分类任务",{"type":18,"tag":26,"props":122,"children":123},{},[124],{"type":18,"tag":125,"props":126,"children":128},"img",{"alt":7,"src":127},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2023/06/29/772c57ea5547497fa5bfeb7b114adad9.png",[],{"type":18,"tag":26,"props":130,"children":131},{},[132],{"type":18,"tag":125,"props":133,"children":135},{"alt":7,"src":134},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2023/06/29/1d0c6732b3b8455fabbfeed2afc06f7d.png",[],{"type":18,"tag":26,"props":137,"children":138},{},[139],{"type":18,"tag":30,"props":140,"children":141},{},[142],{"type":24,"value":143},"02",{"type":18,"tag":26,"props":145,"children":146},{},[147],{"type":18,"tag":30,"props":148,"children":149},{},[150],{"type":24,"value":151},"量子神经网络",{"type":18,"tag":26,"props":153,"children":154},{},[155],{"type":24,"value":156},"论文中提出了两种量子神经网络的层结构：CRADL（Color-Readout-Alternating-Double-Layer）和CRAML（Color-Readout-Alternating-Mixed-Layer）。线路中共有三种作用不同的量子比特，分别编码像素点位置（pixel），像素点颜色（color），还有一个量子比特专门用于输出结果（readout）的测量。两种量子线路都是由XX门或ZZ门组成，每一个门都是双量子比特门，第一个量子比特为编码像素位置的比特，第二个量子比特为编码像素颜色的量子比特或者用于读取输出结果的量子比特。两种层结构区别在于XX门和ZZ门的作用顺序。两种结构如图1和图2所示：",{"type":18,"tag":26,"props":158,"children":159},{},[160],{"type":18,"tag":125,"props":161,"children":163},{"alt":7,"src":162},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2023/06/29/5707f64423104eb9876e206695195a46.png",[],{"type":18,"tag":26,"props":165,"children":166},{},[167],{"type":18,"tag":30,"props":168,"children":169},{},[170],{"type":24,"value":171},"03",{"type":18,"tag":26,"props":173,"children":174},{},[175,180],{"type":18,"tag":30,"props":176,"children":177},{},[178],{"type":24,"value":179},"实验结果",{"type":24,"value":181}," 作者对MNIST中的3和6共进行了五组实验，包含经典和量子两大类。首先图像分别被下采样，并二值化，其结果如图3所示：",{"type":18,"tag":26,"props":183,"children":184},{},[185],{"type":18,"tag":125,"props":186,"children":188},{"alt":7,"src":187},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2023/06/29/032093571873431d8bf952c5094aa16a.png",[],{"type":18,"tag":26,"props":190,"children":191},{},[192],{"type":24,"value":193},"图3. 数字在不同的下采样分辨率下图像。顶部一行是灰度图像，颜色范围在0 ≤ color ≤ 1，与原始数据集相同。底部一行是通过对上面相应图像的像素颜色进行阈值处理得到的黑白图像。（来源：论文原文）",{"type":18,"tag":26,"props":195,"children":196},{},[197],{"type":24,"value":198},"实验中，作者采用了经典的神经网络对8x8和16x16的图像进行分类，经典网络由双隐层组成，激活函数为ReLu。量子神经网络中，作者全部采用CRADL层，并在未压缩的FRQI编码下对8x8的图像分类；在压缩的FRQI编码下，对8x8和16x16进行分类。",{"type":18,"tag":26,"props":200,"children":201},{},[202],{"type":24,"value":203},"我们在昇思MindSpore Quantum复现上述论文结果，并使用MSE作为损失函数以提升结果。分类准确率见下表：",{"type":18,"tag":26,"props":205,"children":206},{},[207],{"type":18,"tag":125,"props":208,"children":210},{"alt":7,"src":209},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2023/06/29/961c8421d3b04a8b94df2b382c99eff6.png",[],{"type":18,"tag":26,"props":212,"children":213},{},[214],{"type":18,"tag":125,"props":215,"children":217},{"alt":7,"src":216},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2023/06/29/079c36e616764849ab5d81af95a1cd8c.png",[],{"type":18,"tag":26,"props":219,"children":220},{},[221],{"type":18,"tag":30,"props":222,"children":223},{},[224],{"type":24,"value":225},"复现分类准确率与论文中基本一致，对于16x16图像下的量子神经网络，MSE的使用对准确率提升了约7%，复现的训练过程走势与论文中基本相同。",{"type":18,"tag":26,"props":227,"children":228},{},[229],{"type":24,"value":230},"引用：[1]Le, P. Q., Dong, F. and Hirota, K. (2011). A flexible representation of quantum images for polynomial preparation, image compression, and processing operations. Quantum Inf. Process.10 63–84.",{"type":18,"tag":26,"props":232,"children":233},{},[234],{"type":18,"tag":125,"props":235,"children":237},{"alt":7,"src":236},"https://obs-mindspore-file.obs.cn-north-4.myhuaweicloud.com/file/2023/06/29/137646f1f68c4f2e946752de72d70cac.png",[],{"type":18,"tag":26,"props":239,"children":240},{},[241],{"type":24,"value":242},"扫码查看论文复现代码",{"type":18,"tag":26,"props":244,"children":245},{},[246],{"type":18,"tag":30,"props":247,"children":248},{},[249],{"type":24,"value":250},"欢迎各位开发者积极投稿，与大家一起分享项目成果、任务开发过程中的经验和感悟，参与者可获得专属礼品，还有机会申请昇思MindSpore优秀开发者或布道师，有兴趣的小伙伴请联系HiQ量子计算小助手：LLT66TT（备注“专题投稿”加速通过）。",{"title":7,"searchDepth":252,"depth":252,"links":253},4,[],"markdown","content:technology-blogs:zh:2586.md","content","technology-blogs/zh/2586.md","technology-blogs/zh/2586","md",1776506122288]