Enhancing additive manufacturing precision- SMART INSPECTION

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Composites Part C: Open Access 14 (2024) 100451

Contents lists available at ScienceDirect

Composites Part C: Open Access


journal homepage: www.sciencedirect.com/journal/composites-part-c-open-access

Enhancing additive manufacturing precision: Intelligent inspection and


optimization for defect-free continuous carbon fiber-reinforced polymer
Md Hasib Zubayer a, Yi Xiong b, Yafei Wang a, *, Haque Md Imdadul c
a
School of Mechanical Engineering, Shanghai Jiao Tong University, 200240, Shanghai, China
b
School of System Design and Intelligent Manufacturing, Southern University of Science and Technology, 518055, Shenzhen, China
c
School of Mechanical Engineering, Shenyang Aerospace University, 110136, Liaoning, China

A R T I C L E I N F O A B S T R A C T

Keywords: Artificial intelligence (AI) has emerged as a pivotal tool in managing extensive datasets, enabling pattern
Additive manufacturing recognition, and deriving solutions, particularly revolutionizing additive manufacturing (AM). This study intends
Artificial intelligent-deep machine learning to develop AI deep machine learning image processing techniques for real-time defects detection in additively
Continuous carbon fiber-reinforced polymer
manufactured continuous carbon fiber-reinforced polymer(cCFRP) specimens. Leveraging YOLOv8- a state-of-
Fiber misalignment defect
Yolov8
the-art, single-stage object detection algorithm, this study focuses on the relationship between printing param­
eters and defect occurrences, specifically misalignment errors. The research delineates a methodological
advancement by correlating detected defects with parameter optimization, leading to significant quality im­
provements in cCFRP specimens. An impressive 94 % accuracy in detecting misalignments was achieved through
fine-tuning the nozzle temperature adjustment, resulting in significant reductions in misalignment errors, while
minimal impact is observed from print bed temperature, feed amount, and feed rate/sec on refining the proposed
model for identifying optimal parameters.

Introduction devaluation plays a crutial role in enhancing fuel efficiency. The final
property of an additively manufactured continuous carbon
In the last decades’ composite structures of additive manufacturing fiber-reinforced polymer part is the repercussions of a combination of
(AM) have appeared as a highly imperative and influential technology numerous processing parameters such as printing bed and nozzle tem­
and played a transformational role among both the research centers and perature, feed rate per sec., and scan speed. However, in the context of a
industrial communities, especially in heavily regulated aerospace in­ high-performance structural component, material defects have the
dustries[1–5]. Composite structures have gained widespread adoption propensity to transform into localized fractures under extreme loading
in aerospace and other top-tier industries due to their in-depth strength, conditions. This progressive propagation of flaws within the structures
stiffness, and excellent fatigue resistance properties[6–8]. Especially, 3D ultimately culminates in the overall failure of the entire structure. The
printed CFRP with cellular structures is functional for the aircraft failure mechanisms observed in additively manufactured CFRP com­
manufacturing industry as it provides lightweight, high-strength, cus­ posites typically associated with various factors, as illustrated in Fig. 1.
tomizable geometries, and cost-effective solutions to complex compo­ These factors, inclusive of the defects recognized within the proposed
nent design and enables the creation of more fuel-efficient and model, have significantly contributed to a comprehensive understanding
high-performance aircraft. The cellular structure optimizes the of the prevailing research problem. Because of this, there is a need to
strength-to-weight ratio of the material by distributing the load evenly develop deep learning-based monitoring techniques that can keep con­
throughout the component and minimizing stress concentrations that trol of the stability of the AM on a layer-by-layer basis and to detect the
are unique to the component’s design and application and further onset defects as soon as possible to get high-quality parts.
reducing the weight of the component without sacrificing its strength In recent scientific literature, deep learning algorithms integrated
and stiffness. This can help reduce assembly time and cost while various computer vision techniques to detect internal defects and mea­
improving the overall structural integrity of the component and exhibits sure the defect size in fused deposition modeling (FDM) 3D printing
exceptional suitability for aeronautics applications where weight composite materials [9–12].For instance Zhang et al.’s vision-based

* Corresponding author.
E-mail address: wyfjlu@sjtu.edu.cn (Y. Wang).

https://doi.org/10.1016/j.jcomc.2024.100451

Available online 6 March 2024


2666-6820/© 2024 The Authors. Published by Elsevier B.V. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-
nc-nd/4.0/).
M.H. Zubayer et al. Composites Part C: Open Access 14 (2024) 100451

