Quantifying the Impact of Inspection Processes on Production Lines through Stochastic Discrete-Event Simulation Modeling

Inspection processes are becoming more and more popular beyond the manufacturing industry to ensure product quality. Implementing inspection systems in multistage production lines brings many benefits in productivity, quality, and customer satisfaction. However, quantifying the changes necessary to adapt the production to these systems is analytically complicated, and the tools available lack the flexibility to visualize all the inspection strategies available. This paper proposed a discrete-event simulation model that relies on probabilistic defect propagation to quantify the impact on productivity, quality, and material supply at the introduction of inspection processes in a multistage production line. The quantification follows lean manufacturing principles, providing from quite basic quantity and time elements to more comprehensive key performance indicators. The flexibility of discrete-event simulation allows for customized manufacturing and inspection topologies and variability in the tasks and inspection systems used. The model is validated in two common manufacturing scenarios, and the method to analyze the cost-effectiveness of implementing inspection processes is discussed.


Introduction
Manufacturing processes are stochastic in nature. The output of any manufacturing process, namely the state of any produced unit, is considered an uncertain probabilistic variable. Quality issues exist inherently in any manufacturing process and considering production output, they add randomness to the result. Quality issues are usually manifested by the number of defects or non-conforming units obtained during production. As workpieces move through a production line, variations of product quality are introduced and propagated. However, the relationship between most production operations and their product quality is still unclear [1]. For any manufacturer, accurate estimation of production output and resource requirements is key to maintain continuous production; however, the impact of quality uncertainty on production planning is either ignored [2] or compensated by inflating processing times and resource requirements [3].
As the most common approach to detect defects in manufacturing lines, inspection systems have become the norm to support the identification and sorting of non-conforming units. Establishing an effective quality-assurance program by planning and managing resources dedicated to the inspection and testing of produced units is important. These tasks are usually carried out by human inspectors, automated sensing devices, or a combination of both. Even then, such systems are not infallible, and inspection errors must be accounted for, increasing the difficulty of accurately estimating production output and quality of units processed. This is especially important as the number of defects increases with the number of units processed; hence additional production to account for quality issues accumulates non-conforming units [4]. Overall, inspection results can be considered as a stochastic variable too, where missed defective units and false rejections can be missed In the past decades, the modeling of multistage manufacturing systems or production lines for quality analysis and improvement has received intensive research. Recent quantitative modeling methods can be roughly divided based on two main approaches: (1) data-driven models where statistical approaches are based on measurements and (2) analytical models where engineering knowledge supports the application of physical approaches.
Analytical models employ offline analysis of production lines based on fundamental laws. These models use physical propagation laws to understand the random occurrence of quality issues or defects in production lines. Based on complex physical relationships, this permits estimating the number of defects in a certain manufacturing process. A few decades ago, an analytical model based on state spaces was first developed by Jin and Shi for quality control of assembly processes [10]. This model remains the most popular analytical approach to quality improvement based on engineering knowledge and measurement data.
Since then, dozens of model extensions have been published to modify the initial model to include further data or consider additional elements in the quality propagation laws defined. For example, the modeling of assembly processes was further investigated to link 3-dimensional design parameters to dimensional quality through simulation [11], or the propagation laws were modified to include machining operations maintaining the state-space model [12]. Although these models accurately determine quality issues, the analysis of long and complex production lines using the state-space model becomes unapproachable [13]. Therefore, the practicability of the state space model is quite limited to individual processes or relatively small production lines, independently of their complexity.
Hence, more recently, Markov models have been investigated to reduce complexity when introducing further manufacturing processes compared to the state-space model. The initial models already showed increased flexibility in the design of the manufactur-ing processes and could accurately evaluate the quality performance of the operations involved [14]. Similar to the evolution of the state-space model, several authors have been modifying the general Markov model presented by Li and Huang to increase its accuracy and resemblance to real industrial operations. Well-known extensions to the model include operational failures and maintenance-derived quality issues [15], quality flow [16], batch production and its impact on quality [17], bottleneck analysis based on quality issues [18,19], production and quality control with random demand [20], or remote quality information feedback [21].
In spite of the above effort, current analytical models are quite complex, and their potential industrial implementation requires expert knowledge, which is not easily accessible. This has limited its application to manufacturing processes in which quality issues are critical to the expected operation of the produced unit, such as aircraft engines or medical devices [22]. With the evolution of Industry 4.0 technologies, production lines integrate sensors, control systems, and communication devices, enabling intelligent manufacturing [23]. The control and management of modern complex production lines, including its quality, using big industrial data has become a significant topic these past years and has switched the focus of researchers worldwide towards data-oriented methods to deal with quality issues.
Compared to analytical models, data-driven models rely on investigating patterns in quality data to model the relationship between manufacturing systems and product quality. These approaches do not require comprehensive prior knowledge of the process and rely on proper data acquisition and processing. Quality data can be described as multiple highly correlated variables, and, consequently, multivariate statistical approaches are principally being developed [24].
Researchers have been using quality data with two main purposes: quality prediction and process monitoring. On the one hand, by monitoring data acquired, necessary information can be extracted to perform, for example, fault detection and diagnosis [25]. The multivariate statistical process monitoring methods, which utilize input and output information, are quite popular for the purpose of fault diagnosis via principal component analysis [26,27] or partial least squares [28,29]. Most importantly, they allow tackling a large number of variables, showcasing these methods' significant advantage over analytical methods. Due to their simpler forms and low design efforts, these models are widely used in numerous industrial applications [30][31][32].
On the other hand, data analysis is the key to generate adequate models that provide insight into abnormal manufacturing process situations. Neural-network-based models have drawn attention for their advantage of exploring complex relationships beneath big data [33,34] and perform quality prediction in complex manufacturing scenarios [35]. The use of neural networks is consistent with the statistical analytical models previously mentioned. Additionally, the network training process automatically characterizes the quality defect propagation laws based on historical data, adhering to current manufacturing output results, and eliminating the need to systematically account for any potential source of defect to accurately determining the model.
In summary, analytical models can accurately quantify quality issues based on statistical propagation, but precision depends on modeling all sources of defects, which is unpractical in complex or long manufacturing setups; whereas data-driven approaches allow simplifying the quality propagation by relying on quality data acquired during the manufacturing process. Overall, data-driven models are gaining attention as they permit a broader reach of processes, mainly due to the popularization of Industry 4.0 technologies, and can be adapted more easily to changes in the process.

