【MATLAB图像融合】[14]PCNN脉冲耦合神经网络代码分享

article/2025/7/20 10:34:26

本代码转自厦门大学屈小波教授15年的DEMO代码。

% Demo for PCNN in image processing
% ---------
% Author:  Qu Xiao-Bo    <qxb_xmu [at] yahoo.com.cn>    Aug.28,2008
%          Postal address:
% Rom 509, Scientific Research Building # 2,Haiyun Campus, Xiamen University,Xiamen,Fujian, P. R. China, 361005
% Website:https://csrc.xmu.edu.cn/ 
%=============================================================
% References:
% [1]Qu Xiao-Bo, YAN Jing-Wen, XIAO Hong-Zhi, ZHU Zi-Qian. Image Fusion Algorithm Based on Spatial Frequency-Motivated Pulse Coupled Neural Networks in Nonsubsampled Contourlet Transform Domain. Acta Automatica Sinica, Vol.34, No.12, pp: 1508-1514.Dec.2008. 
% [2]Xiao-Bo Qu,Jingwen Yan.Image Fusion Algorithm Based on Features Motivated Multi-channel Pulse Coupled Neural Networks, The 2nd International Conference on Bioinformatics and Biomedical Engineering-iCBBE2008,Shanghai, China, 16-18 May 2008, pp. 2103-2106
% [3]Xiaobo Qu, Changwei Hu, Jingwen Yan, Image Fusion Algorithm Based On Orientation Information Motivated Pulse Coupled Neural Networks, The seventh World Congress on Intelligent Control and Automation-WCICA 2008,Chongqing, China,25-27 June 2008, pp.2437-2441
% [4]Xiaobo Qu, Jingwen Yan, Ziqian Zhu, et al. Multi-focus image fusion algorithm based on regional firing characteristic of Pulse Coupled Neural Networks, Conference Pre-proceedings of The Second International Conference on Bio-Inspired Computing: Theories and Applications, pp:563-565,2007
% [5]Yan Jingwen, QU Xiaobo. Beyond Wavelets and Its Applications [M].Beijing: National Defense Industry Press, June 2008.(In Chinese)%=============================================================
%%
clc;
clear all;
close all;
%%
im=imread('2.jpg');
im=double(im);
%%
link_arrange=6;
iteration_times=200;
%%
firing_times=PCNN_large_arrange(im,link_arrange,iteration_times);
%%
figure,imshow(im,[])
figure,imshow(firing_times,[])
function [normalized_matrix,cmin,cmax]=Normalized(matrix)
% function [normalized_matrix,cmin,cmax]=Normalized(matrix)
% Computes the normalized form of matrix
% Input: matrix, denotes an image
% Output: normalized_matrix,normalized form of matrix
%         cmin, is the is the smallest element in matrix
%         cman is the is the largest  element in matrix
% ---------
% Author:  Qu Xiao-Bo    <qxb_xmu [at] yahoo.com.cn>    Aug.28,2008
%          Postal address:
% Rom 509, Scientific Research Building # 2,Haiyun Campus, Xiamen University,Xiamen,Fujian, P. R. China, 361005
% Website: http://quxiaobo.go.8866.org
%=============================================================
% References:
% [1]Qu Xiao-Bo, YAN Jing-Wen, XIAO Hong-Zhi, ZHU Zi-Qian. Image Fusion Algorithm Based on Spatial Frequency-Motivated Pulse Coupled Neural Networks in Nonsubsampled Contourlet Transform Domain. Acta Automatica Sinica, Vol.34, No.12, pp: 1508-1514.Dec.2008. 
% [2]Xiao-Bo Qu,Jingwen Yan.Image Fusion Algorithm Based on Features Motivated Multi-channel Pulse Coupled Neural Networks, The 2nd International Conference on Bioinformatics and Biomedical Engineering-iCBBE2008,Shanghai, China, 16-18 May 2008, pp. 2103-2106
% [3]Xiaobo Qu, Changwei Hu, Jingwen Yan, Image Fusion Algorithm Based On Orientation Information Motivated Pulse Coupled Neural Networks, The seventh World Congress on Intelligent Control and Automation-WCICA 2008,Chongqing, China,25-27 June 2008, pp.2437-2441
% [4]Xiaobo Qu, Jingwen Yan, Ziqian Zhu, et al. Multi-focus image fusion algorithm based on regional firing characteristic of Pulse Coupled Neural Networks, Conference Pre-proceedings of The Second International Conference on Bio-Inspired Computing: Theories and Applications, pp:563-565,2007
% [5]Yan Jingwen, QU Xiaobo. Beyond Wavelets and Its Applications [M].Beijing: National Defense Industry Press, June 2008.(In Chinese)%=============================================================
% Get absolute value of matrix
input_matrix=abs(matrix);
Max_input=max(input_matrix(:));
Min_input=min(input_matrix(:));
min_matrix=ones(size(input_matrix)).*Min_input;
normalized_matrix=(input_matrix-min_matrix)./(Max_input-Min_input+eps);
cmin=Min_input;
cmax=Max_input;
%
function R=PCNN_large_arrange(matrix,link_arrange,np,pre_flag)
% R=PCNN_large_arrange(matrix,link_arrange,np,pre_flag)
% compute the fire times of each pixel in the PCNN 
% np is the iterative times
% R is the fire times of coefficients of wavelet decomposition
% ---------
% Author:  Qu Xiao-Bo    <qxb_xmu [at] yahoo.com.cn>    Aug.28,2008
%          Postal address:
% Rom 509, Scientific Research Building # 2,Haiyun Campus, Xiamen University,Xiamen,Fujian, P. R. China, 361005
% Website: https://csrc.xmu.edu.cn/ 
%=============================================================
% References:
% [1]Qu Xiao-Bo, YAN Jing-Wen, XIAO Hong-Zhi, ZHU Zi-Qian. Image Fusion Algorithm Based on Spatial Frequency-Motivated Pulse Coupled Neural Networks in Nonsubsampled Contourlet Transform Domain. Acta Automatica Sinica, Vol.34, No.12, pp: 1508-1514.Dec.2008. 
% [2]Xiao-Bo Qu,Jingwen Yan.Image Fusion Algorithm Based on Features Motivated Multi-channel Pulse Coupled Neural Networks, The 2nd International Conference on Bioinformatics and Biomedical Engineering-iCBBE2008,Shanghai, China, 16-18 May 2008, pp. 2103-2106
% [3]Xiaobo Qu, Changwei Hu, Jingwen Yan, Image Fusion Algorithm Based On Orientation Information Motivated Pulse Coupled Neural Networks, The seventh World Congress on Intelligent Control and Automation-WCICA 2008,Chongqing, China,25-27 June 2008, pp.2437-2441
% [4]Xiaobo Qu, Jingwen Yan, Ziqian Zhu, et al. Multi-focus image fusion algorithm based on regional firing characteristic of Pulse Coupled Neural Networks, Conference Pre-proceedings of The Second International Conference on Bio-Inspired Computing: Theories and Applications, pp:563-565,2007
% [5]Yan Jingwen, QU Xiaobo. Beyond Wavelets and Its Applications [M].Beijing: National Defense Industry Press, June 2008.(In Chinese)%=============================================================
disp('PCNN is processing...')
[p,q]=size(matrix);
% computes the normalized matrix of the matrixA and  matrixB
F_NA=Normalized(matrix);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Initialize the parameters. 
% You'd better change them according to your applications 
alpha_L=1;
alpha_Theta=0.2;beta=3;
vL=1.00;
vTheta=20;
% Generate the null matrix that could be used
L=zeros(p,q);
U=zeros(p,q);
Y=zeros(p,q);
Y0=zeros(p,q);
Theta=zeros(p,q);
% Compute the linking strength.
center_x=round(link_arrange/2);
center_y=round(link_arrange/2);
W=zeros(link_arrange,link_arrange);
for i=1:link_arrangefor j=1:link_arrangeif (i==center_x)&&(j==center_y)W(i,j)=0;elseW(i,j)=1./sqrt((i-center_x).^2+(j-center_y).^2);endend
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%
F=F_NA;
for n=1:npK=conv2(Y,W,'same');L=exp(-alpha_L)*L+vL*K;Theta=exp(-alpha_Theta)*Theta+vTheta*Y;U=F.*(1+beta*L);Y=im2double(U>Theta);Y0=Y0+Y;   
end
R=Y0;

