Abstract
This paper presents an approach incorporating fuzzy logic techniques inside a convolutional neural network to manage uncertainty present in the multiple data sources that the model handles when training. The implementation considers the use of information and filters in the fuzzy spectrum, as well as the creation of a new layer to replace the traditional convolution layer with a fuzzy convolutional layer. The aim is to design artificial intelligence algorithms that combine the potential of deep convolutional neural networks and fuzzy logic to create robust systems that allow modeling the uncertainty present in the sources of data and that are applied to classification problems. The fuzzification process is developed using three membership functions, including the Triangular, Gaussian, and S functions. The work was tested in databases oriented to traffic signs, due to the complexity of the different circumstances and factors in which a traffic sign can be found.
Introduction
Convolutional Neural Networks (CNNs) are one of the most popular architectures of deep learning, which enables robustness in feature extraction and learning of large volumes of data [1]. Its advantage is the great extraction capacity number of samples of input data for processing and obtaining effective results; however, there may be uncertainty in the input data result of bad information; which may be incomplete, fragmented, not completely reliable, which is largely considered vagueness or ambiguity of data. A deep CNNs network is a fully deterministic model used in a totally “black box” form that cannot handle data ambiguity [2].
Besides neural networks, within the field of artificial intelligence, there are other areas of great relevance, such as fuzzy systems, which have had a great impact on complex real-world problems [3–6]. Fuzzy systems approach reasoning with uncertainty, similar to how humans think and make decisions; these have the ability to model systems with high noise levels, imprecise information, or vagueness of data. Fuzzy logic theory provides mathematical frameworks for processing ambiguous information through the application of numerical calculations utilizing linguistic variables and membership functions that can be interpreted as degrees of membership. The fuzzy rules and fuzzy inference systems make the feature extraction more humanly interpretable [7–10].
The integration/combination of fuzzy logic and convolutional neural networks allows the creation of more robust detection and classification models, allowing high-level feature extraction when working with ambiguous data, which could be due to imprecise information, or distorted by capture or measurement devices [11].
The inclusion of fuzzy logic in neural networks arises from the need to understand how deep learning models work, which are usually considered black box models, due to the complexity of their operation when performing inference tasks. Seek to provide the human approach necessary for complex models to become auditable, giving explanations to the factors that are included in the information for decision making, giving an understanding of the strengths and weaknesses that the model may have, thus offering an opportunity to improve it; so that it can be applied to new environments.
The aim of this approach is to design, develop and implement artificial intelligence algorithms that combine the potential of deep convolutional neural networks and fuzzy logic, to create robust systems that allow modeling the uncertainty present in the sources of data and that these are applied in classification problems.
The investigation presents an approach where the data and filters are exposed to the process defined as fuzzification, which consists of the utilization of a fuzzy membership obtaining a degree of membership which is referred to as fuzzy number. This step is applied to a combination of the data and the random filters initialized by the CNN. The general idea is to reduce the uncertainty present in the data and its filters by utilizing fuzzy numbers aiming to improve the classification rate. The proposal is applied and tested in databases oriented to traffic signs.
The rest of the paper is organized as follows. Section 2 contains related work in the state-of-the-art about the combination of fuzzy logic and neural networks. Section 3 presents the general idea of the methodology carried out by the fuzzy-CNN approach, as well as its operation and implementation. Section 4 contains the results obtained from the experiments after applying the proposal method over the databases. The results obtained are analyzed and discussed in detail in Section 5. The conclusions about the work carried out as well as implementations or future work are presented in Section 6.
State-of-the-art
In the state of the art, exist a plethora of works that have addressed the combination of convolutional neural networks and fuzzy logic in various ways. In the classification area, one can mention some contributions: a fuzzy convolutional neural network that includes a fuzzy inference system in the fully connected layers is presented in [12] to perform the classification task, improving the accuracy of the model when trained with small data sets. In [13], a fuzzy convolution layer model with data and fuzzy kernels in a multimodal is proposed to perform sentiment analysis with movie clips, using audio, video, and text to generate an output, obtaining favorable results. In [14], the authors present a convolutional fuzzy neural network based on feature fusion and the Taguchi method (CFNN) for malware classification, the CFNN comprises convolutional, pooling, feature fusion, and fuzzy neural network (FNN) layers. In [15], a fuzzy pooling layer is proposed that handles uncertainty in feature maps, improving classification accuracy on multiple public datasets. In [16] a fuzzy adaptive neural network is presented, the model is applied to 16 machine learning datasets, outperforming other comparative models with 81.25% of the datasets utilized. Additionally, the proposed FANN model outperformed the latest FNN models, achieving an average of 5.1% increase in modeling accuracy. A novel multimodal emotion understanding framework based on CNNs and fuzzy logic to extract high-level emotion features is presented in [17]. In [18] a model of CNN and fuzzy logic is implemented to improve the accuracy of human smile detection. In [19], proposed an architecture combining CNN and fuzzy clustering to feature extractor and derivation, which performed better than most of benchmark methods in terms of classification accuracy. In [20], a novel deep fuzzy neural network based on fuzzy units and convolutional units is established to handle uncertainty and extract discriminative features, which improved the segmentation accuracy. Lastly, some ANFIS variants, fuzzy multilayer clustering and fuzzy C-means clustering methods based on deep learning were applied to the classification field [21–25].
From the perspective of sentiment analysis or text classification, in [26] proposed an integrated algorithm based on fuzzy mathematics and genetic algorithms, called evolutionary fuzzy deep belief networks with incremental rules. As for the machinery translation, a model based on DNN and fuzzy logic was proposed for better extracting reordering rules of sentence structure [27]. To maximize the utilization of unstructured nursing notes within clinical decision support systems, an innovative approach combining fuzzy tokenization and deep learning techniques was introduced for the purpose of healthcare analysis and predicting disease groups [28].
In Automatic control, deep learning has shown great superiority and potential in feature extraction and parameter fitting, the fusion of fuzzy systems has also resulted in better performance under uncertainty in control. In various state-in-state methodologies [29] used for data-driven control were recalled in detail, including SVM, multiple least square support vector machine, neural network, deep learning, fuzzy logic, probabilistic latent variable models. In the aspect of robot or intelligent system, an intelligent fuzzy sliding mode control method based on deep learning and fuzzy logic was proposed for constructing a complex robot system under disturbances [30], and a robust adaptive control scheme using RBM and type-2 fuzzy system was designed for the fractional-order multi-agent system [31], an online deep fuzzy learning for control of nonlinear systems combining fuzzy logic and deep learning was developed with two training stages [32–35].
Methodology
Membership function utilized for the implementation
In this section, the approach to the fuzzy convolutional neural network using type-1 membership functions is presented. The process to implement is described as follows and Fig. 1 presents an illustration of the general implementation.

