# Neuro-Fuzzy Model Evaluation for Enhanced Prediction of Mechanical Properties in AM Specimens
## 2 The ANFIS Architecture for Mechanical Properties Prediction  
The adaptive neuro-fuzzy inference System (ANFIS) [25] is a hybrid model that combines the learning abilities of artificial neural networks (ANN) with the interpretability of fuzzy logic to predict complex, nonlinear relationships between input and output parameters. ANFIS operates through an architecture consisting of five layers that sequentially process inputs and apply fuzzy inference to produce accurate, adaptable predictions. This model has demonstrated particular effectiveness in applications where traditional models may encounter difficulties with inconsistent or noisy data, a common characteristic of AM processes.  
ANFIS is structured into five key layers (Figure 1), each responsible for a specific aspect of processing:  
Fuzzification Layer (Layer 1): In this initial layer, input variables are converted into fuzzy sets by applying membership functions. Each node in this layer corresponds to a linguistic term (e.g., \"low\", \"medium\", \"high\") of the input parameters, with membership values indicating the degree to which an input belongs to each fuzzy set. For this study, factors such as infill density, layer thickness, and temperature are fuzzified.  
Rule Layer (Layer 2): Layer 2 processes the output from Layer 1 by forming combinations of fuzzy rules. Using the Sugeno fuzzy inference model, each rule represents a specific relationship between input variables, defined by \"if-then\" statements. Each node calculates the strength (firing strength) of the rule by taking the product of the incoming membership values.  
Figure 1: ANFIS architecture with \(n\) inputs and 1 output.  
Normalization Layer (Layer 3): This layer normalizes the firing strengths of each rule by calculating the ratio of a specific rule's firing strength to the sum of all rule strengths. This normalization process enables ANFIS to handle varying input ranges and maintain a stable output range, ensuring that each rule contributes proportionately to the final output.  
Defuzzification Layer (Layer 4): In this layer, the normalized firing strength from Layer 3 is multiplied by a rule-specific linear function. These linear functions represent the consequent part of the Sugeno fuzzy rules and are typically of the form \(f_{i}=p_{i}x+q_{i}y+r_{i}\), where \(p_{i}\), \(q_{i}\), and \(r_{i}\) are consequent parameters. This layer's output reflects the weighted effect of each rule on the final prediction.  
Output Layer (Layer 5): The final layer aggregates the outputs from Layer 4, producing the ANFIS model's output by summing all incoming signals. This aggregated output represents the predicted mechanical property, such as maximum stress, strain, or Young's modulus, based on the input conditions and the rules in place.  
Figure 1 illustrates the ANFIS architecture with n inputs and a single output. The system utilizes a hybrid learning approach, combining gradient descent and least-squares estimation, to adjust membership function parameters in Layers 1 and 4. This dual mechanism enhances the model's predictive accuracy by iteratively learning from experimental data, making ANFIS a valuable tool for AM applications where varying process parameters and material types demand a flexible and robust predictive model.  
To implement the fuzzy inference process effectively, ANFIS requires the partitioning of the input space into multiple subspaces, each modeled with a consistent set of fuzzy rules. This partitioning can be accomplished using two primary methods: grid partitioning (GP) and subtractive clustering (SC). These approaches facilitate the systematic generation of fuzzy rules by either dividing the input space into evenly spaced intervals (GP) or identifying potential cluster centers based on data density (SC). The following subsections provide a detailed explanation of both methods and their application in this study.