A quality inspection method and system for magnesium ingot production

By integrating neural networks and physical models with multi-source data, the problems of low efficiency and high cost in magnesium ingot inspection are solved, enabling precise location and comprehensive evaluation of surface and internal defects in magnesium ingots, and making it suitable for online quality inspection in magnesium ingot production.

CN120746404BActive Publication Date: 2025-11-14SHANXI FUHENGDI NEW MATERIALS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511254895.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-04
Publication Date
2025-11-14
Estimated Expiration
2045-09-04

AI Technical Summary

Technical Problem

Existing magnesium ingot quality inspection technologies suffer from technical bottlenecks such as low inspection efficiency, reliance on human experience for results, inability to comprehensively assess surface and internal defects, high equipment costs, and difficulty in integrating into online production.

Method used

By fusing visible light images, 3D point cloud data, and infrared thermal imaging, a hybrid neural network combining 3D convolution and Transformer self-attention mechanisms is used to identify surface defects. The internal density is then determined by solving a heat conduction model using a physical information neural network, and a fuzzy logic reasoning system is used for comprehensive evaluation.

Benefits of technology

It enables comprehensive and detailed evaluation of magnesium ingot quality, allowing for online and low-cost quantitative assessment of internal defects, with evaluation results closely aligned with actual production needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120746404B_ABST
    Figure CN120746404B_ABST
Patent Text Reader

Abstract

This invention provides a quality inspection method and system for magnesium ingot production. The method involves acquiring visible light images, three-dimensional point cloud data, and infrared thermal images of the magnesium ingot to be inspected; constructing a three-dimensional voxel model characterizing the geometric and color information of the magnesium ingot surface; identifying and outputting the type, three-dimensional location, and size information of defects on the magnesium ingot surface; using the infrared thermal image as the surface temperature boundary condition of the heat conduction model, and using the defect location and size as the thermal conductivity perturbation source within the model; obtaining the equivalent thermal conductivity distribution field inside the magnesium ingot; calculating an index characterizing the internal compactness based on the spatial non-uniformity of the equivalent thermal conductivity distribution field; calculating the shape contour conformance parameter; inputting the surface defect severity parameter, the shape contour conformance parameter, and the internal compactness index into a fuzzy logic inference system; performing inference based on a preset fuzzy rule base matching the downstream application process of the magnesium ingot; and outputting the magnesium ingot quality grade.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of quality inspection, and in particular relates to a quality inspection method and system for magnesium ingot production. Background Technology

[0002] Magnesium and magnesium alloys, as the lightest metallic structural materials used in engineering applications today, play a crucial role in high-end manufacturing fields such as aerospace, automotive lightweighting, and portable electronic devices due to their high specific strength, excellent damping and vibration reduction properties, and electromagnetic shielding. Magnesium ingots are the raw materials for subsequent forming processes such as extrusion, die casting, and rolling. Their quality, including surface integrity, internal density, and dimensional accuracy, directly determines the mechanical properties, service life, and reliability of the final product. However, during the casting process of magnesium ingots, various defects inevitably arise due to the interaction of multiple complex factors such as melting temperature, pouring speed, cooling conditions, and raw material purity. These defects include surface cracks, slag pits, oxide scale, and cold shuts, as well as internal porosity, looseness, shrinkage cavities, and inclusions. Therefore, establishing a comprehensive, accurate, and efficient quality inspection system is of fundamental strategic significance for ensuring product quality in the downstream industrial chain and improving the yield rate of the production process.

[0003] Currently, significant technical bottlenecks remain in the quality inspection methods for magnesium ingots. Industrial sites commonly rely on manual visual inspection combined with manual tools such as calipers for sampling measurements. This method is not only labor-intensive and inefficient, failing to keep pace with modern production, but more seriously, its results are highly dependent on the experience and physiological state of the inspectors, leading to strong subjectivity, missed detections, and misjudgments, making it difficult to guarantee the consistency and reliability of quality control. With the development of automation technology, some enterprises have begun to introduce machine vision inspection solutions based on two-dimensional visible light images. However, such methods have inherent limitations: First, due to variations in crystallization state and oxidation degree, the surface of magnesium ingots often exhibits complex and uneven textures and reflective properties, making it difficult for traditional image processing algorithms or conventional convolutional neural networks to reliably extract defect features; second, two-dimensional images inherently lose depth information, making it impossible to assess the three-dimensional dimensional deviations of magnesium ingots or accurately quantify defects with three-dimensional shapes such as depressions and protrusions. For internal defects, mainstream non-destructive testing technologies such as X-ray testing (RT) or ultrasonic testing (UT), while effective, suffer from significant equipment investment, cumbersome testing procedures, and radiation safety concerns, making them difficult to integrate into high-speed online production processes. Infrared thermal imaging, as a non-contact temperature measurement method, can reflect the temperature field distribution during the cooling process of magnesium ingots. This distribution is related to the density of the internal structure, but this relationship is indirect and ambiguous. Relying solely on thermal images makes it difficult to directly and quantitatively determine the type, location, and severity of internal defects. In summary, existing technologies often treat surface, dimensional, and internal quality inspections as independent processes, resulting in single data sources, limited information dimensions, and a lack of a comprehensive evaluation model that can deeply integrate multi-source heterogeneous data and establish a correlation between surface features and internal states at the physical mechanism level. This makes it difficult to achieve a comprehensive, refined, and intelligent grading of magnesium ingot quality. Summary of the Invention

