【FNN回归预测】基于Jaya优化前馈神经网络FNN实现数据回归预测附Matlab代码

简介: 【FNN回归预测】基于Jaya优化前馈神经网络FNN实现数据回归预测附Matlab代码

?作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。

?个人主页:Matlab科研工作室

?个人信条:格物致知。

更多Matlab仿真内容点击?

智能优化算法       神经网络预测       雷达通信      无线传感器        电力系统

信号处理              图像处理               路径规划       元胞自动机        无人机

? 内容介绍

本文介绍了人工神经网络技术,该技术可使用由反向传播算法训练的前馈神经网络来确定检测乳腺癌的可能性。在训练期间,反向传播被独立应用于优化,以发展ANN的互连权重。本文探索了一种使用25种特征(例如12例患者病史,13项物理发现,4项乳腺X线摄影发现)的ANN,最后通过活检的结果来确定存在乳腺癌的可能性。

? 部分代码

% *************************************************************************************************************

%                  Source Code of JAYA Optimization based Feed-Forward

%                  Neural Network


% Cite: Wang S, Rao RV, Chen P, Zhang Y, Liu A, Wei L. Abnormal breast detection in

% mammogram images by feed-forward neural network trained by Jaya algorithm.


% *************************************************************************************************************

% Enjoy JAYA-ANN!

clc;

close all

% Generating random correlated data

mu = 50;

sigma = 5;

M = mu + sigma * randn(300, 2);

R = [1, 0.75; 0.75, 1];

L = chol(R);

M = M*L;

x = M(:,1);  % Example Inputs, Replace by your data inputs for your own experiments

y = M(:,2); % Example labels, Replace by your data labels for your own experiments

%% JAYA algorithms

%% Problem Definition

pop = 30;               % Population size

% Min-max normalization of data

m = max(x); mn = min(x); mm = m-mn;

X = ((x-mn)/mm); Y = ((x-mn)/mm);

% 90%:10% splitting of data for training and testing

sz = (ceil(size(X,1))*0.9);

inputs = (X(1:sz))';

targets = (Y(1:sz))';

XTest = (X(sz+1:end))';

YTest = Y(sz+1:end)';

% number of neurons

n = 4;

tic;

% create a neural network

net = feedforwardnet(n);

% configure the neural network for this dataset

net = configure(net, inputs, targets);

% Denormalizaion and Prediction by FNN

