1 Introduction

Various product manufacturing paradigms that pursue technological convergence have emerged in current industrial fields. Artificial intelligence (AI), big data, the Internet of Things (IoT), and 3D printing are gaining prominence as core technologies. In particular, 3D printing technology is used across industries, from prototyping to product development, enabling customized product creation while improving the flexibility and productivity of the manufacturing process. Fused deposition modeling (FDM)-style 3D prints are primarily made by the melt extrusion of amorphous materials at high temperatures. This has the limitation of a relatively low mechanical strength compared with other processing methods [1].

PLA is a long-chain polymer with the molecular structure as shown in Fig. 1. It behaves as a liquid when heated above its equilibrium melting temperature (\(T_{m}\)), and the molecular chains move actively. Between the equilibrium melting temperature and the glass transition temperature (\(T_{a}\)), the molecules continuously vibrate and rearrange their positions, making the polymer flexible. When cooled below the glass transition temperature, the polymer becomes a glassy solid with little movement of the molecular chains [2].

Fig. 1
figure 1

Structures of PLA

The mechanical strength of PLA is strongly influenced by its degree of crystallization that changes the internal structure of the polymer as the temperature changes, resulting in a change in mechanical strength [2]. During the 3D printing manufacturing process, PLA heated above its equilibrium melting temperature is extruded through a nozzle and rapidly cooled, resulting in insufficient crystallization. As shown in Fig. 2, the output of FDM 3D printing, a laminated structure, has a limitation that the mechanical strength is relatively low compared with products fabricated using conventional manufacturing methods [3]. Various methods have been proposed to improve the mechanical properties of FDM 3D printed parts [4].

Fig. 2
figure 2

3D printing of layered structures

During FDM 3D printing, insufficiently crystallized PLA substrates can be recrystallized to modify the internal structure of the substrate and improve its mechanical strength. However, maintaining the state and shape of the PLA print is difficult when heated above the equilibrium melting temperature; hence, a limit exists to the temperature increase. Therefore, the temperature to increase crystallinity is limited to the glass transition temperature. Ultrasonic treatment improves mechanical properties without changing chemical properties by changing the structure of the polymer chains via ultrasonic vibrations [5, 6].

The identification of mechanical properties by detecting the presence of ultrasonic treatment was achieved by developing a custom pre-trained model through a CNN technique based on the image data of the PLA output. The CNN algorithm consisted of feature extraction and classification areas. The feature extraction area extracted the features of the image data by convolution, padding, and pooling. The image data were classified by the classification area that consisted of input, hidden, and output layers in a fully connected structure. Figure 3 shows the structure of the CNN algorithm [7,8,9,10,11,12].

Fig. 3
figure 3

CNN algorithm for surface image classification

2 Materials and Methods

2.1 Fabrication of Tensile Specimens

The design specification of the tensile specimen used in this study was ASTM D638 type IV [13] with a thickness of 4 mm, and it was designed using SolidWorks, a 3D shape modeling software. The 3D printer used to fabricate the tensile specimens was CUBICON Style Plus with the FDM method; the filament material was PLA, which is mainly derived from cornstarch and sugarcane, and CUBICON PLA-i21 was used [14]. The printing direction of the tensile specimen was 0°, as shown in Fig. 4, and the 3D printing conditions are listed in Table 1 [15,16,17].

Fig. 4
figure 4

Lamination paths based on the print direction

Table 1 Settings for 3D printing

2.2 Ultrasonic Treatment of tensile Specimens

The 3D printed tensile specimens were subjected to ultrasonic treatment in a constant temperature water bath. The detailed ultrasonic treatment conditions are listed in Table 2. To allow the polymer chains of the PLA print to move, the experimental temperature was set to the glass transition temperature, and a differential scanning calorimeter (DSC) was used to measure the glass transition temperature [18].

Table 2 Experimental settings for ultrasonic treatment

2.3 Mechanical Properties Testing of 3D Printed PLA