[0004] To address the problems mentioned in the background section, this application proposes a quality inspection method for magnesium ingot production, comprising:

[0005] S1, acquire visible light image, three-dimensional point cloud data and infrared thermal image of the magnesium ingot to be tested;

[0006] S2, the three-dimensional point cloud data is registered and fused with the visible light image to construct a three-dimensional voxel model representing the geometric and color information of the magnesium ingot surface; the three-dimensional voxel model is processed using a hybrid neural network that combines three-dimensional convolution and Transformer self-attention mechanism to identify and output the type, three-dimensional location and size information of the defects on the magnesium ingot surface.

[0007] S3, the infrared thermal image is used as the surface temperature boundary condition of the heat conduction model, and the defect location and size are used as the thermal conductivity perturbation source inside the model; the heat conduction model is solved by a physical information neural network to obtain the equivalent thermal conductivity distribution field inside the magnesium ingot; based on the spatial non-uniformity of the equivalent thermal conductivity distribution field, an index characterizing the internal density is calculated.

[0008] S4. Calculate the surface defect severity parameter based on the defect information, and calculate the shape contour conformity parameter by comparing the three-dimensional point cloud data with the standard digital model; input the surface defect severity parameter, shape contour conformity parameter, and internal density index into the fuzzy logic reasoning system, and perform reasoning based on the preset fuzzy rule library that matches the downstream application process of magnesium ingots, and output the magnesium ingot quality grade.

[0009] Optionally, the processing of the three-dimensional voxel model using a hybrid neural network that integrates three-dimensional convolution and Transformer self-attention mechanisms includes:

[0010] S21, the registered and fused 3D point cloud and color information are discretized into a 3D voxel grid, and each voxel occupied by the magnesium ingot entity is given a feature vector containing average color information and occupancy state.

[0011] S22, the three-dimensional voxel mesh is input into an encoder composed of multiple three-dimensional convolutions to extract geometric and texture features in the local three-dimensional space by downsampling layer by layer, and a low-resolution feature map is generated.

[0012] S23, flatten the low-resolution feature map into a feature sequence, add three-dimensional position encoding information to it, and then input the feature sequence into a Transformer encoder based on a multi-head self-attention mechanism to capture the long-distance spatial dependencies between defect features.

[0013] S24, the output of the Transformer encoder is passed to a parallel prediction head to decode and output a prediction set containing multiple defects, wherein each element in the set contains the defect's category, confidence level, and the position and size information of the three-dimensional bounding box.

[0014] Optionally, the step of solving the heat conduction model using a physical information neural network to obtain the equivalent thermal conductivity distribution field inside the magnesium ingot includes:

[0015] S31. Construct a multilayer perceptron as a physical information neural network that takes three-dimensional spatial coordinates (x,y,z) as input and can output the predicted temperature and equivalent thermal conductivity of the coordinate points in parallel.

[0016] S32, defined by the residual loss from the physical equations Boundary condition loss and prior loss due to defects The network is trained using a composite loss function derived from weighted summation; The residuals of the steady-state heat conduction equation at multiple sampling points inside the magnesium ingot are calculated using automatic differentiation; The deviation between the predicted temperature values ​​and the measured values ​​from the infrared thermal image at multiple sampling points on the surface of the magnesium ingot; The deviation between the predicted thermal conductivity value and a preset defect thermal conductivity target value that is lower than the standard magnesium thermal conductivity within the identified defect area;

[0017] S33, minimize the composite loss function through backpropagation until the network converges, thereby solving for the equivalent thermal conductivity distribution field of the entire domain.

[0018] Optionally, the calculation of the index characterizing the internal density based on the spatial inhomogeneity of the equivalent thermal conductivity distribution field includes:

[0019] In the equivalent thermal conductivity distribution field obtained by the physical information neural network, systematic sampling is carried out along the internal space of the magnesium ingot to obtain the thermal conductivity values ​​of multiple sampling points, forming a thermal conductivity sample set.

[0020] Calculate the statistical standard deviation of the sample set as a quantitative indicator to measure the uniformity of thermal conductivity distribution;

[0021] The internal density index is obtained by mapping the standard deviation to a scalar value between 0 and 1 using a monotonically decreasing function.

[0022] Optionally, the step of inputting the surface defect severity parameter, the shape contour conformity parameter, and the internal density index into a fuzzy logic inference system, performing inference based on a preset fuzzy rule base that matches the downstream application process of magnesium ingots, and outputting the magnesium ingot quality grade includes:

[0023] S41, normalizes the three input parameters of surface defect severity, shape profile conformity and internal density, and defines multiple linguistic fuzzy sets for each parameter and configures the corresponding membership function;

[0024] S42, establish a fuzzy rule base covering the main input combinations, with the rule form being: "If the surface defect severity is A, the shape contour conformity is B, and the internal compactness is C, then the quality level is D".

[0025] S43, using fuzzy inference method, calculates the fuzzy set of quality levels of output variables based on the membership degree of each input parameter and fuzzy rules;

[0026] S44. Using a defuzzification method, the output fuzzy set is converted into an accurate comprehensive quality score, and the comprehensive quality score is compared with a preset grade classification threshold to determine the quality grade of the magnesium ingot.

[0027] This application also provides a quality inspection system for magnesium ingot production, comprising:

[0028] The acquisition unit is used to acquire visible light images, three-dimensional point cloud data, and infrared thermal images of the magnesium ingot to be inspected.

[0029] The initial identification unit is used to register and fuse the three-dimensional point cloud data with the visible light image to construct a three-dimensional voxel model representing the geometric and color information of the magnesium ingot surface; and to process the three-dimensional voxel model using a hybrid neural network that combines three-dimensional convolution and Transformer self-attention mechanism to identify and output the type, three-dimensional location and size information of defects on the magnesium ingot surface.

[0030] The index calculation unit is used to use the infrared thermal image as the surface temperature boundary condition of the heat conduction model, and the defect location and size as the thermal conductivity perturbation source inside the model; solve the heat conduction model through a physical information neural network to obtain the equivalent thermal conductivity distribution field inside the magnesium ingot; and calculate the index characterizing the internal density based on the spatial non-uniformity of the equivalent thermal conductivity distribution field.

[0031] The grade determination unit is used to calculate the surface defect severity parameter based on the defect information, calculate the shape contour conformity parameter by comparing the three-dimensional point cloud data with the standard digital model, input the surface defect severity parameter, the shape contour conformity parameter and the internal density index into the fuzzy logic reasoning system, and perform reasoning based on the preset fuzzy rule library that matches the downstream application process of magnesium ingots, and output the magnesium ingot quality grade.

[0032] Optionally, the processing of the three-dimensional voxel model using a hybrid neural network that integrates three-dimensional convolution and Transformer self-attention mechanisms includes:

[0033] The registered and fused 3D point cloud and color information are discretized into a 3D voxel grid, and each voxel occupied by the magnesium ingot entity is given a feature vector containing average color information and occupancy state.

[0034] The three-dimensional voxel mesh is input into an encoder composed of multiple three-dimensional convolutions, and geometric and texture features in the local three-dimensional space are extracted by downsampling layer by layer to generate a low-resolution feature map.

[0035] The low-resolution feature map is flattened into a feature sequence, and three-dimensional position encoding information is added to it. Then, the feature sequence is input into a Transformer encoder based on a multi-head self-attention mechanism to capture the long-distance spatial dependencies between defect features.

[0036] The output of the Transformer encoder is passed to a parallel prediction head to decode and output a prediction set containing multiple defects, where each element in the set contains the defect's category, confidence level, and the location and size information of the 3D bounding box.

[0037] Optionally, the step of solving the heat conduction model using a physical information neural network to obtain the equivalent thermal conductivity distribution field inside the magnesium ingot includes:

[0038] Construct a multilayer perceptron as a physical information neural network that takes three-dimensional spatial coordinates (x, y, z) as input and can output the predicted temperature and equivalent thermal conductivity of the coordinate points in parallel.

[0039] Defined by the residual loss of the physical equation Boundary condition loss and prior loss due to defects The network is trained using a composite loss function derived from weighted summation; The residuals of the steady-state heat conduction equation at multiple sampling points inside the magnesium ingot are calculated using automatic differentiation; The deviation between the predicted temperature values ​​and the measured values ​​from the infrared thermal image at multiple sampling points on the surface of the magnesium ingot; The deviation between the predicted thermal conductivity value and a preset defect thermal conductivity target value that is lower than the standard magnesium thermal conductivity within the identified defect area;

[0040] The composite loss function is minimized through backpropagation until the network converges, thereby solving for the global equivalent thermal conductivity distribution field.

[0041] Optionally, the calculation of the index characterizing the internal density based on the spatial inhomogeneity of the equivalent thermal conductivity distribution field includes:

[0042] In the equivalent thermal conductivity distribution field obtained by the physical information neural network, systematic sampling is carried out along the internal space of the magnesium ingot to obtain the thermal conductivity values ​​of multiple sampling points, forming a thermal conductivity sample set.

[0043] Calculate the statistical standard deviation of the sample set as a quantitative indicator to measure the uniformity of thermal conductivity distribution;

[0044] The internal density index is obtained by mapping the standard deviation to a scalar value between 0 and 1 using a monotonically decreasing function.

[0045] Optionally, the step of inputting the surface defect severity parameter, the shape contour conformity parameter, and the internal density index into a fuzzy logic inference system, performing inference based on a preset fuzzy rule base that matches the downstream application process of magnesium ingots, and outputting the magnesium ingot quality grade includes:

[0046] The three input parameters—surface defect severity, shape profile conformity, and internal density—are normalized, and multiple linguistic fuzzy sets are defined for each parameter, with corresponding membership functions configured.

[0047] Establish a fuzzy rule base that covers the main input combinations. The rule form is: "If the surface defect severity is A, the shape profile conformity is B, and the internal compactness is C, then the quality level is D".

[0048] The fuzzy set of quality levels of the output variable is calculated by using the fuzzy inference method based on the membership degree of each input parameter and fuzzy rules.

[0049] A defuzzification method is used to convert the output fuzzy set into an accurate comprehensive quality score, and the comprehensive quality score is compared with a preset grade classification threshold to determine the quality grade of the magnesium ingot.

[0050] Compared with the prior art, this application has the following beneficial effects:

[0051] This invention constructs a multimodal voxel model integrating geometric, color, and temperature information, and utilizes a neural network combining 3D convolution and Transformer for analysis. This overcomes the limitations of 2D detection, enabling precise location, classification, and dimensional quantification of defects in 3D space, thus achieving a complete characterization of the surface condition of magnesium ingots. By introducing a physical information neural network, surface defects and measured temperature fields are used as physical constraints to solve the internal heat conduction equation, reversing the equivalent thermal conductivity field characterizing the internal density. This establishes a physical correlation between surface information and internal state, providing a direct and quantitative basis for online, low-cost assessment of internal porosity, inclusions, and other defects. Furthermore, a fuzzy logic reasoning system comprehensively evaluates the three major quality indicators—surface, shape, and internal structure—allowing for flexible and refined grading based on the needs of different downstream applications, resulting in assessments that more closely align with actual production decision-making requirements. Attached Figure Description

[0052] Figure 1 This is a flowchart of Example 1;

[0053] Figure 2 A flowchart for processing a 3D voxel model;

[0054] Figure 3 A flowchart for calculating the equivalent thermal conductivity distribution field;

[0055] Figure 4 This is a schematic diagram showing the output of magnesium ingot quality grades. Detailed Implementation

[0056] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0057] The terms "first," "second," and corresponding designations in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of units is not necessarily limited to those units but may include other units not explicitly listed or inherent to those processes, methods, products, or apparatuses.

[0058] Furthermore, in the description of this application, unless otherwise stated, "multiple" means two or more. The terms "and / or" or the character " / " in this application are merely descriptions of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B, or A / B, can represent: A existing alone, A and B existing simultaneously, and B existing alone.

[0059] In a specific embodiment, this application proposes a quality inspection method for magnesium ingot production, such as... Figure 1 As shown, it includes:

[0060] S1, acquire visible light image, three-dimensional point cloud data and infrared thermal image of the magnesium ingot to be tested;

[0061] At the end of the cooling section of the magnesium ingot production line, an integrated inspection station collects data on the still-warm magnesium ingots. This station integrates a line laser 3D profilometer and a long-wave infrared thermal imager. While scanning the magnesium ingot surface, the line laser 3D profilometer's built-in high-resolution camera simultaneously acquires a two-dimensional visible light image and generates high-density 3D point cloud data using laser triangulation. The long-wave infrared thermal imager, operating in the 8-14 micrometer wavelength range, non-contactly collects the temperature distribution on the magnesium ingot surface, generating an infrared thermal image. Synchronization with the encoder signal of the production line conveyor belt ensures that the three data sources collect information from the same area of ​​the magnesium ingot, providing a spatial and temporal reference for subsequent data fusion.

[0062] S2, the three-dimensional point cloud data is registered and fused with the visible light image to construct a three-dimensional voxel model representing the geometric and color information of the magnesium ingot surface; the three-dimensional voxel model is processed using a hybrid neural network that combines three-dimensional convolution and Transformer self-attention mechanism to identify and output the type, three-dimensional location and size information of the defects on the magnesium ingot surface.

[0063] Using a pre-calibrated extrinsic parameter matrix between a 3D profilometer and a visible light camera, each point in the 3D point cloud data is projected onto the visible light image plane and assigned a corresponding RGB color value. Then, this point cloud with color information is voxelized in 3D space, dividing it into a regular 3D grid, for example, 256x256x64. The color value within each voxel is determined by the average color of all points falling within it, thus constructing a voxel model representing geometric and color information. This model is then input into a hybrid neural network for semantic segmentation. The network uses 3DU-Net as its basic skeleton, with its encoder consisting of alternating stacked 3D convolutional layers and Vision Transformer layers. The 3D convolutional layers use 3x3x3 convolutional kernels to extract local geometric and texture features, while the Transformer layers flatten the feature maps into sequences, utilizing their self-attention mechanism to capture large-scale, cross-regional feature dependencies, thereby enabling the complete identification of long, narrow cracks. The decoder part of the network performs upsampling through transposed convolutions and combines them with skip connections from the encoder to ultimately output a segmentation result of the same size as the input voxel model. Each voxel is assigned a category label, such as background, crack, or slag pore. By performing 3D connected component analysis on the segmentation result, the type of each defect, the 3D centroid coordinates, and the size information represented by the number of voxels can be obtained.

[0064] S3, the infrared thermal image is used as the surface temperature boundary condition of the heat conduction model, and the defect location and size are used as the thermal conductivity perturbation source inside the model; the heat conduction model is solved by a physical information neural network to obtain the equivalent thermal conductivity distribution field inside the magnesium ingot; based on the spatial non-uniformity of the equivalent thermal conductivity distribution field, an index characterizing the internal density is calculated.

[0065] A physical information neural network (PEN) is used to solve the steady-state partial differential equation of thermal conduction inside a magnesium ingot. The governing form of this equation is the Laplace equation, where the divergence of the product of the thermal conductivity field and the temperature gradient is zero. The acquired infrared thermal image, after coordinate transformation, is mapped onto the surface of a 3D model of the magnesium ingot, serving as the Dirichlet boundary condition for this PDE. Identified defects, such as slag pores or inclusions, are designated as low thermal conductivity regions at their corresponding 3D locations, while intact regions are designated as having the normal thermal conductivity of magnesium metal. This information collectively constitutes the thermal conductivity perturbation source. The PSN comprises two parallel multilayer perceptrons: one network takes 3D coordinates as input and outputs temperature, while the other takes 3D coordinates as input and outputs equivalent thermal conductivity. By randomly sampling points within the model, the network output is substituted into the thermal conduction equation to calculate the physical residual. Simultaneously, the error between the network's predicted surface temperature and the measured infrared temperature, as well as the difference between the predicted thermal conductivity and the prior information serving as the perturbation source, are calculated. The weighted sum of these three factors constitutes the network's total loss function. By minimizing this loss function during network training, a second network can predict the equivalent thermal conductivity at any point inside the magnesium ingot, forming a complete three-dimensional distribution field. The variance of the thermal conductivity values ​​of all voxel points in this distribution field is calculated. This variance is used as an indicator of internal density; the larger the variance, the more non-uniform the interior and the worse the density.