measurement approach for detecting wire-feeding deviations caused by (3) To measure and minimize defects, a closed-loop control approach
wire twisting in the laser cladding process[13]. In another study, Cal­ is successfully developed to identify the optimal tool path by
tanissetta et al. [14] introduced a deep learning architecture that in­ adjusting various process parameters based on a relationship
tegrates sophisticated image pre-processing algorithms in conjunction between CFRP defects and process parameters.
with an optimized lighting configuration.
Furthermore, Jin et al. [15] designed an autonomous correction Related work
system based on deep learning techniques and executed in-situ defect
analysis, enabling the evaluation of FDM fabricated parts’ quality. CFRP misalignment defect detection approach
Similarly, Yuan et al. [16] proposed a supervised deep learning-based
monitoring approach to predict the welding properties in the L-PBF Traditionally, non-destructive testing (NDT) methods like digital
process, utilizing ex-situ measurements. It is suggested exploring auto­ image correlation (DIC) and ultrasound detection have been used for the
matic analysis of image-based defect detection for AM specimens by inspection of CFRP composites, but these methods can be costly, time-
deep learning is extremely complex but successful patterns in the consuming, complex, and may require skilled human inspectors.
ImageNet databases[17]. Although, previous research endeavors uti­ Recent study indicates the promising potential of deep learning- driven
lizing deep learning methods have focused on recognizing defects within image processing algorithms for the efficient automation of defect
CFRP composites in real-time monitoring process parameters. However, detection in CFRP structures. A comprehensive literature review across
unable to address the elimination of defects during the fabrication diverse academic databases delineates the application of deep learning
process which was considered in our research approach. Defects techniques in identifying misalignment defects in CFRP, highlighting
attributed to CFRP misalignment typically occur at high curvature re­ their achievements, accuracy, limitations, and successes, as presented in
gions and turning angles[18,19]. Table 1.
In this work, deep learning is employed in the CFRP defect locali­ In CFRP composites, misalignment defects emerge as critical con­
zation and minimization in additive manufacturing to achieve high- cerns, potentially undermining structural integrity and performance
precision monitoring in real time. An innovative closed-loop control more significantly than other defects like fiber breakage, delamination,
approach has been successfully developed, facilitating online defect wrinkling, or resin inconsistencies. Misalignment can drastically affect
detection and adjustment of process parameters aimed to achieve a the load-bearing capacity and fatigue life of composites, necessitating
defect-free state while investigating the relationship between misalign­ focused attention in applications demanding high precision and
ment defects and process parameters to improve the efficacy and pre­ strength. During the experimental setup, a range of defects was identi­
cision of cCFRP defect detection. Overall, the principal contribution of fied, including fiber breakage, delamination, misalignment, and resin
this research can be classified into three distinct aspects as follows. richness, mainly due to tool setup and geometrical inaccuracies. Despite
addressing initial issues, misalignment remained in the final printed
(1) A cellular-based linear structure is proposed to develop CFRP structures, echoing literature findings and experimental evidence. This
toolpaths for fabricating cellular structures via an in-house built underscores misalignment’s notable impact on CFRP structure integrity,
co-extrusion CFRP-AM printer, where a Python code has been distinguishing it from other defect types.
developed to automatically extract images from each layer of a
3D printing sample.
(2) The newest state-of-the-art YOLOv8-based deep learning algo­ YOLOv8 architecture as research approach
rithm was proposed that is extremely effective in terms of accu­
racy of misalignment detection on various cellular structures, Currently, YOLO object detection has gained substantial traction due
including triangular, square, linear, and voronoi diagram to its lightweight architecture, real-time adequacies, efficient feature
configurations. fusion methods, and superior detection accuracy in additive
manufacturing [27–30]. Neuhauser et al. [31] implemented YOLOv5 for

Fig. 1. Surface defects observed in proposed CFRP-AM model.

2
M.H. Zubayer et al. Composites Part C: Open Access 14 (2024) 100451

Table 1 extrusion profiling using a camera, effectively discerning flawless sur­


A comprehensive literature review. face defects from other anomalies. This accurate and rapid surface defect
Authors AM Approach Major findings Limitation detection aligns with industrial production equipment standards.
Techniques Furthermore, Redmon et al. [32] introduced a YOLO-based target
Jin FDM Convolutional Successfully Tend to be detection network, transforming the problem into a regression issue, and
et al. Neural detecting inter- much streamlining detection with a single neural network.
[20] Network layer defects slower Published in 2023, YOLOv8 was introduced to amalgamate effective
Banadaki (CNN)-based like where it algorithms from various real-time object detectors. Building upon
et al. image delamination needs large
[21]. acquisition is and pre- amount of
YOLOv5′s Cross-Stage Partial (CSP) architecture [33], the path aggre­
Fjeld, J., accomplished diagnosing AM labeled gation network with feature pyramid network (PAN-FPN) feature fusion
et al. through defects, data. method [34,35], and state-of-the-art (SOTA) models [36], YOLOv8
[22] camera. achieving aimed to enhance object detection performance. It incorporated varying
accuracies of
scales based on scaling coefficients similar to YOLOv7 but employed
97.80 %, 94 %,
and 92.70 % Binary Cross Entropy (BCE) loss for classification. The study used the
respectively. Complete Intersection over Union (CIOU) loss, Distance-IoU Loss (DFL),
Bakhshi Automated Used various Two major Prolonged and Variable Feature Location (VFL) to prioritize specific localization,
et al. fiber process defects namely, run time. maximizing the probability at that particular location.
[23]. Placement parameters blisters and
(AFP) steering radii wrinkles
The architecture of YOLOv8 closely resembles YOLOv5 but in­
and FEM appeared. tegrates the C2f module instead of C3, drawing inspiration from
method to Ensemble Learning with Attention Networks (ELAN) and CSP concepts
identify CFRP from YOLOv7 [37,38]. This module ensures lightweight construction
defect during
while enhancing gradient flow for comprehensive representation
tow steering in
AFP. learning. The SPPF module, employing three maxpools in a row of size 5
Li, Z., et al. FDM Sensor-based A sensor-based Lower × 5, followed by layer concatenation, enables YOLOv8 to handle objects
[24]. model was accuracy of varying scales efficiently.
proposed for The neck module in YOLOv8 combines two up-sampling operations,
predicting AM
a decoupled head structure and multiple C2f modules, inspired by the
surface
roughness and decoupling concept in YOLOx. This
surface efficiently combines regression boxes with confidence, enabling
anomaly excellent accuracy.
detection with
Essentially, YOLOv8 possesses a key attribute of significant extensi­
55–59 %
accuracy. bility, compatibility with various YOLO versions, and seamless transi­
Soete et al. X-ray A Excellent Fail at tion between versions. Efforts have been made to achieve 100 %
[25]. Computed displacement- detection for smaller accuracy, with YOLOv8′s online convolutional neural network algo­
Tomography controlled CFRP indentation rithm for CFRP misalignment defect detection surpassing other versions.
(XCT) indentation microstructure depths.
This architecture offers an effective solution for detecting various CFRP
test, providing defects like
a local porosity, void, structures (see in Fig. 2), enhancing defect classification, and enabling
compressive twisting of the early identification of critical defects.
load, was used fiber occurs at
to examine the several
Defect size as model improvement
internal locations.
actuation
mechanism of Once the misalignment defect is detected using YOLO object detec­
the CFRPs. tion, it is imperative to quantify the size of these defects. This quanti­
Lu et al. Robot-based The cross- The proposed Standard tative assessment provides us with precise insights into the extent of
[26]. AM System sectional approach accuracy
profile of an demonstrates result
improvement required for our model. Given the inherent complexity of
aircraft wing is the real time required. the process, a color-based segmentation in the HSV color space was
chosen as the capability to established to detect the misalignment distance that suits best with the
experimental detect various CFRP model. This process was based on a comprehensive evaluation of
configuration types of defects
several established image-processing models known to be successful in
to validate the (such as
real-time misalignment similar contexts.
defect and abrasion) Zhang et al. [39] introduced camera calibration technique aimed at
identification in CFRP accurate image measurements, establishing the correlation between
and closed- materials image pixels and real-world coordinates. A well-calibrated camera
loop AM effectively and
control. precisely.
compensates for lens distortion and provides the intrinsic parameters
Zhang et al. Fused X-ray Observed Printing necessary for accurate measurements. Lankton et al. [40] used
[18]. Filament computed significant defects were color-based segmentation where they focused more on illumination
Fabrication micro porosity, fiber not directly changes which may affect the results.
(FFF) tomography misalignment, observable
Wahl et al. [41] focused on measuring object dimensions from im­
(μCT), Pruspa shape in the
i3 desktop inaccuracy, current ages requires knowledge of the camera’s intrinsic and extrinsic param­
printer, fiber twisting at model. eters. Without this information, assumptions or approximations (like
specific brass the matrix ours) are made, which can lead to errors. Hartley et al. [42] discussed
nozzle, FEM interface in the distortion as affecting the measurements. When objects are not aligned
analysis printed straight
stripe.
perpendicular to the camera’s optical axis, perspective distortion occurs,
especially if the object spans a large field of view. Correction methods,
such as homography matrices, can mitigate these effects. To conclude,
while our approach aligns with standard practices in computer vision,