Inspection Process Planning
Inspection process planning is an integral part of the design and manufacturing activities. It preemptively determines what characteristics of a product are to be inspected, where the inspection systems must be placed, and when those inspections need to occur.
With modern approaches to manufacturing, part and product inspection are evolving to be an integrated part of the manufacturing process; hence inspection process planning has become an important step in the development of manufacturing lines. The planification of inspection procedures requires better and better decision-support tools as complexity and variety of products increases, as well as company reliance on quality to reach market demands [36].
The quality models reported in the previous subsection are mainly used to determine efficient inspection strategies. These strategies may depend on different process characteristics, such as the capacity of inspection systems to identify the defects of interest, the appropriate definition and parametrization of the manufacturing process, the inspection systems' cost, and the accuracy rate of the inspection system on errors and its consequences [37]. When dealing with complex manufacturing setups and consequently with relatively articulated processes, it is particularly important to identify the more critical and vulnerable processes and to develop appropriate inspection procedures, analyze the resources required, and define the appropriate and most efficient inspection system [38].
The effectiveness of inspection strategies is closely related to the production rate, the volume of the product being manufactured, and the topology of the manufacturing processes. In the case of single-unit or small-sized lot productions, a.k.a. short runs, inspection strategies require treatment of manufacturing processes as individual units, for example, considering the generation of defects in operations as different Bernoulli distributions [39] and economic optimization can be achieved considering different strategies that monitor process dispersion, i.e., excessive scrap or rework costs [40]. For the case of mass manufacturing, statistical process control can be directly applied [41].
In fact, inspection process planning must consider uncertainties in the measurements. Using statistical approaches, several techniques such as cost-benefit models [42], simulation models [43], mathematical models [44], or multi-objective optimization models [45] have been proposed to plan inspection processes as a trade-off between cost and quality. Proposed models that can mitigate uncertainty effects due to the stochastic nature of quality issues to provide clearer insight on inspection planning rely on Monte Carlo or Taguchi methods. Therefore, a tool that supports the inspection planning process must have the capacity to model production tasks, apply production output quality and inspection results uncertainties, enable analysis of repeatable scenarios, and be flexible on the topology of the manufacturing setup. All in all, advanced simulation models are the best suited to handle the modeling of inspection process planning.
Simulation is a well-known methodology in the industry for representing or imitating real systems over time. Becuase flows of material, resources, information, or people in multistage manufacturing systems are complex, simulation is often used to validate, analyze, and optimize those systems. In the context of simulation, two major model types are available: static or dynamic simulation. While static simulation is strictly timedependent, dynamic simulation changes over time. As production units can be represented as passive entities as they move through a manufacturing system, a widely used method to represent those entities is discrete event simulation (DES). Due to the characteristics of inspection procedures and that their actions and application happen at certain points in time, DES modeling of inspection operations is meaningful. Such an approach has been successfully used recently to assess inspection strategies when analyzing DES results [46].