The mechanical properties of the PLA printed materials were characterized by tensile testing. The tensile specimen was fixed in the tensile tester and subjected to an axial tensile force, as shown in Fig. 5. The crosshead moved at a speed of 1.2 mm/s, and the tensile tester measured the deformation of the tensile specimen and the axial load on the tensile specimen. To evaluate the mechanical properties of the PLA output, stress–strain curves were drawn and analyzed [14, 19].

Fig. 5
figure 5

Tensile experiment setup

To understand the effect of ultrasonic treatment on the mechanical properties of the tensile specimens, tensile tests were conducted before and after ultrasonic treatment, and scanning electron microscopy (SEM) was used to observe the fracture surface. DSC was used to analyze the changes in the molecular structure of the PLA prints before and after ultrasonic treatment.

2.4 Analyzing an Image Dataset

In this study, we analyze a dataset of images using machine learning to detect unique image patterns in PLA prints before and after sonication. The image dataset of PLA print uses surface images of tensile specimens, which are used to develop a model that can determine the ultrasonic treatment and predict the mechanical properties of PLA print [20].

The image dataset is processed using Ultralytics' YOLOv8 model within the Google Colab environment. The dataset is located at/content/drive/MyDrive/training_annealing_cls/images. To ensure uniform input dimensions, all images are resized to 640 × 640 pixels. This standardization is crucial as it allows the model to receive consistent inputs, facilitating uniform learning across varying original image sizes.

The CNN-based YOLOv8m cls.pt classification model is used to develop the model, and transfer learning with pre-trained weights is used to efficiently perform the learning process. The training process uses the AdamW optimizer with a learning rate of 0.000714 and a momentum of 0.9, and data augmentation techniques include RandAugment and Erasing.

The epochs for training the model are 15, 17, 20, 25, and 30 to determine the number of epochs with high accuracy, with a batch size of 16 during each epoch. The image dataset for the PLA print consists of 100 training image files, 40 validation image files, and 6 test image files.

3 Properties Changes

3.1 Changes in Mechanical Properties

To determine the mechanical properties of the ultrasonically treated tensile specimens, tensile tests were conducted using a universal material testing machine. The PLA material tensile specimens were divided into before and after ultrasonic treatment and subjected to tensile tests.

Figure 6 shows the results of the tensile test. A stress–strain curve was generated based on the load and displacement data [14, 21, 22].

Fig. 6
figure 6

Measured mechanical properties: a stress–strain curve, b elastic modulus, c tensile stress data shown as mean ± standard deviation

Table 3 presents a comparison of tensile test data after ultrasonic treatment.

Table 3 Ultrasonic treatment tensile test results

The tensile strengths of the specimen before and after ultrasonic treatment were 16.18 ± 0.17 MPa and 22.46 ± 0.88 MPa, respectively. The standard deviation ranged from ± 1.05 to ± 3.92%, and the tensile strength improvement rate was approximately 38.8%. The Young’s moduli of the tensile specimen before and after ultrasonic treatment were 376.05 ± 14.85 MPa and 476.57 ± 3.93 MPa, respectively. The standard deviation ranged from ± 0.82 to ± 3.95%, and the Young's modulus improved by approximately 26.75%.

Figure 7 shows the DSC curves of PLA samples with and without ultrasonic treatment. The peak values of the DSC curves were almost the same before and after ultrasonic treatment. The glass transition temperature (\(T_{a}\)) and melting peak temperature were about 65 °C and 167°. Ultrasonic treatment accelerates the crystallization rate of PLA and increases the glass transition temperature (\(T_{a}\)).[23]. However, the glass transition temperature (\(T_{a}\)) decreases with increasing crystallinity [24]. In this study, ultrasonic treatment increased the crystallinity of PLA, but the glass transition temperature (\(T_{a}\)) changed little due to the accelerated crystallization rate caused by ultrasonic treatment, indicating that the increased crystallinity effect was balanced by the accelerated crystallinity rate.

Fig. 7
figure 7

DSC curves of pristine and ultrasonically treated samples