General process of the fuzzy convolutional approach.
Fuzzify the data and filters of the convolutional layer. In the fuzzification process, a first approach is implemented utilizing popular simple membership functions. These functions include the Triangular, Trapezoidal, and S membership functions, which are expressed in Equations (1)–(3) respectively and illustrated in Fig. 2.

(a) Triangular Membership Function (b) Gaussian Membership Function (c) S Membership Function.
The range of the MFs were denoted with the following restrictions: the training data (in grayscale format) in a range of [0, 255]. Random filters (Originally generated with Xavier initialization [39]), generated from a normal distribution with a range between [–1, 1]. Figure 3, illustrates the MFs used in the fuzzification process.

Membership Function using in the fuzzy convolutional process.
Implementation of the convolutional process with the fuzzy filters and fuzzy images, with the ReLu function. This is a fundamental layer in the CNN architecture. This consists of a set of random filters which are applied to the input data to obtain specific features or patterns in the data. In this case the filters data is fuzzified utilizing the MFs explained in Step 1. The convolutional term is derivative of the utilization of the convolutional equation which is expressed in Equation (4), where f is the fuzzy input image, k is fuzzy input filter, i represents the image column, j is the row of the image and r and c represents the row and column of the fuzzy input filter respectively; (f * k) is the resulting image. Figure 4 illustrates an example of the convolutional process, using fuzzy filters and data; that is, after the fuzzification implementing a Triangular MF and considering the parametrization explained in Step 1. To the output of the convolutional process, the activation function ReLU is applied as is expressed in Equation 5 and illustrated in Fig. 5.