Assumptions
Let us consider a manufacturing process in controllable setting conditions and decompose it into a number of process steps or tasks, representing specific operations providing an added value to the product. Each task is scheduled and organized so that the product is manufactured in its entirety at the end. Before presenting the manufacturing process model, several assumptions are taken. Assumption 3. Non-conformity of produced units can only be detected by inspection systems. All potential defects that generate non-conforming units must be inspected at some point during the production line.

Assumption 4.
After an inspection, only three different complementary outcomes are possible for each unit produced: conforming, reworkable, or waste unit. Assumption 5. If a theoretically reworkable unit does not have a rework process associated, it is considered scrap and discarded. Hence, the model allows each workstation to choose a different operation, and the combination of subsequent operations represents the production line modeled. The independence of operations and inspections is considered to simplify the calculations based on probabilities and is quite reasonable as it represents the reality of most relationships between inspections and operations or operations performed in different workstations. The model allows for repetitive or consecutive inspections if required, always considering them stochastically independent. For all inspection outcomes, a unit can be conforming, reworkable, or scrap; however, all the options are not required to exist for each manufacturing operation (except conforming). For each process step, different kinds of inspection activities are carried out. For the proposed model, all inspection systems are defined by their accuracy and capability to detect defects. Therefore, for all inspection systems, errors type I (false positives) and errors type II (false negatives) are considered.

Model Overview
The proposed model aims to quantify the changes that the decision of implementing an inspection process at any manufacturing process has on productivity, quality, and supply of materials while considering cost-efficiency. For the model to be able to achieve this, certain information is required to build the model. An overview of the model requirements is shown in Figure 1.

Assumptions
Let us consider a manufacturing process in controllable setting conditions and decompose it into a number of process steps or tasks, representing specific operations providing an added value to the product. Each task is scheduled and organized so that the product is manufactured in its entirety at the end. Before presenting the manufacturing process model, several assumptions are taken.

Assumption 1. Each manufacturing operation occurs independently. Operations are stochastically independent of each other.
Assumption 2. The inspection results are also stochastically independent of each other and of the manufacturing process itself. Assumption 3. Non-conformity of produced units can only be detected by inspection systems. All potential defects that generate non-conforming units must be inspected at some point during the production line. Hence, the model allows each workstation to choose a different operation, and the combination of subsequent operations represents the production line modeled. The independence of operations and inspections is considered to simplify the calculations based on probabilities and is quite reasonable as it represents the reality of most relationships between inspections and operations or operations performed in different workstations. The model allows for repetitive or consecutive inspections if required, always considering them stochastically independent. For all inspection outcomes, a unit can be conforming, reworkable, or scrap; however, all the options are not required to exist for each manufacturing operation (except conforming). For each process step, different kinds of inspection activities are carried out. For the proposed model, all inspection systems are defined by their accuracy and capability to detect defects. Therefore, for all inspection systems, errors type I (false positives) and errors type II (false negatives) are considered.

Model Overview
The proposed model aims to quantify the changes that the decision of implementing an inspection process at any manufacturing process has on productivity, quality, and supply of materials while considering cost-efficiency. For the model to be able to achieve this, certain information is required to build the model. An overview of the model requirements is shown in Figure 1.

Model Input
For the model to achieve its aims, the user must provide some information beforehand. This information is considered the input of the model, and the model outcomes depend directly on the validity and accuracy of this information provided. A list of the information required by the model is given as follows:

•
Task durations: the duration of each manufacturing operation must be analyzed through time studies so that the simulation is as accurate as possible in its representation of reality. The task duration must be modeled preferably as a statistical distribution, although other easier statistical metrics (median or average) can also be used.

•
Manufacturing operations topology: for each product, a series of operations in a specific sequence is required. The order of operations needs to be replicated in the simulation model accurately, ensuring that the flow of material is accurately represented within the model. • Current quality rates: for each manufacturing process, the current output must be analyzed to measure the rates of conforming, reworkable, and waste products (when applicable following Assumption 4).

•
Inspection system accuracy: for each inspection system that is planned to be introduced, the error rate for each defect identified is required to allow the model to account for the uncertainty of the system.