3
M.H. Zubayer et al. Composites Part C: Open Access 14 (2024) 100451

Fig. 2. The schematic diagram depicts the architecture of YOLOv8 in the conducted experiment.

there are inherent challenges and limitations in measuring real-world the PLA filaments underwent drying at 60℃ for 10 h.
dimensions from images, as highlighted in the literature. The triangular cells within the lattice are connected via linear paths,
with numerical indicators along these paths denoting the sequence of
Research methodology assembly. The design parameters for each triangular shape, including
the lengths of sides and the angles between them, are precisely defined
This paper employs a deep-learning methodology, specifically as specified dimensions are 30 mm in length, 30 mm in width, and 2 mm
YOLOv8, for surface defect detection on additive-manufactured CFRP in height, with all internal angles set to 60◦ . These specifications are part
specimens. In the initial phase of dataset preparation for enhancing the of a deliberate design strategy aimed at facilitating the detection of
YOLOv8 algorithm, a selection of cellular structures with diverse ge­ misalignments, as illustrated in Fig.3. The methodology section details
ometries, including triangular, square, and Voronoi shapes, was un­ the research procedures, including dataset preparation, deep learning
dertaken. This approach was aimed at augmenting the dataset to refine training process evaluation, and defect size improvements. A schematic
the algorithm’s capability in accurately detecting misalignments across experimental closed-loop flowchart of the research approach is illus­
these geometrical configurations. Following a thorough evaluation, trated below Fig. 4.
triangular lattice structures were identified as the primary focus due to
their exceptional strength-to-weight ratio. This attribute is especially
advantageous in aerospace composite applications, where the emphasis Dataset preparation
is on achieving geometric consistency and optimizing material utiliza­
tion. Each vertex within the triangular lattice is meticulously assigned a The first step in the methodology involves preparing the dataset,
coordinate label, for instance, U15 Y30, to precisely identify locations in where multiple shapes (triangular, square, voronoi) of cellular struc­
a three-dimensional space. Here, ’U’ signifies movement along the x- tures were chosen as the experimental concepts. The cellular structure
axis, and ’Y’ indicates movement along the y-axis, with the numbers was fabricated using an in-house co-extrusion CFRP-AM printer,
representing specific positions in millimeters. wherein two materials, CFRP and PLA, were simultaneously extruded.
The fabrication of the cellular structure employed an in-house The dataset consisted of high-resolution images (3280 × 2464 pixels)
developed co-extrusion CFRP-AM printer, capable of simultaneous capturing CFRP specimens using a Raspberry Pi 4 camera. However, in
extrusion of two materials, CFRP and PLA, through a dual-nozzle system pre-processing step, resizing the images to 640 × 640 pixels and stan­
with a 0.4 mm diameter. The PLA to CFRP mix ratio was set at 1 to 0.3, dardizing pixel values to achieve a mean of 0 and a standard deviation of
within a build volume of 300 mm × 300 mm × 330 mm. The composite 1, ensuring compatibility for training the deep learning model.
material was reinforced using a carbon fiber(CF) tow, containing 1.5k Employing an automated real-time code, the 3D printer operations
filaments per tow, pre-impregnated with thermosets and boasting a fiber paused for 20 s, enabling the Raspberry Pi camera to capture 100 images
volume fraction of approximately 60 %. Each CF tow measured an per layer. Extended interruptions during the printing process are avoi­
effective diameter of 0.35 mm with a linear density of 145 Tex. The ded due to potential adverse effects, such as temperature fluctuations in
polymer matrix consisted of thermoplastic polylactic acid (PLA) fila­ the previous layer and prolonged heating of the print head, resulting in
ments, sourced from Polymaker, China, feature an effective diameter of compromised print quality. A Python code facilitated printer pausing
1.75 mm and a density range of 1.17–1.24 g/cm3. Prior to 3D printing, after each layer, positioning the camera and issuing triggers for
capturing images at high nozzle fan settings while halting capture at low