Convolutional process in two dimensions.

Activation function ReLU.
Implementation of the pooling layer. This layer allows a create a reduced representation of the information, decreasing the number of parameters it contains. Max Pooling represents a filter of size n×n, which loops through the information similar to the convolution process. In this case, unlike applying a dot product, the maximum value of this window is extracted to store it in a new one of the representation, reducing the dimensions proportionally to the size of the filter used, as well as the step size in a similar way to layer convolution.
Dense layer. It consists of weights and biases similar to traditional neural networks. The input of the layer consists of the output of the convolutional layer in the form of a feature vector from the previous layers and transforms it into a specific output, such as an image classification.
Output layer. It is the last layer of a neural network, in which classification or regression is performed. Depending on the problem, this layer may have one or more outputs.
To perform the classification task, four simple CNN architectures (CNN-I to CNN-IV) were proposed. The definition of these models was determined by previous successful experiences in tackling similar classification problems. Each architecture is delineated in Tables 1–4, maintaining a consistent structure, with the sole difference being in input and output sizes. Tailored to distinct datasets, these variations enhance adaptability, ensuring optimized performance across diverse classification challenges.
CNN-I architecture
CNN-I architecture
CNN-II architecture
CNN-III architecture
CNN-II architecture
The following section contains the experimentation performed on the multiple datasets with the proposed models.
The experimentation with the models utilized for the classification task was performed with Python 3.8 utilizing the Tensorflow library with the Keras API [36], the development and training of the modes was performed in a system with the NVIDIA Container Toolkit in a system with Pop!_OS 20.04, Intel Core I7 12700HQ, 64 GB of RAM and a dual GPU, an RTX 3080 Mobile and a RTX 3070Ti with an eGPU enclosure.
Datasets
The classification task was performed with the following datasets, BELGIUMTS, and CTSD [38].
BELGIUMTS dataset
The Belgium Traffic Sign Classification Benchmark contains 62 different types of traffic signs from the country which are cropped from video frames. This dataset contains 7,095 images, with 4,575 training images and 2,520 testing images. Figure 6, presents a sample of this dataset.

Belgium dataset.
The Traffic Sign Recognition Database is a Chinese dataset with 58 different traffic signs from China. The dataset has a total of 6,164 images, with 4,170 training images and 1,994 testing images. The dataset is in PPM format with a 64px-by-64px. Figure 7 illustrates a sample of the dataset.