Probabilistic Model
The probabilistic model proposed for inspection processes is based on a discrete-event simulation. An overview of the proposed model architecture is illustrated in Figure 2. Discrete-event simulation models are principally defined by two elements: entities and objects. Objects are elements that represent different products or calculations within the model and that are linked in a specific order according to the production plan. Entities are computational elements that proceed through the simulation model following the specified plan. For each entity that goes through an object, certain operations are executed. These operations are object-specific and must be declared previously.
Modelling 2021, 2, FOR PEER REVIEW 7 determine which inspection processes are active. This allows the user to run different scenarios without changing the model itself and see different outcomes based on inspection process placement. The second one asks the user to define the type of defects that a certain inspection system is able to classify and redirect to its correct rework station if it exists.
Remind that all defects need to be inspected at least once; otherwise the model cannot run. Now, for each inspection system that wants to be introduced into the production line, the quality outcome is estimated following probability propagation laws. Let = { , , } the set that defines the quality rate ( ) for the process ( ), where ( ) is the rate of conforming units being produced, ( ) is the set of rates for each ( = {1, … , }) individual defect identified, and ( ) is the rate of waste being produced. The quality rate set for each process is complementary (see Equation (1)).
Let ( ) the accuracy of the inspection system for the process ( ). For each of the options available at each process, ( ) defines the rate at which results obtained by the inspection system match reality, for example, ( ) represents the rate in which detected conforming products are actually conforming or ( ) represents the rate at which detected For this model, entities represent the production units at any stage of the manufacturing process, considering that at the end of the simulation, each entity is a finalized product; and each manufacturing process is represented as an object, stating its duration and transforming the entity characteristics. In other words, as an entity flows through an object, simulation time passes, and the entity is transformed to match the operations performed on it.
The quality inspection processes are also modeled as objects, with the difference that no transformation to the product occurs. The inspection objects serve as a sorting gate in which alternative outcomes for the inspection results are stochastically determined.
Depending on the outcome of the inspection process, the entity would follow different simulation paths: if conforming, the entity continues towards the next operation if it exists; if reworkable, the entity goes towards the rework process (another object); if waste, the entity is destroyed.
As observed, the model takes a certain quantity of material stock and runs it through as many processes and inspections, as modeled until the end product is obtained. From an architecture point of view, all blocks of process and associated inspection are identical, bar the value of the characteristics defining them, i.e., task duration or quality rate. As an entity leaves any process, it enters an inspection process if it exists, which uses its stochastic output to decide its next steps. As a minimum, the model must contain all the processes involved and a final inspection, as the end product must have its quality ensured. Note that this minimum model is the most common practice in the industry.
In the model, two user-based decisions are required before each simulation run (shown as a diamond symbol in Figure 2) and stored as global arrays in the model that are accessed at the initialization of the model execution. The first one asks the user to determine which inspection processes are active. This allows the user to run different scenarios without changing the model itself and see different outcomes based on inspection process placement. The second one asks the user to define the type of defects that a certain inspection system is able to classify and redirect to its correct rework station if it exists. Remind that all defects need to be inspected at least once; otherwise the model cannot run. Now, for each inspection system that wants to be introduced into the production line, the quality outcome is estimated following probability propagation laws. Let Q i = {C i , D ik , W i } the set that defines the quality rate (Q) for the process (i), where (C i ) is the rate of conforming units being produced, (D ik ) is the set of rates for each (k = {1, . . . , K}) individual defect identified, and (W i ) is the rate of waste being produced. The quality rate set for each process is complementary (see Equation (1)).
Let (A Q i ) the accuracy of the inspection system for the process (i). For each of the options available at each process, (A) defines the rate at which results obtained by the inspection system match reality, for example, (A CC ) represents the rate in which detected conforming products are actually conforming or (A CW ) represents the rate at which detected conforming products ended up being waste. The resulting accuracy for each detected output is complementary (see Equation (2)).
∀i, A Q : To represent the propagation of quality uncertainty following Equations (1) and (2) in the DES model, the use of probabilistic branches is suggested. It is also possible to hardcode the nested probabilities within an executable object within the simulation model that could give some additional room to include some additional complexity to the model; however, it was deemed unnecessary based on the assumptions taken. An example of the inspection process of a task within the DES model in Simphony is shown in Figure 3.
Modelling 2021, 2, FOR PEER REVIEW 8 however, it was deemed unnecessary based on the assumptions taken. An example of the inspection process of a task within the DES model in Simphony is shown in Figure 3. Therefore, for an inspection system that inspects a single task, the probabilities of obtaining conforming ( ( )), reworkable ( ( )), and waste ( ( )) units can be expressed directly as a function of the quality rate of the process and the inspection accuracy as shown in Equation (3).
Similarly, as probabilities are propagated from complementary sets, the probabilities of obtaining conforming, reworkable, and waste units are also complementary (see Equation (4)), which is consistent with the fact that a produced unit cannot be conforming and waste at the same time and so forth.
In case of a specific task, ( ), no inspection system is considered; all units exiting that task continue to the next one with their defects uninspected (as shown in Figure 2). Then, those defects generated must be inspected in another station downstream. For that inspection process, the probabilities of the quality rate are propagated. Then, Equations (5)- (7) indicate the probability propagation of a non-inspected task for conforming, reworkable, and waste units. Therefore, for an inspection system that inspects a single task, the probabilities of obtaining conforming (p(c f )), reworkable (p(rw)), and waste (p(wst)) units can be expressed directly as a function of the quality rate of the process and the inspection accuracy as shown in Equation (3).
Similarly, as probabilities are propagated from complementary sets, the probabilities of obtaining conforming, reworkable, and waste units are also complementary (see Equation (4)), which is consistent with the fact that a produced unit cannot be conforming and waste at the same time and so forth.
In case of a specific task, (N), no inspection system is considered; all units exiting that task continue to the next one with their defects uninspected (as shown in Figure 2). Then, those defects generated must be inspected in another station downstream. For that inspection process, the probabilities of the quality rate are propagated. Then, Equations (5)- (7) indicate the probability propagation of a non-inspected task for conforming, reworkable, and waste units.
This propagation results in a nested set of probabilistic branches within the DES model, similar to the previous example but with an additional layer. Figure 4 showcases the changes made to an inspection process when a previous station had not been inspected. Note that (Q * ) represents a simplified version of the quality rate for a given station when the entity (produced unit) already comes with reworkable defects. Simply, if a unit comes with defects, the probability of achieving a conforming unit is zero. Similarly, if a unit comes as waste from a previous task, the only outcome for that unit after inspection is waste. In that sense, (Q * ) can be defined as follows: This propagation results in a nested set of probabilistic branches within the DES model, similar to the previous example but with an additional layer. Figure 4 showcases the changes made to an inspection process when a previous station had not been inspected. Note that ( * ) represents a simplified version of the quality rate for a given station when the entity (produced unit) already comes with reworkable defects. Simply, if a unit comes with defects, the probability of achieving a conforming unit is zero. Similarly, if a unit comes as waste from a previous task, the only outcome for that unit after inspection is waste. In that sense, ( * ) can be defined as follows: Finally, for each reworkable unit, its defect is identified, and a direct path to the appropriate rework task is followed. The rework task is defined independently from the main manufacturing operations of the production line, with its different durations and quality rates. After a unit has reworked its defects, it returns to the inspection process again to be reinspected.  Finally, for each reworkable unit, its defect is identified, and a direct path to the appropriate rework task is followed. The rework task is defined independently from the main manufacturing operations of the production line, with its different durations and quality rates. After a unit has reworked its defects, it returns to the inspection process again to be reinspected.

