Evaluate of The Reproductive Efficiency of Cows With Fuzzy Logic

Fuzzy Logic (Fuzzy Logic) is a branch of science based on thinking like human beings and solving them with mathematical functions. Fuzzy logic theory is a mathematical theory. Based on fuzzy set theory, it also uses intermediate values. The fuzzy logic that emerged in 1965 is used in many fields. In the production of pacemakers, in the production of artificial organs, in many electronic devices, company efficiency estimation, etc. situations are used. Fuzzy logic, which is frequently used in the solution of problems that occur in uncertain situations such as quality assessment in recent years, is one of the artificial intelligence methods. With the help of machines, people-specific data and experiences are studied using the fuzzy logic approach. In this study, by using Matlab Fuzzy Toolbox, it was aimed to design a system that gives information about the breeding performances of cows. The expert system was designed based on the optimal values under the ideal conditions specified in the literature. The architecture of the system presented in this paper is designed as three input parameters and one output. The designed system was tested with 100 sample values. Afterwards, expert results were evaluated and system decisions were compared. The success of the decision support system was 94%. As a result, the reproductive efficiency of cows can be determined with this designed system. With this determination, the handling or disposal of cows can be determined. This is an


Introduction
Along with the developing social structure, perspectives on real life problems and events also change. People solve their problems by using the verbal and numerical data they have and use various methods for this. While mathematical methods help people in analyzing problems in situations involving certainty by analyzing numerical data, they may be inadequate in situations involving uncertainty. Fuzzy logic, which is frequently used in the solution of problems that occur in uncertain situations such as quality assessment in recent years, is one of the artificial intelligence methods. Azeri-based scientist Lotfi A. Zadeh stated that a different mathematics is needed for fuzzy (uncertain) situations that cannot be defined by probability distribution [1]. In 1965, the first article on fuzzy logic, titled "Fuzzy Sets," was made by Zadeh. Zadeh stated that there are mostly fuzzy expressions that are not certain in the mentality of people. Fuzzy logic theory has a more flexible structure than classical logic theory. It explains events with the degree of accuracy they assign to objects between "0" and "1", thus creating a link between verbal and numerical data [2].
In our daily life, many data that we use contain blur. Turbidity is the need for intermediate values as well as certain values in expressing the current situation. For example, if the age range is 16-25 for a person whom we define as young, we do not use the expression old for 26 years. Intermediate values such as young-middle age-old can be used to express the turbidity condition here [3].
Fuzzy Logic (Science of Fuzzy Logic) is a branch of science that is based on thinking like a human and solves them by using mathematical functions. Working with intermediate values is the main element of fuzzy set theory [4]. Fuzzy logic theory allows to be transferred to machines using human data and experiences. This ability is gained by using symbolic expressions instead of numerical expressions. Symbolic expressions are transferred to machines using mathematical principles. This is the basic fuzzy sets theory [5]. The application areas of fuzzy logic are very wide. The biggest benefit is that the "learning with human experience" phenomenon can be easily modeled and that even uncertain concepts can be expressed mathematically. Therefore, it is particularly suitable for approaching nonlinear systems. Fuzzy logic; Concepts such as "hot" or "air polluted" and how fast it will work, or when it will go from one stage to another, etc.) Although it is difficult to define the criteria to be used for making changes related to these, it helps engineers to make self-determining systems [5].
In the study by Morag, I. et al. [6], a decision support system has been developed that allocates condensed feed using fuzzy logic to cows through individual feeders according to their performance.
Mehraban, S.M. et al. [7] also displayed that fuzzy logic is applied to classify raw milk according to microbiological and physicochemical qualities.
In the study by Takma, Ç. et al. [8] The effect of lactation time (LS), calving year (BY) and service period (SP) on the lactation milk yields of Black Pied cows were modeled with multiple regression and artificial neural network (ANN) and models compliance abilities were compared. The analyzes were performed on the milk yields of the first five lactations of a total of 305 Black Pied cows calving in 2006, 2007 and 2008. Grinspan, P. et al. [9] also used fuzzy logic for decision making in the selection of the feeding method of dairy cows. They stated that the decisions taken were based on milk production, body weight change and the interaction between them.
Atıl, H. et al. [10] also included literature on artificial neural networks in animal husbandry in recent years, generally in the literature such as disease recognition, quality determination, reproduction, and yield.
De Mol, R.E. et al. [11] reported that sensors for measuring cow yield, temperature, electrical conductivity and animal activity can be used for automatic cow condition monitoring. Fuzzy logic is used to classify mastitis and oestrus impulses. Their purpose is to reject the number of false positive warnings and not to change the levels of mastitis and oestrus cases detected. Classification with a fuzzy model has proven to be very useful in increasing the applicability of automatic cow condition monitoring.
The study by Sanzogni, L. et al. [12] was on estimates of milk production using artificial neural networks for feed production.
Hassan, K.J. et al. [13] focused on using neural networks to detect small and large pathogens that cause bovine mastitis. It was concluded that this model was better compatible with the results obtained from traditional microbiological methods. It is stated that these models can be evaluated in sequential milking systems to provide diagnostic options in mastitis treatment.
Yang, X.Z. et al. [14] by studying artificial neural networks, they investigated the production and conformation features related to clinical mastitis. It may be appropriate to work with this technology, since artificial neural networks and mastitis have their performance in determining the key factors in the presence of mastitis.
The study by Shahinfar, S. et al. [15] was also on estimation of breeding values in dairy cattle using artificial neural networks and neuro turbid systems. Studies in the field of machine learning have enabled the creation of new methods in many other fields. The aim of the study is to analyze the situation of artificial neural networks and neuro-fuzzy systems in order to find the breeding values (EBV) of Iranian dairy cattle.
The aim of the study is to develop a fuzzy logic based decision support system that aims to divide the two calves into productive and inefficient according to the values of the first calving age, calving interval, number of seeding per pregnancy.