[0066] S4. Calculate the surface defect severity parameter based on the defect information, and calculate the shape contour conformity parameter by comparing the three-dimensional point cloud data with the standard digital model; input the surface defect severity parameter, shape contour conformity parameter, and internal density index into the fuzzy logic reasoning system, and perform reasoning based on the preset fuzzy rule library that matches the downstream application process of magnesium ingots, and output the magnesium ingot quality grade.

[0067] The surface defect severity parameter is calculated by assigning different weights to different types of defects identified, such as cracks with a weight of 0.8 and slag porosity with a weight of 0.3. The volume of each defect is multiplied by its corresponding weight and then summed. The shape profile conformance parameter is calculated by using the Iterative Closest Point (ICP) algorithm to register and align the collected 3D point cloud data with a standard CAD digital model. Then, the average distance from all point cloud points to the model surface is calculated; the smaller the distance, the higher the conformance. The fuzzy logic inference system takes three inputs: surface defect severity, shape profile conformance, and internal density. The output is the quality grade. A fuzzy set is defined for each input indicator; for example, the internal density indicator can be divided into three fuzzy sets: dense, general, and loose. The fuzzy rule base is preset according to downstream applications. For example, if applied to the aerospace field, the rule is: if the internal density is loose, the quality grade is unqualified; if the internal density is dense and the surface defect severity is low, the quality grade is first-class. The inference engine, based on the Mamdani model, activates the corresponding rules according to the membership degree of the input indicators, aggregates the output results of all activated rules, and finally defuzzifies them using the centroid method to obtain a final quality grade judgment result, such as Grade 1, Grade 2, or unqualified product.

[0068] In an optional embodiment, the hybrid neural network that integrates 3D convolution and Transformer self-attention mechanisms processes the 3D voxel model, such as... Figure 2 As shown, it includes:

[0069] S21, the registered and fused 3D point cloud and color information are discretized into a 3D voxel grid, and each voxel occupied by the magnesium ingot entity is given a feature vector containing average color information and occupancy state.

[0070] S22, the three-dimensional voxel mesh is input into an encoder composed of multiple three-dimensional convolutions to extract geometric and texture features in the local three-dimensional space by downsampling layer by layer, and a low-resolution feature map is generated.

[0071] S23, flatten the low-resolution feature map into a feature sequence, add three-dimensional position encoding information to it, and then input the feature sequence into a Transformer encoder based on a multi-head self-attention mechanism to capture the long-distance spatial dependencies between defect features.

[0072] S24, the output of the Transformer encoder is passed to a parallel prediction head to decode and output a prediction set containing multiple defects, wherein each element in the set contains the defect's category, confidence level, and the position and size information of the three-dimensional bounding box.

[0073] Specifically, during execution, a 3D point cloud containing five million points and its corresponding RGB color information is discretized into a 256x256x128 3D voxel grid. For each voxel occupied by a magnesium ingot, the average R, G, and B values ​​of all points within it are calculated and concatenated with the occupancy state 1 to form a four-dimensional feature vector, for example, [0.8, 0.8, 0.8, 1]. This voxel grid is then input into an encoder containing three 3x3x3 3D ​​convolutional layers. Each convolutional layer is followed by a pooling layer with a stride of 2, ultimately downsampling the 256x256x128 input into a 32x32x16 low-resolution feature map, which contains rich local geometric and color features.

[0074] This 32x32x16 feature map is flattened into a sequence containing 16,384 feature vectors. Each feature vector is encoded with its absolute position in 3D space before being fed into the Transformer encoder. A Transformer structure with six layers of multi-head self-attention modules processes this sequence. For example, when a 20cm-long crack exists on the surface of a magnesium ingot, the crack's features are distributed across multiple locations in the sequence. The self-attention mechanism can compute the intrinsic correlations between these distant features, thus gaining a complete understanding of the entire defect's morphology. Finally, the model's prediction head outputs a defect set, for example, containing element one: {Category: Crack, Confidence: 0.96, Center Coordinates: (100, 50, 20), Size: (200, 5, 10) mm}, and element two: {Category: Slag Pore, Confidence: 0.91, Center Coordinates: (150, 180, 15), Size: (8, 8, 8) mm}.

[0075] In an optional embodiment, the equivalent thermal conductivity distribution field inside the magnesium ingot is obtained by solving the heat conduction model using a physical information neural network, such as... Figure 3 As shown, it includes:

[0076] S31. Construct a multilayer perceptron as a physical information neural network that takes three-dimensional spatial coordinates (x,y,z) as input and can output the predicted temperature and equivalent thermal conductivity of the coordinate points in parallel.