4
M.H. Zubayer et al. Composites Part C: Open Access 14 (2024) 100451

Fig.3. Schematic of a cellular triangular lattice showcasing a sequential design notation.

Fig. 4. Schematic Experimental closed-loop flowchart of the research approach.

fan settings. Subsequently, manual annotation of misalignment defects Dataset annotation


in the cCFRP structure involved drawing bounding boxes around defect
regions using the roboflow software tool. The annotated images were The second step in dataset preparation is annotation. Annotation
randomly split into sets of training, valid, and testing purposes. The involves the manual labeling of the images to identify the regions of
training set is utilized to train the deep learning model, while the vali­ interest. In this study, the surface defects on the CFRP parts were an­
dation set is employed to choose the best model based on its perfor­ notated using a bounding box. The annotations were done manually by
mance on the validation set. The testing set is used to evaluate the drawing a bounding box around each surface defect region in the image
overall performance of the selected model. A well-prepared dataset using Roboflow software. Specifically, within the dataset, the yellow
preparation is an essential step in deep machine learning research for square markings denote areas of misalignment, while the purple squares
accurate validation. Here, in Fig. 5 shows the step-by-step approach to signify non-misalignment as shown in Fig. 6.
how the dataset was prepared for this study.

Data augmentation

The third step in dataset preparation includes data augmentation,

5
M.H. Zubayer et al. Composites Part C: Open Access 14 (2024) 100451

Fig. 5. Close loop flowchart of dataset preparation.

Preprocessing

The fifth step in dataset preparation involves preprocessing, a crucial


stage that transforms raw data into a suitable format for training the
deep learning model. This preprocessing step ensures that the data is
appropriately formated and optimized for effective utilization during
the training process. In this study, the images were resized to a fixed size
of 640 × 640 pixels, and the pixel values of the images were standard­
ized by normalizing to have a mean of 0 and 1 as a standard deviation.
Overall, the dataset preparation process involves collecting, cleaning,
annotating, splitting, augmenting, and pre-processing the images to
create a high-quality dataset that is suitable for training a deep machine
learning model. Each step is critical to ensure that the dataset is repre­
sentative of the real-world data and that the machine learning model can
learn to detect surface defects on the cCFRP specimen accurately.

Training process and evaluation


Fig. 6. Annotation sample- yellow bounding box denote areas of misalignment,
while the purple signifies non-misalignment. The experimental platform details, as well as the initialization model
parameters for the experiment, are presented in Table 2 and 3 respec­
which typically involves creating additional training samples through tively. The accuracy of the proposed method was rigorously quantified
transformations like rotations, translations, scaling, and flipping. Data using globally recognized standard metrics within the field of machine
augmentation is necessary to increase the number of the dataset and learning and computer vision object detection models [43]. Intersection
make the deep learning model more robust. However, as there was a over Union (IoU) is used to evaluate the performance of object detection
sufficient number of datasets available for this study, data augmentation by comparing the ground truth bounding box to the predicted bounding
was not performed.
Table 2
Hardware and software parameters of the experimental platform.
Splitting the dataset Category Configuration

Hardware CPU Intel(R) Core (TM) i7–8565 U


The fourth step in dataset preparation is splitting the dataset into GPU NVIDIA NVTX 11.6
training, validation, and testing sets to evaluate the final performance of Operating system Linux Ubuntu 16.04
the selected model. In this study, the dataset was split randomly into 65 RAM 16 GB
% training set, 18 % validation set, and 17 % testing set to avoid Software Program environment Python 3.9.13
Deep learning framework PyTorch 1.7
overfitting.

6
M.H. Zubayer et al. Composites Part C: Open Access 14 (2024) 100451

Table 3 for the YOLOv8 algorithm’s defects detection capabilities in CFRP