Material
The material of the study consists of the data of the criteria specified in a study on herd management in dairy cattle [16]. The input variables of the fuzzy system designed within the scope of this study were determined as the first calving age, calving interval, number of seeding per pregnancy. The output of the fuzzy system designed was in the form of cow breeding efficiency assessment. The analysis of the study was carried out using Matlab (Release 2019a) package program.

Method
The material of the study consists of the data of the criteria specified in a study on herd management in dairy cattle [16]. The input variables of the fuzzy system designed within the scope of this study were determined as the first calving age, calving interval, number of seeding per pregnancy. The output of the fuzzy system designed was in the form of cow breeding efficiency assessment. The analysis of the study was carried out using Matlab (Release 2019a) package program.
Computer systems operate with precise numerical information. However, in today's world, complexity arising from uncertainties prevails. For example, according to classical logic, while a short (0) or long (1) definition is made for a person's height; According to the fuzzy logic theory, definitions such as "very short, short, medium, long, very long" show a closer expression to real life situations. Verbal expressions such as "a little" or "a lot" used in daily life are called fuzzy variables. Based on a numerical basis, fuzzy logic theory has emerged to transmit oral concepts to digital platform. Fuzzy logic has provided a wide range of applications in the interpretation of mathematics in the real world [17]. Fuzzy systems consist of four components: fuzzy rule base, fuzzy inference engine (decision making unit), fuzzy and clarification ( Figure 1).