CTSD dataset.
The experimentation was performed utilizing the fuzzified data (fuzzy data), filters (fuzzy filters), and a combination of both (fuzzy data and filters) in the process of convolution, applying it to the Belgium and CTSD databases. Thirty independent model training courses were conducted for each study case.
BelgiumTS results
In this section, the results obtained from the experimentation utilizing the BelgiumTS database are displayed.
Table 5 presents the results after applying the four CNN models using the images in grayscale format.
Results for BelgiumTS with grayscale data
Results for BelgiumTS with grayscale data
In another experiment, all input images were fuzzified using Gauss (Gauss), Triangular (Trian), and S MFs; the results are presented in Table 6.
Results for BelgiumTS with fuzzy data
Table 7 presents the results obtained when the CNN models are performed using the fuzzy kernel; that is, in the convolutional process the kernel is fuzzified using the three different MFs.
Results for BelgiumTS with fuzzy kernels
In the case of the results in Table 8, two processes are combined; first, the input database images are fuzzified with the different MFs, and during the convolution process, the kernels are also fuzzified.
Results for BelgiumTS with fuzzy data and kernels
In this section, the results obtained from the experimentation utilizing the CTSD database are presented.
The simulation results were also implemented using four CNN models. The case studies are the same as those described in the previous section; Table 9 presents the results using the input image database in grayscale format. The case in which the input images are fuzzified using the three variations of MF is described in Table 10. Table 11 presents the results obtained when only the convolutional kernels are fuzzified and, finally, in Table 12, where both the data of the input images and the kernels are fuzzified.
Results for CTSD with grayscale data
Results for CTSD with grayscale data
Results for CTSD with fuzzy data
Results for CTSD with fuzzy kernels
Results for CTSD with fuzzy data and kernels
To validate the results, a right-tailed test was included to verify the existence of significant evidence in the comparison of the membership functions utilized. Type: Right tailed test α = 0.05(Confidence of 95%, rejection zone z
c
= 1.96). n = 30. H0: The utilization of the Triangular MF (μ1) offers less or equal precision when compared to the Gaussian MF (μ2). H0 : μ1 ⩽ μ2. H
a
: The utilization of the Triangular MF (μ1) offers a better precision when compared to the Gaussian MF (μ2) .| H
a
: μ1 > μ2 (Affirmation).
The results obtained for BelgiumTS on Tables 5–8, show a particular loss in precision when the S MF and Gaussian MF are applied to the data, kernels, and the combination of both before the convolution process. The application of the Triangular MF to the filters, and the combination of both fuzzified filters and data, did not result in a significant improvement when compared to our baseline model trained with the grayscale images. On the other hand, the utilization of the data in the fuzzy spectrum with the Triangular membership function presents a significant improvement with all the proposed models.
The results of the statistical test performed to compare the Gaussian membership function against the Triangular membership function did not result in significant evidence to determine which of them, is the best option to perform the classification task.
The experimentation performed under the CTSD dataset presented in Tables 9–12 tends to follow a similar pattern to the BelgiumTS. The fuzzification of data, filters, and its combination with Gaussian MF and SMF, and the utilization of Triangular MF with kernels, and data and kernels, results in a decrease in the accuracy obtained. In a similar fashion, with the utilization of the Triangular MF under the data, presents an improvement up to 3% with CNN-III. The analysis of the tables demonstrates that the usage of fuzzy data with the Triangular MF is the best way to include the fuzzy paradigm in the model, which has a constant improvement in the results over Gaussian MF and S MF.
The results of the right-tailed test in Tables 13–14 indicate significant evidence of a difference when comparing the Triangular membership function against the Gaussian membership function in some of the proposed models.
Results for statistical analysis comparing Gaussian and Triangular MF applied to data for BelgiumTS
Results for statistical analysis comparing Gaussian and Triangular MF applied to data for BelgiumTS
Results for statistical analysis comparing Gaussian and Triangular MF applied to data for CTSD
Based on the obtained results, a decision was made to conduct a second statistical test, comparing a new model trained with RGB images (without data loss due to channel reduction), against the results obtained for the Triangular MF, this due to the great results obtained with the experimentation. The results presented in Table 15 indicate significant evidence only when comparing the CNN-I architecture with the fuzzy treatment to the data, making it a viable alternative preprocessing approach.
Results for statistical analysis comparing RGB images and Triangular MF data applied to data for CTSD
The utilization of the membership functions offers an improvement in the precision of the models, especially with the Triangular MF, which affected particularly the models trained with CTSD, significantly improving their results. The usage of fuzzy kernels, as well as the combination of data and kernels, have a negative impact when perfuming experimentation with new models.
For future work, there are plans to extend the fuzzification of filters and data to the Dense (traditional) layers. Additionally, the intention is to incorporate more types of membership functions and expand the experimentation to include type-2 fuzzy logic.
Footnotes
Acknowledgments
We thank Tijuana Institute of Technology/TecNM and CONAHCyT for support with the finances with the grant number CF-2023-I-555.
