Quality detection method and system for magnesium ingot production
Through multimodal data fusion and neural network processing, combined with heat conduction models and fuzzy logic reasoning, the comprehensiveness and cost issues of magnesium ingot quality inspection were solved, and accurate and online evaluation of surface and internal defects of magnesium ingots was achieved.
Patent Information
- Application Number
- CN202511254895.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-04
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-09-04
AI Technical Summary
The existing magnesium ingot quality inspection technology has the following problems: the inspection results rely on manual experience, are inefficient, and cannot comprehensively evaluate surface and internal defects. In addition, the existing equipment is expensive and difficult to integrate into online production, and lacks multi-source data fusion and physical correlation evaluation.
A multimodal data fusion method is used to identify surface defects and solve the heat conduction model through visible light images, 3D point clouds and infrared thermal imaging data, combined with a neural network of 3D convolution and Transformer self-attention mechanism, invert the internal density, and conduct a comprehensive evaluation combined with a fuzzy logic reasoning system.
It achieves precise positioning and quantitative evaluation of surface and internal defects of magnesium ingots, establishes a physical correlation between surface information and internal state, provides online, low-cost quality evaluation, and the evaluation results are close to actual production needs.
Smart Images

Figure CN120746404A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of quality inspection, and in particular to a quality inspection method and system for magnesium ingot production. Background Art
[0002] As the lightest metal structural materials used in current engineering applications, magnesium and its alloys play a vital role in high-end manufacturing applications such as aerospace, lightweight automotive manufacturing, and portable electronic devices due to their high specific strength, excellent damping and shock absorption, and electromagnetic shielding properties. Magnesium ingots serve as the raw material for subsequent forming processes such as extrusion, die-casting, and rolling. Their quality, including surface integrity, internal microstructure density, and dimensional accuracy, directly determines the mechanical properties, service life, and reliability of the final product. However, during the casting process, the complex interaction of multiple factors, including melting temperature, pouring rate, cooling conditions, and raw material purity, inevitably leads to various defects, such as surface cracks, slag pores, oxide scale, cold shuts, and internal porosity, porosity, shrinkage, and inclusions. Therefore, establishing a comprehensive, accurate, and efficient quality inspection system is of fundamental strategic importance for ensuring product quality throughout the downstream supply chain and improving the yield rate of the production process.
[0003] Currently, quality inspection methods for magnesium ingots still face significant technical bottlenecks. Industrial sites generally rely on manual visual inspection combined with spot measurements using hand tools such as calipers. 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 physical condition of the inspector, leading to subjectivity and prone to missed detections and misjudgments, making it difficult to ensure consistent and reliable quality control. With the advancement of automation technology, some companies have begun to introduce machine vision inspection solutions based on two-dimensional visible light images. However, these methods have inherent limitations: First, the surface of magnesium ingots often exhibits complex and uneven textures and reflective properties due to varying crystallization states and oxidation levels, 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 the magnesium ingots or accurately quantify three-dimensional defects such as depressions and protrusions. Mainstream nondestructive testing technologies for internal defects, such as X-ray testing (RT) or ultrasonic testing (UT), while effective, require significant equipment investment, involve complex testing procedures, and involve 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 of magnesium ingots. This distribution is correlated with the density of the internal structure, but this correlation is indirect and ambiguous. Relying solely on thermal images, it is difficult to directly and quantitatively determine the type, location, and severity of internal defects. In summary, existing technical solutions often treat surface, dimensional, and internal quality inspections as independent processes, resulting in single data sources and one-sided information dimensions. There is a lack of a comprehensive evaluation model that can deeply integrate multi-source heterogeneous data and establish a physical mechanism-based correlation between surface features and internal conditions, making it difficult to achieve a comprehensive, refined, and intelligent grading of magnesium ingot quality. Summary of the Invention
[0004] In order to solve the problems pointed out in the above background technology, the present application proposes a quality inspection method for magnesium ingot production, comprising: S1, obtaining visible light images, three-dimensional point cloud data and infrared thermal images of the magnesium ingot to be inspected; S2, registering and fusing the three-dimensional point cloud data with the visible light image to construct a three-dimensional voxel model representing the surface geometry and color information of the magnesium ingot; processing the three-dimensional voxel model using a hybrid neural network that combines three-dimensional convolution with a Transformer self-attention mechanism to identify and output the type, three-dimensional position, and size information of the surface defects of the magnesium ingot; S3, using the infrared thermal image as the surface temperature boundary condition of the heat conduction model, and using the defect position and size as the thermal conductivity disturbance source inside the model; solving the heat conduction model through a physical information neural network to obtain an equivalent thermal conductivity distribution field inside the magnesium ingot; and calculating an index representing the internal density based on the spatial inhomogeneity of the equivalent thermal conductivity distribution field; S4, calculate the surface defect severity parameters based on the defect information, and calculate the shape contour conformity parameters by comparing the three-dimensional point cloud data with the standard digital model; input the surface defect severity parameters, shape contour conformity parameters and the internal density index into the fuzzy logic reasoning system, perform reasoning based on the preset fuzzy rule library that matches the downstream application process of the magnesium ingot, and output the quality grade of the magnesium ingot.
[0005] Optionally, the processing of the three-dimensional voxel model using a hybrid neural network combining three-dimensional convolution and Transformer self-attention mechanism includes: S21, discretizing the registered fused three-dimensional point cloud and color information into a three-dimensional voxel grid, and assigning a feature vector containing average color information and occupancy state to each voxel occupied by the magnesium ingot entity; S22, inputting the 3D voxel grid into an encoder composed of multiple layers of 3D convolution, extracting geometric and texture features in the local 3D space in a layer-by-layer downsampling manner, and generating a low-resolution feature map; S23, flattening the low-resolution feature map into a feature sequence, adding three-dimensional position encoding information thereto, and then inputting the feature sequence into a Transformer encoder based on a multi-head self-attention mechanism to capture long-range spatial dependencies between defect features; S24, passing the output of the Transformer encoder to the parallel prediction head to decode and output a prediction set containing multiple defects, where each element in the set contains the category, confidence, and location and size information of the three-dimensional bounding box of the defect.
[0006] Optionally, solving the heat conduction model by a physical information neural network to obtain an equivalent thermal conductivity distribution field inside the magnesium ingot includes: S31, construct a multi-layer perceptron as a physical information neural network that takes three-dimensional spatial coordinates (x, y, z) as input and can output the temperature prediction value and equivalent thermal conductivity prediction value of the coordinate point in parallel; S32, defined by the residual loss of the physical equation , boundary condition loss and defect prior loss The network training is performed using a composite loss function composed of weighted summation; Calculate the residuals of the steady-state heat conduction equation at multiple sampling points inside the magnesium ingot by automatic differentiation; is the deviation between the temperature prediction value and the measured value of the infrared thermal imaging image at multiple sampling points on the surface of the magnesium ingot; The deviation between the predicted thermal conductivity value and a preset target defect thermal conductivity value that is lower than the standard magnesium thermal conductivity within the identified defect area; S33, minimizing the composite loss function by back propagation until the network converges, thereby solving the equivalent thermal conductivity distribution field of the entire domain.
[0007] Optionally, the index characterizing the internal density is calculated based on the spatial inhomogeneity of the equivalent thermal conductivity distribution field, including: 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 to form a thermal conductivity sample set; Calculating the statistical standard deviation of the sample set as a quantitative indicator for measuring the uniformity of thermal conductivity distribution; The standard deviation is mapped to a scalar value between 0 and 1 through a monotonically decreasing function to obtain an internal density index.
[0008] Optionally, the surface defect severity parameter, the contour conformity parameter, and the internal density index are input into a fuzzy logic reasoning system, and reasoning is performed based on a preset fuzzy rule base that matches the downstream application process of the magnesium ingot to output the magnesium ingot quality grade, including: S41, normalizing the three input parameters of surface defect severity, contour conformity, and internal density, defining multiple linguistic fuzzy sets for each parameter, and configuring corresponding membership functions; S42, establish a fuzzy rule base covering the main input combinations, the rule form of which is: "If the surface defect severity is A, the shape contour conformity is B, and the internal density is C, then the quality level is D"; S43, using a fuzzy reasoning method, calculating the fuzzy set of the quality level of the output variable according to the membership degree of each input parameter and the fuzzy rules; S44, using a defuzzification method to convert the output fuzzy set into an accurate comprehensive quality score, and compare the comprehensive quality score with a preset grade classification threshold to determine the quality grade of the magnesium ingot.
[0009] The present application also provides a quality inspection system for magnesium ingot production, comprising: An acquisition unit, used to acquire visible light images, three-dimensional point cloud data, and infrared thermal images of the magnesium ingot to be tested; An initial recognition 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 that represents the surface geometry and color information of the magnesium ingot; a hybrid neural network that combines three-dimensional convolution with the Transformer self-attention mechanism is used to process the three-dimensional voxel model to identify and output the type, three-dimensional position and size information of the surface defects of the magnesium ingot; an index calculation unit, configured to use the infrared thermal image as a surface temperature boundary condition of a heat conduction model and the defect location and size as a thermal conductivity disturbance source within the model; solve the heat conduction model using a physical information neural network to obtain an equivalent thermal conductivity distribution field within the magnesium ingot; and calculate an index characterizing the internal density based on the spatial inhomogeneity 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, and calculate the shape contour conformity parameter by comparing the three-dimensional point cloud data with the standard digital model; the surface defect severity parameter, the shape contour conformity parameter and the internal density index are input into the fuzzy logic reasoning system, and reasoning is performed according to a preset fuzzy rule library that matches the downstream application process of the magnesium ingot, and the quality grade of the magnesium ingot is output.
[0010] Optionally, the processing of the three-dimensional voxel model using a hybrid neural network combining three-dimensional convolution and Transformer self-attention mechanism includes: The registered fused 3D point cloud and color information are discretized into a 3D voxel grid, and each voxel occupied by the magnesium ingot entity is assigned a feature vector containing the average color information and occupancy state; Inputting the 3D voxel grid into an encoder composed of multiple layers of 3D convolution, extracting geometric and texture features in the local 3D space in a layer-by-layer downsampling manner to generate a low-resolution feature map; Flatten the low-resolution feature map into a feature sequence and add three-dimensional position encoding information to it. Then input the feature sequence into a Transformer encoder based on a multi-head self-attention mechanism to capture the long-range 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 category, confidence, and location and size information of the 3D bounding box of the defect.
[0011] Optionally, solving the heat conduction model by a physical information neural network to obtain an equivalent thermal conductivity distribution field inside the magnesium ingot includes: Construct a multi-layer perceptron as a physical information neural network that takes three-dimensional spatial coordinates (x, y, z) as input and can output the temperature prediction value and equivalent thermal conductivity prediction value of the coordinate point in parallel; Define the residual loss by the physical equation , boundary condition loss and defect prior loss The network training is performed using a composite loss function composed of weighted summation; Calculate the residuals of the steady-state heat conduction equation at multiple sampling points inside the magnesium ingot by automatic differentiation; is the deviation between the temperature prediction value and the measured value of the infrared thermal imaging image at multiple sampling points on the surface of the magnesium ingot; The deviation between the predicted thermal conductivity value and a preset target defect thermal conductivity value that is lower than the standard magnesium thermal conductivity within the identified defect area; The composite loss function is minimized by back propagation until the network converges, thereby solving the equivalent thermal conductivity distribution field of the entire domain.
[0012] Optionally, the index characterizing the internal density is calculated based on the spatial inhomogeneity of the equivalent thermal conductivity distribution field, including: 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 to form a thermal conductivity sample set; Calculating the statistical standard deviation of the sample set as a quantitative indicator for measuring the uniformity of thermal conductivity distribution; The standard deviation is mapped to a scalar value between 0 and 1 through a monotonically decreasing function to obtain an internal density index.
[0013] Optionally, the surface defect severity parameter, the contour conformity parameter, and the internal density index are input into a fuzzy logic reasoning system, and reasoning is performed based on a preset fuzzy rule base that matches the downstream application process of the magnesium ingot to output the magnesium ingot quality grade, including: The three input parameters of surface defect severity, contour conformity, and internal density are normalized, and multiple linguistic fuzzy sets are defined for each parameter, and corresponding membership functions are configured; Establish a fuzzy rule base covering the main input combinations, whose rule form is: "If the surface defect severity is A, the shape contour conformity is B, and the internal density is C, then the quality level is D"; The fuzzy reasoning method is used to calculate the fuzzy set of the output variable quality level based on the membership degree of each input parameter and the fuzzy rules; The output fuzzy set is converted into an accurate comprehensive quality score by using a defuzzification method, and the comprehensive quality score is compared with a preset grade classification threshold to determine the quality grade of the magnesium ingot.
[0014] Compared with the prior art, this application has the following beneficial effects: The present invention constructs a multimodal voxel model that integrates geometric, color, and temperature information, and uses a neural network that integrates three-dimensional convolution and Transformer for analysis. The present invention can break through the limitations of two-dimensional detection, accurately locate, classify, and quantify defects in three-dimensional space, and achieve a complete characterization of the surface condition of the magnesium ingot. By introducing a physical information neural network, the surface defects and the measured temperature field are used as physical constraints to solve the internal heat conduction equation, and the equivalent thermal conductivity field that characterizes the density of the internal tissue is inverted. The physical relationship between surface information and internal state is established, providing a direct and quantitative basis for online, low-cost evaluation of internal defects such as looseness and inclusions. In addition, a fuzzy logic reasoning system is used to comprehensively evaluate the three major quality indicators of surface, appearance, and interior, which can be flexibly and finely graded according to the needs of different downstream application scenarios. The evaluation results are closer to the actual production decision-making needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 This is a flow chart of Example 1; Figure 2 A flowchart for processing a three-dimensional voxel model; Figure 3 Flowchart for calculation of equivalent thermal conductivity distribution field; Figure 4 Schematic diagram of the quality grade of output magnesium ingots. DETAILED DESCRIPTION
[0016] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.
[0017] The terms "first", "second" and corresponding terminology numbers in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged under appropriate circumstances. This is merely a way of distinguishing when describing objects with the same properties in the embodiments of the present application. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, so that a process, method, system, product or apparatus that includes a series of units is not necessarily limited to those units, but may include other units that are not explicitly listed or inherent to these processes, methods, products or apparatuses.
[0018] In addition, in the description of this application, unless otherwise specified, "plurality" means two or more. The term "and / or" or the character " / " in this application is merely a description of the association relationship between related objects, indicating that three relationships can exist. For example, A and / or B, or A / B, can mean: A exists alone, A and B exist at the same time, or B exists alone.
[0019] Specific embodiment, this application proposes a quality detection method for magnesium ingot production, such as Figure 1 Shown, including: S1, obtaining visible light images, three-dimensional point cloud data and infrared thermal images of the magnesium ingot to be inspected; At the end of the cooling section of the magnesium ingot production line, data is collected from magnesium ingots that are still warm through an integrated detection station. The station integrates a line laser 3D profiler and a long-wave infrared thermal imager. While scanning the surface of the magnesium ingot, the line laser 3D profiler uses a built-in high-resolution camera to simultaneously acquire a two-dimensional visible light image and generate high-density three-dimensional point cloud data through the principle of laser triangulation. The long-wave infrared thermal imager, with an operating band of 8 to 14 microns, collects the temperature distribution on the surface of the magnesium ingot in a non-contact manner and generates an infrared thermal image. By synchronizing with the encoder signal of the production line conveyor belt, it 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.
[0020] S2, registering and fusing the three-dimensional point cloud data with the visible light image to construct a three-dimensional voxel model representing the surface geometry and color information of the magnesium ingot; processing the three-dimensional voxel model using a hybrid neural network that combines three-dimensional convolution with a Transformer self-attention mechanism to identify and output the type, three-dimensional position, and size information of the surface defects of the magnesium ingot; Using the pre-calibrated extrinsic parameter matrix between the 3D profilometer and the 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. This color-informed point cloud is then 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 value of all points within it, thereby constructing a voxel model representing both geometric and color information. This model is then fed into a hybrid neural network for semantic segmentation. This network uses 3DU-Net as its basic framework, with its encoder consisting of alternating 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. Its self-attention mechanism captures large-scale, cross-regional feature dependencies, enabling comprehensive recognition of long cracks. The decoder portion of the network performs upsampling via transposed convolutions and, combined with skip connections from the encoder, ultimately outputs a segmentation result of the same size as the input voxel model, where each voxel is assigned a class label such as background, crack, or slag hole. By performing 3D connected domain analysis on the segmentation results, the defect type, 3D center of mass coordinates, and size information represented by the number of voxels are determined.
[0021] S3, using the infrared thermal image as the surface temperature boundary condition of the heat conduction model, and using the defect position and size as the thermal conductivity disturbance source inside the model; solving the heat conduction model through a physical information neural network to obtain an equivalent thermal conductivity distribution field inside the magnesium ingot; and calculating an index representing the internal density based on the spatial inhomogeneity of the equivalent thermal conductivity distribution field; A physical information neural network is used to solve the steady-state partial differential equation for heat conduction within a magnesium ingot. The governing form of this equation is the Laplace equation, which states that the divergence of the product of the thermal conductivity field and the temperature field gradient is zero. The acquired infrared thermal image is mapped onto the surface of a three-dimensional model of the magnesium ingot after coordinate transformation, serving as the Dirichlet boundary condition for the partial differential equation. Identified defects, such as slag holes or inclusions, are assigned low thermal conductivity regions at their corresponding three-dimensional locations, while intact regions are assigned the normal thermal conductivity of magnesium metal. This information together constitutes the thermal conductivity perturbation source. The physical information neural network consists of two parallel multilayer perceptrons: one network inputs three-dimensional coordinates and outputs temperature, while the other network inputs three-dimensional coordinates and outputs equivalent thermal conductivity. Randomly sampling points within the model, the network output is substituted into the heat conduction equation to calculate the physical residual. The network also calculates the error between the network-predicted surface temperature and the infrared temperature measurement, as well as the difference between the predicted thermal conductivity and the prior information used as the perturbation source. These three factors are weighted to form the network's overall loss function. By minimizing this loss function, the network is trained. After training, the second network can predict the equivalent thermal conductivity of any point inside the magnesium ingot, forming a complete three-dimensional distribution field. The variance of the thermal conductivity values of all voxels in this distribution field is calculated. This variance value serves as an indicator of internal density. A larger variance indicates a more uneven interior and a lower density.
[0022] S4, calculate the surface defect severity parameters based on the defect information, and calculate the shape contour conformity parameters by comparing the three-dimensional point cloud data with the standard digital model; input the surface defect severity parameters, shape contour conformity parameters and the internal density index into the fuzzy logic reasoning system, perform reasoning based on the preset fuzzy rule library that matches the downstream application process of the magnesium ingot, and output the quality grade of the magnesium ingot.
[0023] The surface defect severity parameter is calculated by assigning different weights to different types of defects identified, such as a crack weight of 0.8 and a slag hole weight of 0.3. The volume of each defect is multiplied by its corresponding weight and the sum is calculated. The contour conformity parameter is calculated by aligning the collected three-dimensional point cloud data with the standard CAD digital model through the iterative closest point algorithm ICP, and then calculating the average distance from all point cloud points to the model surface. The smaller the distance, the higher the conformity. The input of the fuzzy logic reasoning system is three indicators: surface defect severity, contour conformity, and internal density, and 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 the downstream application. For example, if it is 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. Based on the Mamdani model, the inference engine activates the corresponding rules according to the membership of the input indicators, aggregates the output results of all activated rules, and finally defuzzifies them through the center of gravity method to obtain a final quality grade judgment result, such as first-class, second-class or unqualified products.
[0024] In an optional embodiment, the hybrid neural network using three-dimensional convolution and Transformer self-attention mechanism is used to process the three-dimensional voxel model, such as Figure 2 Shown, including: S21, discretizing the registered fused three-dimensional point cloud and color information into a three-dimensional voxel grid, and assigning a feature vector containing average color information and occupancy state to each voxel occupied by the magnesium ingot entity; S22, inputting the 3D voxel grid into an encoder composed of multiple layers of 3D convolution, extracting geometric and texture features in the local 3D space in a layer-by-layer downsampling manner, and generating a low-resolution feature map; S23, flattening the low-resolution feature map into a feature sequence, adding three-dimensional position encoding information thereto, and then inputting the feature sequence into a Transformer encoder based on a multi-head self-attention mechanism to capture long-range spatial dependencies between defect features; S24, passing the output of the Transformer encoder to the parallel prediction head to decode and output a prediction set containing multiple defects, where each element in the set contains the category, confidence, and location and size information of the three-dimensional bounding box of the defect.
[0025] Specifically, during execution, a 3D point cloud containing five million points and their 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 the point clouds within it are calculated and concatenated with the occupancy state of 1 to form a four-dimensional feature vector, such as [0.8, 0.8, 0.8, 1]. This voxel grid is then input into an encoder consisting of three layers of 3x3x3 3D convolutions. Each convolution layer is followed by a pooling layer with a stride of 2, ultimately downsampling the 256x256x128 input to a low-resolution 32x32x16 feature map that contains rich local geometric and color features.
[0026] This 32x32x16 feature map is flattened into a sequence of 16,384 feature vectors. Before being fed into the Transformer encoder, each feature vector is encoded with its absolute position in three-dimensional space. A Transformer architecture with six layers of multi-head self-attention modules processes this sequence. For example, if a 20-centimeter-long crack appears on the surface of a magnesium ingot, its features are distributed across multiple locations in the sequence. The self-attention mechanism can calculate the intrinsic correlations between these distant features, thereby fully understanding the entire defect morphology. Ultimately, the model's prediction head outputs a defect set, for example, consisting of element 1: {category: crack, confidence: 0.96, center coordinates: (100, 50, 20), size: (200, 5, 10) mm}, and element 2: {category: slag hole, confidence: 0.91, center coordinates: (150, 180, 15), size: (8, 8, 8) mm}.
[0027] In an optional embodiment, the heat conduction model is solved by a physical information neural network to obtain the equivalent thermal conductivity distribution field inside the magnesium ingot, such as Figure 3 Shown, including: S31, construct a multi-layer perceptron as a physical information neural network that takes three-dimensional spatial coordinates (x, y, z) as input and can output the temperature prediction value and equivalent thermal conductivity prediction value of the coordinate point in parallel; S32, defined by the residual loss of the physical equation , boundary condition loss and defect prior loss The network training is performed using a composite loss function composed of weighted summation; Calculate the residuals of the steady-state heat conduction equation at multiple sampling points inside the magnesium ingot by automatic differentiation; is the deviation between the temperature prediction value and the measured value of the infrared thermal imaging image at multiple sampling points on the surface of the magnesium ingot; The deviation between the predicted thermal conductivity value and a preset target defect thermal conductivity value that is lower than the standard magnesium thermal conductivity within the identified defect area; S33, minimizing the composite loss function by back propagation until the network converges, thereby solving the equivalent thermal conductivity distribution field of the entire domain.
[0028] Specifically, a multilayer perceptron consisting of eight fully connected layers is constructed, each layer contains 256 neurons and uses the SiLU activation function. The network receives a three-dimensional coordinate (x, y, z) as input and has two output heads, which predict the temperature T and equivalent thermal conductivity k of the point respectively. During training, the weights of the composite loss function are set to This weight configuration indicates that accurately matching the surface temperature boundary conditions is the top priority.
[0029] In each training iteration, 10,000 points are randomly sampled inside the magnesium ingot, and 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 At the same time, 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 to obtain For the 8x8x8 mm slag hole defect detected in the previous step, one hundred points are sampled in the area, and the mean square error between the network-predicted thermal conductivity k and a preset defect target value, such as 15 watts per meter Kelvin, is calculated to obtain By minimizing the total loss function with the Adam optimizer, the network eventually converges, and its thermal conductivity output constitutes an accurate three-dimensional representation of the equivalent thermal conductivity k(x,y,z) inside the entire magnesium ingot.
[0030] In an optional embodiment, the index characterizing the internal density is calculated based on the spatial inhomogeneity of the equivalent thermal conductivity distribution field, including: 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 to form a thermal conductivity sample set; Calculating the statistical standard deviation of the sample set as a quantitative indicator for measuring the uniformity of thermal conductivity distribution; The standard deviation is mapped to a scalar value between 0 and 1 through a monotonically decreasing function to obtain an internal density index.
[0031] Specifically, within the solved k(x,y,z) three-dimensional thermal conductivity distribution field, a uniform three-dimensional grid is constructed at 1 mm intervals, and sampling is performed 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 with excellent internal quality, the thermal conductivity values of the vast majority of its sample points are concentrated around the standard magnesium value of 156 watts per meter Kelvin, with only minor fluctuations.
[0032] Next, calculate the statistical standard deviation of this million-level sample set For the above-mentioned high-quality magnesium ingots, For a magnesium ingot with tiny loose particles and impurities inside, its thermal conductivity distribution will have more low value areas, and the calculated In one embodiment, a negative exponential function is used. For high-quality magnesium ingots, the internal density index is calculated to be 0.70. For low-quality magnesium ingots, the index is 0.08. This index value intuitively and quantitatively reflects the uniformity and density of the internal material.
[0033] In an optional embodiment, the surface defect severity parameter, the contour conformity parameter and the internal density index are input into a fuzzy logic reasoning system, and reasoning is performed based on a preset fuzzy rule library that matches the downstream application process of the magnesium ingot to output the quality grade of the magnesium ingot, such as Figure 4 Shown, including: S41, normalizing the three input parameters of surface defect severity, contour conformity, and internal density, defining multiple linguistic fuzzy sets for each parameter, and configuring corresponding membership functions; S42, establish a fuzzy rule base covering the main input combinations, the rule form of which is: "If the surface defect severity is A, the shape contour conformity is B, and the internal density is C, then the quality level is D"; S43, using a fuzzy reasoning method, calculating the fuzzy set of the quality level of the output variable according to the membership degree of each input parameter and the fuzzy rules; S44, using a defuzzification method to convert the output fuzzy set into an accurate comprehensive quality score, and compare the comprehensive quality score with a preset grade classification threshold to determine the quality grade of the magnesium ingot.
[0034] Specifically, suppose a magnesium ingot, after calculation and normalization, has three input parameters: surface defect severity of 0.8, contour conformance of 0.9, and internal density of 0.7. For the internal density of 0.7, using the preset Gaussian membership function, its membership in the three fuzzy sets {poor, fair, good} is calculated to be 0.1, 0.9, and 0.2, respectively. The same fuzzification operation is performed on the other two inputs.
[0035] Activate a rule in the fuzzy rule base: If the surface defect severity is high, the contour conformity is excellent, and the internal density is medium, then the quality grade is Grade II. Assuming that the membership of the three inputs to the premise of this rule is 0.7, 0.8, and 0.9 respectively, the trigger strength of this rule is the minimum of the three, that is, 0.7. This strength value is used to reduce the shape of the fuzzy set of Grade II in the conclusion part. After all relevant rules are calculated, all activated output fuzzy sets are aggregated into a total output fuzzy shape. Finally, the centroid method is used to calculate the horizontal coordinate of the center of mass of the shape to obtain an accurate quality score, for example, 82.5. According to the 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 judged to be Grade II.
[0036] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some feature data can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0037] The units described as separate components may or may not be physically separate, and 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 these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0038] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0039] If the integrated unit is implemented in the form of 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 the present application is essentially 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, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
Claims
1. A quality inspection method for magnesium ingot production, characterized in that: include: S1, obtaining visible light images, three-dimensional point cloud data and infrared thermal images of the magnesium ingot to be inspected; S2, registering and fusing the three-dimensional point cloud data with the visible light image to construct a three-dimensional voxel model representing the surface geometry and color information of the magnesium ingot; processing the three-dimensional voxel model using a hybrid neural network that combines three-dimensional convolution with a Transformer self-attention mechanism to identify and output the type, three-dimensional position, and size information of the surface defects of the magnesium ingot; S3, using the infrared thermal image as the surface temperature boundary condition of the heat conduction model, and using the defect position and size as the thermal conductivity disturbance source inside the model; solving the heat conduction model through a physical information neural network to obtain an equivalent thermal conductivity distribution field inside the magnesium ingot; and calculating an index representing the internal density based on the spatial inhomogeneity of the equivalent thermal conductivity distribution field; S4, calculate the surface defect severity parameters based on the defect information, and calculate the shape contour conformity parameters by comparing the three-dimensional point cloud data with the standard digital model; input the surface defect severity parameters, shape contour conformity parameters and the internal density index into the fuzzy logic reasoning system, perform reasoning based on the preset fuzzy rule library that matches the downstream application process of the magnesium ingot, and output the quality grade of the magnesium ingot.
2. The method according to claim 1, characterized in that The hybrid neural network using a combination of three-dimensional convolution and Transformer self-attention mechanism to process the three-dimensional voxel model includes: S21, discretizing the registered fused three-dimensional point cloud and color information into a three-dimensional voxel grid, and assigning a feature vector containing average color information and occupancy state to each voxel occupied by the magnesium ingot entity; S22, inputting the 3D voxel grid into an encoder composed of multiple layers of 3D convolution, extracting geometric and texture features in the local 3D space in a layer-by-layer downsampling manner, and generating a low-resolution feature map; S23, flattening the low-resolution feature map into a feature sequence, adding three-dimensional position encoding information thereto, and then inputting the feature sequence into a Transformer encoder based on a multi-head self-attention mechanism to capture long-range spatial dependencies between defect features; S24, passing the output of the Transformer encoder to the parallel prediction head to decode and output a prediction set containing multiple defects, where each element in the set contains the category, confidence, and location and size information of the three-dimensional bounding box of the defect.
3. The method according to claim 1, characterized in that Solving the heat conduction model through a physical information neural network to obtain an equivalent thermal conductivity distribution field inside the magnesium ingot includes: S31, construct a multi-layer perceptron as a physical information neural network that takes three-dimensional spatial coordinates (x, y, z) as input and can output the temperature prediction value and equivalent thermal conductivity prediction value of the coordinate point in parallel; S32, defined by the residual loss of the physical equation , boundary condition loss and defect prior loss The network training is performed using a composite loss function composed of weighted summation; Calculate the residuals of the steady-state heat conduction equation at multiple sampling points inside the magnesium ingot by automatic differentiation; is the deviation between the temperature prediction value and the measured value of the infrared thermal imaging image at multiple sampling points on the surface of the magnesium ingot; The deviation between the predicted thermal conductivity value and a preset target defect thermal conductivity value that is lower than the standard magnesium thermal conductivity within the identified defect area; S33, minimizing the composite loss function by back propagation until the network converges, thereby solving the equivalent thermal conductivity distribution field of the entire domain.
4. The method according to claim 1, wherein The index characterizing the internal density is calculated based on the spatial inhomogeneity of the equivalent thermal conductivity distribution field, including: 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 to form a thermal conductivity sample set; Calculating the statistical standard deviation of the sample set as a quantitative indicator for measuring the uniformity of thermal conductivity distribution; The standard deviation is mapped to a scalar value between 0 and 1 through a monotonically decreasing function to obtain an internal density index.
5. The method according to claim 1, wherein The surface defect severity parameter, the contour conformity parameter, and the internal density index are input into a fuzzy logic reasoning system, and reasoning is performed based on a preset fuzzy rule library that matches the downstream application process of the magnesium ingot to output the quality grade of the magnesium ingot, including: S41, normalizing the three input parameters of surface defect severity, contour conformity, and internal density, defining multiple linguistic fuzzy sets for each parameter, and configuring corresponding membership functions; S42, establish a fuzzy rule base covering the main input combinations, the rule form of which is: "If the surface defect severity is A, the shape contour conformity is B, and the internal density is C, then the quality level is D"; S43, using a fuzzy reasoning method, calculating the fuzzy set of the quality level of the output variable according to the membership degree of each input parameter and the fuzzy rules; S44, using a defuzzification method to convert the output fuzzy set into an accurate comprehensive quality score, and compare the comprehensive quality score 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: An acquisition unit, used to acquire visible light images, three-dimensional point cloud data, and infrared thermal images of the magnesium ingot to be tested; An initial recognition 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 that represents the surface geometry and color information of the magnesium ingot; a hybrid neural network that combines three-dimensional convolution with the Transformer self-attention mechanism is used to process the three-dimensional voxel model to identify and output the type, three-dimensional position and size information of the surface defects of the magnesium ingot; an index calculation unit, configured to use the infrared thermal image as a surface temperature boundary condition of a heat conduction model and the defect location and size as a thermal conductivity disturbance source within the model; solve the heat conduction model using a physical information neural network to obtain an equivalent thermal conductivity distribution field within the magnesium ingot; and calculate an index characterizing the internal density based on the spatial inhomogeneity 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, and calculate the shape contour conformity parameter by comparing the three-dimensional point cloud data with the standard digital model; the surface defect severity parameter, the shape contour conformity parameter and the internal density index are input into the fuzzy logic reasoning system, and reasoning is performed according to a preset fuzzy rule library that matches the downstream application process of the magnesium ingot, and the quality grade of the magnesium ingot is output.
7. The system according to claim 6, characterized in that The hybrid neural network using a combination of three-dimensional convolution and Transformer self-attention mechanism to process the three-dimensional voxel model includes: The registered fused 3D point cloud and color information are discretized into a 3D voxel grid, and each voxel occupied by the magnesium ingot entity is assigned a feature vector containing the average color information and occupancy state; Inputting the 3D voxel grid into an encoder composed of multiple layers of 3D convolution, extracting geometric and texture features in the local 3D space in a layer-by-layer downsampling manner to generate a low-resolution feature map; Flattening the low-resolution feature map into a feature sequence and adding three-dimensional position encoding information to it, then inputting the feature sequence into a Transformer encoder based on a multi-head self-attention mechanism to capture the long-range 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 category, confidence, and location and size information of the 3D bounding box of the defect.
8. The system according to claim 6, wherein: Solving the heat conduction model through a physical information neural network to obtain an equivalent thermal conductivity distribution field inside the magnesium ingot includes: Construct a multi-layer perceptron as a physical information neural network that takes three-dimensional spatial coordinates (x, y, z) as input and can output the temperature prediction value and equivalent thermal conductivity prediction value of the coordinate point in parallel; Define the residual loss by the physical equation , boundary condition loss and defect prior loss The network training is performed using a composite loss function composed of weighted summation; Calculate the residuals of the steady-state heat conduction equation at multiple sampling points inside the magnesium ingot by automatic differentiation; is the deviation between the temperature prediction value and the measured value of the infrared thermal imaging image at multiple sampling points on the surface of the magnesium ingot; The deviation between the predicted thermal conductivity value and a preset target defect thermal conductivity value that is lower than the standard magnesium thermal conductivity within the identified defect area; The composite loss function is minimized by back propagation until the network converges, thereby solving the equivalent thermal conductivity distribution field of the entire domain.
9. The system according to claim 6, wherein: The index characterizing the internal density is calculated based on the spatial inhomogeneity of the equivalent thermal conductivity distribution field, including: 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 to form a thermal conductivity sample set; Calculating the statistical standard deviation of the sample set as a quantitative indicator for measuring the uniformity of thermal conductivity distribution; The standard deviation is mapped to a scalar value between 0 and 1 through a monotonically decreasing function to obtain an internal density index.
10. The system according to claim 6, wherein: The surface defect severity parameter, the contour conformity parameter, and the internal density index are input into a fuzzy logic reasoning system, and reasoning is performed based on a preset fuzzy rule library that matches the downstream application process of the magnesium ingot to output the quality grade of the magnesium ingot, including: The three input parameters of surface defect severity, contour conformity, and internal density are normalized, and multiple linguistic fuzzy sets are defined for each parameter, and corresponding membership functions are configured; Establish a fuzzy rule base covering the main input combinations, whose rule form is: "If the surface defect severity is A, the shape contour conformity is B, and the internal density is C, then the quality level is D"; The fuzzy reasoning method is used to calculate the fuzzy set of the output variable quality level based on the membership degree of each input parameter and the fuzzy rules; The output fuzzy set is converted into an accurate comprehensive quality score by using a defuzzification method, 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
Cited By
Method and system for evaluating internal inclusion level of primary magnesium ingot
CN121933581A