Figure 1. Fuzzy system structure
Blurring; an actual value is defined as a converter to a fuzzy set. For this, the input variable range is converted to the appropriate universal set, so that the input values are converted to the appropriate verbal values. Preliminary preparations are made in order to process the data coming from outside during the blurring phase by using the inference mechanism of the system and the information in the fuzzy rule base. The most used membership function types in applications are Triangle, Trapezoid, Bell Curve, Gauss, Sigmoidal, S and Pi (π) membership functions. In determining the membership functions, artificial intelligence methods such as ant colony algorithm, clonal selection algorithm, taboo search algorithm, genetic algorithms, and artificial neural networks are preferred by researchers [2]. In this study, in the light of detailed literature review and opinions of the expert, triangle and trapezoid membership functions were used.
In the fuzzy inference section; There is an inference mechanism along with the rule base used for the presentation of information. After the data coming to the system in the fuzzy rule base is brought ready for processing, it is processed by the extraction mechanism according to the rules defined as "if-then". Here are the variables, the number of membership functions and the number of rules. According to these defined parameters, a structural learning takes place. Fuzzy concepts are taught in a similar way to people's ability to make decisions and make inferences. Since the inference is defined as obtaining new information using the information obtained, it can be defined that the output value will be determined according to the input value in the fuzzy inference mechanism. In the fuzzy inference mechanism, information is modeled by various methods [18]. These methods called inference methods are expressed as Mamdani method, Larsen method, Tsukamoto method and Tagaki-Sugeno-Kang method. In this study, Mamdani inference method was used. The rule structure of this method; If m = F1 and n = L1 then qx = S1 If m = F2 or n = L2 then qy = S2 It is shown in the form.
Here, x1 and x2 represent the input variables and z represents the output variable. Membership functions are A1, B1, A2 and B2, and C is the fuzzy result set resulting from each rule. W1 and w2 threshold values are determined according to the blurry processors "and" and "or". If the processor "and" is used, the threshold value is equal to the smallest degree in the fuzzy sets on the basis of the intersection feature. If the processor "or" is used, the threshold value is equal to the largest membership degree on fuzzy clusters on the basis of the join operation. In the Mamdani extraction method, the first rule is determined by using the "and" processor and the w1 threshold value is the smallest membership 40 degree of fuzzy sets. The second rule is determined by the processor "or" and w2 threshold value is equal to the largest membership degree. As a result of the application of these rules, the result set is formed on the basis of the combination process in fuzzy sets [19].
In the rinsing section; The fuzzy cluster obtained in the fuzzy inference engine is converted to a certain value. The fuzzy set obtained must be a numerical value to be reapplied to real life [20]. In this study, the center of gravity method was used. Rinsing value, It is calculated by the formula (1). Here, yi represents the output variable value, and μc (yi) represents the membership degree of the output variable, y * represents the rinse value.

Results
The optimal values under the ideal conditions stated in the references [16,21] are given in the table below. The structure of the fuzzy logic system designed with rule base connections created with the criteria chosen by the expert among these data is given in Figure 2. Classes and class ranges of selected parameters must be determined before proceeding to blur process, which is the first stage of fuzzy system formation. Table 2 shows the classes and class ranges of the first calving age, calving interval and the number of insemination per pregnancy input variables.    Mamdani method, which is one of the inference methods, was used in this study. In the study, 27 "if-then" rules were created. The result of the rules reports the efficiency decision. Some of the rule table created for the input variables are given in Figure 7. When the input parameters that are intended to be predicted in the designed system "for example the first calving age 20, calving interval 10, the number of seeding per pregnancy 1" are entered into the system, the output value is obtained as 0.767 as a result of rinsing. When the fuzzy rule table in Figure 7, which was created with a specialist in its field, is examined, it is seen that the above mentioned input parameters affect rule 7. The statement at the end of this rule states that the version has failed. In addition, as a result of the analysis performed in the Matlab program, obtaining the output value as 0.767 displayed that the sample in question is in the inefficient (unsuccessful) class. Figure 8 shows the relationship between calving interval and first calving age input variables and output variable in three dimensions. The data analyzed using the Matlab program were also evaluated by the expert and compared with system decisions. As a result of the comparison, it was determined that the decision support system created to determine 100 input classes showed success at 94%. In the samples in the data set, it was observed that the most important variable affecting version yield was the calving interval.

