Fused filament printing defect correction method, device, equipment and storage medium
By constructing an improved multi-head neural network model for defect detection and parameter correction in fused wire printing, the problem of difficult correction of wire drawing defects in fused wire printing is solved, and real-time adaptive control of the fused wire printing process is realized, thereby improving printing efficiency and product quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CIVIL AVIATION UNIV OF CHINA
- Filing Date
- 2026-01-05
- Publication Date
- 2026-05-29
AI Technical Summary
Filament defects during fused filament printing are difficult to correct in a timely manner, leading to low printing efficiency, material waste, and product quality issues.
By acquiring images and real-time parameters of the fused wire printing process, an improved multi-head neural network model is constructed. Defect detection and parameter correction are performed using residual attention networks and multilayer perceptrons, forming a real-time adaptive closed-loop control to dynamically suppress wire drawing defects.
It achieves real-time dynamic correction without manual intervention, reduces printing failures and material waste, improves printing success rate and product quality, and enhances the system's ability to resist single-prediction interference.
Smart Images

Figure CN122115322A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of additive manufacturing process inspection and repair technology, and in particular to a method, apparatus, equipment and storage medium for correcting wire drawing defects in fused filament printing. Background Technology
[0002] Fused filament fabrication is a common additive manufacturing technology characterized by its ease of use, high efficiency, low cost, and mechanical and environmental stability, making it widely used in the aerospace, automotive, medical, and consumer goods industries. Wire drawing is a common error in fused filament fabrication. It occurs when the extruder nozzle moves from one point to another, resulting in a stretched, linear structure on the product surface due to improper printing parameter settings. Since fused filament printing often lasts from several hours to several days, if wire drawing errors go undetected for an extended period, it not only reduces surface finish and dimensional accuracy but also wastes material and increases post-processing time, leading to significant time and material losses. Severe wire drawing can even cause slight dimensional distortions in the printed object, especially in smaller objects with high dimensional fidelity requirements, easily leading to product defects or even rejection.
[0003] With the increasing variety of fused filament printing materials, the causes and solutions to filament drawing defects have become more complex and diverse. Especially when using high-performance printing materials, the vastly different physical properties (viscosity, hygroscopicity, thermal sensitivity, elasticity, etc.) of different materials make it difficult to form a universally applicable set of perfect printing parameters. This necessitates frequent manual observation of the printing process, identification of errors, and stopping of printing. Afterward, the part is removed, parameters are adjusted, and printing is restarted. This not only interrupts the printing process but also consumes a significant amount of manpower and time, resulting in low printing efficiency. Summary of the Invention
[0004] This invention provides a method, apparatus, device, and storage medium for correcting wire drawing defects in fused filament printing, in order to solve the technical problem of low printing efficiency caused by the difficulty in timely correction of wire drawing defects.
[0005] In a first aspect, embodiments of the present invention provide a method for correcting wire drawing defects in fused wire printing, comprising: S101: Acquire images of the fuse printing process and obtain real-time fuse printing parameters. Based on the preset optimal fuse printing parameter range, mark printing defects in the fuse printing process images and perform data preprocessing to form an original defect image dataset. S102 improves the multi-head neural network by using a residual attention network as the backbone network to extract image features and a multilayer perceptron to extract printing parameter features. It constructs an improved fuse printing defect detection model with multiple input heads and outputs the corresponding printing parameter label classification results through multiple output heads. S103, using the trained improved fuse printing defect detection model, performs printing parameter defect identification on the original defect image dataset to obtain parameter deviation prediction data; S104, based on the parameter deviation prediction data and combined with the preset optimal fuse printing parameter range, corrects the real-time fuse printing parameters corresponding to the parameter deviation prediction data.
[0006] Secondly, embodiments of the present invention provide a wire drawing defect correction device for fused wire printing, comprising: The data acquisition module is used to acquire images of the fuse printing process, obtain real-time fuse printing parameters, mark printing defects in the fuse printing process images, and perform data preprocessing to form an original defect image dataset. The model building module is used to improve multi-head neural networks by using residual attention networks as the backbone network and combining them with multilayer perceptrons to build an improved filament printing defect detection model with multiple input heads. The defect detection module is used to identify printing parameter defects in the original defect image dataset using a trained improved filament printing defect detection model. The printing parameter correction module is used to correct the real-time fuse printing parameters corresponding to the deviation from the predicted data, based on the parameter deviation from the predicted data and in combination with the preset optimal fuse printing parameter range.
[0007] Thirdly, embodiments of the present invention provide an electronic device, including: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the above-described method for correcting wire drawing defects in fused filament printing.
[0008] Fourthly, embodiments of the present invention provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the above-described method for correcting wire drawing defects in fused wire printing.
[0009] This invention provides a method, apparatus, device, and storage medium for correcting wire drawing defects in fused tomography (FMT) printing. The method constructs a closed-loop execution path encompassing data acquisition and automatic labeling, model building and multi-parameter prediction, and proportional correction based on statistical decision-making. First, it acquires images of the printing process while simultaneously acquiring real-time printing parameters and aligning them temporally. Then, it utilizes a residual attention network as the backbone of a multi-head neural network to construct an improved FMT printing defect detection model. The trained model predicts deviations in printing parameters, and the real-time printing parameters are proportionally corrected based on the identified deviations. This directly locates wire drawing problems caused by printing parameter deviations, forming a real-time adaptive closed-loop control of perception-decision-execution. Wire drawing can be dynamically suppressed in real-time during printing without manual intervention, effectively reducing printing failures, material waste, and post-processing time caused by wire drawing defects. This improves printing success rate and the quality of one-time product molding. The use of a mode decision-making and proportional adjustment mechanism enhances the system's resistance to single-prediction interference, making the printing parameter correction process more stable and reliable, and avoiding parameter oscillations. Attached Figure Description
[0010] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings: Figure 1 This is a flowchart of a wire drawing defect correction method for fused wire printing according to Embodiment 1 of the present invention; Figure 2 This is a model structure diagram of the improved fuse printing defect detection model described in Embodiment 1 of the present invention; Figure 3 This is a schematic diagram of the real-time printing parameter correction closed loop as described in Embodiment 1 of the present invention; Figure 4 This is a flowchart of a wire drawing defect correction method for fused wire printing according to Embodiment 2 of the present invention; Figure 5 This is a schematic diagram of the fused filament 3D printing image acquisition system described in Embodiment 2 of the present invention; Figure 6 This is a schematic diagram of the marked printing defect image as described in Embodiment 2 of the present invention; Figure 7 This is a schematic diagram showing the model accuracy of the trained improved fuse printing defect detection model described in Embodiment 2 of the present invention; Figure 8 This is a schematic diagram of the structure of a wire drawing defect correction device for fused wire printing according to Embodiment 3 of the present invention; Figure 9 This is a structural diagram of the electronic device described in Embodiment 4 of the present invention. Detailed Implementation
[0011] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.
[0012] Example 1 Figure 1 The flowchart below illustrates a method for correcting wire drawing defects in fused wire printing according to Embodiment 1 of the present invention. It involves acquiring images of the fused wire printing process, simultaneously obtaining real-time fused wire printing parameters, and marking printing defects. A printing defect detection model is constructed by improving a multi-head neural network using a residual attention network as the backbone network. This model identifies deviations in printing parameters and corrects the real-time fused wire printing parameters proportionally. The specific steps include: S101: Acquire images of the fuse printing process and obtain real-time fuse printing parameters. Based on the preset optimal fuse printing parameter range, mark printing defects in the fuse printing process images and perform data preprocessing to form an original defect image dataset.
[0013] A fused filament 3D printing image acquisition system continuously captures and saves video images of the printing process during the 3D printer's printing operation. It also acquires real-time fused filament printing parameters, ensuring the timing consistency between the video images and printing parameters. This can be achieved by continuously capturing the video stream of the printing process using a high-definition camera, and simultaneously reading and recording key printing parameters in real-time via the printer's communication interface with a host computer (such as an industrial control computer or server) (e.g., USB, Ethernet). These parameters include, but are not limited to, retraction distance, retraction speed, printing temperature, and printing speed. The preset optimal fused filament printing parameter range is determined through preliminary process experiments based on the printing material (e.g., PLA, ABS) and printer model; this range will vary between each printing task. The acquired video stream is then segmented into images frame by frame, and each frame is associated with the printing parameters corresponding to its timestamp. By comparing the real-time fused filament printing parameters with the preset range, if any printing parameter deviates from the appropriate range (too low or too high), that frame is marked as a printing defect image. Images where all printing parameters are within the appropriate range are considered normal and not marked. Then, basic data preprocessing such as size normalization, format conversion, noise sampling, and outlier removal is performed on all printed defect images to filter out invalid data and form the original defect image dataset.
[0014] S102 improves the multi-head neural network by using a residual attention network as the backbone network to extract image features and a multilayer perceptron to extract printing parameter features. An improved fuse printing defect detection model with multiple input heads is constructed, and the corresponding printing parameter label classification results are output through multiple output heads.
[0015] To enable direct classification and prediction of deviations (too high or too low) in printing parameters based on input data combining printed defect images and printing parameters, a multi-head neural network is employed. Multiple output heads predict different printing parameters, eliminating the need for multiple independent models to independently assess each parameter. This is achieved by replacing the general feature extraction backbone of the basic multi-head neural network with a residual attention network, forming one input head for image modality data. A multilayer perceptron (MLP) is then used to form another input head for parameter modality data, used for extracting image features and printing parameter features respectively. This results in an improved fuse printing defect detection model with dual-modality input heads. The improved model structure is shown below. Figure 2 As shown, by introducing an attention mechanism, the model can focus more on local areas in the image where stringing may occur (such as the suspended area between the nozzle and the printed layer). Simultaneously, its residual structure effectively alleviates the gradient vanishing problem of deep networks, making it more suitable for extracting subtle spatiotemporal features from high-speed printing videos. Combined with a multilayer perceptron for feature extraction of printing parameters, an improved filament printing defect detection model is constructed that can input dual-modal data of images and parameters. This improved model can output a label classification result for one of the printing parameters through its multiple output heads (e.g., 0 for too low, 1 for suitable, and 2 for too high). Based on this label classification result, the deviation of each printing parameter from the suitable range during the printing process can be analyzed.
[0016] S103. Using the trained improved filament printing defect detection model, print parameter defects are identified in the original defect image dataset to obtain parameter deviation prediction data.
[0017] The original defect image dataset (or its partitioned test set) is input into a well-trained improved filament printing defect detection model. The model processes each input image and its associated printing parameters, and then outputs corresponding printing parameter prediction labels through multiple output heads, forming parameter deviation prediction data (time-series data) consistent with the printing process time sequence. Instead of directly identifying filament pulling in the defect image, it directly predicts the deviation state of printing parameters at the time of image acquisition, which can significantly reduce the amount of computation and resource requirements, and is suitable for deployment in scenarios with limited computing power, such as edge devices. For example, for an input image, the model may output the prediction: retraction distance - appropriate (1), retraction speed - too low (0), printing temperature - too high (2), printing speed - appropriate (1). These prediction results are the parameter deviation prediction data corresponding to the single frame image. The time-series parameter deviation prediction data is formed according to the time sequence relationship between single frames, which is used to reflect whether the parameters in the current printing state have deviations and the direction of deviations.
[0018] S104, based on the parameter deviation prediction data and combined with the preset optimal fuse printing parameter range, corrects the real-time fuse printing parameters corresponding to the parameter deviation prediction data.
[0019] Based on the deviation of the model-predicted printing parameters from the preset optimal range of fuse printing parameters, corresponding printing parameter adjustments are made. To avoid system instability caused by noise interference from single prediction results, a correction strategy based on continuous prediction statistics can be adopted to proportionally adjust the real-time fuse printing parameters.
[0020] Specifically, for each printing parameter in the parameter deviation prediction data, a mode threshold is compared, and the frequency of printing parameter deviation is determined based on the deviation of printing parameters that exceeds the preset mode threshold.
[0021] The mode decision method is adopted by maintaining a sliding window list containing L consecutive predictions for the same printing parameter (i.e., the list length is L). Then, the frequency of the predicted too low or too high states in the list is calculated. p This refers to the percentage of outcomes predicted as too low or too high, calculated using the following formula: in, p This indicates that the printing parameters deviate from the frequency. N This indicates the number of times the result is too low or too high in the list. The result with the highest frequency is selected (for example, if the result of too high appears the most (more than too low and appropriate), then the result of too high appears the most). LThis represents the list length, i.e., the number of prediction results in the list. For example, suppose each image has four print parameters, corresponding to the prediction results for the deviation of these four print parameters from their states. The list length is the number of images being predicted, say 10 images. In this case, each of the four print parameters has 10 prediction results, so the list length L is 10, resulting in four lists. Taking the pullback distance as an example, if the first prediction result is 1, the second prediction result is 1, ..., and the tenth prediction result is 0, then the maintained list format is [1, 1, 0, 0, 0, 0, 0, 1, 2, 0], containing ten elements. It can be seen that the frequency of 0 is 0.6. If the mode threshold is 0.5, this prediction result can be adopted, resulting in a current pullback distance of 0 (i.e., too low), requiring correction. If the frequency of 0 or 2 is less than the mode threshold, it is considered normal and no correction is needed; the prediction result is considered good.
[0022] Based on the difference between the frequency of deviation of printing parameters and the preset mode threshold, the adjustment amount of printing parameters is calculated by one-dimensional linear interpolation to correct the printing parameters.
[0023] Deviate printing parameters from frequency p The value is compared with a preset mode threshold θ (obtained through repeated trials for each parameter, which varies depending on the printing task). When p ≥ θ, it can be confirmed that the corresponding printing parameter has a trend of being too low or too high, at which point printing parameter correction needs to be triggered. Then, the adjustment amount is calculated proportionally based on the significance of the deviation trend. For example, assuming the mode is too high with a frequency p = 0.7 and a mode threshold θ = 0.5, one-dimensional linear interpolation is used to adjust the value. p Mapping from the interval [θ, 1] to the scaling interval [I] min , 1](I min The minimum adjustment factor, i.e., the minimum scaling ratio, corresponds to the minimum allowable adjustment value for this printing parameter (determined based on printing needs, printing materials, and printing equipment). This factor is then used to linearly scale the preset standard update amount A (the maximum safe update amount, also determined based on printing job requirements, materials, and equipment) (A+ when the parameter increases, A- when the parameter decreases), to calculate the final printing parameter adjustment. The formula is as follows: Where A represents the standard update quantity. Let represent the minimum adjustment factor, p represent the frequency of deviation of the printing parameters, and θ represent the mode threshold. The adjustment amount is calculated accordingly. This generates G-code instructions to correct printing parameters. If the printing temperature or printing speed parameters are set incorrectly, adjustments will be made accordingly. Generate G-code instructions and send them directly to the printer in real time for modification. If the retraction speed or retraction distance parameters are set incorrectly, due to complex factors such as motion planning, printing will be paused and the current print layer height and nozzle coordinates will be recorded. Adjustments will be made accordingly. Reset the printing parameters and resume printing by regenerating the G-code of the subsequent print path in the slicing software or through a dedicated algorithm. For example, Table 1 provides a reference for different adjustment standards for different printing parameters: Table 1. Different Adjustment Standards for Different Printing Parameters This embodiment constructs a closed-loop execution path encompassing data acquisition and automatic labeling, model building and multi-parameter prediction, and proportional correction based on statistical decision-making. First, it acquires images of the printing process while simultaneously collecting real-time printing parameters and aligning them temporally. Then, it utilizes a residual attention network as the backbone of a multi-head neural network to construct an improved filament printing defect detection model. The trained model predicts deviations in printing parameters, and the real-time printing parameters are proportionally corrected based on the identified deviations. This directly locates filament pulling problems caused by printing parameter deviations, forming a real-time adaptive closed-loop control system of perception-decision-execution. Filament pulling can be dynamically suppressed in real-time during the printing process without manual intervention, effectively reducing printing failures, material waste, and post-processing time caused by filament pulling defects. This improves printing success rate and the quality of one-time product molding. The adoption of a mode decision-making and proportional adjustment mechanism enhances the system's resistance to single-prediction interference, making the printing parameter correction process more stable and reliable, and avoiding parameter oscillations.
[0024] Optionally, based on the corrected printing parameters, continue to acquire images of the fuse printing process, and simultaneously obtain real-time fuse printing parameters to continue performing printing parameter deviation analysis and correction.
[0025] After the printing parameters are corrected, the process is repeated cyclically from the data acquisition steps described above, forming a real-time printing parameter correction closed loop of image acquisition, defect detection, adjustment decision, correction execution, and re-acquisition. Figure 3 As shown, until the printing task is completed, the system achieves real-time and dynamic control of wire drawing defects in fused wire printing through real-time acquisition, real-time detection, real-time calculation, and real-time correction.
[0026] Example 2 Figure 4 This is a flowchart of a wire drawing defect correction method for fused wire printing according to Embodiment 2 of the present invention. This embodiment is based on the above embodiment and optimized. In this embodiment, S101 is specifically optimized as follows: The video data of the fuse printing process is collected and processed frame by frame to form a fuse printing process image. At the same time, the real-time fuse printing parameters corresponding to each frame are obtained. The real-time fuse printing parameters are compared with the preset optimal fuse printing parameter range, and the fuse printing process image corresponding to the real-time fuse printing parameters deviating from the range is marked as a printing defect image; The printed defect images are filtered for noise samples and abnormal parameters to form the original defect image dataset.
[0027] Accordingly, the method for correcting wire drawing defects in fused filament printing provided in this embodiment specifically includes: S201: Collect video data of the fuse printing process and perform video frame segmentation to form fuse printing process images, while acquiring the real-time fuse printing parameters corresponding to each frame image.
[0028] The acquired video stream of the fused filament printing process is segmented frame by frame into fused filament printing process images using video segmentation code. Simultaneously, real-time fused filament printing parameters corresponding to each image are acquired and bound together. For example, the fused filament 3D printing image acquisition system includes a printer 1, a processor 2, and a camera 3, such as... Figure 5 As shown, processor 2 can be a regular computer (or industrial control computer), which is electrically connected to printer 1 and camera 3 respectively. On the one hand, it allows printing users to control the printing status of the fused filament 3D printer through a computer connected to the local area network. On the other hand, it monitors the working status of camera 3 and stores the printing video to the computer. Each image is aligned with the printing parameter log at the time of acquisition.
[0029] S202, compare the real-time fuse printing parameters with the preset optimal fuse printing parameter range, and mark the fuse printing process image corresponding to the real-time fuse printing parameters deviating from the range as a printing defect image.
[0030] For example, for a certain model of printer using PLA material, the preset optimal fuse printing parameter range for its main printing parameters might be: retraction distance 2-3mm, retraction speed 50-70mm / s, printing temperature 200-210℃, and printing speed 80-90mm / s. However, the real-time fuse printing parameters during printing are: retraction distance 1mm, retraction speed 60mm / s, printing temperature 220℃, and printing speed 81mm / s. Based on the deviation of these four parameters (too low / suitable / too high), a unique combined label is generated. For example, the corresponding frame image is labeled "0121," where 0 indicates the parameter is below the optimal parameter range (too low), 1 indicates it is within the optimal range, and 2 indicates it is above the optimal range (too high). The labeled printing defect image is as follows: Figure 6 As shown.
[0031] S203 performs noise sample and abnormal parameter filtering on the printed defect images to form the original defect image dataset.
[0032] Due to the long response time when updating printing parameters, the dataset may contain some noisy labels. Regarding mechanical delay, based on the worst-case scenario of the response time required for all parameters in the dataset to change between their minimum and maximum values (e.g., changes after parameter updates are mostly visible within 4 seconds), image samples taken within 4 seconds of the parameter update are removed. Unrealistic parameter outliers caused by the printer failing to correctly execute G-code commands or malfunctions of sensors such as thermistors are also filtered out, ultimately retaining correct and appropriate image samples to form the original defect image dataset.
[0033] One optional implementation of this embodiment is to perform data augmentation and expansion on the original defect image dataset to form an expanded defect image dataset.
[0034] To improve the model's generalization ability, the original defect image dataset can be augmented with data. Roboflow can be used to augment the defect images with data augmentation methods such as rotation, flipping, and adding noise. The original images are augmented to an augmented defect image dataset containing a large number of printed defect images, and then divided into training, validation, and test sets in a 7:2:1 ratio.
[0035] S204 improves the multi-head neural network by using a residual attention network as the backbone network to extract image features and a multilayer perceptron to extract printing parameter features. It constructs an improved fuse printing defect detection model with multiple input heads and outputs the corresponding printing parameter label classification results through multiple output heads.
[0036] Specifically, a residual attention network is used as the backbone network to form an image modality input head, which is used to extract features from the expanded defect image dataset to obtain defect image features.
[0037] Multi-head neural networks (or multi-head deep learning models), also known as multi-output deep learning models, typically consist of a basic network backbone and multiple output heads for different category classifications. To improve classification accuracy, multi-type data, including defect images and printing parameters, are used as model inputs. Both serve as the basis for printing state classification, improving prediction accuracy and model generalization. The basic network backbone of the multi-head neural network is replaced with a residual attention network for image feature extraction. Residual attention networks are more effective at solving gradient vanishing and exploding problems and are better suited for feature extraction in high-speed printing. After feature extraction from the input image is completed by three attention modules and six residual blocks, the feature vector is transformed into a one-dimensional vector, forming the defect image features, which are then used for subsequent concatenation with the parameter feature vectors.
[0038] A multilayer perceptron is used as the parameter modal input head to extract features from real-time fuse printing parameters and obtain defect parameter features.
[0039] The printing parameters (a set of numerical values) can be encoded into a high-dimensional feature vector using a lightweight multilayer perceptron (MLP) to obtain the printing parameter features corresponding to the defect image. The MLP has two fully connected layers. During the forward propagation, the four printing parameter inputs pass through each fully connected layer sequentially, and a ReLU activation function is applied after each layer. The features are then converted into a one-dimensional feature vector, thus forming the defect parameter features.
[0040] The defect image features and defect parameter features are concatenated to obtain the joint printing features.
[0041] Subsequently, the defect image features extracted by the residual attention network and the defect parameter features extracted by the multilayer perceptron are concatenated along the feature dimension using concatenation, forming a joint printing feature that integrates printing visual state information and printing parameter state information.
[0042] By using multiple output heads, each printing parameter is classified for defects based on joint printing features, resulting in the printing parameter label classification result for each printing parameter.
[0043] Joint printing features are predicted through multiple independent, structurally identical fully connected layers (i.e., output heads), each responsible for predicting a specific printing parameter. For example, the four output heads, each with its own fully connected layer, predict four printing parameters: pullback distance, pullback speed, printing temperature, and printing speed, resulting in a printing parameter label classification result for each parameter (0=low, 1=suitable, 2=high). This structure allows a single model to simultaneously diagnose all key parameters, share underlying feature extraction, and achieve significantly higher computational efficiency than deploying four independent models. Compared to using multiple independent networks and treating them as four separate single-label classification problems, multi-head neural networks are better able to learn the interactions and relationships between parameters. Furthermore, training four independent networks independently requires significantly more computation, and they also need to be run in parallel during runtime. Residual attention, using attention, can reduce the number of network parameters required, shortening inference time compared to using multiple independent networks.
[0044] Optionally, during the model training phase, multiple sets of model parameters can be initially trained on the improved fuse printing defect detection model using a pre-defined dataset of obvious defects.
[0045] During the model training phase, the AdamW optimizer can be used to train the model. First, a pre-defined dataset of obvious defects (a small, artificially created dataset containing obvious string defects) is used. During training, multiple sets of model parameters (such as learning rate, hyperparameters, and other basic model parameters) are set for the same model, and multiple training sessions are performed separately. The aim is to allow the model to quickly learn the strong correlation between the basic visual patterns of string defects and parameter anomalies. For example, the hardware configuration of this solution is a dual-GPU setup: a single NVIDIA RTX 3090 with 24GB of VRAM and 10496 CUDA cores, an AMD EPYC7542 32-Core Processor CPU with 32 cores, 128GB of RAM, and PyTorch 1.7.1, Python 3.6, and CUDA 11.6. Training parameters are set as follows: 50 epochs, 640×640 input images, and a batch size of 32 images.
[0046] Based on the initial training results, the set of model parameters with the best performance is selected as the optimal random seed. Then, through transfer learning, the model is trained using the expanded defect image dataset to construct the model with the optimal random seed, resulting in a well-trained improved filament printing defect detection model.
[0047] After initial training, the set of model parameters that performs best on the validation set (e.g., based on accuracy) is selected as the optimal random seed, representing the set with the highest accuracy. A new improved fuse printing defect detection model is then constructed using this optimal random seed. This model is then retrained more thoroughly and fully using an expanded defect image dataset, resulting in a more powerful and stable improved fuse printing defect detection model. For example, the trained model is validated using a validation set, achieving an overall accuracy of 83.3%. Figure 7 As shown, the classification accuracy on the test set for each printing parameter is as follows: pullback distance 84.3%, pullback speed 82%, printing speed 82%, and printing temperature 83.3%. Comparing the prediction performance of four ResNet models with the same configuration for the four parameters, after 50 training epochs, the ResNet18 model using only images achieved an accuracy of 74.4%, while the improved model considering both printing parameter features and image features achieved a final prediction accuracy of 83.3% after the same number of training epochs, as shown in Table 2. Table 2 Comparison of accuracy of different models on the test set S205 utilizes a trained improved filament printing defect detection model to identify printing parameter defects in the original defect image dataset, obtaining parameter deviation prediction data.
[0048] S206, Based on the parameter deviation prediction data and combined with the preset optimal fuse printing parameter range, correct the real-time fuse printing parameters corresponding to the parameter deviation prediction data.
[0049] This embodiment annotates defective images through parameter range comparison, expands the dataset using data augmentation, and constructs a multi-head neural network model with a residual attention network as the backbone, fusing image and parameter dual-modal features and equipped with multiple output heads. A two-stage transfer learning strategy is then employed to efficiently train this model. This solves the problems of high cost and low efficiency of manual annotation of large-scale defect data, and the labels directly correspond to the causes of defects, forming high-quality labeled data. Introducing a residual attention network as the feature extraction backbone allows the model to focus on key areas of the printed image (such as the nozzle path), enhancing the representation of subtle stringing features in complex backgrounds and improving the accuracy of printing parameter state classification. The multi-modal splicing and fusion strategy of image features + parameter features enables the model to simultaneously utilize printing vision and printing parameters to deeply understand the generation mechanism of stringing defects and the coupling relationship between printing parameters. The two-stage transfer learning training strategy allows for rapid learning of strongly correlated features first, followed by fine-tuning to adapt to complex scenarios, ensuring training efficiency while improving the model's generalization ability and robustness, thus enhancing the model's adaptability.
[0050] Example 3 Figure 8 This is a schematic diagram of a wire drawing defect correction device for fused wire printing according to Embodiment 3 of the present invention. In this embodiment, the wire drawing defect correction device for fused wire printing includes: The data acquisition module 810 is used to acquire images of the fuse printing process, obtain real-time fuse printing parameters, mark printing defects in the fuse printing process images, and perform data preprocessing to form an original defect image dataset. Model building module 820 is used to improve multi-head neural networks by using residual attention network as the backbone network to build an improved fuse printing defect detection model; The defect detection module 830 is used to identify printing parameter defects in the original defect image dataset using a trained improved filament printing defect detection model. The printing parameter correction module 840 is used to correct the real-time fuse printing parameters corresponding to the parameter deviation from the prediction data based on the parameter deviation prediction data and in combination with the preset optimal fuse printing parameter range.
[0051] This embodiment acquires images of the filament printing process and obtains real-time filament printing parameters through a data acquisition module. A model building module improves the multi-head neural network using a residual attention network as the backbone. A defect detection module identifies printing parameter defects in the original defect image dataset. A printing parameter correction module corrects the real-time filament printing parameters corresponding to deviations from the predicted data. This directly locates filament pulling problems caused by printing parameter deviations, forming a real-time adaptive closed-loop control of perception-decision-execution. Filament pulling can be dynamically suppressed in real-time during printing without manual intervention, effectively reducing printing failures, material waste, and post-processing time caused by filament pulling defects. This improves printing success rate and the quality of one-time product molding. The adoption of a mode decision and proportional adjustment mechanism enhances the system's ability to resist single-prediction interference, making the printing parameter correction process more stable and reliable, and avoiding parameter oscillations.
[0052] The wire drawing defect correction device for fused filament printing provided in this embodiment of the invention can execute the wire drawing defect correction method for fused filament printing provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method.
[0053] Example 4 Figure 9 This is a structural diagram of an electronic device according to Embodiment 4 of the present invention. Figure 9 A block diagram is shown of an exemplary electronic device 12 suitable for implementing embodiments of the present invention. Figure 9 The electronic device 12 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.
[0054] like Figure 9 As shown, the electronic device 12 is represented in the form of a general-purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, system memory 28, and bus 18 connecting different system components (including system memory 28 and processing unit 16).
[0055] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0056] Electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by electronic device 12, including volatile and non-volatile media, removable and non-removable media.
[0057] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (… Figure 9 Not shown; usually referred to as a "hard drive"). Although Figure 9 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0058] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 42 typically perform the functions and / or methods described in the embodiments of the present invention.
[0059] Electronic device 12 can also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), and with one or more devices that enable a user to interact with the electronic device 12 / server / computer, and / or with any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed through input / output (I / O) interface 22. Furthermore, electronic device 12 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 20. Figure 9 As shown, network adapter 20 communicates with other modules of electronic device 12 via bus 18. It should be understood that, although... Figure 9 As not shown, other hardware and / or software modules may be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0060] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the wire drawing defect correction method for fused wire printing provided in the embodiments of the present invention.
[0061] Example 5 Embodiment 5 of the present invention also provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the wire drawing defect correction method for fused wire printing as provided in the above embodiments.
[0062] The computer storage medium of this invention can be any combination of one or more computer-readable media. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0063] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0064] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including—but not limited to—wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0065] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0066] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.
Claims
1. A method for correcting wire drawing defects in fused filament printing, characterized in that, include: S101: Acquire images of the fuse printing process and obtain real-time fuse printing parameters. Based on the preset optimal fuse printing parameter range, mark printing defects in the fuse printing process images and perform data preprocessing to form an original defect image dataset. S102 improves the multi-head neural network by using a residual attention network as the backbone network to extract image features and a multilayer perceptron to extract printing parameter features. It constructs an improved fuse printing defect detection model with multiple input heads and outputs the corresponding printing parameter label classification results through multiple output heads. S103, using the trained improved fuse printing defect detection model, the original defect image dataset is used to identify printing parameter defects and obtain parameter deviation prediction data; S104, based on the parameter deviation prediction data and combined with the preset optimal fuse printing parameter range, corrects the real-time fuse printing parameters corresponding to the parameter deviation prediction data.
2. The method according to claim 1, characterized in that, S101 includes: The video data of the fuse printing process is collected and processed frame by frame to form a fuse printing process image. At the same time, the real-time fuse printing parameters corresponding to each frame are obtained. The real-time fuse printing parameters are compared with the preset optimal fuse printing parameter range, and the fuse printing process image corresponding to the real-time fuse printing parameters deviating from the range is marked as a printing defect image; The printed defect images are filtered for noise samples and abnormal parameters to form the original defect image dataset.
3. The method according to claim 2, characterized in that, S101 further includes: The original defect image dataset is augmented and expanded to form an expanded defect image dataset.
4. The method according to claim 3, characterized in that, S102 includes: A residual attention network is used as the backbone network to form an image modality input head, which is used to extract features from the expanded defect image dataset to obtain defect image features. A multilayer perceptron is used as the parameter modal input head to extract features from real-time fuse printing parameters and obtain defect parameter features; The defect image features and defect parameter features are concatenated to obtain joint printing features; By using multiple output heads to classify defects for each printing parameter based on joint printing features, the printing parameter label classification result for each printing parameter is obtained.
5. The method according to claim 4, characterized in that, S102 further includes: During the model training phase, multiple sets of model parameters are initially trained on the improved fuse printing defect detection model using a pre-set dataset of obvious defects. Based on the initial training results, the set of model parameters with the best performance is selected as the optimal random seed. Then, through transfer learning, the model is trained using the expanded defect image dataset to construct the model with the optimal random seed, resulting in a well-trained improved fused wire printing defect detection model.
6. The method according to claim 1, characterized in that, S104 includes: For each printed parameter in the parameter deviation prediction data, the mode threshold is compared, and the frequency of printed parameter deviation is determined based on the deviation of printed parameters that is greater than the preset mode threshold. Based on the difference between the frequency of deviation of printing parameters and the preset mode threshold, the adjustment amount of printing parameters is calculated by one-dimensional linear interpolation to correct the printing parameters.
7. The method according to claim 1, characterized in that, The method further includes: Based on the corrected printing parameters, continue to acquire images of the fuse printing process, and simultaneously obtain real-time fuse printing parameters to continue analyzing and correcting printing parameter deviations.
8. A device for correcting wire drawing defects in fused filament printing, characterized in that, include: The data acquisition module is used to acquire images of the fuse printing process, obtain real-time fuse printing parameters, mark printing defects in the fuse printing process images, and perform data preprocessing to form an original defect image dataset. The model building module is used to improve multi-head neural networks by using residual attention networks as the backbone network and combining them with multilayer perceptrons to build an improved filament printing defect detection model with multiple input heads. The defect detection module is used to identify printing parameter defects in the original defect image dataset using a trained improved filament printing defect detection model. The printing parameter correction module is used to correct the real-time fuse printing parameters corresponding to the deviation from the predicted data, based on the parameter deviation from the predicted data and in combination with the preset optimal fuse printing parameter range.
9. An electronic device, characterized in that, The electronic device includes: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the wire drawing defect correction method for fused filament printing as described in any one of claims 1-7.
10. A storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the wire drawing defect correction method for fused tomography as described in any one of claims 1-7.