FNN_Pred = ((net(XTest))' * mm) + mn;

sz = n^2 + n + n + 1; % Number of design variables i.e., no. of weights in FNN                

maxGen = 30;            % Maximum number of iterations

mini = repmat(-1,1,sz); % Lower Bound of Variables

maxi = ones(1,sz);      % Upper Bound of Variables  

objective = @(x) NMSE(x, net, inputs, targets);      % Cost Function

disp(['Optimum value = ',num2str(val,10)])

figure;

plot(fopt,'LineWidth', 2);

xlabel('Itteration');

ylabel('Best Cost');

legend('JAYA');

disp(' ' );

% Setting optimized weights and bias in network

net = setwb(net, Best');

% Denormalizaion and Prediction by JAYA_FNN

JAYA_FNN_Pred = ((net(XTest))' * mm) + mn;

YTest = (YTest * mm) + mn;

JAYA_FNN_Execution_Time_Seconds = toc

% Plotting prediction results

figure;

plot(YTest,'LineWidth',2, 'Marker','diamond', 'MarkerSize',8);

hold on;

plot(FNN_Pred, 'LineWidth',2, 'Marker','x', 'MarkerSize',8);

plot(JAYA_FNN_Pred, 'LineWidth',2, 'Marker','pentagram', 'MarkerSize',8);

title('JAYA Optimization based Feed-Forward Neural Network');

xlabel('Time Interval');

ylabel('Values');

legend('Actual Values', 'FNN Predictions', 'JAYA-FNN Predictions');

hold off;

% Performance Evaluaion of FNN and JAYA-FNN

fprintf('Performance Evaluaion of FNN and JAYA-FNN using Normalized Root Mean Square Error \n');

NRMSE_FNN = (abs( sqrt( mean(mean((FNN_Pred - YTest).^2) )) )) / (max(YTest)-min(YTest))

NRMSE_JAYA_FNN = (abs( sqrt( mean(mean((JAYA_FNN_Pred - YTest).^2) ) ) )) / (max(YTest)-min(YTest))



% Objective Function for minimizing normalized mean square error of FNN by

% updation of nework's weights and biases

function [f] = NMSE(wb, net, input, target)

% wb is the weights and biases row vector obtained from the genetic algorithm.

% It must be transposed when transferring the weights and biases to the network net.

net = setwb(net, wb');

% The net output matrix is given by net(input). The corresponding error matrix is given by

error = target - net(input);

% The mean squared error normalized by the mean target variance is

f = (mean(error.^2)/mean(var(target',1)));

% It is independent of the scale of the target components and related to the Rsquare statistic via

% Rsquare = 1 - NMSEcalc ( see Wikipedia)

end

? 运行结果

? 参考文献

[1] Babu G A ,  Bhukya S N ,  Kumar R S . Feed forward network with back propagation algorithm for detection of breast cancer[C]// International Conference on Computer Science & Education. IEEE, 2013.

[2]朱正林, 刘权, 张欢. 基于优化广义回归神经网络的碟式太阳能温度预测研究[J]. 南京工程学院学报:自然科学版, 2020, 18(1):5.

?? 完整代码

??部分理论引用网络文献,若有侵权联系博主删除
?? 关注我领取海量matlab电子书和数学建模资料


相关文章
|
1天前
|
安全 网络安全 数据安全/隐私保护
网络安全与信息安全:保护您的数据和隐私
【5月更文挑战第14天】本文将探讨网络安全漏洞、加密技术和安全意识等方面,以帮助读者更好地了解如何保护他们的数据和隐私。我们将讨论各种类型的网络攻击,以及如何使用加密技术来保护信息。此外,我们还将强调培养良好的安全习惯的重要性,以降低遭受网络攻击的风险。
|
1天前
|
安全 网络协议 网络安全
网络安全与信息安全:保护你的数据,保护你的未来
【5月更文挑战第14天】在数字化的世界中,网络安全和信息安全是每个互联网用户都必须面对的问题。本文将深入探讨网络安全漏洞、加密技术以及安全意识等方面的知识,帮助读者更好地理解和保护自己的数据。我们将讨论如何识别和防范网络安全威胁,如何使用加密技术来保护数据,以及如何提高自己的安全意识,从而在网络世界中更安全地生活。
|
1天前
|
安全 物联网 网络安全
网络安全与信息安全:保护数据的关键策略
【5月更文挑战第14天】 在数字化时代,网络安全和信息安全已成为维护个人隐私、企业资产和国家安全的基石。面对日益增长的网络威胁,理解并应对安全漏洞、掌握加密技术以及提升安全意识显得尤为重要。本文将深入探讨当前的网络安全隐患,解析加密技术的工作原理及其重要性,并提出提高个人和组织安全意识的有效方法。我们的目标是通过知识分享,为读者提供一套全面的网络安全自保策略。
|
1天前
|
安全 网络安全 数据安全/隐私保护
网络安全与信息安全:保护你的数据,保护你的未来
【5月更文挑战第14天】在数字化的世界中,网络安全和信息安全是我们生活的基石。本文将深入探讨网络安全漏洞、加密技术以及安全意识等方面,以期帮助读者更好地理解和应对网络安全威胁。我们将从网络安全的基本概念出发,分析常见的网络攻击手段,然后介绍加密技术的基本原理和应用。最后,我们将讨论如何提高个人和企业的安全意识,以应对日益严峻的网络安全形势。
|
1天前
|
网络安全 数据安全/隐私保护 计算机视觉
2024蓝桥杯网络安全-图片隐写-缺失的数据(0基础也能学会-含代码解释)
2024蓝桥杯网络安全-图片隐写-缺失的数据(0基础也能学会-含代码解释)
|
1天前
|
监控 安全 Linux
【专栏】Linux中六个常用的网络命令:ping、traceroute、netstat、nmap、ifconfig和ip
【4月更文挑战第28天】本文介绍了Linux中六个常用的网络命令:ping、traceroute、netstat、nmap、ifconfig和ip,以及它们在测试网络连通性、追踪路由、查看网络状态、安全扫描和接口配置等场景的应用。通过学习和运用这些命令,系统管理员和网络爱好者能更有效地诊断和管理网络问题,确保网络稳定运行。
|
1天前
|
网络协议 Linux 网络架构
|
1天前
|
域名解析 网络协议 Linux
linux网络配置详解
linux网络配置详解
16 0
|
1天前
|
网络协议 Java Linux
【探索Linux】P.29(网络编程套接字 —— 简单的TCP网络程序模拟实现)
【探索Linux】P.29(网络编程套接字 —— 简单的TCP网络程序模拟实现)
14 0
|
1天前
|
存储 网络协议 算法
【探索Linux】P.28(网络编程套接字 —— 简单的UDP网络程序模拟实现)
【探索Linux】P.28(网络编程套接字 —— 简单的UDP网络程序模拟实现)
15 0

热门文章

最新文章

http://www.vxiaotou.com