Setting of the training parameter value and experimental data for defect structures, the collection of 50 images per parameter set is strategically
analysis. chosen to balance comprehensive data variability with algorithmic ef­
Material Nozzle Bed Feed Feed Train. ficiency. This specific number ensures the dataset is large enough to
Temp. Temp. amount rate Epoch encapsulate the inherent variance in the 3D printing process, crucial for
PLA+ 195 ◦ C, 200 ◦ C, 205 40 ◦ C, 50 2,5,10 5,2,1 25 the algorithm to learn and accurately identify potential misalignments
CFRP ◦
C, 210 ◦ C, 215 ◦ C, ◦
C, 60 ◦ C (mm) (mm/ across different conditions. It provides a robust foundation for the model
220 ◦ C, 230 ◦ C s) to generalize well to new, unseen data, enhancing the predictive capa­
bility and reliability of the YOLOv8 algorithm in real-world applications.
Upon the completion of individual parameter tests, YOLOv8 successfully
box which is analysed by Eqs. (1). In defect detection, IoU quantifies
identified no misalignment defects specifically at a nozzle temperature
overlap between two boxes, evaluating ground truth and prediction
of 230 ◦ C, printing bed speed of 40 ◦ C mm/s, layer height of 0.2 mm,
region overlap in object detection and segmentation. Average precision
feed rate of 1 mm/s, and feed amount of 10 mm. These parameters
(AP) is employed as the evaluation metric for misalignment defect
exhibited no observable misalignment errors within the CFRP cellular
detection in this experiment, while the mean average precision (mAP) is
structure during YOLOv8 analysis.
used to evaluate the overall performance of the model, which is analysed
by Eqs. (2) and (3); where TP is the true positive rate. FP is the false
positive rate, which indicates that misalignment defects are in the Results and discussion
non-defects regions and are falsely detected as defects. FN is the false
negative rate, representing a certain number of defects that failed to be The proposed method was evaluated on a CFRP cellular structure
detected during this experiment. Precision represents the accuracy of the dataset containing surface defects in CFRP cellular structures. The pro­
prediction from the performance of the model. Recall represents the posed method achieved a mAP (mean Average Precision) score of 0.94
performance of the model to find all the possible positive cases in top for misalignment and 1 for non-misalignment respectively and the
priorities predictions. The mathematical expressions for precision, proposed model took 0.039 h for 25 epochs; which outperformed the
recall, and mean average precision (mAP@0.5:0.95) [44] are elucidated other YOLO models. The size estimation accuracy of the proposed
as Eqs. (4), (5), and (6), respectively. method was also evaluated, and the results demonstrate that the size of
misalignment defects can be estimated with an average error of less than
Intersection Over Union (IOU) =
A∩B
=
Area of overalp
(1) 1 %. Fig. 7(a). presents the confusion matrix for the proposed model. It is
A∪B Area of union evident that misalignment and non-misalignment are sometimes not
∫ 1
detected and are considered as background. Fig. 7(b). shows the pro­
Average Precision (AP) = p(r)dr (2) gression of various metrics during training and validation, including box
0 loss, object loss, class loss, and metrics after each epoch, such as accu­
racy and recall.
1 ∑N
Mean Average Precision(mΛP) = ΛP(i) (3) The recall metric is the percentage of correct predictions relative to
N i
the total number of valid predictions. The F1 score takes into account
True Positive (TP) both the accuracy and the number of correct predictions and has a
Precision (P) = (4) maximum possible value of 1. Some faults in CFRP sample were picked
True Positive (TP) + False Positive (FP)
up by the YOLOv8 algorithm, but they can be ignored in consideration of
True positive (TP) 0.94 mAP results. The investigation employed to find the best param­
Recall(R) = (5) eter, encompassing a diverse range of parameters: varying nozzle tem­
True Positive (TP) + False Negative (FN)
peratures from 195 ◦ C to 230 ◦ C, print bed temperatures ranging from 40
mAP0.50 + mAP0.55 … + mAP0.95 ◦
C to 60 ◦ C, feed amounts set at 2 mm, 5 mm, and 10 mm, and feed rates
mAP@0.5 : 0.95 = (6)
N adjusted to 1 mm/s, 2 mm/s, and 5 mm/s. Each parameter was indi­
The investigation employed to find the best parameter, encompass­ vidually tested, and a total of 50 images were collected for each
ing a diverse range of parameters: varying nozzle temperatures from 195 parameter set to conduct YOLOv8 analysis, aiming to detect misalign­

C to 230 ◦ C, print bed temperatures ranging from 40 ◦ C to 60 ◦ C, feed ment errors within each layer of CFRP cellular structure. Model per­
amounts set at 2 mm, 5 mm, and 10 mm, and feed rates adjusted to 1 formance and defect images are depicted as table 4 and Fig. 8
mm/s, 2 mm/s, and 5 mm/s. Each parameter was individually tested, respectively.
setting specific values as follows: nozzle temperature at 210 ◦ C, printing The final results of YOLOv8 misalignment detection accuracy in each
bed speed at 40 ◦ C mm/s, layer height fixed at 0.2 mm, feed rate set to 2 layer performed as an excellent detector in terms of various cellular
mm/s, and feed amount adjusted to 10 mm. This range is chosen based linear structures. More importantly, similar code works for several CFRP
on the material properties and printing performance of PLA and CFRP. structures for misalignment detection that hamper the composite
The nozzle temperature and print bed temperature range were tailored structure. Adding 50 images of each layer increases the training dataset,
to the thermal characteristics of PLA+CFRP, aiming to enhance extru­ resulting in better mAP of 0.88, 0.90, and 0.94 respectively. Besides,
sion quality and first-layer adhesion while mitigating defects such as avg. defect size is taken as another consideration to improve the process
warping. Feed amounts and feed rates were varied to fine-tune the parameter to avoid misalignment defects.
extrusion process, addressing potential under-extrusion or over- To identify the automatic misalignment size or distance, a correla­
extrusion issues to optimize structural integrity and surface finish. tion between misalignment defect size with Raspberry camera infor­
Additionally, setting the training epoch at 25 indicates a balanced mation was established. As measuring the distance or size could be a
approach to learning, ensuring the model iterates through the dataset significant factor of CFRP specimen quality assurance, resulting in
sufficiently to achieve desired accuracy without excessive training, improvement in our model it’s necessary to know the defect size accu­
reflecting a methodical optimization of print quality and learning effi­ rately. After studying several existing literature reviews, HSV color
ciency in composite material 3D printing. Subsequently, a total of 50 isolation suits best with the existing CFRP model to detect the
images were collected for each parameter set to conduct YOLOv8 misalignment size. Besides, both manual and visual calculation was
analysis, aiming to detect misalignment errors within each layer of CFRP followed for validation purposes along with automatic Python coding.
cellular structure. In the pursuit of establishing an optimized framework The first step is to determine the conversion factor (pixels to mm); Py­
thon code will take the YOLO bounding box object detection

7
M.H. Zubayer et al. Composites Part C: Open Access 14 (2024) 100451

Fig. 7. Performance of YOLOv8 (a) confusion matrix; (b) performance graph.

automatic image capture, defect detection, and defect measurement size


Table 4
is illustrated in Fig. 9.
Model performance of YOLOv8.
Here’s the best image that accurately detects misalignment is upload
Layer Class Images mAP Precision Recall mAP50–95 and convert the image to the HSV color space and create a mask for the
L1 Misalignment 50 0.88 0.78 0.74 0.52 red regions. The HSV (Hue, Saturation, Value) color space is usually
L2 Misalignment 50 0.90 0.81 0.78 0.57 used in image processing tasks involving color detection because it
L3 Misalignment 50 0.94 0.85 0.80 0.60
specifies the color information (Hue) from the intensity information
(Saturation, value). This can make it easier to detect specific colors, that
information and convert it to real-life value. Secondly, measure the are marked or detected, under varying lighting conditions. The dis­
defect of known size in mm from the camera’s focal plane; capture im­ played image is a mask where white regions correspond to areas
ages of the defect with Raspberry Pi and calculate the number of pixels it detected as red in the original image and contours in this mask. The
occupies. Finally, divide the object’s size in mm by the number of pixels contours will give us the boundaries of the red regions as an alternative
to get the conversion factor (pixels to mm). An overall closed loop of to YOLO in terms of identifying the distance. Once have the contours,