运行结果:
在这里插入图片描述
链接强度为6,迭代次数为200次。
代码可稳健运行。


http://chatgpt.dhexx.cn/article/x0pOWSux.shtml

相关文章

PCNN探究实验

1.常规PCNN&#xff0c;采用kin的连接权矩阵&#xff0c;并固定参数beta 0.2 alph 0.22 Ve 50 周期为15 初次迭代&#xff0c;图像信息熵最大&#xff0c;但效果不是最好的&#xff0c;在周期临界位置的不同迭代次数有不同的分割效果&#xff0c;第11次迭代效果最好。 因此…

脉冲耦合神经网络(PCNN)的matlab实现

基本脉冲耦合神经网络的matlab实现 Gray 首先发现了猫的初生视觉皮层有神经激发相关振荡现象&#xff0c;并将其研究结果发在了 Nature 杂志上。与此同时&#xff0c; Eckhom 也根据猫的大猫皮层的同步脉冲发放现象&#xff0c;提出了脉冲发现的连接模式&#xff0c;将开拓性地…

【MATLAB图像融合】[18]双通道PCNN模型实现图像融合

引言 简单回顾一下以往的单通道PCNN模型&#xff0c;原理与实现步骤&#xff1a; 13、单通道PCNN原理 14、单通道PCNN融合代码实现 一、单通道PCNN 图1 单通道PCNN&#xff1a; 在单通道PCNN中&#xff0c;对于一个神经元的一次迭代过程正如图1描述&#xff1a; ①、F&#…