[0077] S32, defined by the residual loss from the physical equations Boundary condition loss and prior loss due to defects The network is trained using a composite loss function derived from weighted summation; The residuals of the steady-state heat conduction equation at multiple sampling points inside the magnesium ingot are calculated using automatic differentiation; The deviation between the predicted temperature values ​​and the measured values ​​from the infrared thermal image at multiple sampling points on the surface of the magnesium ingot; The deviation between the predicted thermal conductivity value and a preset defect thermal conductivity target value that is lower than the standard magnesium thermal conductivity within the identified defect area;

[0078] S33, minimize the composite loss function through backpropagation until the network converges, thereby solving for the equivalent thermal conductivity distribution field of the entire domain.

[0079] Specifically, a multilayer perceptron consisting of eight fully connected layers, each containing 256 neurons and employing the SiLU activation function, is constructed. This network receives a three-dimensional coordinate (x, y, z) as input and has two outputs, predicting the temperature T and equivalent thermal conductivity k at that point, respectively. During training, the weights of the composite loss function are set to... This weighting configuration indicates that accurately matching the surface temperature boundary conditions is the primary task.

[0080] In each training iteration, 10,000 points are randomly sampled inside the magnesium ingot. The residuals of the steady-state heat conduction equation at these points are calculated using automatic differentiation, and their mean square errors are accumulated to obtain the result. Simultaneously, two thousand points were sampled on the surface of the magnesium ingot, and the mean square error between the temperature predicted by the network and the actual temperature of 350 degrees Celsius measured by the infrared thermal imager was calculated, yielding... For the 8x8x8 mm slag pore defect detected in the previous step, one hundred points are sampled within this area. The mean square error between the network-predicted thermal conductivity k and a preset defect target value, such as 15 W / m Kelvin, is calculated to obtain... By minimizing the total loss function using the Adam optimizer, the network eventually converges, and its thermal conductivity output head constitutes a precise three-dimensional representation of the equivalent thermal conductivity k(x,y,z) inside the entire magnesium ingot.

[0081] In an optional embodiment, the calculation of the index characterizing the internal density based on the spatial inhomogeneity of the equivalent thermal conductivity distribution field includes:

[0082] In the equivalent thermal conductivity distribution field obtained by the physical information neural network, systematic sampling is carried out along the internal space of the magnesium ingot to obtain the thermal conductivity values ​​of multiple sampling points, forming a thermal conductivity sample set.

[0083] Calculate the statistical standard deviation of the sample set as a quantitative indicator to measure the uniformity of thermal conductivity distribution;

[0084] The internal density index is obtained by mapping the standard deviation to a scalar value between 0 and 1 using a monotonically decreasing function.

[0085] Specifically, within the solved k(x,y,z) three-dimensional thermal conductivity distribution field, a uniform three-dimensional grid is constructed at 1-m intervals, and samples are taken at each grid point. For a standard-sized magnesium ingot, this produces a sample set containing over one million thermal conductivity values. For example, for a magnesium ingot of excellent internal quality, the thermal conductivity values ​​at the vast majority of sampling points are concentrated around 156 W / m Kelvin, typical for standard magnesium, with only minor fluctuations.

[0086] Next, we calculate the statistical standard deviation of this million-sample set. Regarding the aforementioned high-quality magnesium ingots, its It might only be 3.5. However, for a magnesium ingot containing minute porous structures and impurities, its thermal conductivity distribution will show even more areas of low values, and the calculated... It may increase to 25.0. In one embodiment, a negative exponential function is used. The mapping was performed. For high-quality magnesium ingots, the calculated internal density index was 0.70. For low-quality magnesium ingots, the index was 0.08. This index value intuitively and quantitatively reflects the uniformity and density of the internal material.

[0087] In an optional embodiment, the surface defect severity parameter, the shape profile conformity parameter, and the internal density index are input into a fuzzy logic inference system. The system then performs inference based on a preset fuzzy rule base that matches the downstream application processes of the magnesium ingot, outputting the magnesium ingot quality grade, such as... Figure 4 As shown, it includes:

[0088] S41, normalizes the three input parameters of surface defect severity, shape profile conformity and internal density, and defines multiple linguistic fuzzy sets for each parameter and configures the corresponding membership function;

[0089] S42, establish a fuzzy rule base covering the main input combinations, with the rule form being: "If the surface defect severity is A, the shape contour conformity is B, and the internal compactness is C, then the quality level is D".

[0090] S43, using fuzzy inference method, calculates the fuzzy set of quality levels of output variables based on the membership degree of each input parameter and fuzzy rules;

[0091] S44. Using a defuzzification method, the output fuzzy set is converted into an accurate comprehensive quality score, and the comprehensive quality score is compared with a preset grade classification threshold to determine the quality grade of the magnesium ingot.

[0092] Specifically, suppose that after calculation and normalization, a magnesium ingot yields three input parameters: surface defect severity 0.8, shape profile conformity 0.9, and internal density 0.7. For the input value of internal density 0.7, according to the preset Gaussian membership function, its membership degrees to the three fuzzy sets {poor, medium, good} are calculated to be 0.1, 0.9, and 0.2, respectively. Similarly, this fuzzification operation is performed on the other two inputs.

