30 MATLAB Intelligent Algorithm Cases | Mine Water Inrush Source Discrimination

“30 Case Studies of MATLAB Intelligent Algorithms” uses a case-based approach to explain the most commonly used intelligent algorithms, including genetic algorithms, immune algorithms, simulated annealing algorithms, particle swarm algorithms, fish swarm algorithms, ant colony algorithms, and neural network algorithms, focusing on their implementation in MATLAB. A total of 30 cases are presented, each case being a specific example of using intelligent algorithms to solve problems. Each case consists of four parts: theoretical explanation, case background, MATLAB program implementation, and further reading, complete with original programs, allowing readers to quickly improve their ability to solve practical problems while mastering the algorithms.

Similar to “43 Case Studies of MATLAB Neural Networks”, published by Beihang University Press, the intelligent algorithms discussed here belong to the popular field of intelligent predictive classification algorithms before the rise of neural networks, with widespread applications in digital signal processing, such as in image and speech processing. Let’s begin with the simulation examples, mainly introducing the source code application examples from each chapter. This article is primarily based on the simulation implementation on the MATLAB 2015b (32-bit) platform, specifically focusing on the instance of unsupervised learning neural networks for mine water inrush source discrimination. Without further ado, let’s get started!

MATLAB Simulation Example

Open MATLAB, click on “Home”, then click “Open”, and locate the example file.

30 MATLAB Intelligent Algorithm Cases | Mine Water Inrush Source Discrimination

Select main.m and click “Open”.

The source code for main.m is as follows:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Function: Unsupervised Learning Neural Network Classification - Mine Water Inrush Source Discrimination Example
% Environment: Win7, MATLAB2015b
% Modi: C.S
% Time: 2022-07-09
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Clear Environment
clc
clear all
close all

%% Chapter 27 Unsupervised Learning Neural Network Classification - Mine Water Inrush Source Discrimination
% 
%% Training/Test Set Generation
% Import Data
load water_data.mat
% Data Normalization
attributes = mapminmax(attributes);
% Training Set - 35 samples
P_train = attributes(:,1:35);
T_train = classes(:,1:35);
% Test Set - 4 samples
P_test = attributes(:,36:end);
T_test = classes(:,36:end);
%% Competitive Neural Network Creation, Training, and Simulation Testing
% Create Network
net = newc(minmax(P_train),4,0.01,0.01);
% Set Training Parameters
net.trainParam.epochs = 500;
% Train Network
net = train(net,P_train);
% Simulation Testing
% Training Set
t_sim_compet_1 = sim(net,P_train);
T_sim_compet_1 = vec2ind(t_sim_compet_1);
% Test Set
t_sim_compet_2 = sim(net,P_test);
T_sim_compet_2 = vec2ind(t_sim_compet_2);
%% SOFM Neural Network Creation, Training, and Simulation Testing
% Create Network
net = newsom(P_train,[4 4]);
% Set Training Parameters
net.trainParam.epochs = 200;
% Train Network
net = train(net,P_train);
% Simulation Testing
% Training Set
t_sim_sofm_1 = sim(net,P_train);
T_sim_sofm_1 = vec2ind(t_sim_sofm_1);
% Test Set
t_sim_sofm_2 = sim(net,P_test);
T_sim_sofm_2 = vec2ind(t_sim_sofm_2);
%% Results Comparison
% Competitive Neural Network
result_compet_1 = [T_train' T_sim_compet_1'];
result_compet_2 = [T_test' T_sim_compet_2'];
% SOFM Neural Network
result_sofm_1 = [T_train' T_sim_sofm_1'];
result_sofm_2 = [T_test' T_sim_sofm_2'];
toc
%%
% 
% <table align="left" width="656"> <tr><td align="center"><p align="left"><font size="2">Related Forums:</font></p><p align="left"><font size="2">MATLAB Technical Forum: <a href="http://www.matlabsky.com">www.matlabsky.com</a></font></p><p align="left"><font size="2">MATLAB Function Encyclopedia: <a href="http://www.mfun.la">www.mfun.la</a></font></p></td> </tr></table>
% 
% After adding, click "Run" to start the simulation. The simulation results are as follows:

Time elapsed: 10.771554 seconds.

30 MATLAB Intelligent Algorithm Cases | Mine Water Inrush Source Discrimination

Click on the Plots tab for SOM Topology, SOM Neighbor Connections, SOM Neighbor Distance, SOM Input Planes, SOM Sample Hits, and SOM Weight Positions to obtain the following illustrations:

30 MATLAB Intelligent Algorithm Cases | Mine Water Inrush Source Discrimination

30 MATLAB Intelligent Algorithm Cases | Mine Water Inrush Source Discrimination

30 MATLAB Intelligent Algorithm Cases | Mine Water Inrush Source Discrimination

30 MATLAB Intelligent Algorithm Cases | Mine Water Inrush Source Discrimination

30 MATLAB Intelligent Algorithm Cases | Mine Water Inrush Source Discrimination

30 MATLAB Intelligent Algorithm Cases | Mine Water Inrush Source Discrimination

Conclusion

The learning rules of neural networks, also known as training algorithms, are used to calculate and update the weights and thresholds of neural networks. There are two main categories of learning rules: supervised learning and unsupervised learning. In supervised learning, a series of correct input/output pairs (i.e., training samples) must be provided for the learning rule. When the network is input, the network output is compared with the corresponding expected value, and then the learning rule is applied to adjust the weights and thresholds to make the network output close to the expected value. In unsupervised learning, the adjustment of weights and thresholds is only related to the network input, without any expected values. Most algorithms in this category use clustering methods to classify input patterns into finite categories. For those interested in the content of this chapter or wanting to learn more thoroughly, it is recommended to study Chapter 27 of the book.

Leave a Comment