class: center, middle, inverse, title-slide .title[ # Augmented AI for Quality Control and Analytics Education ] .subtitle[ ## Practical Tools, Lessons, and Opportunities ] .author[ ###
Ying-Ju Tessa Chen, PhD
Scholar
|
@ying-ju
|
ychen4@udayton.edu
Joint work with:
Fadel M. Megahed, Allison Jones-Farmer, Josh Ferris, Gabe Lee, Brooke Wang
Miami University
Bianca Maria Colosimo, Marco L.G. Grasso
Politecnico di Milano
Sven Knoth
Helmut-Schmidt-Universität
Douglas C. Montgomery
Arizona State University
Hongyue Sun
University of Georgia
Inez Zwetsloot
University of Amsterdam
] .date[ ### October 30, 2025 | Flyer Scholars in Action | University of Dayton ] --- ## The Road to Large Language Models <br> <img src="figs/generative_ai_chart.png" alt="From big data to big models, a flow chart documenting how we got to large language models" width="100%" style="display: block; margin: auto;" /> .footnote[ <html> <hr> </html> **Comment:** You have been hearing about **big data** in Quality Control for over a decade now. In fact, we presented our paper, [Statistical Perspectives on Big Data](https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&doi=ab40f392e653b7336cbebf7c4fb95d3988748282), almost exactly 12 years ago in the ISQC Workshop in Sydney. We now have models that can digest questions/prompts and generate answers based on more than 45TB of text. ] --- ## Uniqueness of LLMs vs. Earlier AI Models .content-box-gray[ .bold[.red[LLMs:]] .bold[The objective is to generate new content rather than analyze existing data.] ] .font90[ - The generated content is based on a .bold[.red[stochastic behavior embedded in generative AI models such that the same input prompts results in different content]]. - LLMs with known model sizes can have up to **540 billion parameters** ([PaLM](https://arxiv.org/abs/2204.02311)). Note that state-of-the-art models like *GPT-o3*, and *Claude Sonnet 3.7* have **not revealed their model sizes**. - With the increase in model size, researchers have observed the **“emergent abilities”** of LLMs, which were **not explicitly encoded in the training**. [Examples include](https://ai.googleblog.com/2022/11/characterizing-emergent-phenomena-in.html): + Multi-step arithmetic, and + taking college-level exams. - LLMs are **foundation models** (see [Bommasani et al. 2021](https://arxiv.org/abs/2108.07258)), large pre-trained AI systems that can be **repurposed with minimal effort across numerous domains and diverse tasks.** ] --- ## Beyond the Hype > Megahed, F. M., Chen, Y. J., Ferris, J. A., Knoth, S., & Jones-Farmer, L. A. (2024). How generative AI models such as ChatGPT can be (mis) used in SPC practice, education, and research? An exploratory study. Quality Engineering, 36(2), 287-315. **The question isn't hype - it's how to use these tools responsibly.** - Megahed, F. M., Chen, Y. J., Jones-Farmer, L. A., Lee, Y., Wang, J. B., & Zwetsloot, I. M. (2025). Reliable Decision Support with LLMs: A Framework for Evaluating Consistency in Binary Text Classification Applications. arXiv preprint arXiv:2505.14918. - Megahed, F. M., Chen, Y. J., Ferris, J. A., Resatar, C., Ross, K., Lee, Y., & Jones-Farmer, L. A. (2024). ChatISA: A Prompt-Engineered, In-House Multi-Modal Generative AI Chatbot for Information Systems Education. arXiv preprint arXiv:2407.15010. - Megahed, F. M., Chen, Y. J., Zwetsloot, I. M., Knoth, S., Montgomery, D. C., & Jones-Farmer, L. A. (2024). Introducing ChatSQC: Enhancing statistical quality control with augmented AI. Journal of Quality Technology, 56(5), 474-497. - Megahed, F. M., Chen, Y. J., Colosimo, B. M., Grasso, M. L. G., Jones-Farmer, L. A., Knoth, S., Hongyue Sun, & Zwetsloot, I. (2025). Adapting OpenAI's CLIP model for few-shot image inspection in manufacturing quality control: An expository case study with multiple application examples. arXiv preprint arXiv:2501.12596. --- class: inverse, center, middle # Structured Text Extraction for SQC Applications --- ## What is Structured Text Extraction (STE)? **Structured Text Extraction** is the process of extracting relevant information from unstructured text data and converting it into a structured format that can be easily analyzed. <br> <table class="table table-striped table-hover table-condensed" style="font-size: 12px; color: black; font-family: Arial; width: auto !important; "> <caption style="font-size: initial !important;">2025 Models Recall Data from NHTSA.</caption> <thead> <tr> <th style="text-align:right;"> Record ID </th> <th style="text-align:left;"> Defect Description </th> </tr> </thead> <tbody> <tr> <td style="text-align:right;"> 300365 </td> <td style="text-align:left;"> Polestar Automotive USA, Inc. (Polestar) is recalling certain 2021-2025 Polestar 2 vehicles. The rearview camera image may not display when the vehicle is placed in reverse. </td> </tr> <tr> <td style="text-align:right;"> 299665 </td> <td style="text-align:left;"> Mercedes-Benz USA, LLC (MBUSA) is recalling certain 2023-2024 AMG GT 63 S E Performance 4-door coupe, 2025 AMG GLC 63 S E Performance, GLC 63 S E Performance Coupe, AMG GT 63 S E Performance, 2023-2025 AMG S 63 E Performance, and 2024-2025 AMG SL 63 S E Performance vehicles with a hybrid powertrain. A software error may cause the high-voltage starter alternator control unit to fail, causing a loss of drive power. </td> </tr> <tr> <td style="text-align:right;"> 299911 </td> <td style="text-align:left;"> Thor Motor Company (TMC) is recalling certain 2023-2026 Axis, Chateau, Four Winds, 2023-2025 Coleman, Echelon, Freedom Elite, Geneva, Outlaw, Quantum, Vegas, 2025 Eddie Bauer, Freedom Traveler, Pasadena, and 2024-2025 Magnitude motorhomes. The slide-Out room can be deployed without the parking brake engaged, allowing the room to extend while the vehicle is in motion. </td> </tr> </tbody> </table> .footnote[ <html> <hr> </html> **Data Source:** [NHTSA Recalls Dataset From 2020-2024 (2025).](https://static.nhtsa.gov/odi/ffdd/rcl/RCL_FROM_2020_2024.zip) The data is based on the NHTSA's recall database, which contains information about vehicle recalls in the United States. **Context:** Manufacturers who determine that a product or piece of original equipment either has a safety defect, or is not in compliance with federal safety standards, are required to notify NHTSA within five business days. NHTSA requires that manufacturers file a defect and noncompliance report as well as quarterly recall status reports, in compliance with Federal Regulation 49 (the National Traffic and Motor Safety Act) Part 573, which identifies the requirements for safety recalls. NHTSA stores this information and the data can be used to search for recall information related to specific NHTSA campaigns and product types. **Note:** Recalls made in 2024 can influence later models, and hence, we are using the 2025 model year as a filter in the print out above. ] --- ## Our No-Code App for STE: A Demo Our [no-code app](https://huggingface.co/spaces/fmegahed/structured_text_extraction) utilizes the `ellmer` package to extract structured data from unstructured text, and OpenAI's `gpt-4o-mini` model to perform the extraction. <img src="figs/hf_ste.png" width="90%" style="display: block; margin: auto;" /> --- ## Some Potential Applications of STE in SQC - **Defect Detection**: Automating the identification of defects in manufacturing processes by analyzing inspection reports and maintenance logs. - **Customer Feedback Analysis**: Analyzing customer feedback, reviews, and warranty claims to identify common defects or issues with products. - **Regulatory Compliance**: Extracting information from regulatory documents, such as safety recalls or compliance reports, to ensure that products meet industry standards and regulations. - **Research:** Analyzing research papers, patents, and technical reports to extract relevant information about new materials, processes, or technologies. --- ## Practical Considerations > LLMs are **inherently stochastic**. It is important to check the: (a) **consistency** of the extracted data, and (b) **external validity** of the results. <img src="figs/intra_dist.png" width="45%" style="display: block; margin: auto;" /> .footnote[ <html> <hr> </html> **Note:** Our work on LLM consistency is available at [arXiv](https://arxiv.org/abs/2505.14918). Our detailed analysis in this area is available [here](https://fmegahed.github.io/research/llm_consistency/llm_consistency.html). ] --- class: inverse, center, middle # ChatISA: Our In-House Bot for Students <br> .pull-left-2[<br>Megahed, F. M., Chen, Y. J., Ferris, J.A., Resatar, C., Ross, K., Lee, Y., & Jones-Farmer, L. A. (2024). ChatISA: A Prompt-Engineered Chatbot for Coding, Project Management, Interview and Exam Preparation Activities. Under review. [Freely available @ [arXiv](https://arxiv.org/abs/2407.15010)].] .pull-right-2[<div><img src="figs/paper3_qr_code.png" class="paper-img" width="300px" align="right"></div>] --- ## A Live Demo of ChatISA <center> <a href="https://chatisa.fsb.miamioh.edu/"> <img alt="The interface to our ChatISA app" src="figs/chatisa_demo.gif" style="width:80%; height:80%;"> </a> </center> .footnote[ <html> <hr> </html> **Note:** We encourage the audience to experiment with **ChatISA** at <https://chatisa.fsb.miamioh.edu/>. If we have time, we can also go over [this pre-recorded and sped-up demo of our voice-enabled Interview Mentor](https://www.loom.com/share/896d4ab0e18747f0bca8dba5fff9cc36?sid=24872af4-aefd-4889-8083-b3eeb1082c52). ] --- class: inverse, center, middle # ChatSQC: Our Grounded App, to address Imprecise SQC Answers and Hallucinations <br> .pull-left-2[<br>Megahed, F. M., Chen, Y. J., Zwetsloot, I., Knoth, S., Montgomery, D.C., & Jones-Farmer, L. A. (2024). Introducing ChatSQC: Enhancing Statistical Quality Control with Augmented AI. *Journal of Quality Technology*, 56(5), 474-497. [Freely available @ [arXiv](https://arxiv.org/pdf/2308.13550)].] .pull-right-2[<div><img src="figs/paper2_qr_code.png" class="paper-img" width="300px" align="right"></div>] --- ## The Construction of ChatSQC <img src="figs/ChatSQC_flowchart_new.png" alt="The construction of ChatSQC involved four main phases: (a) a one-time extraction of the reference material, (b) a one-time preprocessing of the extracted material, (c) a continuous (online) chat inference, and (d) the hosting/deployment of the app on a web server." width="80%" style="display: block; margin: auto;" /> --- ## A Live Demo of ChatSQC <center> <a href="https://chatsqc.osc.edu/"> <img alt="The interface to our ChatSQC app" src="figs/chatsqc_demo.png" style="width:90%; height:90%;"> </a> </center> .footnote[ <html> <hr> </html> **Note:** We encourage the audience to experiment with **ChatSQC** at <https://chatsqc.osc.edu/>. ] --- class: inverse, center, middle # Adapting OpenAI's CLIP Model for Few-Shot Image Inspection in Manufacturing Quality Control <br> .pull-left-2[<br>Megahed, F. M., Chen, Y. J., Colosimo, B. M., Grasso, M. L. G., Jones-Farmer, L. A., Knoth, S., Sun, H. & Zwetsloot, I. (2025). Adapting OpenAI's CLIP Model for Few-Shot Image Inspection in Manufacturing Quality Control: An Expository Case Study with Multiple Application Examples. arXiv preprint arXiv:2501.12596. [Freely available @ [arXiv](https://arxiv.org/pdf/2501.12596)].] .pull-right-2[<div><img src="figs/paper4_qr_code.png" class="paper-img" width="300px" align="right"></div>] --- ## The Central Role of Images in SQC .center[ <video width="80%" controls> <source src="figs/image_qc_full.mp4" type="video/mp4"> </video> ] .footnote[ <html> <hr> </html> **Note:** This video was generated by Fadel M. Megahed using [Google's text-to-video Veo 3 model](https://labs.google/fx/tools/flow/). The prompts used to create and stitch the generated videos into one comprehensive video can be accessed [here](https://github.com/fmegahed/fmegahed.github.io/blob/master/talks/isspm2025/figs/image_qc_video_steps.md). ] --- ## What is CLIP? <img src="figs/CLIP.png" width="100%" style="display: block; margin: auto;" /> .footnote[ <html> <hr> </html> **Note:** CLIP (Contrastive Language–Image Pretraining) is a neural network architecture that learns to connect images and text. It was developed by OpenAI and released in January 2021. **Image Source:** <https://github.com/openai/CLIP>. ] ??? This is the main training loss for CLIP. The key idea is simple: we want the embedding of an image and its correct caption to be close, and for all other captions to be far away — and vice versa. So for each image–text pair in the mini-batch, we compute how similar the image is to every text in the batch, and how similar the text is to every image. Then we use a softmax to convert those similarities into a probability distribution, and apply cross-entropy loss to maximize the likelihood of the correct match. The loss is symmetric — we do this from image-to-text and text-to-image, and average the two directions. This simple structure is what gives CLIP its ability to generalize so broadly. --- ## Our Few Shot QC Framework <img src="figs/clip_framework.png" width="100%" style="display: block; margin: auto;" /> > **Practical Notes:** > > All preprocessing shown in the figure—center-crop → resize → patch extraction → embedding—happens **automatically** inside the standard `model, preprocess = clip.load("ViT-L/14", device=device)` function. > > In practice, you call one function, and CLIP handles the crop, resize, non-overlapping patching, and projection to the `\(d\)`-dimensional vector. > >We do **NOT** leverage the **text encoder** in our few-shot approach. We only use the **image encoder** to extract the `\(d\)`-dimensional vector representation of the image. --- ## An Example with Stochastic Textured Surfaces (STS) <img src="https://raw.githubusercontent.com/fmegahed/qe_genai/main/results/exp03_learning_images.gif" width="100%" style="display: block; margin: auto;" /> --- ## Zero-Shot Failure for the STS Example CLIP fails in **zero‑shot** because STS defects are subtle & domain‑specific. <br> | Accuracy | Sens | Spec | Prec | F1 | AUC | |---------:|-----:|-----:|-----:|---:|----:| | 0.500 | 0.000 | 1.000 | 0.000 | 0.000 | 0.171 | <br> Therefore we evaluate **few‑shot** performance while varying the learning‑set siz and two image encoder models (*ViT‑L/14* vs *ViT‑B/32*). --- ## Few-Shot Learning for the STS Example <img src="figs/exp03_comparing_two_clip_models.png" width="72%" style="display: block; margin: auto;" /> ??? - *ViT‑L/14* reaches **97% accuracy** with only **50** images/class. - Smaller *ViT‑B/32* saturates around 76%. - Fine‑grained `\(14\times14\)` patching better captures local stochastic texture. --- ## Our No-Code App for CLIP: A Demo **Our tool is available at**: <https://huggingface.co/spaces/fmegahed/clip>. <img src="figs/hf_clip.png" width="90%" style="display: block; margin: auto;" /> .footnote[ <html> <hr> </html> **Notes:** Our source code for the app can be found under our [HF Files](https://huggingface.co/spaces/fmegahed/clip/tree/main). Furthermore, the code for our detailed experiments with CLIP is available in [this Python Notebook](https://github.com/fmegahed/qe_genai/blob/main/notebook/image_inspection_with_clip.ipynb). Our under development Python library can be accessed at [FewShotIQ](https://test.pypi.org/project/FewShotIQ/0.1.1/). ] --- class: inverse, center, middle # Concluding Remarks --- ## 1. Keeping up with AI Developments is Hard!! <img src="figs/timeline_animation.gif" width="78%" style="display: block; margin: auto;" /> --- ## 2. The Fear of Technological Unemployment is Not New <img src="figs/cnn_ai_displace_jobs.png" alt="41% of companies worldwide plan to reduce workforces by 2030 due to AI" width="92%" style="display: block; margin: auto;" /> .footnote[ <html> <hr> </html> **Article Source:** Dmitracova, O. (2025, January 8). **41% of companies worldwide plan to reduce workforces by 2030 due to AI**. CNN Business. <https://www.cnn.com/2025/01/08/business/ai-job-losses-by-2030-intl/index.html> ] --- count: false ## 2. The Fear of Technological Unemployment is Not New > "The **fear** has even been expressed by some that **technological change** would in the **near future not only cause increasing unemployment**, but that **eventually it would eliminate all but a few jobs**, with the major portion of what we now call **work being performed automatically** ..." > > .font70[National Commission on Technology, Automation and Economic Progress (1966). Technology and the American Economy. Volume 1. February 1966. Report to the President and Members of Congress [(p.xii)](https://files.eric.ed.gov/fulltext/ED023803.pdf)]. -- <br> > The .black[.bold[basic fact]] is that **technology eliminates jobs, not work**. > > .font70[National Commission on Technology, Automation and Economic Progress (1966). Technology and the American Economy. Volume 1. February 1966. Report to the President and Members of Congress [(p.9)](https://files.eric.ed.gov/fulltext/ED023803.pdf)]. ??? We have the honor to present the report of the National Commission on Technology, Automation, and Economic Progress. This Commission was established by Public Law 88-444, which was approved by Congress on August 5, 1964, and signed by the President on August 19, 1964. The Commission was appointed by the President in December 1964, and the appointments were approved by the Senate on January 27, 1965. --- ## 3. The Future of Work: Projected Needed Skills <img src="figs/wef_skills_matrix.png" width="65%" style="display: block; margin: auto;" /> .footnote[ <html> <hr> </html> **Source:** World Economic Forum (2025). [The Future of Jobs Report 2025](https://reports.weforum.org/docs/WEF_Future_of_Jobs_Report_2025.pdf), P. 41. The Future of Jobs Report 2025 brings together the perspective of over 1,000 leading global employers, representing more than 14 million workers across 22 industry clusters and 55 economies from around the world. ] --- ## 4. Use Cases Overlap with our Discpline!! <img src="figs/use_cases2.svg" width="100%" style="display: block; margin: auto;" /> .footnote[ <html> <hr> </html> **Created By:** Fadel Megahed based on the text in the article by Ava McCartney. (2024). "When Not to Use Generative AI", *Gartner*. The article was published on April 23, 2024 and last accessed on October 18, 2025. It can be accessed at <https://www.gartner.com/en/articles/when-not-to-use-generative-ai>. ] --- ## Thank You! .pull-left[ - This presentation was created based on Dr. Fadel Megahed's presentation at [International 15th Workshop on Intelligent Statistical Quality Control](https://statistische-woche.de/en/startseite-en). Click [here](https://fmegahed.github.io/talks/isqc2025/genai.html) to find the original presentation. - Please do not hesitate to contact me (Tessa Chen) at <a href="mailto:ychen@udayton.edu"><i class="fa fa-paper-plane fa-fw"></i> ychen4@udayton.edu</a> for questions or further discussions. ] .pull-right[ <img src="./figs/Tessa_grey_G.gif" width="60%" style="display: block; margin: auto;" /> ]