[0093] A rule in the fuzzy rule base is activated: if the surface defect severity is high, the shape profile conformity is excellent, and the internal density is medium, then the quality grade is Grade II. Assuming the membership degrees of the three inputs corresponding to this rule's premise are 0.7, 0.8, and 0.9 respectively, the trigger strength of this rule is the minimum of the three, i.e., 0.7. This strength value is used to reduce the shape of the fuzzy set representing the Grade II product in the conclusion part. After all relevant rules have been calculated, all activated output fuzzy sets are aggregated into a total output fuzzy shape. Finally, the centroid abscissa of this shape is calculated using the centroid method to obtain a precise quality score, for example, 82.5. According to a preset threshold, a score greater than 90 is Grade I, between 70 and 90 is Grade II, and less than 70 is unqualified. Therefore, the magnesium ingot is ultimately classified as Grade II.

[0094] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some feature data may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or units through some interfaces, and may be electrical, mechanical, or other forms.

[0095] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0096] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0097] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A quality inspection method for magnesium ingot production, characterized in that, include: S1, acquire visible light image, three-dimensional point cloud data and infrared thermal image of the magnesium ingot to be tested; S2, the three-dimensional point cloud data is registered and fused with the visible light image to construct a three-dimensional voxel model representing the geometric and color information of the magnesium ingot surface; the three-dimensional voxel model is processed using a hybrid neural network that combines three-dimensional convolution and Transformer self-attention mechanism to identify and output the type, three-dimensional location and size information of the defects on the magnesium ingot surface. S3, the infrared thermal image is used as the surface temperature boundary condition of the heat conduction model, and the defect location and size are used as the thermal conductivity perturbation source inside the model; the heat conduction model is solved by a physical information neural network to obtain the equivalent thermal conductivity distribution field inside the magnesium ingot; based on the spatial non-uniformity of the equivalent thermal conductivity distribution field, an index characterizing the internal density is calculated. S4. Calculate the surface defect severity parameter based on the defect information, and calculate the shape contour conformity parameter by comparing the three-dimensional point cloud data with the standard digital model; input the surface defect severity parameter, shape contour conformity parameter, and internal density index into the fuzzy logic reasoning system, and perform reasoning based on the preset fuzzy rule library that matches the downstream application process of magnesium ingots, and output the magnesium ingot quality grade.

2. The method according to claim 1, characterized in that, The hybrid neural network that integrates 3D convolution and Transformer self-attention mechanism processes the 3D voxel model, including: S21, the registered and fused 3D point cloud and color information are discretized into a 3D voxel grid, and each voxel occupied by the magnesium ingot entity is given a feature vector containing average color information and occupancy state. S22, the three-dimensional voxel mesh is input into an encoder composed of multiple three-dimensional convolutions to extract geometric and texture features in the local three-dimensional space by downsampling layer by layer, and a low-resolution feature map is generated. S23, flatten the low-resolution feature map into a feature sequence, add three-dimensional position encoding information to it, and then input the feature sequence into a Transformer encoder based on a multi-head self-attention mechanism to capture the long-distance spatial dependencies between defect features. S24, the output of the Transformer encoder is passed to a parallel prediction head to decode and output a prediction set containing multiple defects, wherein each element in the set contains the defect's category, confidence level, and the position and size information of the three-dimensional bounding box.

3. The method according to claim 1, characterized in that, The process of solving the heat conduction model using a physical information neural network to obtain the equivalent thermal conductivity distribution field inside the magnesium ingot includes: S31. Construct a multilayer perceptron as a physical information neural network that takes three-dimensional spatial coordinates (x,y,z) as input and can output the predicted temperature value and the predicted equivalent thermal conductivity value of the coordinate points in parallel. S32, defined by the residual loss from the physical equations Boundary condition loss and prior loss due to defects The network is trained using a composite loss function derived from weighted summation; The residuals of the steady-state heat conduction equation at multiple sampling points inside the magnesium ingot are calculated using automatic differentiation; The deviation between the predicted temperature values ​​and the measured values ​​from the infrared thermal image at multiple sampling points on the surface of the magnesium ingot; The deviation between the predicted thermal conductivity value and a preset defect thermal conductivity target value that is lower than the standard magnesium thermal conductivity within the identified defect area; S33, minimize the composite loss function through backpropagation until the network converges, thereby solving for the equivalent thermal conductivity distribution field of the entire domain.

4. The method according to claim 1, characterized in that, The indexes characterizing the internal density, calculated based on the spatial inhomogeneity of the equivalent thermal conductivity distribution field, include: In the equivalent thermal conductivity distribution field obtained by the physical information neural network, systematic sampling is carried out along the internal space of the magnesium ingot to obtain the thermal conductivity values ​​of multiple sampling points, forming a thermal conductivity sample set. Calculate the statistical standard deviation of the sample set as a quantitative indicator to measure the uniformity of thermal conductivity distribution; The internal density index is obtained by mapping the standard deviation to a scalar value between 0 and 1 using a monotonically decreasing function.

5. The method according to claim 1, characterized in that, The surface defect severity parameter, shape contour conformity parameter, and internal density index are input into a fuzzy logic inference system. Based on a pre-set fuzzy rule base matching the downstream application processes of magnesium ingots, inference is performed to output the magnesium ingot quality grade, including: S41, normalizes the three input parameters of surface defect severity, shape profile conformity and internal density, and defines multiple linguistic fuzzy sets for each parameter and configures the corresponding membership function; S42, establish a fuzzy rule base covering the main input combinations, with the rule form being: "If the surface defect severity is A, the shape contour conformity is B, and the internal compactness is C, then the quality level is D". S43, using fuzzy inference method, calculates the fuzzy set of quality levels of output variables based on the membership degree of each input parameter and fuzzy rules; S44. Using a defuzzification method, the output fuzzy set is converted into an accurate comprehensive quality score, and the comprehensive quality score is compared with a preset grade classification threshold to determine the quality grade of the magnesium ingot.