Conclusions
In the literature, many quality determination studies have been done by using fuzzy logic method.
In the study, a multi-network system has been developed that includes a neural classifier and two special neural predictors to predict milk yield from monthly records of Holstein dairy cattle [22].
Another study carried out is the feature of motion (weak, medium and high), whether the cow is mobile (low-motion, medium-mobile and very mobile), and the time after the last heat (short, normal, longer than normal and long) features of fuzzy logic model It was aimed to correctly diagnose the anger using it together with the patient [23].
As a result of the study, it was stated that when the fuzzy logic system was used, the anger cows were detected at a rather high rate such as 98.0%. In another research, decision support system was designed by studying fuzzy logic which aims to separate raw milk samples into quality classes. The inputs of the system are the measured values of the total number of bacteria, somatic cell count and protein amount related to raw milk samples. The output of the fuzzy system designed is raw milk quality assessment.
In order to determine the success of the analysis, a comparison was made with expert decisions and it was stated that the system was successful at 80%. The system was modelled using the Matlab (version R2010b) program [2].
In another study, 305 days milk yield estimation studies were performed using partial lactation records of Jersey cattle with fuzzy cattle regression method. In the study, calving age, lactation number, milk day, calving season and first four milk test day records were used as independent variables. In addition, 305 days milk yield was used as a dependent variable. These results indicated that the fuzzy linear regression method could be successfully used to estimate 305-day milk yield at the beginning of lactation [24].
Another research designed decision support system from fuzzy logic area aiming to separate raw milk samples into quality classes. The inputs of the created system consist of 305 days milk yield, calving interval (BA), service period (SP), number of exceedances (AS), dry period (KP). Class decision is designed as a system output. The performance of the study was examined by looking at the compatibility between expert decisions and system decisions. Accordingly, kappa statistics are used. The performance of the system designed according to the result was 92.6%. (P <0.05) [25].
In another study, the potential benefit of combining feature activity and period has been explored since the last estrus for estrus detection [26]. Simultaneous analysis of these features in a fuzzy logic model should reflect the milk manufacturer's attention to assessing oestrus impulses. The analyses included 862 cows, each with a confirmed case of estrus. Information on previous oestrus or inseminations is available for 373 cows. One variable fuzzy logic model is studied and the results for comparison feature are compared. According to the results, the sensitivity was determined as 91.7% and the error rate as 34.6%. In the later stages of the study, using the multivariable fuzzy logic model, the sensitivity decreased to 87.9% and the error rate increased to 12.5%. Simultaneous analysis of the cows with and without prior knowledge in the estrus detection model caused the error rate to increase to 23.8% due to the high number of cows without prior knowledge. According to the results of the research, it is explained that the information about the previous cases of oestrus is proportional for multivariable oestrus detection.
Another study reported that it developed the earlier method using fuzzy logic technique to classify oestrus impulses from a model-based detection method using the circular structure of oestrus [27]. Based on the distribution of the duration of the feature since the last detected oestrus, a number of membership functions are introduced to reduce the number of false positive warnings and to improve the missed detection rate. This approach was tested on data from twelve days old cows collected over six months. The indicated that the actual number of cases detected decreased somewhat after classification, but false positive warnings were almost eliminated.
Another study is about grouping the conditions of mastitis in cows used in automatic milking system by designing a fuzzy logic system [28]. The results of the test data and training data are shown compatibility. This means that the study could be generalized. With this study, it is shown that fuzzy logic technology can be studied for mastitis detection. It is predicted that there will be a noticeable decrease in error rates by choosing different parameters.
Another study investigated the grouping of stroke and mastitis in cows using fuzzy logic [29]. Sensitivity, specificity and error rate were evaluated in order to obtain the results of the designed system. Specificity in mastitis detection models is between 84.1% and 92.1%, while error rates are between 96.2% and 97.9%. As a result of the study, the results of the test data were compared with the results of the training data. The results are confirmed. However, it was stated that some difficulties may be encountered during the application phase.
The fuzzy logic-based decision support system designed in this study has achieved a 94% success and it has been concluded that it is highly effective in the reproductive productivity assessment of cows. Farm yield assessment is one of the uncertainty problems encountered in animal husbandry. The fuzzy logic method, which has been used frequently in the solution of such problems in recent years, provides a more flexible structure to the cows' reproductive efficiency decisions compared to classical methods and provides a more suitable perspective to nature in evaluations. In addition, it can help save time and work by partially replacing human experts. Calving interval, one of the input variables discussed in this study, was observed to be much more effective in determining farm productivity compared to other input variables. Our research study has demonstrated that the fuzzy logic method is one of the very affluent and appropriate ways to analyze the reproduction traits of dairy cattle and can properly be applied in distinct fields of livestock i.e., animal breeding and genetics, nutrition, production and health as well as management. It is therefore thought that integrated systems created by using fuzzy logic method and other artificial intelligence methods such as Machine Learning (ML), and Artificial Neural Network (ANN) and Genetic Algorithm (GA) would provide many opportunities for researchers to make more consistent predictions and better estimations related to genome-wide association studies (GWAS) in animal breeding and sciences with various different perspectives in future.