Model Output
As the model runs, measurements are taken and collected. In this model, these measurements are time and quantity-based. Once all results are obtained, considering management and engineering interests, key performance indicators (KPIs) can be derived and evaluated for efficiency or quality analysis. Thus, the model directly outputs supporting metrics for posterior decision-making. This subsection presents the basic and more comprehensive KPIs computed in the model.
To monitor productivity and quality performance, most comprehensive KPIs depend on time and quantity elements; this last one is referred to as logistical elements in the ISO 22400-2 (2014). From the proposed model, time elements are directly obtained from the simulation times, and the quantity elements can be all obtained directly from stochastic inspection outcomes. The used supporting elements for production and quality KPIs are extracted from Kang et al. work on key performance indicators for operation management and continuous improvement in production systems [47].

Time Elements
Time elements are data related to time durations in production operations. They are time measurements that help describe activities related to production. The following time elements are considered and obtained as snippets of the simulation time from the order point of view.

Quantity Elements
In addition to time elements, quantity elements provide information on issues related to product quality through recounting. The quantity elements are obtained as entities pass certain tasks (objects) in the model and are directly linked to the inspection outcomes. For a total of (U) units entering a process (i): • Good quantity (GQ): the produced quantity that meets quality requirements in the first time of an operation process.
• Scrap quantity (SQ): the produced quantity that does not meet quality requirements and must be scrapped or recycled.
∀i, SQ i = U * p(wst) i (10) • Rework quantity (RQ): the quantity that fails to meet the quality requirements, but these requirements can be met by reprocessing.
• Processed quantity (PQ): the quantity that a workstation has processed, which includes the reworked and scraped ones. In case that some units may need more than one rework, say parts are reworked (R) times, then: • Produced quantity in the first operation process (PQF): the quantity that a workstation has produced in the first time of an operation process. ∀i,