6. A quality inspection system for magnesium ingot production, characterized in that, include: The acquisition unit is used to acquire visible light images, three-dimensional point cloud data, and infrared thermal images of the magnesium ingot to be inspected. The initial identification unit is used to register and fuse the three-dimensional point cloud data with the visible light image to construct a three-dimensional voxel model representing the geometric and color information of the magnesium ingot surface; and to process the three-dimensional voxel model using a hybrid neural network that combines three-dimensional convolution and Transformer self-attention mechanism to identify and output the type, three-dimensional location and size information of defects on the magnesium ingot surface. The index calculation unit is used to use the infrared thermal image as the surface temperature boundary condition of the heat conduction model, and the defect location and size as the thermal conductivity perturbation source inside the model; solve the heat conduction model through a physical information neural network to obtain the equivalent thermal conductivity distribution field inside the magnesium ingot; and calculate the index characterizing the internal density based on the spatial non-uniformity of the equivalent thermal conductivity distribution field. The grade determination unit is used to calculate the surface defect severity parameter based on the defect information, calculate the shape contour conformity parameter by comparing the three-dimensional point cloud data with the standard digital model, input the surface defect severity parameter, the shape contour conformity parameter and the internal density index into the fuzzy logic reasoning system, and perform reasoning based on the preset fuzzy rule library that matches the downstream application process of magnesium ingots, and output the magnesium ingot quality grade.

7. The system according to claim 6, characterized in that, The hybrid neural network that integrates 3D convolution and Transformer self-attention mechanism processes the 3D voxel model, including: The registered and fused 3D point cloud and color information are discretized into a 3D voxel grid, and each voxel occupied by the magnesium ingot entity is given a feature vector containing average color information and occupancy state. The three-dimensional voxel mesh is input into an encoder composed of multiple three-dimensional convolutions, and geometric and texture features in the local three-dimensional space are extracted by downsampling layer by layer to generate a low-resolution feature map. The low-resolution feature map is flattened into a feature sequence, and three-dimensional position encoding information is added to it. Then, the feature sequence is input into a Transformer encoder based on a multi-head self-attention mechanism to capture the long-distance spatial dependencies between defect features. The output of the Transformer encoder is passed to a parallel prediction head to decode and output a prediction set containing multiple defects, where each element in the set contains the defect's category, confidence level, and the location and size information of the 3D bounding box.

8. The system according to claim 6, characterized in that, The process of solving the heat conduction model using a physical information neural network to obtain the equivalent thermal conductivity distribution field inside the magnesium ingot includes: Construct a multilayer perceptron as a physical information neural network that takes three-dimensional spatial coordinates (x, y, z) as input and can output the predicted temperature and equivalent thermal conductivity of the coordinate points in parallel. Defined by the residual loss of the physical equation Boundary condition loss and prior loss due to defects The network is trained using a composite loss function derived from weighted summation; The residuals of the steady-state heat conduction equation at multiple sampling points inside the magnesium ingot are calculated using automatic differentiation; The deviation between the predicted temperature values ​​and the measured values ​​from the infrared thermal image at multiple sampling points on the surface of the magnesium ingot; The deviation between the predicted thermal conductivity value and a preset defect thermal conductivity target value that is lower than the standard magnesium thermal conductivity within the identified defect area; The composite loss function is minimized through backpropagation until the network converges, thereby solving for the global equivalent thermal conductivity distribution field.

9. The system according to claim 6, characterized in that, The indexes characterizing the internal density, calculated based on the spatial inhomogeneity of the equivalent thermal conductivity distribution field, include: In the equivalent thermal conductivity distribution field obtained by the physical information neural network, systematic sampling is carried out along the internal space of the magnesium ingot to obtain the thermal conductivity values ​​of multiple sampling points, forming a thermal conductivity sample set. Calculate the statistical standard deviation of the sample set as a quantitative indicator to measure the uniformity of thermal conductivity distribution; The internal density index is obtained by mapping the standard deviation to a scalar value between 0 and 1 using a monotonically decreasing function.

10. The system according to claim 6, characterized in that, The surface defect severity parameter, shape contour conformity parameter, and internal density index are input into a fuzzy logic inference system. Based on a pre-set fuzzy rule base matching the downstream application processes of magnesium ingots, inference is performed to output the magnesium ingot quality grade, including: The three input parameters—surface defect severity, shape profile conformity, and internal density—are normalized, and multiple linguistic fuzzy sets are defined for each parameter, with corresponding membership functions configured. Establish a fuzzy rule base that covers the main input combinations. The rule form is: "If the surface defect severity is A, the shape profile conformity is B, and the internal compactness is C, then the quality level is D". The fuzzy set of quality levels of the output variable is calculated by using the fuzzy inference method based on the membership degree of each input parameter and fuzzy rules. A defuzzification method is used to convert the output fuzzy set into an accurate comprehensive quality score, and the comprehensive quality score is compared with a preset grade classification threshold to determine the quality grade of the magnesium ingot.

Citation Information

Patent Citations

  • Control method and system for product marking

    CN120295169A

  • Distributed Additive Manufacturing Platform for Value Chain Networks

    US20230080545A1