Galoitica: Journal of Mathematical Structures and Applications

On The Fusion of Neural Networks and Fuzzy Logic, Membership Functions and Weights

Rama Asad Nadweh
Volume 7, Issue 1, pp. 18-25 (2023)
DOI: https://doi.org/10.54216/GJMSA.070102
Online: https://americaspg.com/journal/33/article/2017

Abstract

Fuzzy logic plays a huge role in the symbolic inference and causality associated with modern cognitive human systems. In this paper, we present a mathematical method that defines the mechanism of forming a hybrid structure in which neural networks and expert systems are connected so that one forms a primary processing stage for the other, where the neural network can act as a primary processor that processes low-level information, or as an internal Subsystem for learning tasks or generalization and classification. Where neural networks can be used to generate rules using training data and then submit these rules to be used by a fuzzy system to give the final results.

Keywords: Fuzzy set; fuzzy logic; neural network; membership function

1. Introduction

Symbols or symbolic figures are visual patterns, for example, a letter or a sequence of consecutive letters. These visual patterns have a meaning embedded in them so that this symbol indicates something else that may be a physically existing object, idea, or event [11], for example, we use the symbol X to denote an unknown quantity in a mathematical equation, or the word (Apple) to denote a semi-spherical organic substance with a red color that can be eaten. Thus, it can be said that symbols compress and shorten large amounts of information in such a way that the human mind can easily cope with it. Symbols can be used in a complex way to contribute to the transmission of large amounts of information in a concise form (compression Information) and dealing with these symbols is by setting rules that link them together and the results of applying these rules are also symbols that indicate real results in the real world. In most use cases, we combine a number of symbols to show the internal relationships between them, and this is what we call (symbolic causality). Symbolic causality refers to any kind of symbolic structures that show a relationship between symbols either in a purely abstract way, such as mathematical equations, or in ordinary speech, for example, if we say (all trees are green, cypress is a tree, Cypress is green.( Applications that rely on symbolic causality are called rule engines, expert systems, or cognitive graphs. One of the most famous current applications of these systems is the answers provided by Google directly under the search result, for example, when searching for (what are the names of Uranus moons) the answer appears directly before the web search results[4]. The fundamental difference between machine learning and symbolic causality lies in the method [6]. In machine learning and deep learning, algorithms learn rules and are in the process of establishing relationships between income and output. While in symbolic causality, the rules are set by the programmer so that when building a symbolic causality system, the programmer must first determine the rules that connect at least two phenomena together and then express these rules programmatically statically [14](hard-coded) . Deep learning and neural networks involve a different structure for forming perceptions and building assumptions so that the preconceived rules in them are about how they learn and build their own rules rather than what the result is to be reached [6]. Using fuzzy logic techniques, neural networks can be combined with symbolic causality and the goal is to solve more complex problems in the real world, such as pattern recognition, regression or density estimation issues when using data of large sizes or multiple dimensions, for example, neural networks are used in digital navigation systems, and decision-making processes in these systems need to process a large number of deterministic to deal with Whit foggy income to generate inevitable results. When we look at neural networks. From the perspective of symbolic causality, expert systems and fuzzy logic share many internal features and computational techniques. A model based on fuzzy logic will be presented, in which an artificial neural network is designed in order to build the knowledge base of the expert system by training examples. In neural networks, two types of weights are associated with synaptic connections in the AND-OR structure: primary linguistic weights, which are interpreted as designations of fuzzy sets, and secondary numerical weights. The value at which the cell is activated is calculated by the equations of fuzzy weights .the min max learning process is based on finding (numerical) weights and determining network paths, and these networks were initially called front-Fed networks, and the first areas of their use in applications that help in medical diagnostics [10]. Next we will apply the method to show how we can use it to recognize handwriting. For example, in a fuzzy neuron describing a number, the language weights represent fuzzy sets on the intersection detection lines and the numerical weights reflect the importance of the connections between the intersection detection lines and the characters.

2. Reference Study There are a number of researches that have studied systems involving fuzzy logic and neural networks together, in 2007, researchers shitul and Zahran published a paper entitled Combining fuzzy logic and neural networks in classification of weld defects using ultrasonic time-of-flight diffraction [9], a study of docking defects using ultrasonic waves, in which The training data set was introduced into neural networks with the identification of a large number of output probabilities (rows), so that the output of the neural network is a field (beam) containing the most likely fault rows, to be passed this beam on a fuzzy system that converts it to an deterministic value (one row). In 2019, we will find a study entitled Hybrid model based on neural networks, type-1 and type-2 fuzzy systems for 2-lead cardiac arrhythmia [3]classification for researchers y. Ramirez, B. Milne, and J. Archiga. In this study, a hybrid model for classifying the types of heart rhythm disorders was built, which is a fuzzy logic system that uses neural networks as the initial processing stage of a data set consisting of readings of ECG results for a group of 5233 people. And we find another research by researchers B. Gonzalez and B. Milin, published in 2015 entitled Fuzzy logic in the gravitational search algorithm for the optimization of modular neural networks in pattern recognition [8] describes a method of using fuzzy logic within the gravitational search algorithm (GSA) in order to improve the results of neural units responsible for pattern recognition, neural units are several relatively small neural networks that work separately and their results are compiled using specific mathematical methods, in which averaging the value for each pattern using fuzzy logic and comparing this value with the results of each of the neural units.

3. Aim of research We find that most of the attempts to integrate neural networks and fuzzy logic were at the data and processing level, but comparing the methodologies used in building expert systems, we find that neural networks and fuzzy logic share a number of features and techniques, for example, the structure of data sets, equations and mathematical methods. The combination of Fuzzy Logic and neural networks at the mathematical and structural level can enhance the ability of intelligent systems to learn from experience and adapt to changes in an environment with qualitative, inaccurate, uncertain, incomplete or containing any form of data anomalies. This can be achieved by reaching a method that defines the mechanism of forming a hybrid structure in which neural networks and expert systems are connected so that one forms a primary processing stage for the other, where the neural network can act as a primary processor that processes low-level information, or as an internal Subsystem for learning tasks or generalization and classification. For example, neural networks can be used to generate rules using training data and then submit these rules to be used by a fuzzy system to give the final results.

4. Data and Methods 3.1. fuzzy logic and neural networks In neural networks, weights reflect the behavior of the system. In Fuzzy Systems, information is usually expressed using linguistic terms after being transformed into fuzzy sets, therefore, to take advantage of the two forms, we will present linguistic weights in the form of a fuzzy neural model[5]. We consider weights of two types: primary weights, followed by secondary ones. Elementary weights express the main information of knowledge, have a linguistic form and are interpreted as designations of fuzzy sets, with this we give them values as follows (increase, decrease, significant increase, normal value, stable, etc..) And it varies that depending on the purpose application, these fuzzy sets are defined depending on a set of terms related to the nature of the input cells or as in the case of fuzzy logic controllers, they can be values from the domain [+1,-1], with a membership dependent we can give the following designations: Large negative (NL), average negative(NM), small negative(NS), close to zero(R)), small positive(PS), average positive(PM), large positive (PL), and by shortening the previous values we can keep the next ones (decrease, stabilize, increase) in a section of 3 fuzzy sets. And we see in (Figure (1) the corresponding diagram of a triangular membership sequence containing the previous designations.

Figure

Figure (1) Secondary weights are numbers within the domain [0,1], reflect the degree of weakness of their corresponding connection (the weaker the connection, the closer its weight is to 1) and are not necessarily connected by connections but, when doing so, they follow the initial weight with which they are combined. The fuzzy nervous system is a front-feed network without threshold values, because fuzzy sets do not have thresholds, but a set of graded transitions is taken from one state to another. And in this system there are no iterative cycles, so that one cycle will be enough to get to the conclusion of the inference. At the training stage, methods with weighted totals of inputs are not used, but from fuzzy equations containing (lower) and (higher) values. This stage consists of finding numerical weights from training examples and there is no need to determine the organic dependencies of the initial weights at this stage, as it is assumed that the human expert has an approximate idea of the shapes and therefore can adjust the curves according to the information provided by the input and output examples. Learning mainly consists of finding numerical secondary weights and the structure of connections of the network, numerical (secondary) weights close to "1" will indicate the absence of the corresponding primary weight, while numerical (secondary) weights close to "0" will not at all affect the corresponding primary weight. The basic linguistic weights can always be adjusted when needed by changing the curves, as in (Figure 2) in the fuzzy region (membership scores differ from 0 and 1).

Figure

Figure (2)

A fuzzy neural network consists of connections between input cells (𝑆𝑗) and output cells (𝐷𝑖 ) (Figure 3) and can contain hidden cells(𝐻𝑗 𝑖) are linguistic designations of fuzzy sets characterizing the differences of input cells and their relationship to output cells [10].

𝑖). initial weights (π‘Šπ‘—

We assume that 𝑀𝑗 𝑖 expresses a language weight (or the fuzzy set associated with this weight). The secondary weights (𝑏𝑗) are numbers within the domain of values. In a neural network, input cells have connections that either point to hidden cells and are followed by connections towards output cells (Figure 4), or direct connections from input cells to output cells (this case corresponds to a numerical weight equal to 0), but not necessarily a connection with all output cells (no connection at all corresponds to a numerical weight equal to 1)[2]. As soon as an alert is issued from an input cell, a language weight is selected and there is not necessarily a digital weight in the absence of a hidden background. The hidden cells contain only numerical weights linked by connections to the output cells [1] Input cells can take numerical values or fuzzy numbers (fields), we use 𝑆𝑗 to indicate the numerical (fuzzy) value assigned to that cell. When the input cells are assigned 𝑆𝑗, a set of weights is added that are used for inference in order to calculate the output cells 𝐷𝑖, according to the following formula:

𝐷𝑖=π‘šπ‘–π‘›π‘—β‘γ€–[𝑏𝑖𝑗  ⋁ 𝑒(𝑀𝑖𝑗)(𝑆𝑗)] γ€—

𝐷𝑖=π‘šπ‘–π‘›π‘—β‘γ€–[𝑏𝑖𝑗 ⋁ Ο€(𝑀𝑖𝑗,𝑆𝑗)] γ€— …….Equation (1) Where U𝑀𝑖𝑗(𝑆𝑗) is a subordinate of the degree of membership of 𝑆𝑗 in 𝑀𝑖𝑗 and 𝑆𝑗 is a fuzzy number (domain).

Ο€(𝑀𝑖𝑗,𝑆𝑗)=sup ⁑ γ€– (π‘€π‘–π‘—βˆ©π‘†π‘—)γ€— is the probability measure associated with the fuzzy set 𝑀𝑖𝑗 and 𝑆𝑗. Where we notice that when we give 𝑆𝑗 a constant, non-fuzzy value Ο€ (𝑀𝑖𝑗,𝑆𝑗), its value becomes 𝑒(𝑀𝑖𝑗)(𝑆𝑗).

In Equation (1), we assume that 𝑀𝑖𝑗is known as an approximate value, and the unknown values are the values of 𝑏𝑖𝑗, these equations can be solved according to the bruerian method, where we set the set of x values so that a ∨ x β‰₯ b contains a minor element and is located in the domain [0,1] in the absence of solutions with a high success rate, the membership dependencies of 𝑀𝑖𝑗 can be adjusted by changing slopes or resetting them. And in case we don't know the values of 𝑀𝑖𝑗nor 𝑏𝑖𝑗 in the first equation, but we know that w_ijs is located Within a finite finite fuzzy domain of [1+, 1-] as in Fig .1and also then Equation(1) can be solved for each 𝑀𝑖𝑗of said fuzzy domain. 3- 2-Application to mutations and chromosomes causing them: The fuzzy network of communication between a set of chromosomes and mutations will now be represented where the chromosomes are as follows 𝑋1 𝑋2𝑋3𝑋4𝑋5 and corresponding to four gene mutations 𝑀4, 𝑀3, 𝑀2, 𝑀1 The relationship is illustrated (Figure 5), where the five chromosomes correspond to the 𝑋𝑖input cells، And the four groups of output cells are𝑀4,..., 𝑀𝑖There are seven hidden cells associated with numerical weights. Linguistic weights have the following meaning: π‘Š11: average. π‘Š12: medium,π‘Š22: high,π‘Š32low or normal,π‘Š42: low or medium. π‘Š13medium,π‘Š23: high,π‘Š33: high,π‘Š43: low or medium. π‘Š14: medium,π‘Š24: high,π‘Š34: very high,π‘Š44: high or slightly high. π‘Š15: medium,π‘Š25: too high,π‘Š35: too high.

Figure

Figure (3) Let's take the mutation (𝑀3as an example: The mutation (𝑀3) is associated with chromosome (𝑀2) according to the connection (π‘Š32) with language weight (low or normal) as we explained earlier.

The mutation (𝑀3) is associated with the chromosome (𝑀3): according to the connection (π‘Š33) with a weight (high) and a weight value of 0.2. The mutation (𝑀3) is associated with the chromosome (𝑋4) according to the connection (π‘Š34) with a language weight (very high) and a weight value of 0.7. The mutation (𝑀3) is associated with the chromosome (𝑋5) according to the connection (π‘Š35) with a language weight (very high) and a weight value of 0.2. 3-3-convert handwriting to text: The prototype of handwriting recognition using fuzzy neural networks was presented by researcher Takeshi Yamakawa [12] [13] according to the following: Weighting factors are replaced by organic functions. Stimulated connections are represented by MIN operations and inhibited connections by Fuzzy Logic complements followed by operations .MIN The threshold level is not set We will try to apply the previous method in a similar way to the approach we took in detecting mutations based on chromosomes. Since handwritten characters (𝐢𝑖replace mutations, and the letter is written within a predetermined dimensionally defined and known space, a set of reference lines is placed within this space and these lines can be intersecting and The Shape of the letter is determined depending on the numerical weights that will correlate with the reference lines [7]. We define π‘Šπ‘–π‘—groups, which are blurry groups in the reference intersection lines. The intersection zones, i.e. the blurry areas of the reference lines are determined where the characters should intersect, and the blocked areas, where the characters should not intersect, these lines are shown in (Figure 7).

Figure

Figure (4) For example, the blurry area at Line 5 allows the number 9 to be distinguished from the number 3 The formula for calculating the output is as follows:

𝑒𝑐𝑖=π‘šπ‘–π‘›π‘— ⁑〖[𝑏𝑖𝑗 ⋁𝐢𝐷𝐿𝑗] γ€— Where𝐢𝑖 is a character (e.g. "9"), 𝐢𝐷𝐿𝑗is a degree of the reference line number j, and b_ij are numerical weights of relative importance to the reference line j in recognizing c_i: 𝑏𝑖𝑗=1 means that the reference line j has no use in 𝑐𝑖 𝑏𝑖𝑗=0 means that there is no need to weight the reference line j in 𝑐𝑖 ]𝑏𝑖𝑗 E ]0,1 reflects the relative importance of the cross reference 𝑙𝑖𝑛𝑒𝑗in 𝑐𝑖 The higher the𝑏𝑖𝑗, the less influential the corresponding reference line will be. By following supervised learning the values of 𝑏𝑖𝑗can be found by solving the fuzzy min-max equations. The above explanations allow𝑏𝑖𝑗 to adjust the number of reference lines in a pattern, and their relative importance with respect to 𝑐𝑖can be adjusted by 𝑏𝑖𝑗itself. 4-Practical application: Using the Python programming language and relying on the following libraries: Fuzzylogic 1.0.1 PyLearn2 PyTesseract

Figure

Figure (5) An application was built (Figure 5) based on the previous equations and conducted tests to distinguish a set of numbers after being trained on a data set specially made for this purpose using the random number generation function in the Microsoft Excel program and using a font close to normal handwriting and named Segoe Print and then we used the same method to select a set of random numbers taken from the domain [0,9] and convert each cell into an image so that the file name is the same as the line number in the Excel file and then the application tries to detect the number in the image and compare the result with the line for the image in the Excel file Excel to find out the correct results and the wrong results, after 50 thousand attempts The percentage of correct answers was 68.2%, after 100,000 attempts the percentage of correct answers was 72.2%, and after 200,000 attempts the percentage of correct answers was 71.9%. The number of test samples, the percentage of correct answers, the time it takes to complete 50,000 70.2% 2000 seconds 100,000 72.2% 4550 seconds 200,000 71.9% 9000 seconds

5. results and discussion:

A fuzzy neural network is designed to build a knowledge base of a classification system using training examples. Two of its main characteristics are: 1-the use of linguistic weights. 2-the activation of neurons is a matter of degree, according to a weighted minimum. This model can be used to characterize rules in fuzzy logic. We have shown that fuzzy logic can be relied on to generate training sets that are input to neural networks used in artificial intelligence and deep learning systems so that the values of these training data are similar to the values of training data taken from the real world because they are not deterministic values but fuzzy values within a field containing all the probabilities of the value of the target property. This method of recognizing handwritten numbers and converting them to numeric text was tested, and it gave very good results, as at 100,000 test samples, we got 72.2% of the correct output cases. However, the use of fuzzy logic to generate training data for neural networks needs further research and application to other study cases to ensure its effectiveness in all cases, as we may find cases where even fuzzy values cannot be used, or cases where the results must be very accurate even using fuzzy logic, such as medical applications or cases that need to provide very accurate information at very high speed, such as navigation applications and maps. And these are all cases that should be studied specifically in terms of the possibility of generating training data for their neural networks by Fuzzy Logic.

6. conclusions

Through this research, in which the ways of using fuzzy logic and neural networks were studied together, we came to the following scientific conclusions: * Neural networks and fuzzy logic can be used interleaved at the structural level (neural network architecture or fuzzy system architecture). * Fuzzy logic rules can be generated for a fuzzy system, using artificial neural networks. * The output of a neural network often needs to be modulated (using slope modulation) before it can be used in organic dependencies in fuzzy logic. * When constructing a fuzzy nervous system, threshold values must be dispensed with, because fuzzy sets do not have thresholds, but a set of graded transformations is taken and expressed as a numerical domain. * By making the neural network balances take a blurry field, handwritten numbers can be distinguished according to the rules of reference lines with a high success rate of more than 70%. * Training data for neural networks can in certain cases be generated by Fuzzy Logic. Scientific References: [1] AGGARWAL C, 2018 - Neural networks and deep learning. SPRINGER Vol. 10/2018. 903 – 978. [2] GAMA F, ISUFI E, 2020 - Graphs, convolutions, and neural networks. IEEE Signal Processing Magazine, Vol. 37. 128 – 138. [3] GONZALEZ B, MELIN P, 2015 - Hybrid model based on neural networks, type-1 and type-2 fuzzy systems for 2-lead cardiac arrhythmia classification. Expert Systems with Applications. Vol. 126. 295 – 307. [4] HASIBUAN N, 2017 - Expert systems with genetics probability. International Journal of Research In Science & Engineering, Vol. 3. 42 –54. [5] NAITZAT G, ZHITNIKOV A, 2020 - Topology of deep neural networks. J. Mach. Learn. Res. Vol. 184. 1 – 40. [6] PRENTZAS N, 2019 - Integrating machine learning with symbolic reasoning to build an explainable AI model for stroke prediction, IEEE Bioinformatics and Bioengineering (BIBE), Vol. 19. 817 - 821. [7] RACHMAWANTO E, ANARQI G, SARI C - 2018 Handwriting Recognition Using Eccentricity and Metric Feature Extraction Based on K-Nearest Neighbors. Application for Technology of Information and Communication. Vol.18. 411 – 416.

[8] RAMIREZ E, MELIN P, PRADO-ARECHIGA G, 2019 - Fuzzy logic in the gravitational search algorithm for the optimization of modular neural networks in pattern recognition. Expert Systems with Applications. Vol. 42(14). 5839 – 5847. [9] SHITOLE C, 2007 - Combining fuzzy logic and neural networks in classification of weld defects using ultrasonic time-of-flight diffraction. Insight-Non-Destructive Testing and Condition Monitoring. Vol. 49. 79 –89. [10] VAN GERVEN M, 2017 - Artificial neural networks as models of neural information processing, Frontiers in Computational Neuroscience, Vol. 11. 114-121. [11] XIAOYAN W, 2019 - The Study of Visual Symbols in Digital Media Technology. Semantics Scholar, 30 – 47. [12] YAMAKAWA T, 1991 - A fuzzy neuron and its application to pattern recognition. IEEE International Sympoisum on Circuits and Systems, Vol.91.1369 – 1372. [13] YAMAKAWA T, 1993 - A fuzzy inference engine in nonlinear analog mode and its application to a fuzzy logic control. IEEE transactions on Neural Networks , 496– 522.

References

[1] AGGARWAL C, 2018 - Neural networks and deep learning. SPRINGER Vol. 10/2018. 903 – 978.

[2] GAMA F, ISUFI E, 2020 - Graphs, convolutions, and neural networks. IEEE Signal Processing Magazine, Vol. 37. 128 – 138.

[3] GONZALEZ B, MELIN P, 2015 - Hybrid model based on neural networks, type-1 and type-2 fuzzy systems for 2-lead cardiac arrhythmia classification. Expert Systems with Applications. Vol. 126. 295 – 307.

[4] HASIBUAN N, 2017 - Expert systems with genetics probability.
International Journal of Research In Science & Engineering, Vol. 3. 42 –54.

[5] NAITZAT G, ZHITNIKOV A, 2020 - Topology of deep neural networks. J. Mach. Learn. Res. Vol. 184. 1 – 40.

[6] PRENTZAS N, 2019 - Integrating machine learning with symbolic reasoning to build an explainable AI model for stroke prediction, IEEE Bioinformatics and Bioengineering (BIBE), Vol. 19. 817 - 821.

[7] RACHMAWANTO E, ANARQI G, SARI C - 2018 Handwriting Recognition Using Eccentricity and Metric Feature Extraction Based on K-Nearest Neighbors. Application for Technology of Information and Communication. Vol.18. 411 – 416.

[8] RAMIREZ E, MELIN P, PRADO-ARECHIGA G, 2019 - Fuzzy logic in the gravitational search algorithm for the optimization of modular neural
networks in pattern recognition. Expert Systems with Applications. Vol. 42(14). 5839 – 5847.

[9] SHITOLE C, 2007 - Combining fuzzy logic and neural networks in classification of weld defects using ultrasonic time-of-flight diffraction.
Insight-Non-Destructive Testing and Condition Monitoring. Vol. 49. 79 –89.

[10] VAN GERVEN M, 2017 - Artificial neural networks as models of neural information processing, Frontiers in Computational Neuroscience, Vol. 11. 114-121.

[11] XIAOYAN W, 2019 - The Study of Visual Symbols in Digital Media Technology. Semantics Scholar, 30 – 47.

[12] YAMAKAWA T, 1991 - A fuzzy neuron and its application to pattern
recognition. IEEE International Sympoisum on Circuits and Systems, Vol.91.1369 – 1372.

[13] YAMAKAWA T, 1993 - A fuzzy inference engine in nonlinear analog mode and its application to a fuzzy logic control. IEEE transactions on Neural Networks , 496– 522.