Key Performance Indicators
All indicators presented in this subsection reveals an aspect of performance for a work unit or system derived from the quantity and time elements. These KPIs are grouped depending on the manufacturing aspect they tackle, namely aspects from production and aspects from quality. Although other aspects have been previously investigated, such as maintenance [47], they fall out of the scope of this study.
Some important KPIs addressing production issues are grouped and defined below: • Utilization efficiency (UE): the productivity of a workstation, measured by the relationship between the productive time and execution time.
∀i, UE i = AET i APT (14) • Throughput rate (TR): the process performance in terms of produced units and the execution time for each workstation.
Now, other important KPIs that target quality related issues are grouped and defined below: • Scrap ratio (SR): reports the ratio of waste units over the total processed units in a workstation. ∀i, SR i = SQ i PQ i (19) • Rework ratio (RR): reports the ratio of reworkable units over the total processed units in a workstation. ∀i, RR i = RQ i PQ i (20) • Fall off ratio (FR): the fall off quantity for a specific production operation in relation to the produced quantity in the first operation, measured by the ratio between the produced quantity on the first production order sequence minus the conforming units on the current production and the produced quantity in the first operation.
• First time quality (FTQ): the ratio of conforming units produced in the first time in a workstation. ∀i, FTQ i = GQ i PQF i (22) • Quality buy rate (QBR): the overall ratio of conforming units, even after rework, in a workstation. ∀i,

Description of the Use Case
The use case within this paper is applied to a synthetic multistage manufacturing line. This line consists of three process steps, each with its potential inspection system. The simulation model is designed to be able to skip inspection systems as desired, except the last one. Inspection systems are parametrized to have varying costs and inspection accuracies. To ensure that all defects are inspected, the last inspection system is assumed to be able to carry out such inspection tasks. An overview of the DES model for the case study is shown in Figure 5. line. This line consists of three process steps, each with its potential inspection system. The simulation model is designed to be able to skip inspection systems as desired, except the last one. Inspection systems are parametrized to have varying costs and inspection accuracies. To ensure that all defects are inspected, the last inspection system is assumed to be able to carry out such inspection tasks. An overview of the DES model for the case study is shown in Figure 5.
When parametrizing the inspection systems in the case study, the maximum adaptability of the studied systems is presented. In other words, the inspection systems are modeled with the maximum number of parameters possible, aiming at creating a model able to play the maximum of different scenarios. Remind that all inspection processes can be toggled off, except the last one. With that, the inspection systems are as follows: • Inspection process 1: enables inspection of defects in process 1. • Inspection process 2: enables inspection of defects in process 2 or inspection of defects in processes 1 and 2. • Inspection process 3: enables inspection of defects in process 3, or inspection of defects in processes 1 and 3, or inspection of defects in processes 1 and 2, or inspection of defects in processes 1, 2, and 3. Figure 5. Overview of the discrete-event model used as case study (in Simphony). Figure 5. Overview of the discrete-event model used as case study (in Simphony).
When parametrizing the inspection systems in the case study, the maximum adaptability of the studied systems is presented. In other words, the inspection systems are modeled with the maximum number of parameters possible, aiming at creating a model able to play the maximum of different scenarios. Remind that all inspection processes can be toggled off, except the last one. With that, the inspection systems are as follows: • Inspection process 1: enables inspection of defects in process 1. • Inspection process 2: enables inspection of defects in process 2 or inspection of defects in processes 1 and 2. • Inspection process 3: enables inspection of defects in process 3, or inspection of defects in processes 1 and 3, or inspection of defects in processes 1 and 2, or inspection of defects in processes 1, 2, and 3.
For all the following scenarios, the processes characteristics will remain the same to reduce variability and consider that during the following offline study, no changes have been introduced. The characteristics of the processes are listed in Table 1. Process 1 has a task duration modeled by a triangular distribution with a low value of 18 s, a mode of 21 s, and a high value of 27 s; and a recorded quality rate of 85% of conforming units, 12% of reworkable units, and 3% of the waste produced. Then, process 2 has a task duration modeled by a normal distribution with a mean value of 50 s and a standard deviation of 3 s; and a recorded quality rate of 90% of conforming units, 7% of reworkable units and 3% of the waste produced. Finally, process 3 has a task duration modeled by a normal distribution with a mean value of 39 s and a standard deviation of 4 s; and a recorded quality rate of 94% of conforming units, 3% of reworkable units, and 3% of the waste produced. Let it know that all numbers are synthetic for the purpose of validating the model, and there is no intent to accurately represent a specific manufacturing line.

