# Leveraging Machine Learning for Porosity Prediction in AM Using FDM for Pretrained Models and Process Development

**Authors:** Khadija Ouajjani, James E. Steck, Gerardo Olivares

PMC · DOI: 10.3390/ma18194499 · 2025-09-27

## TL;DR

This paper uses machine learning to predict porosity defects in 3D-printed parts using Fused Deposition Modeling, improving process optimization and reducing trial-and-error.

## Contribution

A novel machine learning pipeline is developed for porosity prediction in AM using FDM, with scalable and repeatable validation methods.

## Key findings

- The image classifier achieved over 97% accuracy in distinguishing defective from exploitable images.
- The MLP model's accuracy improved from 54.4% to 77.6% with a larger dataset, highlighting the importance of sample size.
- A grouped k-fold cross-validation protocol was implemented to prevent data leakage and overfitting.

## Abstract

Additive manufacturing involves numerous independent parameters, often leading to inconsistent print quality and necessitating costly trial-and-error approaches to optimize input variables. Machine learning offers a solution to this non-linear problem by predicting optimal printing parameters from a minimal set of experiments. Using Fused Deposition Modeling (FDM) as a case study, this work develops a machine learning-powered process to predict porosity defects. Specimens in two geometrical scales were 3D-printed and CT-scanned, yielding raw datasets of grayscale images. A machine learning image classifier was trained on the small-cube dataset (~2200 images) to distinguish exploitable images from defective ones, averaging over 97% accuracy and correctly classifying more than 90% of the large-cube exploitable images. The developed preprocessing scripts extracted porosity features from the exploitable images. A repeatability study analyzed three replicate specimens printed under identical conditions, and quantified the intrinsic process variability, showing an average porosity standard deviation of 0.47% and defining an uncertainty zone for quality control. A multi-layer perceptron (MLP) was independently trained on 1709 data points derived from the small-cube dataset and 3746 data points derived from the large-cube dataset. Its accuracy was 54.4% for the small cube and increased to 77.6% with the large-cube dataset, due to the larger sample size. A rigorous grouped k-fold cross-validation protocol, relying on splitting data per cube, strengthened the ML algorithms against data leakage and overfitting. Finally, a dimensional scalability study further assessed the use of the pipeline for the large-cube dataset and established the impact of geometrical scaling on defect formation and prediction in 3D-printed parts.

## Full-text entities

- **Diseases:** injury to (MESH:D014947), AM defects (MESH:D000013), FDM (MESH:D000069337), CT (MESH:C000719218), PLA (MESH:D011015)
- **Chemicals:** metal (MESH:D008670), Nylon (MESH:D009757), polymers (MESH:D011108), ULTEM 9085 (-), PLA (MESH:C033616)
- **Species:** Homo sapiens (human, species) [taxon 9606]
- **Mutations:** C +- 5  C, C-115  C

## Figures

21 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12525203/full.md

---
Source: https://tomesphere.com/paper/PMC12525203