The glass transition and melting peak temperatures were approximately 65 °C and 167 °C, respectively. Low exothermic peak temperatures of around 88 °C and 89 °C were caused by incomplete crystallization [6]. As an amorphous material, the crystallinity of PLA printouts is affected by the printing conditions and environment, such as printing speed [25], and in our study, the crystallinity increased from 8.34% before sonication to 17.46% after sonication, indicating an increase in crystallinity. The crystallinity was calculated using the following formula: \([(\Delta H_{m} - \Delta H_{c} )/\Delta H_{f} ]\) × 100%, where \(\Delta H_{m}\) represents the melting enthalpy, \(\Delta H_{c}\) represents the crystallization enthalpy, and \(\Delta H_{f}\) represents the melting enthalpy of completely crystalline PLA that has a value of 93 J/g [6].

The mechanical property analysis by tensile testing and DSC indicated that the ultrasonic treatment of PLA material FDM 3D printed parts at the glass transition temperature resulted in internal molecular rearrangement and increased crystallinity, thereby improving the mechanical properties [26, 27].

3.2 Changes in the Layered Structure

The layered structure on the surface of the FDM 3D printed output indicated that the output without ultrasonic treatment had a uniform arrangement shape without large gaps between the tissues, as shown in Fig. 8a, whereas the output with ultrasonic treatment, as shown in Fig. 8c, had a large gap between the tissues and an uneven arrangement shape.

Fig. 8
figure 8

Cross sections and surfaces of tensile samples observed by SEM: a surface of the pristine sample, b cross section of the pristine sample, c surface of the ultrasonically treated sample, d cross section of the ultrasonically treated sample

As shown in Fig. 8b, the SEM image of the fracture surface of the pristined PLA substrate showed uniform layer spacing, but after ultrasonic treatment, a non-uniform layer spacing morphology was observed in Fig. 8d. This change is attributed to the fact that the ultrasonic vibration above the glass transition temperature reduced the layer spacing in the cross-section of the PLA print, especially as the interlayer interfaces weakened as the surface stacking did not progress [6], and the volume decreased according to the volume-temperature relationship of long-chain polymers [2]. This resulted in larger gaps and non-uniform shape in the image geometry of the surface. It can also be seen that the interfaces of the surface layers were weak from the initial stacking stage, so the enlargement of the gaps on the surface does not have a significant mechanical property impact; rather, the narrowing of the interface gap, as observed in the cross-section, has a greater impact on the overall mechanical properties.

These structural changes led to the formation of unique image patterns of the PLA material FDM 3D printing printouts.

4 Development and Use of Custom Pre-trained Models

As has been confirmed, the ultrasonic treatment of PLA material FDM 3D printing printouts is effective in improving their mechanical properties. Based on these results, this study predicted the mechanical strength of the printouts through machine learning using image patterns appearing in PLA printouts before and after ultrasonic treatment.

Figure 9 shows the surface images of a PLA print applied to machine learning. As shown in Fig. 9a, a parallel and uniform layered structure with small gaps between the structures existed before ultrasonic treatment, whereas the layered structure became irregular and the gaps between the structures expanded owing to ultrasonic treatment, as shown in Fig. 9b. From this, we could confirm the image pattern on the surface of the PLA print before and after ultrasonic treatment. Based on this, we developed a custom pretrained model by applying the image dataset of the PLA print to the CNN-based machine learning algorithm.

Fig. 9
figure 9

Surface of tensile specimens: a surface of the pristine sample, b surface of the ultrasonically treated sample

The number of training iterations on the entire image dataset, epoch, is one of the hyperparameters that affects the performance of a user-defined pre-trained model. In this study, we used several key parameters to predict the condition before and after ultrasonic treatment. These include classify, which indicates the type of task; train, the training mode; yolov8m-cls.pt, the model filename; /content/ drive/ MyDrive/ training_annealing_cls/ images, the data path; number of epochs, 25; batch size, 16; and image size, 640. Using these parameters, a custom pre-training model was developed by applying convolutional neural network (CNN) techniques based on the image data to predict the PLA print before and after ultrasonic treatment.[7, 9, 28, 29].