Simulation Scenarios
Within this study, four different scenarios are simulated on the basis of a discrete-event simulation. For each scenario presented, a hundred runs are repeated to depict stochastic results and behavior. The different scenarios present different inspection strategies based on the model presented in Figure 5. Table 2 gives an overview of the selected simulation scenarios and related information within this case study. An "x" in the column means that an inspection has been performed at the workstation. Table 2. List of the selected simulated scenarios.

Scenario
Inspection 1 Inspection 2 Inspection 3 Scenario 1 can be considered as a baseline scenario, as it represents the most common inspection strategy and the minimum effort to achieve conforming quality. It will also serve as a benchmark for all metrics measured during the simulation. The other scenarios include additional inspection systems until all possible options are studied.

Validation Results
The scenarios discussed in the previous subsection are established on certain userdetermined conditions to validate the model. These conditions emulate real-world targets or scenarios in which multistage manufacturing lines can operate. For the first two conditions, inspection accuracy is set fixed to reduce variability but is targeted in the last set of results presented.

Condition 1: Production Target
For the first set of simulations, a production target of 250 conforming units is set with an unlimited amount of time and initial materials and resources. The simulation model will run until the target is reached after process 3. Table 3 lists all the results obtained from the simulation model, annotating the average for each element or KPI and rounded to the unit (for quantity-related elements) or to the second (for time-related elements). In the table, it is highlighted in bold and light green the condition that terminates the simulation model.
In scenario 4, where all processes are inspected, QBR stabilizes for all processes around 96%, which shows the importance of continuous inspection in multistage manufacturing operations. This increase in quality is also noticeable in the reduction of the scrap ratio (SR) from 20.9% (61 waste units-S1) to 9.1% and 5.5% (29 and 8 waste units-S2), 3.8% and 11.4% (25 and 27 waste units-S3), and 4%, 5.7%, and 3.7% (25,9, and 8 waste units-S4) by introducing rework stations where rework rates have increased from 12% (38 reworkable units-S1) to 24.1% and 7.1% (84 and 13 reworkable units-S2), 16.9% and 9.9% (139 and 23 reworkable units-S3), and 17.1%, 15.2%, and 7.4% (119, 46, and 14 reworkable units-S4). Thus, quality improvements are achieved through two paths: reduce scrap by quickly identifying reworkable units and by enabling rework in each station. As less units are wasted due to quality issues, productivity rises. For the second set of simulations, a limit on the material supply of 250 units is set. The simulation model will run until all the supply is used. Table 4 lists all the results obtained from the simulation model, annotating the average for each element or KPI and rounded to the unit (for quantity-related elements) or to the second (for time-related elements). In the table, it is highlighted in bold and light green the condition that terminates the simulation model.