8
M.H. Zubayer et al. Composites Part C: Open Access 14 (2024) 100451

Fig. 8. Final misalignment defect detection accuracy.

compute the centroid of the main red region, which will be used to parameters for accurate measurement.
measure the distance from a reference point. The red mark’s centroid The final investigation into the relationship between defect size and
has been successfully detected and is shown as a red dot in the image. To process parameters facilitated the identification of an optimal model,
calculate the real-world distance of this mark from a reference point (e. effectively mitigating misalignment defects as depicted in Fig. 10. An
g., the bottom of the image), It is necessary to convert the pixel distance experimental case study was conducted, involving the systematic vari­
into millimeters in order to establish precise measurements. Based on ation of multiple process parameters such as nozzle temperature, print
the information obtained from the proposed experimental value, the bed temperature, feed amount, and feed rate. A total of 50 specimens
fixed camera-to-bed distance was 130 mm and the image resolution was were printed using the YOLOv8 algorithm, successfully detecting and
3280 × 2460. The largest red contour is successfully identified and establishing defect-free CFRP specimens.
highlighted in the image. Next, to calculate the length of this contour; Throughout the individual parameter tests, YOLOv8 consistently
I’ll consider the two most distant points on the contour as the endpoints identified the absence of misalignment defects, notably at specific
of the red mark. The length between these two points will give the length parameter settings: nozzle temperature set at 230 ◦ C, print bed speed at
of the red mark in pixels and convert it to real-world value automati­ 40 mm/s, layer height of 0.2 mm, feed rate of 1 mm/s, and feed amount
cally. Challenge and validation task is considered an important task for of 10 mm. These settings demonstrated the absence of observable
the model improvement, a visual or manual inspection is necessary for misalignment errors within the CFRP cellular structure during YOLOv8
code validation in case of automatic misalignment distance calculation. analysis. Notably, a direct correlation was observed between nozzle
Besides, camera calibration, focal length, Raspberry camera resolution, temperature and the occurrence of misalignment defects.
color-based segmentation, perspective, and distortion are the important In the quest to determine the most influential parameter, it was

9
M.H. Zubayer et al. Composites Part C: Open Access 14 (2024) 100451

Fig. 9. Defect Measurement for improvement FDM tool path.

Fig. 10. Improved model with best FDM tool path without misalignment.

observed that print bed temperature, feed amount, and feed rate/sec did the efficiency and accuracy of CFRP defect detection and contribute to
not significantly contribute to enhancing the proposed model’s perfor­ the reliability of CFRP structures in various applications.
mance. However, it was noted that the inclusion of a fan was imperative To be more precise, this study remarkably minimized defects,
for optimizing the nozzle temperature and achieving the best overall particularly misalignments, within the cCFRP structure through con­
performance. scientious adjustment of process parameters, ensuring an optimized
cellular structure devoid of misalignment issues. The conclusive findings
Conclusion revealed a direct correlation between misalignment defects and nozzle
temperature. However, the parameters of print bed temperature, feed
In conclusion, the use of deep learning for the identification of CFRP amount, and feed rate per second exhibited no significant impact on
defects is a relatively recent development that has gained momentum in enhancing the efficacy of our proposed model in identifying the optimal
the last few years. Early studies have shown the potential of deep parameter for defect reduction.
learning for the automated detection and identification of CFRP defects,
such as delamination, matrix cracks, porosity, and misalignment. Recent CRediT authorship contribution statement
studies have proposed novel methods for detecting, measuring, and
optimizing misalignment defects in 3D-printed CFRP products, demon­ Md Hasib Zubayer: Writing – review & editing, Writing – original
strating the potential of deep learning for the inspection of CFRP draft, Resources, Methodology, Formal analysis, Data curation,
composites. Conceptualization. Yi Xiong: Writing – review & editing, Supervision,
This paper proposed a YOLOv8 object detection algorithm for Software, Resources, Project administration, Investigation, Funding
detecting misalignment defects in CFRP structures. The proposed acquisition. Yafei Wang: Writing – review & editing, Supervision,
method with HSV color space also estimates the size of the detected Project administration. Haque Md Imdadul: Formal analysis, Data
defects to provide additional information for structural evaluation. The curation.
experimental results demonstrate the effectiveness and accuracy (94 %)
of the proposed method in detecting and measuring misalignment de­
fects in CFRP structures. The proposed model can potentially improve

10
M.H. Zubayer et al. Composites Part C: Open Access 14 (2024) 100451

