## 3 Problem Statement and Proposed Method  
A hybrid neural model, described in [35; 36; 37], was previously designed for the same problem, using 3 fuzzy systems: the first provides the classification of the patient's blood pressure level [38; 39; 40], the second classifies the heart rate level and a third classifies the night profile of the patient [41]. Now, in this paper, we are using the Bird Swarm Algorithm for finding the optimal design of type-1 and type-2 fuzzy systems for the classification of the heart rate level of patients. Because the improvement in classification is aimed at providing an accurate diagnosis to patients, it was decided to use a bio-inspired algorithm, such as the Bird Swarm Algorithm, forthe optimization of fuzzy systems, in order for the algorithm to make the necessary adjustment in the membership functions. Figure 2 shows the proposed methodology for what is being addressed in this work and which is explained below:  
A database with readings of the heart rate of a set of patients was used, which were obtained through the Ambulatory Blood Pressure Monitoring device (ABPM) [42]. To perform the optimization, 30 patients were taken from the database. The necessary information is the age and the tendency of the heart rate, and these are the inputs to the fuzzy system. Regarding optimization, the individuals, in this case the birds, are the ones that will be moving the membership functions in the search space, until fuzzy system is found that provides a classification with less error, and for this reason, the mean square error is used as an objective function, as presented in Equation (7). The algorithm will provide the fuzzy system with the least error in the classification, and this is tested with different sets of patients to observe its performance. Once this is done with type-1 fuzzy systems with Gaussian and trapezoidal membership functions and the best fuzzy systems are obtained, they are taken as a basis to perform the optimization of the interval type-2 fuzzy system for which the BSA algorithm will adjust the footprint of uncertainty; for this, the procedure described above is also performed. Design of the Type-1 Fuzzy Inference System with Trapezoidal Membership Functions for the Classification of the Heart Rate Level  
A Mamdani fuzzy inference system is designed for the classification of the heart rate level based on [19] and the experience of the cardiologist, the inputs and output of which are described below and illustrated in Figure 3:  
Figure 2: Proposed methodology. Age input: this input is in a range from 0 to 100, granulated in 4 membership functions corresponding to the linguistic variables \"Child\", \"Young\", \"Adult\" and \"Elder\", as presented in Figure 4.  
Heart rate input: this input goes between the range of 0 to 220, because it is the maximum heart rate that a young person may have during physical activity, and is granulated into 5 membership functions using the linguistic variables \"Very Low\", \"Low\", \"Normal\", \"High\" and \"VeryHigh\", as presented in Figure 5.  
The output is the heart rate level, which ranges from 0 to 100%; this indicates how high or low the patient's heart rate is, and is granulated into 5 membership functions, with the linguistic variables \"Low\", \"BelowAV\", \"Excellent\", \"AboveAV\" and \"VeryHigh\". As a defuzzification method, the centroid of area was used. The fuzzy system output is illustrated in Figure 6.  
Figure 4: Input age. Figure 5: Input heart rate. Figure 3: Heart rate level fuzzy system.