PCNN

Distant Supervision for Relation Extraction via Piecewise Convolutional Neural Networks 1. 关键字 关系抽取&#xff0c;远程监督 2. 摘要 本文提出了PCNNs&#xff0c;用来解决远程监督关系抽取中的两个问题&#xff1a;一个是在对齐知识图谱时的错误标注问题&#xff0…

【NLP】基于神经网络PCNN(Piece-Wise-CNN)的关系抽取模型

背景 关系抽取是信息抽取的基本任务之一&#xff0c;对于知识库的构建以及文本的理解十分重要&#xff0c;在自然语言处理的一些任务&#xff0c;如问答&#xff0c;文本理解等得到了广泛的应用。 这里介绍的关系抽取主要指的是实体之间的关系抽取&#xff0c;实体是之前NER任…

PCNN 脉冲耦合神经网络整理

PCNN 脉冲耦合神经网络 脉冲耦合神经元模型 神经元的输入有哪些&#xff1f; 首先来看看这个神经元的图示的左边&#xff0c;有 Y Y Y和 F F F。 Y Y Y为这个神经元之前输出的数值&#xff0c;就是说这个模型需要进行多次的运算&#xff0c;每次的运算需要上一次运算的值来做…

关系抽取之分段卷积神经网络(PCNN)

文章目录 远程监督PCNN关系抽取PCNN方法论向量表达卷积层分段最大池化层Softmax层多实例学习 Reference Tensorflow2.2实现&#xff0c;见github仓库。 远程监督 关系抽取训练集标注成本高&#xff0c;一般使用远程监督方法&#xff08;半监督&#xff09;自动标注数据。远程监…

脉冲耦合神经网络(PCNN)阅读笔记

摘要 本文采用高级视觉模型来描述灵长类视觉系统中的信息传递和连接。信息链接方案&#xff0c;如状态相关模块化和时间同步&#xff0c;被视为视觉系统使用期望组合信息的方法&#xff0c;以填充缺失信息和删除不需要的信息。研究了使用基于生理学理论模型的链接方法结合当前…

PCNN的知识抽取

PCNN是一个结构简单的CNN网络, 它最初被用于在已知实体对位置时, 辨别实体对关系的网络. 上图是论文里带的PCNN结构图. PCNN的输入由两部分构成, 一部分是词本身的词向量word, 另一部分是词相对于实体词的位置信息position. PCNN优秀的地方就在于加入了位置信息, 具体如下: 1.…

基于PCNN脉冲耦合神经网络的图像分割

目录 1.算法描述 2.仿真效果预览 3.MATLAB核心程序 4.完整MATLAB 1.算法描述 脉冲耦合神经网络&#xff08;PCNN-Pulse Coupled Neural Network&#xff09;与传统神经网络相比&#xff0c;有着根本的不同。PCNN有生物学的背景&#xff0c;它是依据猫、猴等动物的大脑皮层上…

