13. AI and Machine Learning in Quality ManagementIntroduction and ContextQuality management has traditionally relied on inspection, statistical process control, designed experiments, audits, and expert judgment. These methods remain essential, but the scale and speed of contemporary operations have created situations in which conventional analysis alone is insufficient. Manufacturing systems generate high-frequency sensor readings, images, maintenance records, laboratory results, customer complaints, supplier data, and process histories. Artificial intelligence (AI) and machine learning (ML) provide methods for extracting patterns from these diverse sources and using them to support quality decisions. The significance of AI in quality management does not lie simply in automating inspection. Its deeper contribution is the movement from reactive quality control toward predictive and adaptive quality management. A conventional inspection system may identify that a component is defective. A predictive quality system attempts to determine which process conditions make the defect likely, when the risk will increase, and what intervention is most appropriate. An intelligent decision-support system may combine these predictions with cost, risk, capacity, and customer requirements before recommending an action. AI should not, however, be treated as a substitute for quality principles, process knowledge, or managerial accountability. A model can learn patterns without understanding their operational meaning. It can perform accurately during validation and fail after a supplier changes material, a machine is recalibrated, or customer preferences shift. The central managerial question is therefore not whether an organization should use AI, but where AI can create defensible quality value and how it can be governed responsibly. Learning ObjectivesAfter studying this chapter, the learner should be able to: 1. Explain the roles of AI and ML in modern quality management. 2. Distinguish supervised, unsupervised, semi-supervised, and reinforcement learning approaches. 3. Evaluate computer vision, predictive quality, generative AI, and intelligent decision-support applications. 4. Compare AI-based methods with classical statistical and engineering methods. 5. Assess data quality, model performance, explainability, validation, and deployment requirements. 6. Design appropriate human-oversight and governance arrangements. 7. Explain model drift, MLOps, monitoring, and lifecycle management. 8. Identify ethical, regulatory, operational, and professional risks in AI-enabled quality systems. From Statistical Control to Intelligent Quality SystemsClassical quality methods generally begin with a defined process, a measurable characteristic, and assumptions about variation. Control charts distinguish common-cause from special-cause variation. Regression and designed experiments estimate relationships between inputs and outputs. Acceptance sampling provides a decision rule for inspecting a lot, while failure mode and effects analysis (FMEA) prioritizes risks through structured expert assessment. Machine learning differs primarily in how relationships are discovered and used. Rather than requiring the analyst to specify all relevant relationships in advance, an ML algorithm can estimate complex or nonlinear relationships from historical data. This is especially useful when many variables interact, when signals are high-dimensional, or when direct physical modelling is difficult. A neural network, for example, may identify visual patterns associated with surface defects that would be difficult to express as simple measurement rules. The distinction should not be overstated. AI and classical quality methods are complementary. Statistical process control remains valuable for monitoring stability and communicating variation. Engineering knowledge is required to select meaningful variables and interpret causal mechanisms. ML may identify a high-risk pattern, but a designed experiment may be needed to establish whether changing a process input actually reduces the defect. A mature quality system therefore combines descriptive statistics, causal reasoning, process capability analysis, and predictive algorithms. A useful distinction is between prediction and explanation. Prediction asks, “What is likely to happen?” Explanation asks, “Why is it happening, and what intervention will change it?” A model may predict failures accurately while providing limited causal insight. Quality professionals must avoid treating predictive association as proof of causation. Important Concepts and TerminologyArtificial intelligence refers broadly to computational systems capable of performing tasks associated with human intelligence, such as perception, language processing, reasoning, and decision support. Machine learning is a subset of AI in which algorithms learn patterns from data rather than being programmed solely through explicit rules. In supervised learning, the model is trained with labelled examples, such as images marked defective or acceptable. Classification predicts categories, while regression predicts numerical values such as strength, dimensional deviation, or remaining useful life. In unsupervised learning, the data are not labelled; clustering, dimensionality reduction, and anomaly detection are used to discover structure or unusual observations. Semi-supervised learning combines a small labelled dataset with a larger unlabelled dataset, which is common when expert labelling is expensive. Reinforcement learning learns through actions, feedback, and rewards, although its use in safety-critical quality decisions requires considerable caution. Features are measurable inputs used by a model. Labels are the target outcomes. Training data are used to fit a model, validation data to tune choices and compare alternatives, and test data to estimate performance on unseen cases. Data leakage occurs when information unavailable at the time of the real decision is inadvertently included during training. Overfitting occurs when a model learns accidental characteristics of the training data and performs poorly on new data. Underfitting occurs when the model is too simple to represent important relationships. Precision is the proportion of predicted positives that are correct; recall, or sensitivity, is the proportion of actual positives detected. Specificity measures the ability to identify negatives correctly. Accuracy can be misleading when defects are rare. A confusion matrix displays these outcomes. The receiver operating characteristic curve and area under the curve help compare classifiers across thresholds, but operational costs should determine the selected threshold. Explainability concerns how understandable a model’s reasoning is to relevant users. Interpretability may be built into a simple model, whereas post-hoc explanation methods attempt to explain a complex model after it has been trained. Concept drift occurs when the relationship between inputs and outcomes changes. Data drift refers to a change in the distribution of input data. Model drift is the broader decline in practical performance as the operating environment changes. MLOps is the set of practices for developing, deploying, monitoring, governing, and updating ML systems. It connects data engineering, model development, software deployment, cybersecurity, quality assurance, and operational ownership. The AI Quality-Management ArchitectureAn AI-enabled quality system can be understood as a lifecycle rather than a single algorithm. The lifecycle begins with a quality problem and a decision that must be improved. Examples include reducing false accepts in visual inspection, predicting a dimensional failure before final assembly, or prioritizing supplier audits. The organization then identifies data sources, defines the prediction target, establishes the cost of errors, and determines who owns the resulting decision. The next stage is data preparation. Quality data often contain missing values, inconsistent codes, changing measurement systems, duplicate records, and labels that reflect inspector disagreement. Data must be linked to the correct production unit and time period. In manufacturing, a measurement taken after rework should not be confused with the original process outcome. Labelling policies should be documented, and uncertain labels should not be presented as unquestionable truth. Model development follows exploratory analysis, feature selection or representation learning, algorithm comparison, and validation. The performance measure must reflect the business and safety context. If failing to detect a critical defect is much more costly than stopping a good unit, recall may receive greater emphasis than overall accuracy. Conversely, an excessive false-alarm rate may cause operators to ignore the system. Deployment involves integrating the model with inspection equipment, manufacturing execution systems, laboratory information systems, enterprise resource planning systems, or maintenance platforms. The output should be presented in an actionable form: a probability, a risk category, a recommended inspection, or a proposed process adjustment. Deployment also requires a fallback procedure for missing data, system outages, uncertain predictions, and disputes between the model and an experienced operator. Finally, the model must be monitored and periodically reviewed. A model is not “finished” when it is placed into production. Its data, performance, fairness, explanations, security, and operational consequences must be assessed throughout its useful life. Computer Vision for Quality InspectionComputer vision applies image acquisition and computational analysis to inspection tasks. A basic system may compare measurements against geometric tolerances. More advanced systems use convolutional neural networks or vision transformers to classify images, detect objects, segment defect regions, or estimate surface conditions. A typical vision solution contains lighting, optics, camera positioning, image acquisition, preprocessing, a trained model, and a decision interface. Many apparent AI failures originate in the physical inspection system rather than the algorithm. Glare, vibration, shadows, contamination on a lens, inconsistent product orientation, and inadequate resolution can make a defect invisible or create a false defect. Consequently, quality engineers must validate the complete measurement system, not only the software. Computer vision is particularly valuable where inspection is repetitive, rapid, hazardous, or dependent on subtle visual differences. Applications include weld inspection, printed circuit board examination, packaging verification, textile defects, pharmaceutical packaging, paint finish assessment, and measurement of assembly presence or orientation. Human inspectors remain important for unusual cases, ambiguous images, and updating the defect taxonomy. The performance threshold should reflect the consequence of error. A system intended to prevent a safety-critical defect from reaching a customer may be configured for high sensitivity, followed by human review of uncertain cases. A system used for cosmetic grading may use a different balance between false rejects and false accepts. The model’s confidence score should not be mistaken for certainty; confidence must be calibrated against observed outcomes. Predictive Quality and Process IntelligencePredictive quality uses historical and real-time process data to estimate future quality outcomes. Inputs may include temperature, pressure, speed, torque, tool wear, raw-material properties, environmental conditions, operator or shift information, and prior inspection results. Outputs can include the probability of nonconformance, expected measurement deviation, or remaining useful life of equipment. A practical predictive-quality workflow begins with a clearly defined prediction horizon. Predicting a defect ten seconds before it occurs is different from predicting it several hours before production. The available interventions determine whether a prediction is useful. If no action can be taken, improved prediction may have little quality value. Predictive models can support early-warning systems, dynamic sampling, preventive maintenance, recipe adjustment, and supplier risk assessment. They can also reveal interactions that are not obvious in standard reports. Nevertheless, correlations may reflect confounding factors. If a particular shift appears associated with higher defects, the explanation may involve machine temperature, product mix, or material lots rather than the shift itself. Process investigation and controlled experimentation remain necessary. Anomaly detection is useful where defects are rare or labels are unavailable. The system learns the normal operating pattern and flags unusual observations. Such alerts do not automatically represent defects; they indicate that investigation is warranted. This distinction is important in environments where normal variation is broad and process changes occur frequently. Generative AI and Quality KnowledgeGenerative AI creates text, images, code, summaries, or other content from learned patterns. In quality management, it can assist with drafting audit summaries, searching procedures, converting natural-language questions into data queries, preparing training material, classifying complaint narratives, and supporting root-cause investigations. Retrieval-augmented systems can connect a language model to approved procedures, standards, lessons learned, and controlled records. The appropriate role of generative AI is usually assistive rather than autonomous. A language model may summarize nonconformities, but it can omit qualifications, invent a plausible statement, or use an obsolete procedure. Every generated output that affects product release, regulatory reporting, corrective action, or customer communication requires human verification and controlled information sources. Generative AI can improve access to organizational knowledge by allowing personnel to ask questions in ordinary language. It can also expose weaknesses in documentation: if the system cannot identify the current inspection instruction, the organization may have a document-control problem. Access controls, confidential-data protection, source citation, version management, and audit trails are essential. Intelligent Decision SupportAn intelligent decision-support system combines data, predictive models, rules, optimization, and human judgment. It may rank incoming lots for inspection, recommend maintenance priorities, propose a sampling level, or display the likely consequences of alternative actions. Decision support is different from automatic decision-making. The former informs a responsible person; the latter executes a decision without routine human approval. The level of automation should correspond to risk. Low-risk administrative tasks may be automated. Decisions involving safety, legal conformity, product release, or significant customer impact generally require defined human authority. A useful design distinguishes three zones: automatic action for routine and low-risk cases, human review for uncertain or high-impact cases, and escalation when data or model conditions are outside validated limits. Decision systems should communicate uncertainty and reasons for recommendations. “Reject lot” is less useful than “high predicted risk because of increased torque variation and an unfamiliar material-lot pattern; confirm with dimensional inspection.” Such explanations support learning and make it possible to challenge an erroneous recommendation. Comparing AI with Classical Quality MethodsAI is attractive when the data are large, complex, unstructured, or generated continuously. It can process images, text, and nonlinear sensor patterns at a scale that may exceed manual analysis. It is often useful for prediction, ranking, and pattern recognition. Classical methods are often superior when the process is well understood, data are limited, transparency is essential, or the objective is to estimate and control variation using interpretable parameters. A control chart provides a clear signal about process stability. A regression model with carefully selected variables may be easier to validate and maintain than a deep neural network. A designed experiment can provide stronger evidence about causation than an observational ML model. The most effective approach is often hybrid. Statistical control can monitor the process; ML can provide early prediction; engineering analysis can identify mechanisms; and human experts can authorize intervention. AI should be selected because it solves a defined quality problem better than available alternatives, not because it is technologically fashionable. Validation, Explainability, and Human OversightValidation must reproduce the conditions under which the system will operate. Randomly splitting records can produce misleadingly optimistic results when adjacent observations from the same batch, machine, or patient appear in both training and test sets. Time-based, batch-based, supplier-based, or site-based validation may be more appropriate. The test set should remain protected until final evaluation. Validation should address technical performance, robustness, usability, and quality outcomes. Questions include: Does performance remain acceptable across product variants? Does it work under different lighting or environmental conditions? What happens when a sensor fails? Are minority defect types detected? Does use of the system reduce total cost or merely shift work to manual review? Explainability has several audiences. A data scientist may need feature-attribution diagnostics; an operator may need a visual highlight and a simple reason code; an auditor may need evidence of validation and change control; a manager may need information about risk and performance. No single explanation method satisfies every purpose. Human oversight must be designed, not assumed. Personnel should know when to accept, reject, override, or escalate a recommendation. Overrides should be recorded and periodically analyzed. If staff are held responsible for decisions but are unable to challenge the system, the arrangement is neither effective accountability nor genuine human control. Model Drift, Deployment, and MLOpsA model may deteriorate because products change, equipment ages, suppliers alter materials, inspection standards are revised, or customer expectations evolve. Monitoring should therefore include input distributions, missingness, prediction rates, confidence, error rates, calibration, and downstream quality outcomes. A sudden fall in detected defects may indicate improvement, sensor failure, or model blindness. MLOps establishes repeatable lifecycle controls. These may include versioned datasets, reproducible training code, model registries, approval gates, automated testing, deployment logs, access controls, rollback capability, and documented ownership. Model updates should undergo impact assessment and validation proportionate to risk. A change to image preprocessing may be as consequential as a change to the algorithm itself. A production system should have a champion model and, where appropriate, a challenger model evaluated under controlled conditions. Retraining should not occur blindly whenever new data arrive. New data may include biased labels, unusual temporary conditions, or outcomes affected by the model’s own recommendations. A controlled review is necessary before incorporating them into the training set. Risks, Ethics, and GovernanceAI quality systems raise issues of privacy, security, intellectual property, discrimination, accountability, and employment. Worker-related variables may create unfair or legally problematic inferences. Supplier scores may penalize small suppliers because of sparse data rather than actual poor quality. Facial or biometric information, if collected, requires particularly careful governance. Cybersecurity is a quality concern because manipulation of sensor data, images, labels, or model files can lead to defective releases or unnecessary shutdowns. Access should be limited, data should be protected, and unusual system behavior should be investigated. Organizations should retain records sufficient to reconstruct how a significant decision was made. Common mistakes include beginning with an algorithm rather than a quality problem; using historical inspection labels without assessing their consistency; optimizing accuracy while ignoring error costs; allowing data leakage; deploying without monitoring; and assuming that explainability is unnecessary because a model performs well. Another mistake is automation bias, in which users accept a model recommendation despite contradictory evidence. Governance should define the model owner, process owner, data owner, validation authority, escalation route, review frequency, and retirement criteria. In regulated industries, AI systems may fall within existing requirements for validation, electronic records, product safety, measurement systems, or change control. Compliance should be considered during design rather than after deployment. Illustrative Case: Vision-Based Defect Detection in a Medical-Device Assembly LineBackgroundA medical-device manufacturer assembled small disposable components on three production lines. Final inspectors examined images for a missing seal, incorrect orientation, and surface contamination. Inspection was slow, and defect definitions were interpreted somewhat differently by inspectors. Situation and ProblemThe organization proposed a deep-learning vision system to reduce inspection time. Historical images were available, but labels had been created from inspector decisions rather than independent laboratory confirmation. Some defect types were rare, and lighting differed across lines. AnalysisThe quality team first mapped the decision and its risks. A false accept could affect product safety, whereas a false reject would create reinspection and scrap cost. It reviewed label agreement, identified images from the same production runs, and found that a random data split would place near-identical images in both training and test sets. The team also performed a measurement-system study of camera position and lighting. Approach and SolutionThe organization standardized lighting and fixture position before retraining the model. Images were divided by production run and line for validation. The system was configured as a triage tool: high-confidence acceptable images could proceed, high-confidence defect images were stopped, and uncertain images were sent to a trained inspector. A second inspection method was retained for safety-critical defect confirmation. The interface displayed the suspected defect region and a reason code. Inspectors could override the recommendation, but every override required a classification and was reviewed weekly. Performance was monitored separately for each line and defect type. A documented fallback procedure was established for camera failure or abnormal lighting. OutcomeThe system reduced routine inspection effort while retaining human review for ambiguous cases. More importantly, the project identified inconsistent defect labelling and inadequate lighting control. The greatest quality improvement came from combining process standardization, better data governance, and AI rather than from the algorithm alone. Learning PointsThe case demonstrates that AI validation includes the physical measurement system, the label-generation process, and the human workflow. It also shows why a high-risk application should use staged automation, explicit escalation, and continuous monitoring rather than unconditional automatic release. Best Practices for AI-Enabled Quality ManagementA robust implementation follows several principles: - Begin with a measurable quality decision and define the cost of errors.
- Establish data ownership, lineage, label definitions, and retention rules.
- Compare AI with simpler statistical and engineering alternatives.
- Validate using realistic splits and representative operating conditions.
- Measure subgroup, product, supplier, and site performance rather than only aggregate accuracy.
- Present uncertainty and actionable explanations to users.
- Keep humans accountable for decisions appropriate to the risk level.
- Monitor drift, calibration, data quality, cybersecurity, and downstream outcomes.
- Version data, code, models, and deployment configurations.
- Define rollback, retraining, escalation, and retirement procedures.
- Treat user feedback and overrides as evidence for system improvement, not as inconvenient exceptions.
Current Developments and Emerging DirectionsQuality analytics is moving toward multimodal systems that combine images, sensor streams, text records, maintenance histories, and supplier information. Digital twins may allow organizations to test process changes computationally before physical implementation, although their usefulness depends on model fidelity. Edge AI enables inspection decisions near the equipment, reducing latency and dependence on network connectivity. Foundation models and generative interfaces may make quality data more accessible, but their use will increase the importance of source control, evaluation, and confidentiality. Causal ML, uncertainty quantification, and physics-informed modelling are receiving attention because quality decisions often require more than correlation. The long-term direction is not fully autonomous quality management; it is a more integrated system in which statistical evidence, process knowledge, AI predictions, and accountable human judgment work together. Chapter SummaryAI and machine learning extend quality management from inspection and retrospective analysis toward prediction, pattern recognition, and intelligent decision support. Computer vision is effective for repetitive visual tasks when image acquisition and labels are controlled. Predictive quality models estimate future nonconformance or process risk, while anomaly detection identifies unusual conditions requiring investigation. Generative AI can assist with quality knowledge and documentation but requires controlled sources and human verification. AI does not replace statistical process control, designed experiments, engineering knowledge, or professional accountability. Appropriate systems combine classical and AI methods according to the problem, data, risk, and need for explanation. Reliable deployment requires realistic validation, measurement of error costs, explainability, human oversight, drift monitoring, cybersecurity, version control, and MLOps. The quality professional’s role is to ensure that AI improves decisions without weakening traceability, fairness, safety, or governance. Key TermsArtificial intelligence: Computational capability associated with perception, reasoning, learning, or decision support. Machine learning: Methods that learn patterns from data to make predictions or decisions. Supervised learning: Learning from examples containing input data and known outcome labels. Unsupervised learning: Learning structure or anomalies from data without predefined labels. Computer vision: AI-based analysis of images or video for recognition, measurement, or inspection. Predictive quality: Use of data to estimate future quality outcomes or nonconformance risk. Feature: An input variable or representation used by a model. Label: The target outcome assigned to a training example. Overfitting: Learning training-specific patterns that do not generalize to new data. Data leakage: Use of information during training that would not be available at decision time. Precision: The proportion of predicted positive cases that are actually positive. Recall: The proportion of actual positive cases that a system detects. Explainability: The degree to which a model’s output and reasoning can be understood. Concept drift: Change in the relationship between inputs and outcomes over time. Data drift: Change in the distribution of model inputs. MLOps: Lifecycle practices for developing, deploying, monitoring, and governing ML systems. Human oversight: Arrangements enabling responsible people to review, challenge, and control AI-supported decisions. Generative AI: AI that produces new text, images, code, or other content from learned patterns. Anomaly detection: Identification of observations that differ substantially from learned normal behaviour. Model calibration: Agreement between predicted probabilities and observed frequencies. Review QuestionsShort Answer Questions1. Distinguish prediction from explanation in quality analytics. 2. What is the difference between precision and recall? 3. Why can accuracy be misleading when defects are rare? 4. Define data drift and concept drift. 5. State two reasons why computer-vision performance depends on physical inspection conditions. Long Answer Questions1. Explain how AI and classical quality methods can be combined in an integrated quality-management system. 2. Describe the lifecycle of an AI quality application from problem definition through monitoring. 3. Discuss the validation and explainability requirements for a high-risk predictive-quality model. 4. Evaluate the benefits and limitations of generative AI in quality documentation and knowledge management. 5. Explain how MLOps supports reliable deployment and lifecycle control of quality models. Analytical / Application Questions1. A defect-detection model has high accuracy but misses most critical defects because those defects are rare. Which performance measures and operational changes should the quality team consider? 2. After a supplier changes raw material, a predictive model’s alert rate falls sharply. Design an investigation to determine whether the cause is process improvement, data drift, concept drift, or sensor failure. 3. Design a human-oversight arrangement for an AI system that recommends release or rejection of safety-critical products. Identify escalation rules, records, validation evidence, and fallback procedures. 22. Multiple Choice Questions with AnswersQuestion 1Which situation most strongly justifies using machine learning rather than a simple fixed inspection rule? A. The acceptance criterion is a single, stable dimensional tolerance. B. The process has complex nonlinear relationships among many sensor variables. C. The organization has no defined quality objective. D. The decision must never be validated after deployment. Correct Answer: B. The process has complex nonlinear relationships among many sensor variables. Question 2A model identifies 90% of all actual defective units but also flags many acceptable units. Which measure is especially high? A. Recall B. Specificity C. Precision D. Calibration error Correct Answer: A. Recall Question 3Why is a random split of adjacent production records sometimes unsuitable for model validation? A. It always reduces the size of the training set to zero. B. It may place highly similar records from the same run in both training and test data. C. It prevents the use of numerical variables. D. It guarantees underfitting. Correct Answer: B. It may place highly similar records from the same run in both training and test data. Question 4In a high-risk visual inspection system, what is the most appropriate use of uncertain predictions? A. Automatically release the product. B. Delete the image from the training database. C. Route the case for defined human review. D. Change the defect label without investigation. Correct Answer: C. Route the case for defined human review. Question 5A model’s input distribution changes after a new supplier is introduced, although the defect relationship may be unchanged. This is best described as: A. Data drift B. Underfitting C. Label leakage D. Reinforcement learning Correct Answer: A. Data drift Question 6Which statement best describes the role of generative AI in controlled quality documentation? A. Its output can replace approval and document control. B. It should be used only when no source documents exist. C. It can assist drafting and retrieval, but outputs require verification against approved sources. D. It eliminates the need for audit trails. Correct Answer: C. It can assist drafting and retrieval, but outputs require verification against approved sources. Question 7Why should an AI project compare its proposed model with classical methods? A. Classical methods are always less accurate. B. A simpler method may be more interpretable, robust, and adequate for the decision. C. Comparison prevents any future model updates. D. AI models cannot use quality data. Correct Answer: B. A simpler method may be more interpretable, robust, and adequate for the decision. Question 8Which activity is most characteristic of MLOps? A. Ignoring model versions after deployment B. Changing labels whenever performance is inconvenient C. Monitoring performance, versioning models, and maintaining rollback procedures D. Removing human review from all quality decisions Correct Answer: C. Monitoring performance, versioning models, and maintaining rollback procedures Question 9A model predicts a higher defect risk for a particular shift. What is the most appropriate quality response? A. Treat the shift as the proven root cause. B. Investigate possible confounding process conditions and, if necessary, conduct controlled analysis. C. Remove the shift variable without further analysis. D. Automatically discipline the shift personnel. Correct Answer: B. Investigate possible confounding process conditions and, if necessary, conduct controlled analysis. Question 10Which design principle best supports accountable intelligent decision support? A. Provide only a final recommendation with no uncertainty information. B. Allow automatic action regardless of risk level. C. Define decision zones, explanations, override procedures, and escalation responsibilities. D. Prevent operators from recording disagreements with the model. Correct Answer: C. Define decision zones, explanations, override procedures, and escalation responsibilities.
|