Discussion
As observed, the model proposed can quantify based on certain assumptions, user inputs, and pre-known parameters of the production processes, changes to relevant productivity, and quality KPIs based on different inspection strategies. Overall, the model enables data analysis on different scenarios to perform data-driven decision-making on the best inspection strategies. The current model considers productivity and quality-related information; however, additional domains have a known impact on quality: maintenance operations, logistics, or product design [38]. None of those elements have been included in the current model; hence the model is limited in the flexibility of options given to users to improve quality based on the model's results. Research to include such domains onto the DES model will be addressed in the near future. In fact, several examples of similar integration within DES models have been explored before, i.e., maintenance systems and operations [48]. Note that, as additional information is included in the model, the complexity and stochasticity increases. It may be interesting at that point to explore other solutions that can support stochastic environments without deterministic models, such as the use of reinforcement learning to determine defect propagation laws within a production line.
Regarding the inspection strategies, some options have not been discussed, such as destructive testing or batch sampling. Although these methods represent valid inspection procedures, the presented model focuses on the integration of continuous inspection and data acquisition, following Industry 4.0 principles [49]. Nonetheless, the proposed DES model can be easily modified to allow sampling and destructive testing. Current software, Simphony, has the capability of destroying entities after inspection or grouping and ungrouping production units at the user's convenience. In other words, enterprises that use those approaches can utilize DES models to analyze any potential changes between inspection strategies, no matter how different they seem, and obtain data that can be used to compare and take the best possible decision for their inspection processes and product quality.
Finally, large, well-capitalized enterprises have access to significant resources and capital to capture economies of scale and the value of introducing new inspection systems, transforming the decision process into an optimization problem; however, small and medium-sized enterprises (SMEs) face the scrutiny of a well-supported business case, cash flow analysis, net present value, and return on investment (ROI) for any expenditure, inspection systems or otherwise. This poses the question: Given a certain budget limitation and expectations, what are the inspection options available, and which is the best inspection strategy?
In order to get a cost-effective solution, cost models regarding inspection processes are already available. These models allow examining the minimum increase in quality that is necessary to break even on an investment-related to inspection and quality control [50]. A simplified model assumes that the equipment cost of the added inspection system (C Inspection ), plus the cost of running the system, (C OpInspection ), needs to be covered by the difference on operating costs. The difference in operating costs can be estimated directly from the variation obtained in certain measured KPIs: the quality buy rate (∆QBR), the rework ratio (∆RR), and the scrap ratio (∆SR). This model establishes that, for (U) units manufactured, the breakeven point is achieved when Equation (24) is satisfied: where (C Unit ) is the unit cost, (C Production ) is the process cost, and (C RW ) is the rework cost. Indeed, as discussed previously, additional inspection increases rework operations while reducing waste and increasing overall quality. Hence, the additional rework costs have to be compensated by the additional units manufactured and the reduction in waste. The proposed approach allows the user to obtain those quantity variations while keeping options open on inspection costs to test different strategies.
Let us assume a scenario in which a company has determined that a certain maximum amount of money is to be invested in improving the quality of their production line (that is similar to the one modeled before). Currently, their strategy is to inspect the whole process at the end of the line, where they own an inspection system that has a 96% accuracy. With their budget, several options are available: Change 1: Improve their current system in process 3 from 96% accuracy to 99%. Change 2: Add a 92% accuracy inspection system in process 2. Change 3: Add an 88% accuracy inspection system in process 1 and an 84% accuracy inspection system in process 2. Change 4: Add a 96% accuracy inspection system in process 1.
The model is adapted to test those potential changes while maintaining the durations and quality rates of the processes untouched. For each scenario presented, a hundred runs are repeated to depict stochastic results and behavior. Table 5 lists the average variation of KPIs obtained during the simulation runs. As expected, the simulation model anticipates a fair reduction of scrap while rework and quality increase. The model provides an estimate of the variation of scrap, rework, and quality ratios for each workstation, easying comparative analysis and decision-making. Further, the model predicts the impact of inspection system changes on production, allowing to guide stakeholders towards desired goals based on key performance indicators. With different results obtained, an analysis on the best possible change can be performed based on each company status and operative conditions. To answer the previous question, cost information on the specific company is required, and depending on each production line, the outcome of the cost-efficiency analysis will vary. In summary, the model proposed is an interesting tool for companies that have limited resources and are interested in ensuring their investments regarding inspection planning. For large enterprises with access to more capital, the inspection strategy that obtains the best results is to inspect at every stage of the manufacturing line. Nonetheless, this model allows to estimate the quality outcome of increasing inspection efforts and quantify changes in production and supply that can support smoother transitions when changing operating conditions in production lines.

Conclusions
Inspection strategies and processes are becoming more and more important for manufacturers to ensure product quality. Following this trend, this paper proposes the implementation of a probabilistic approach to modeling inspection processes within a discrete-event simulation model. The proposed model builds upon existing analytical models on quality inspection processes while introducing the flexibility and variability that discrete-event models and computation provide. A generalistic discrete-event model is proposed where defect generation is propagated through nested probabilistic laws and stochastic inspections. The model relies on accurate manufacturing information, as well as user input, to output quality, productivity, and supply in the form of basic elements and more comprehensive key performance indicators. These indicators allow to simplify the quantification of the impact of introducing changes to the inspection plans of a manufacturing line in three main areas: productivity, quality, and supply chain. By running different scenarios, the results can be compared to support data-driven decision-making regarding inspection planning and investments in inspection systems.
The variability of the model is validated in two different manufacturing scenarios, limited supply and production target, testing the capacity of the proposed model to reliable output information in realistic conditions. Finally, the utilization of the model is discussed around the methods to analyze the cost-effectiveness of introducing inspection processes when limited resources are available, which is a serious issue for most small and medium enterprises. Future work will encompass expanding the model to include other relevant factors that impact quality, such as logistics, design parameters, or maintenance operations.