【MATLAB图像融合】[13]PCNN脉冲耦合神经网络基本原理

→这是一篇学习笔记。 →但考虑要发出来&#xff0c;还是排版了&#xff0c;请放心食用。 PCNN在图像融合中应用广泛 1、脉冲耦合的神经元之间有有耦合和无耦合两种形式。&#xff0c;有耦合的神经元之间存在能量传播&#xff0c;产生同步脉冲发放&#xff0c;从而将输入相似的…

【图像特征提取】基于matlab脉冲耦合神经网络(PCNN)图像特征提取【含Matlab源码 1868期】

⛄一、脉冲耦合神经网络&#xff08;PCNN&#xff09;图像特征提取简介 1 引言 随这生物神经学的迅速发展及其研究的进一步深入&#xff0c;国外对一种叫做第三代人工神经网络的模型——脉冲耦合神经网络模型——PCNN&#xff08;Pulse Coupled Neural Network&#xff09;模型…

脉冲耦合神经网络(PCNN)-pulse coupled neural network

摘要 本文采用高级视觉模型来描述灵长类视觉系统中的信息传递和连接。信息链接方案&#xff0c;如状态相关模块化和时间同步&#xff0c;被视为视觉系统使用期望组合信息的方法&#xff0c;以填充缺失信息和删除不需要的信息。研究了使用基于生理学理论模型的链接方法结合当前图…

NTFS 数据流隐写学习

NTFS 数据流隐写学习 —— 概念学习&#xff1a; NTFS文件系统中存在NTFS数据流文件也被称为 Alternate data streams&#xff08;ADS&#xff09;&#xff0c; 是NTFS磁盘格式的一个特性之一每个文件都有主文件流和非主文件流&#xff0c;主文件流能够直接看到&#xff1b;…

CTF隐写知识

通用知识 通用软件 010或winhex或HxD或HexEditXP 一.在文件中加入字符 jpg文件头 FF D8 jpg 文件尾 FF D9 FF D9后面的都是增加的内容; 增加的可能是字符串&#xff0c;也可能是另一个文件&#xff08;就是把多个文件的十六进制放在一起&#xff09; 二.ZIP格式文件分离 十…

图片隐写术总结

0x00 前言 之前还没有见到drops上有关于隐写术的总结&#xff0c;我之前对于隐写术比较有兴趣&#xff0c;感觉隐写术比较的好玩。所以就打算总结总结一些隐写术方面的东西。写的时候&#xff0c;可能会有错误的地方&#xff0c;请不吝赐教&#xff0c;谢谢。 本篇章中用到的隐…

图像隐写分析——生成含密图像 Stego Image

文章目录 一 图像隐写分析的数据集二 含密图像展示三 结语 一 图像隐写分析的数据集 小编本科毕设的题目是《基于深度学习的图像隐写分析》&#xff0c;图像隐写分析问题本质上是一个二分类&#xff08;binary classifier&#xff09;问题&#xff0c;即判断一张图片中是否含有…

图片LSB信息隐写

LSB&#xff08;全大写&#xff09;有时也指Least Significant Byte&#xff0c;指多字节序列中最小权重的字节。指的是一个二进制数字中的第0位&#xff08;即最低位&#xff09; RGB色彩模式是工业界的一种颜色标准&#xff0c;是通过对红(R)、绿(G)、蓝(B)三个颜色通道的变化…

F3隐写

F3隐写 文章目录 F3隐写1. 引言2. 实验环境3. 实现使用的现有外部库4. 实现思路> **预处理**> **DCT量化**>**秘密信息嵌入**> **Z字形序列化**>**Huffman编码**>**反Z字形序列化**>**提取秘密信息** 5.验证6. 总结 1. 引言 数字隐写技术是一种在数字媒体…

TTL隐写

#拿到一个长成这样的文件&#xff0c;里面是意义不明的数字 63 63 63 255 63 63 63 255 63 63 63 255 63 63 63 255 63 63 63 255 63 63 63 255 63 127 63 255 63转换为2进制&#xff0c;并设置为8位数的2进制&#xff0c;就会有很神奇的事情发生 with open(C:/Users/brighten…