Disclosure of Invention
In order to overcome the defects in the prior art, the invention provides a 3D printing abnormity warning method and system based on double-channel detection and decision fusion, which are used for synchronously acquiring visible light images and temperature fields in a printing process by utilizing a high-resolution optical camera and a thermal infrared imager and carrying out multi-mode data fusion analysis by combining an improved YOLOv target detection network so as to realize defect detection and early warning.
To achieve the above object, one or more embodiments of the present invention provide the following technical solutions:
The invention provides a 3D printing abnormity warning method based on double-channel detection and decision fusion;
A3D printing abnormity alarm method based on double-channel detection and decision fusion comprises the following steps:
Synchronously acquiring optical image and infrared image data in the 3D printing process, and respectively preprocessing the optical image and the infrared image;
Utilizing a data enhancement frame to perform multi-mode enhancement on defects in the preprocessed optical image and infrared image data, and obtaining an enhanced optical data set and an enhanced infrared data set;
Training a first YOLOv-DAD model by using the enhanced optical data set, performing defect detection, and outputting a first detection result; training a second YOLOv-DAD model by using the enhanced infrared data set, performing defect detection, and outputting a second detection result;
And carrying out decision-level fusion on the first detection result and the second detection result to generate a fusion detection result, and triggering a grading early warning signal according to the fusion detection result.
As a further technical solution, the synchronously collecting optical image and infrared image data in the 3D printing process, respectively preprocessing the optical image and the infrared image, includes:
Clipping the optical image to remove background noise, and enhancing image details by adopting a CLAHE high-light enhancement filtering technology;
based on the printing bed angle calibration plate, performing space coordinate alignment on the optical image and the infrared image through characteristic point matching, and registering the images under the same coordinate system by utilizing an image registration algorithm;
And extracting high-frequency characteristics of the registered images by adopting a high-pass filter and an edge detection algorithm, and optimizing the image quality by combining histogram equalization, highlight inhibition and chromatic aberration correction.
As a further technical solution, the multi-modal enhancement of defects in the preprocessed optical image and infrared image data by using the data enhancement framework, to obtain an enhanced optical data set and an enhanced infrared data set, includes:
And calling a data enhancement framework, and obtaining an enhanced optical data set and an infrared data set by generating an countermeasure network to simulate different defect types and adding the enhanced defects into the preprocessed optical image and infrared image data.
As a further technical solution, the first YOLOv-DAD model and the second YOLOv-DAD model include:
the DAD detection head module is used for outputting defect types, confidence and boundary frame information;
SEVERITYNET regression network module for calculating defect severity score.
As a further technical scheme, the first detection result comprises a first defect category, a first confidence coefficient and a first frame;
the second detection result comprises a second defect category, a second confidence and a second frame.
As a further technical solution, performing decision-level fusion on the first detection result and the second detection result to generate a fusion detection result, and triggering a hierarchical early warning signal according to the fusion detection result, including:
Weighting calculation is carried out on the confidence coefficient of the first detection result and the confidence coefficient of the second detection result;
Comprehensively evaluating by combining the defect severity score and the continuous occurrence frequency;
and determining a final early warning grade according to a preset threshold rule.
As a further technical scheme, the early warning level comprises a level I prompt early warning, a level II manual intervention early warning and a level III emergency stop early warning.
The second aspect of the invention provides a 3D printing abnormity warning system based on double-channel detection and decision fusion.
3D prints unusual alarm system based on binary channels detects and decision fusion, includes:
the image acquisition and preprocessing module is configured to synchronously acquire optical images and infrared image data in the 3D printing process and respectively preprocess the optical images and the infrared images;
The data enhancement module is configured to perform multi-mode enhancement on defects in the preprocessed optical image and infrared image data by utilizing a data enhancement frame to obtain an enhanced optical data set and an enhanced infrared data set;
the detection result output module is configured to train a first YOLOv-DAD model by utilizing the enhanced optical data set, detect defects and output a first detection result, train a second YOLOv-DAD model by utilizing the enhanced infrared data set, detect defects and output a second detection result;
the decision-stage fusion module is configured to perform decision-stage fusion on the first detection result and the second detection result to generate a fusion detection result, and trigger a grading early warning signal according to the fusion detection result.
A third aspect of the present invention provides a computer readable storage medium having stored thereon a program which when executed by a processor implements the steps in a 3D printing anomaly alerting method based on a dual channel detection and decision fusion as described in the first aspect of the present invention.
A fourth aspect of the present invention provides an electronic device, including a memory, a processor, and a program stored on the memory and executable on the processor, where the processor implements the steps in the method for 3D printing anomaly alarm based on dual channel detection and decision fusion according to the first aspect of the present invention when the program is executed.
The one or more of the above technical solutions have the following beneficial effects:
According to the invention, through the cooperative work of the optical and infrared dual-channel sensor, the omnibearing monitoring of surface morphology defects and internal thermal anomalies in the 3D printing process is realized, and the coverage range and accuracy of defect detection are obviously improved. The decision-level fusion strategy avoids the computational complexity of the traditional feature-level fusion, and is matched with an improved YOLOv model and a SEVERITYNET regression network, so that the system response time is controlled within 10ms while the detection precision is ensured, and the industrial-level real-time requirement is completely met. The intelligent three-level early warning mechanism is adopted to realize closed loop quality control from slight abnormality prompt to serious defect emergency stop, and clear decision basis is provided for operators.
Additional aspects of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Detailed Description
It should be noted that the following detailed description is exemplary and is intended to provide further explanation of the invention. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of exemplary embodiments according to the present invention.
Embodiments of the invention and features of the embodiments may be combined with each other without conflict.
Example 1
The embodiment discloses a 3D printing abnormity warning method based on double-channel detection and decision fusion;
as shown in fig. 1, the 3D printing abnormality alarm method based on dual-channel detection and decision fusion includes:
Step S1, synchronously acquiring optical image and infrared image data in a 3D printing process, and respectively preprocessing the optical image and the infrared image;
s2, carrying out multi-mode enhancement on defects in the preprocessed optical image and infrared image data by utilizing a data enhancement frame to obtain an enhanced optical data set and an enhanced infrared data set;
Step S3, training a first YOLOv-DAD model by using the enhanced optical data set, performing defect detection, and outputting a first detection result; training a second YOLOv-DAD model by using the enhanced infrared data set, performing defect detection, and outputting a second detection result;
And S4, carrying out decision-level fusion on the first detection result and the second detection result to generate a fusion detection result, and triggering a grading early warning signal according to the fusion detection result.
Specifically, the method also comprises the following steps:
step S1, synchronously acquiring optical image and infrared image data in the 3D printing process, and respectively preprocessing the optical image and the infrared image.
After printing starts, the optical image frame and the infrared thermal imaging frame are respectively acquired in the same laser scanning period by calling the synchronous trigger, so that the two paths of data are ensured to strictly correspond in time. And simultaneously, writing uniform time stamps into the acquired optical image and infrared image, performing geometric coordinate conversion based on a pre-calibrated external parameter matrix, and only completing space alignment without pixel-level superposition or channel fusion, thereby keeping the original characteristic information of each channel complete.
Further, preprocessing the optical image and the infrared image includes:
Step S11, aiming at the optical image, background noise and non-key information are removed through clipping, definition and quality of key areas are ensured, and further, details of bright parts and dark parts in the image are enhanced and the discrimination of fine defects in the image is enhanced based on a high-light enhancement filtering technology CLAHE. The operation is helpful for improving the accuracy in the subsequent processing steps, especially in the high-reflection light image, and is mainly used for capturing the abnormalities such as molten drop splashing, molten pool necking balling, powder accumulation and the like. For infrared images, radiation calibration is first performed, specifically by calibration of the response of a standard blackbody source of known temperature and an infrared sensor, so as to ensure the accuracy of temperature data. In order to better adapt to the thermal characteristics of different materials, dynamic emissivity compensation is carried out, and the radiation emissivity of the materials is dynamically adjusted according to the factors such as the type of the materials in the printing process, environmental changes and the like, so that the temperature data of the infrared image is more reliable. The method mainly captures the anomalies such as cavities, abnormal cooling spots and the like caused by abnormal local temperature rise and deep melting pit-steam cavity.
And S12, aligning the acquired optical image and the infrared image through a printing bed angle calibration plate to ensure that the space coordinates of the two paths of images are consistent. Geometric transformation between images is performed by using an image registration algorithm, such as a feature point-based matching algorithm or an optical flow-based motion estimation technique, so as to ensure accurate registration of the images under the same coordinate system.
Step S13, further preprocessing is carried out on the registered image, high-frequency features in the image are extracted through a high-pass filter and an edge detection algorithm (such as Canny edge detection), and image details are optimized. The image is then contrast enhanced using an image enhancement algorithm, such as histogram equalization, and combined with highlight rejection and color difference correction to reduce the interference of illumination variations and environmental factors.
And according to predefined 3D printing defect type classification coding and severity grading quantization rules, performing defect labeling on the spatially aligned two-channel frame sequences synchronously through manual visual verification or a semi-automatic boundary recognition algorithm, and generating a training sample with a multi-mode label.
And S2, carrying out multi-mode enhancement on defects in the preprocessed optical image and infrared image data by utilizing a data enhancement frame to obtain an enhanced optical data set and an enhanced infrared data set.
In this embodiment, the MM-DiffAug data enhancement framework is invoked to multimodal enhance defects in the optical and infrared images, respectively. The specific enhancement mode is as follows:
For optical image defect enhancement, the MM-DiffAug (Multi-Modal Diffusion Augmentatio) framework is invoked to enhance defects in images by generating a countermeasure network (GAN). By simulating different defect types (e.g., droplet splatter, puddle necking into a sphere, powder build-up, etc.), optical image data similar to real defects is generated. Specifically, random noise, defect category and background image are generated through a condition generator, the difference between the generated defect image and the real image is correspondingly evaluated through a discriminator, and the consistency of modes is judged. The generated images keep the structure and texture characteristics of the optical images, and a plurality of defect modes are added, so that an enhanced optical data set is obtained, the data set is ensured to cover more defect situations, and the diversity of training data is enhanced.
For infrared images, defects in the infrared images are enhanced by generating an countermeasure network using the same MM-DiffAug framework. In this process, defects (e.g., hot spots, cooling non-uniformity, etc.) in the infrared image will be generated and added to the preprocessed infrared image data. The generated infrared image will simulate different thermal distributions and defect modes to ensure the diversity of the infrared data set and improve the recognition of the model for thermal anomalies and temperature changes. The enhanced optical dataset and the infrared dataset retain the original features of the optical and infrared images, respectively, and are used for subsequent training and verification.
Further, a new defect image is generated by using the trained GAN, the quality of the generated image is evaluated, the image is ensured to accord with the actual defect characteristics, the generated image is fused with the original data set, and the diversity and the scale of the data set are increased.
And step S3, training a first YOLOv-DAD model by using the enhanced optical data set, performing defect detection, outputting a first detection result, and training a second YOLOv-DAD model by using the enhanced infrared data set, performing defect detection, and outputting a second detection result.
The enhanced optical dataset and the infrared dataset are divided into a training set, a validation set and a test set, and a first YOLOv-DAD model and a second YOLOv-DAD model are trained. The first YOLOv-DAD model and the second YOLOv-DAD model comprise a DAD detection head module for outputting defect types, confidence and bounding box information, and a SEVERITYNET regression network module for calculating defect severity scores. Specific:
Training a YOLO-v12-RGB model on the enhanced optical dataset, outputting a first detection result using a DAD detection head, wherein the first detection result comprises a first defect class First confidence levelAnd a first frame. The relative offset predicted by the neural network is converted into an actual detection frame in the image by utilizing a frame regression key formula, so that the accurate positioning and size adjustment of the target are realized, and the accuracy of target detection is improved. Wherein, the key formula of frame regression is:
Wherein the method comprises the steps of Representing the absolute coordinates of the final prediction box center point in the entire image,Is the width and height of the final prediction block.Center point offset (not activated) for the neural network raw output; wide and high offset (log scale) for the neural network raw output; the reference coordinate of the upper left corner of the grid unit where the prediction frame is positioned is set; the width and height of the Anchor (a priori frame) are predefined for scale reference. And (3) in order to predict the actual width and height of the frame, mapping the actual width and height of the frame into a scaling factor which is always positive through the exponential operation of the width and height offset of the network prediction, and multiplying the scaling factor with the width and height of the anchor frame.
Independently training a YOLO-v12-IR model on the enhanced infrared dataset, outputting a second detection result comprising a second defect classSecond confidence levelAnd a second frame。
And writing the output first detection result and the output second detection result into a detection result buffer area to be fused according to the time stamp for the subsequent severity assessment and decision stage fusion.
And aiming at the first detection result and the second detection result, performing ROI clipping-filling on the frame area in each channel, extracting a standardized area corresponding to the target defect from the two-channel image, removing background interference, ensuring consistency of optics and infrared, and facilitating subsequent feature extraction, classification and decision fusion, and respectively sending the result to a corresponding SEVERITYNET regression network to obtain defect severity and score. Specifically, region clipping is performed on a bounding box corresponding to each detection result in the same sensor channel, a local image sub-block (ROI) where a defect is located is extracted, scaling and blank filling are performed on the ROI obtained by clipping according to a preset size, compatibility of input resolution and SEVERITYNET network structures is guaranteed, and meanwhile defect characteristics are kept undistorted. Inputting the normalized ROI into a corresponding SEVERITYNET regression model, and calculating the defect severity score in real time, wherein the defect severity score is shown in the following formula:
Wherein, the A feature representation of the jth POI small in the infrared channel; The characteristic matrix is a weight matrix and is used for carrying out linear characteristic transformation on the pooled characteristics; a feature map of the jth infrared channel ROI area; Is a bias term; The pooling operation is global averaged.
And S4, carrying out decision-level fusion on the first detection result and the second detection result to generate a fusion detection result, and triggering a grading early warning signal according to the fusion detection result.
The two highest confidence levels are integrated, and the following formula is adopted:
Wherein, the Is the highest confidence.
And comprehensively judging the defect type, the confidence coefficient, the continuous frame number and the occurrence frequency in each time window through an intelligent alarm engine (SMART ALARM ENGINE, SAE) event engine to generate corresponding risk level parameters.
And setting a highest confidence threshold value, and generating an alarm level according to the threshold value set. When the risk level reaches a preset threshold, the event engine triggers corresponding early warning according to the I/II/III level sequence, wherein the early warning comprises I level prompt, II level manual intervention and III level emergency stop, and synchronously drives acousto-optic or PLC output.
Meanwhile, after the trigger event, the system packages and uploads the defect record, the associated G-code line number and the real-time environment parameter to a quality database, so that subsequent traceability and statistical analysis are realized.
Example two
The embodiment discloses a 3D printing abnormity alarm system based on double-channel detection and decision fusion;
As shown in fig. 2, the 3D printing abnormality alarm system based on the dual-channel detection and decision fusion includes:
the image acquisition and preprocessing module is configured to synchronously acquire optical images and infrared image data in the 3D printing process and respectively preprocess the optical images and the infrared images;
The data enhancement module is configured to perform multi-mode enhancement on defects in the preprocessed optical image and infrared image data by utilizing a data enhancement frame to obtain an enhanced optical data set and an enhanced infrared data set;
the detection result output module is configured to train a first YOLOv-DAD model by utilizing the enhanced optical data set, detect defects and output a first detection result, train a second YOLOv-DAD model by utilizing the enhanced infrared data set, detect defects and output a second detection result;
the decision-stage fusion module is configured to perform decision-stage fusion on the first detection result and the second detection result to generate a fusion detection result, and trigger a grading early warning signal according to the fusion detection result.
Example III
An object of the present embodiment is to provide a computer-readable storage medium.
A computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps in the 3D printing anomaly alerting method based on dual channel detection and decision fusion as described in embodiment 1.
Example IV
An object of the present embodiment is to provide an electronic apparatus.
An electronic device comprising a memory, a processor and a program stored on the memory and executable on the processor, the processor implementing the steps in the two-channel detection and decision fusion based 3D printing anomaly alert method as described in embodiment 1 when the program is executed.
The steps involved in the devices of the second, third and fourth embodiments correspond to those of the first embodiment of the method, and the detailed description of the embodiments can be found in the related description section of the first embodiment. The term "computer-readable storage medium" shall be taken to include a single medium or multiple media that includes one or more sets of instructions, and shall also be taken to include any medium that is capable of storing, encoding or carrying a set of instructions for execution by the processor and that cause the processor to perform any one of the methodologies of the present invention.
It will be appreciated by those skilled in the art that the modules or steps of the invention described above may be implemented by general-purpose computer means, alternatively they may be implemented by program code executable by computing means, whereby they may be stored in storage means for execution by computing means, or they may be made into individual integrated circuit modules separately, or a plurality of modules or steps in them may be made into a single integrated circuit module. The present invention is not limited to any specific combination of hardware and software.
While the foregoing description of the embodiments of the present invention has been presented in conjunction with the drawings, it should be understood that it is not intended to limit the scope of the invention, but rather, it is intended to cover all modifications or variations within the scope of the invention as defined by the claims of the present invention.