Figure 10 shows a line graph of the results of training loss and validation loss according to the number of epochs in machine learning. As the number of epochs increased, the training loss and validation loss, that were decreasing, tended to converge to zero after 15 epochs. Figure 11 shows the accuracy according to the number of epochs and shows a directly proportional trend as the number of epochs increases, converging to 1.0, after seventeen epochs. Table 4 compares the performance of the custom pre-trained model according to the number of epochs applied in machine learning. As the number of epochs increased, the detection rate of the custom pre-trained model for the test sample images increased; after 20 epochs, the test sample images were detected with a high detection rate of 0.9 or higher. Consequently, the number of epochs was set to 25 to obtain accurate results from machine learning, improve the efficiency of time expenditure, and prevent overfitting.

Fig. 10
figure 10

Validation accuracy loss curve by the number of image classification training epochs a Loss curve of the training process, b Loss curve of the validation process

Fig. 11
figure 11

Accuracy variation curve with the number of epochs for image classification machine learning

Table 4 Machine learning recognition rate according to the number of epochs

Figure 12 shows the prediction results of six test sample images using the machine learning model before and after ultrasonic treatment. The aim is to predict the mechanical properties that change with ultrasonic treatment, and the prediction accuracy before and after ultrasonic treatment as a function of the number of epochs is shown in Table 4. The results show that the highest accuracy is 0.95–1.00, or 95–100%, when the number of epochs is 25.

Fig. 12
figure 12

Image analysis results using machine learning: ac surface image data before ultrasonic treatment, df surface image data after ultrasonic treatment

Table 5 shows the prediction results of applying the custom pre-trained model to six test image data (Sample A through F) other than the image dataset applied to the train group and validation group.

Table 5 Classification accuracy of custom pre-trained model with 25 epochs and experimental tensile strength

The custom pre-trained model used to predict the results in Table 5 is a model with epoch 25 applied based on the image dataset associated with mechanical properties, which shows a classification accuracy of more than 95%.

Therefore, the custom pre-trained model in this study was able to extract image patterns related to mechanical properties with and without ultrasonic treatment, and confirmed that it is possible to predict the mechanical properties of PLA output with a classification accuracy of more than 95% through the detection of ultrasonic treatment status.

5 Conclusions

In this study, ultrasonic treatment was performed to improve the mechanical properties of PLA printed by FDM method, and tensile tests were performed to quantitatively evaluate the effect of ultrasonic treatment. It was found that the mechanical properties of the ultrasonically treated PLA printed material were improved by increasing the tensile strength and elongation. To determine the changes in thermal properties, DCS analysis was performed before and after sonication, and the results showed that the glass transition temperature showed little change in the glass transition temperature due to the increase in crystallinity and the zero term of sonication, and the crystallinity increased after sonication, which contributed to the improvement in the mechanical properties of the PLA print.

A custom pre-trained model was developed by inputting the image dataset related to mechanical properties into a machine learning algorithm, and the unique image pattern extraction of PLA printed material images using the custom pre-trained model and the detection of the presence or absence of ultrasonic treatment were used to predict the low tensile strength before ultrasonic treatment and the improved high tensile strength after ultrasonic treatment. The approach of this study enables the evaluation and prediction of 3D printing technologies that are suitable for low-volume production of a wide variety of products. Recent FDM 3D printing technologies are gaining importance in manufacturing, and reliable performance evaluation and prediction is essential. The development of a custom pre-trained model proposed in this study has been shown to improve the reliability of products by accurately distinguishing between before and after ultrasonic treatment to evaluate the performance and predict the mechanical properties of PLA output. Therefore, it is expected to have a positive impact on various industries related to FDM 3D printing, along with the development of guidelines and standards for accurate and stable product production and the advancement of 3D printing technology.

Further research should be conducted to find the optimal conditions of time and temperature conditions in ultrasonic treatment, as well as follow-up studies on the mechanical properties that change under the influence of ultrasonic treatment depending on the thickness of the output, which are expected to contribute to the advancement of 3D printing technology and the expansion of its application range.