Declaration of competing interest [15] Z. Jin, Z. Zhang, G. Gu, Autonomous in-situ correction of fused deposition
modeling printers using computer vision and deep learning, Manuf. Lett. 22 (2019)
11–15, https://doi.org/10.1016/j.mfglet.2019.09.005.
The authors whose names are listed immediately below certify that [16] B. Yuan, G. Guss, A. Wilson, S. HauRiege, P. DePond, S. McMains, M. Matthews,
they have NO affiliations with or involvement in any organization or Machine-learning-based monitoring of laser powder bed fusion, Adv. Mater.
entity with any financial interest (such as honoraria; educational grants; Technol. 3 (12) (2018) 1800136, https://doi.org/10.1002/admt.201800136.
[17] L. Meng, B. Williams, W. Jarosinski, H. Park, Y. Jung, J. Lee, J. Zhang, Machine
participation in speakers’ bureaus; membership, employment, consul­ learning in additive manufacturing: a review, SpringerTechnical Article 72 (2020)
tancies,stock ownership, or other equity interest; and expert testimony 2363–2377, https://doi.org/10.1007/s11837-020-04155-y.
or patent-licensing arrangements), or non-financial interest (such as [18] H. Zhang, J. Chen, D. Yang, Fibre misalignment and breakage in 3D printing of
continuous carbon fibre reinforced thermoplastic composites, Addit. Manuf. 38
personal or professional relationships, affiliations, knowledge or beliefs) (2021) 101775, https://doi.org/10.1016/j.addma.2020.101775.
in the subject matter or materials discussed in this manuscript. [19] Y. Ming, S. Zhang, W. Han, B. Wang, Y. Duan, H. Xiao, Investigation on process
parameters of 3D printed continuous carbon fiber-reinforced thermosetting epoxy
composites, Addit. Manuf. 33 (2020) 101184, https://doi.org/10.1016/j.
Data availability addma.2020.101184.
[20] Z. Jin, Z. Zhang, G. Gu, Automated real-time detection and prediction of interlayer
Data will be made available on request. imperfections in additive manufacturing processes using artificial intelligence,
Advanced Intelligent Systems 2 (1) (2020) 1900130, https://doi.org/10.1002/
aisy.201900130.
[21] Y. Banadaki, N. Razaviarab, H. Fekrmandi, S. Sharifi, Toward enabling a reliable
Acknowledgements quality monitoring system for additive manufacturing process using deep
convolutional neural networks,, Computer Vision and Pattern Recognition (2020),
https://doi.org/10.48550/arXiv.2003.08749.
The authors would like to acknowledge Prof. Dr. Xiong Yi, School of [22] J. Fjeld, N. Achten, H. Hilligoss, A. Nagy, M. Srikumar, Principled artificial
System Design and Intelligent Manufacturing, Southern University of intelligence: mapping consensus in ethical and rights-based approaches to
Science and Technology, China, for supporting this research with com­ principles for AI, Berkman Klein Center Res. Publication (2020–1) (2020), https://
doi.org/10.2139/ssrn.3518482.
posite materials and in-house built co-extrusion CFRP-AM printer, the [23] N. Bakhshi, M. Hojjati, An experimental and simulative study on the defects
Guangdong Basic and Applied Basic Research Foundation [Grant No. appeared during tow steering in automated fiber placement, Compos. Part A: Appl.
2022A1515010316], National Key Research and Development Program Sci. Manuf. 113 (2018) 122–131, https://doi.org/10.1016/j.
compositesa.2018.07.03.
of China [Grant No. 2021YFB1715400], the National Natural Science [24] Z. Li, Z. Zhang, J. Shi, D. Wu, Prediction of surface roughness in extrusion-based
Foundation of China [Grant No. 52105261], the Department of Educa­ additive manufacturing with machine learning, Robotics and Computer-Integrated
tion of Guangdong Province [No. 2022ZDZX3020] and the Shenzhen 57 (2019) 488–495, https://doi.org/10.1016/j.rcim.2019.01.004.
[25] J. Soete, B. Badoux, Y. Swolfs, L. Gorbatikh, Defect detection in 3D printed carbon
Science and Technology Innovation Committee [Grant No. fibre composites using X-ray Computed Tomography (2019) 1–8.
JCYJ20210324104610028]. [26] L. Lu, J. Hou, S. Yuan, X. Yao, Y. Li, J. Zhu, Deep learning-assisted real-time defect
detection and closed-loop adjustment for additive manufacturing of continuous
fiber-reinforced polymer composites, Robot. Comput. Integr. Manuf. 79 (2023)
References 102431, https://doi.org/10.1016/j.rcim.2022.102431.
[27] M. Machado, K. Antin, L. Rosado, P. Vilaça, T. Santos, High-speed inspection of
[1] R. Bogue, 3D printing: the dawn of a new era in manufacturing? Assembly Autom. delamination defects in unidirectional CFRP by non-contact eddy current testing,
33 (4) (2013) 307–311, https://doi.org/10.1108/AA-06-2013-055. Sep 23. Composites Part B: Engineering 224 (2021) 109167, https://doi.org/10.1016/j.
[2] C. Meeks, E. Greenhalgh, B.G. Falzon, Stiffener debonding mechanisms in post- compositesb.2021.109167.
buckled CFRP aerospace panels, Compos. Part A: Appl. Sci. Manuf. 36 (7) (2005) [28] W. Li, H. Zhang, G. Wang, G. Xiong, M. Zhao, G. Li, Deep learning based online
934–946, https://doi.org/10.1016/j.compositesa.2004.12.003. metallic surface defect detection method for wire and arc additive manufacturing,
[3] G. Marsh, Composites conquer with carbon supercars, Reinforced Plastics 50 (1) Robot. Comput. Integr. Manuf. 80 (2023) 102470, https://doi.org/10.1016/j.
(2006) 20–24, https://doi.org/10.1016/S0034-3617(06)70868-2. rcim.2022.102470.
[4] P. Parandoush, D.J.C.S. Lin, A Review On Additive Manufacturing of Polymer-Fiber [29] G. Goh, N. Hamzah, W. Yeong, Anomaly detection in fused filament fabrication
Composites, 182, RMIT university, 2017, pp. 36–53. using machine learning, 3D. Print. Addit. Manuf. 10 (3) (2023) 428–437, https://
[5] C. Garnier, M. Pastor, F. Eyma, B. Lorrain, The detection of aeronautical defects in doi.org/10.1089/3dp.2021.0231.
situ on composite structures using Non Destructive Testing, Compos. Struct. 93 (5) [30] H. Cho, S. Shin, G. Seo, D. Kim, D. Lee, Real-time anomaly detection using
(2011) 1328–1336, https://doi.org/10.1016/j.compstruct.2010.10.017. convolutional neural network in wire arc additive manufacturing: molybdenum
[6] S. Yuan, S. Li, J. Zhu, Y. Tang, Additive manufacturing of polymeric composites material, J. Mater. Process. Technol. 302 (2022) 117495, https://doi.org/10.1016/
from material processing to structural design, Compos. Part B: Eng. 219 (2021) j.jmatprotec.2022.117495.
108903, https://doi.org/10.1016/j.compositesb.2021.108903. [31] F. Neuhauser, G. Bachmann, P. Hora, Surface defect classification and detection on
[7] X. Tian, T. Liu, C. Yang, Q. Wang, D. Li, Interface and performance of 3D printed extruded aluminum profiles using convolutional neural networks, Int. J. Mater.
continuous carbon fiber reinforced PLA composites, Compos. Part A: Applied Form. 13 (4) (2020) 591–603, https://doi.org/10.1007/s12289-019-01496-1.
Science 88 (2016) 198–205, https://doi.org/10.1016/j.compositesa.2016.05.032. [32] J. Redmon, S. Divvala, R. Girshick, A. Farhadi, You only look once: unified, real-
[8] M. Rani, P. Choudhary, V. Krishnan, S. Zafar, A review on recycling and reuse time object detection, in: Proceedings of the IEEE conference on computer vision
methods for carbon fiber/glass fiber composites waste from wind turbine blades, and pattern recognition, 2016.
Compos. Part B: Eng. 215 (2021) 108768, https://doi.org/10.1016/j. [33] C. Wang, H. Liao, Y. Wu, P. Chen, J. Hsieh, I. Yeh, CSPNet: a new backbone that
compositesb.2021.108768. can enhance learning capability of CNN, in: Proceedings of the IEEE/CVF
[9] H. Bang, S. Park, H.J.C.S. Jeon, Defect identification in composite materials via conference on computer vision and pattern recognition workshops, 2020.
thermography and deep learning techniques, Compos. Struct. 246 (2020) 112405, [34] T. Lin, P. Dollar, R. Girshick, K. He, Feature pyramid networks for object detection,
https://doi.org/10.1016/j.compstruct.2020.112405. in: Proceedings of the IEEE conference on computer vision and pattern recognition,
[10] M. Shi, J. Xiong, G. Zhang, S. Zheng, Monitoring process stability in GTA additive 2017, https://doi.org/10.48550/arXiv.1612.03144.
manufacturing based on vision sensing of arc length, Meas. 185 (2021) 110001, [35] S. Liu, L. Qi, H. Qin, J. Shi, J. Jia, Path aggregation network for instance
https://doi.org/10.1016/j.measurement.2021.110001. segmentation, in: Proceedings of the IEEE conference on computer vision and
[11] N. Saeed, N. King, Z. Said, M. Omar, Automatic defects detection in CFRP pattern recognition, 2018.
thermograms, using convolutional neural networks and transfer learning, Infrared. [36] D. Bolya, C. Zhou, F. Xiao, Y. Lee, Yolact: real-time instance segmentation, in:
Phys. Technol. 102 (2019) 103048, https://doi.org/10.1016/j. Proceedings of the IEEE/CVF international conference on computer vision, 2019,
infrared.2019.103048. pp. 9157–9166.
[12] Z. Chen, Z. Zhang, K. Granland, C. Chen, Exploring optimal adaptive process [37] C. Wang, A. Bochkovskiy, H. Liao, YOLOv7: trainable bag-of-freebies sets new
parameters for curved infill paths of additive manufactured carbon fibre reinforced state-of-the-art for real-time object detectors, in: Proceedings of the IEEE/CVF
polymers, Compos. Commun. 39 (2023) 101549, https://doi.org/10.1016/j. Conference on Computer Vision and Pattern Recognition, 2023, pp. 7464–7475.
coco.2023.101549. [38] Y. Cao, K. Chen, C. Loy, D. Lin, Prime sample attention in object detection, in:
[13] Q. Zhang, Y. Liang, J. Ding, S. Williams, A wire deflection detection method based Proceedings of the IEEE/CVF conference on computer vision and pattern
on image processing in wire+ arc additive manufacturing, The Int. J. Adv. Manuf. recognition, 2020, pp. 11583–11591.
Technol. 89 (2017) 755–763, https://doi.org/10.1007/s00170-016-9106-2. [39] Z. Zhang, A flexible new technique for camera calibration, IEEe Trans. Pattern.
[14] F. Caltanissetta, M. Grasso, S. Petro, B. Colosimo, Characterization of in-situ Anal. Mach. Intell. 22 (11) (2000) 1330–1334, https://doi.org/10.1109/
measurements based on layerwise imaging in laser powder bed fusion, Addit. 34.888718.
Manuf. 24 (2018) 183–199, https://doi.org/10.1016/j.addma.2018.09.017. [40] S. Lankton, A. Tannenbaum, Localizing region-based active contours, IEEE Trans.
on Image Proc. 17 (11) (2008) 2029–2039, https://doi.org/10.1109/
TIP.2008.2004611.

11
M.H. Zubayer et al. Composites Part C: Open Access 14 (2024) 100451

[41] E. Wahl, U. Hillenbrand, G. Hirzinger, Surflet-pair-relation histograms: a statistical [43] M. Everingham, L. Van Gool, C.K. Williams, J. Winn, A. Zisserman, The Pascal
3D-shape representation for rapid classification, in: Fourth International visual object classes (voc) challenge, Int. J. Comput. Vision 88 (2) (2010) 303–338,
Conference on 3-D Digital Imaging and Modeling, 20033DIM 2003. Proceedings, https://doi.org/10.1007/s11263-009-0275-4.
IEEE, 2003, https://doi.org/10.1109/IM.2003.1240284. [44] W. Zhao, H. Huang, D. Li, F. Chen, W. Cheng, Pointer defect detection based on
[42] R. Hartley, A. Zisserman, Multiple View Geometry in Computer Vision, Cambridge transfer learning and improved cascade-RCNN, Sensors 20 (17) (2020) 4939,
university press, 2003. https://doi.org/10.3390/s20174939.

12

You might also like