Casting internal shrinkage cavity fault prediction method based on casting head accompanying texture feature mapping

By preprocessing and feature extraction of the fracture surface image of the casting gating and riser, and combining multifractal ridge spectrum and Riemann manifold tangent space mapping, an adjoint mapping prediction network is constructed. This solves the blind zone and complex environmental interference problems in the detection of shrinkage cavities inside castings, and realizes high-precision prediction and visualization of internal state.

CN122073030APending Publication Date: 2026-05-22CRRC DALIAN INST CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CRRC DALIAN INST CO LTD
Filing Date
2026-01-30
Publication Date
2026-05-22

AI Technical Summary

Technical Problem

Existing methods for detecting shrinkage cavities inside castings have limitations such as blind spots, poor anti-interference capabilities, and Euclidean space modeling. They are difficult to accurately map the internal state through surface images, and existing deep learning methods have poor robustness under complex lighting conditions.

Method used

We employ a preprocessing model based on the fracture surface image of the riser and gating system, a heterogeneous feature parallel extraction model, and an adjoint mapping prediction network. By using multifractal ridge spectrum and Riemannian manifold tangent space feature mapping, we capture the physical and geometric features of the fracture surface and construct an adjoint mapping prediction network to predict internal shrinkage cavities.

Benefits of technology

It enables low-cost, high-reliability online non-destructive testing without the need for X-ray equipment, significantly improving the accuracy of feature extraction and internal hole prediction in complex environments, and providing an intuitive visual traceability mechanism.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122073030A_ABST
    Figure CN122073030A_ABST
Patent Text Reader

Abstract

The invention provides a casting internal shrinkage cavity fault prediction method based on casting head accompanying texture feature mapping. Firstly, a casting head fracture image of a casting is collected and preprocessed through an industrial camera, and a texture effective area graph is obtained; thirdly, feature extraction is carried out through a heterogeneous feature parallel extraction model, and the model comprises a fracture texture physical chaos degree feature extraction module which is responsible for extracting physical features; the Riemannian manifold tangent space-based feature mapping module is responsible for extracting geometric features; and the feature fusion module is used for fusing the physical and geometric features into mixed accompanying texture features. Then, constructing an adjoint mapping prediction network, training the adjoint mapping prediction network by mixing adjoint texture features until a total loss function is converged, and obtaining a trained network; and finally, predicting a shrinkage cavity fault in the casting by using the network, outputting a prediction result and a volume, and generating an accompanying texture thermodynamic diagram for visualization. According to the method, the interference of reflection and shadow on the metal surface is effectively overcome, and the signal-to-noise ratio of feature extraction and the accuracy of complex fracture texture classification are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of intelligent manufacturing, industrial non-destructive testing, and computer vision, and in particular to a method for predicting shrinkage cavities in castings based on the mapping of texture features accompanying the gating system. Background Technology

[0002] Casting is a fundamental process in modern mechanical manufacturing, with sand casting being widely used due to its low cost and high adaptability. In the casting process, the riser / gating system, as the final solidification channel for feeding molten metal, plays a crucial role. If the riser / gating system is poorly designed or the feeding pressure during solidification is insufficient, shrinkage cavities and other density defects can easily form inside the casting. These internal shrinkage cavities are often hidden deep within the casting and cannot be directly observed from the outside, but their presence can severely damage the mechanical properties of the parts, leading to fracture failure and other safety accidents.

[0003] Currently, methods for detecting shrinkage cavities inside castings are mainly divided into two categories: destructive testing and non-destructive testing (NDT). Destructive testing typically uses the slicing method. Although it yields accurate results, it damages the product and is only suitable for process verification stages, making it unsuitable for large-scale online full inspection. Non-destructive testing mainly includes industrial CT (computed tomography) and X-ray flaw detection. While these technologies can visualize the internal structure of castings and directly identify shrinkage cavities, the equipment is expensive, the inspection efficiency is low (long scanning time per piece), and radiation protection issues arise, making it difficult to conduct real-time inspections of every low-cost casting on high-speed production lines.

[0004] In recent years, with the development of machine vision and deep learning technologies, surface image-based defect detection has been widely applied in industrial settings. However, existing visual inspection technologies have the following significant limitations when applied to predicting shrinkage cavities in castings: (1) There is a blind spot in detection: Most existing vision solutions focus on visible defects on the surface of castings (such as porosity, cracks, and sand inclusions), but cannot infer the internal state from the surface information. Although metallurgical theory points out that there is a physical relationship between the micro-texture state of the fracture surface of the gating and riser and the internal feeding effect (that is, insufficient feeding will lead to coarse grains and weak intergranular bonding, presenting a specific loose texture), existing general image processing algorithms are difficult to capture this subtle cross-physical field correlation; (2) Poor anti-interference ability in complex environments: The environment of the foundry workshop is harsh, the lighting conditions vary greatly, and the surface of the metal fracture has strong specular reflection and irregular shadows. Traditional texture analysis methods based on gray-level histograms, LBP (Local Binary Pattern) or GLCM (Gray-Level Co-occurrence Matrix) are easily affected by reflective highlights and oil stains, resulting in distorted feature extraction and a very high false alarm rate; (3) Limitations of Euclidean Space Modeling: Existing deep learning methods (such as standard CNNs) typically map image features to a flat Euclidean space for classification. However, the texture variations of metal fracture surfaces are highly nonlinear and chaotic, and their feature distribution is essentially located on a curved Riemannian manifold space. Simply measuring texture similarity in Euclidean space often fails to distinguish between normal roughness and loose roughness caused by defects, resulting in insufficient prediction accuracy under critical conditions.

[0005] Therefore, there is an urgent need to develop a predictive method that can accurately map the internal shrinkage state without the need for perspective equipment, simply by analyzing the surface image of the riser and gating gate fracture. This method can achieve low-cost and high-reliability online non-destructive testing by mining the deep physical and geometric features associated with the texture. Summary of the Invention

[0006] This invention provides a method for predicting shrinkage cavity faults inside castings based on the feature mapping of texture associated with gating and risers, in order to overcome the technical problems of strong concealment of shrinkage cavity faults inside castings, which are difficult to detect through conventional surface visual inspection, as well as the poor robustness and weak physical interpretability of existing deep learning methods in complex industrial lighting environments.

[0007] To achieve the above objectives, the technical solution of the present invention is as follows: A method for predicting shrinkage cavity faults inside castings based on the mapping of texture features associated with gating and risers, comprising the following steps: S1. Acquire images of the fracture surface of the gating and riser after the casting has been cleaned using an industrial camera, and preprocess the images of the fracture surface of the gating and riser to obtain a texture effective area map; S2. Establish a heterogeneous feature parallel extraction model, extract features from the effective texture region map based on the heterogeneous feature parallel extraction model, and output mixed accompanying texture features; The heterogeneous feature parallel extraction model includes a fracture texture physical chaos degree feature extraction module based on multifractal ridge spectrum, a feature mapping module based on Riemannian manifold tangent space, and a feature fusion module; The physical chaos degree feature extraction module for fracture texture is used to extract physical features from the effective region map of the texture. The feature mapping module based on the Riemannian manifold tangent space is used to obtain geometric features from the effective texture region map; The feature fusion module is used to fuse the physical features and geometric features and output a mixed accompanying texture feature; S3. Construct an adjoint mapping prediction network that maps the reaction mixture adjoint feature vector to the internal constriction state. Train the adjoint mapping prediction network based on the mixture adjoint feature vector. When the set total loss function converges, obtain the trained adjoint mapping prediction network. S4. Based on the trained adjoint mapping prediction network, predict the internal shrinkage cavity fault of the casting and output the fault prediction result and predicted volume. At the same time, generate an adjoint texture heat map and visualize it.

[0008] Furthermore, in S1, the specific steps for preprocessing the fracture surface image of the gating system include: The dimensions of the riser and gating fracture image are normalized to a single-channel grayscale image; A dark channel morphological decoupling algorithm is used to remove metallic highlights from the single-channel grayscale image while preserving the deep topological structure of the fracture surface, including: Define a radius as Circular structural elements A morphological top-hat transform is performed on a single-channel grayscale image, and the calculation formula is as follows: ; in, This is the decoupled texture feature map; This represents the morphological opening operation, which is an operation of erosion followed by dilation. These are pixel coordinates; right Adaptive contrast enhancement includes: Calculate the local gradient magnitude of the decoupled texture feature map; Regions with local gradient magnitudes below a set threshold are defined as smooth regions, and the pixel values ​​of smooth regions are set to 0, resulting in a texture effective region map containing only fracture and tear textures.

[0009] Furthermore, the specific steps for the fracture texture physical chaos feature extraction module to extract physical features from the effective texture region map include: S21. Perform Hessian matrix ridge detection on the effective texture area map to extract the ridge skeleton map of the fracture surface, including; For each pixel in the effective texture region map, calculate its Hessian matrix. Two eigenvalues Assuming ; When satisfied When this happens, the pixel is determined to be a break ridge point; A binary ridge skeleton map is generated based on all fracture ridge points. ; S22. Calculate the multifractal spectrum of the ridge skeleton map to obtain the physical chaos characteristics of the fracture texture, including: S221. Using the box dimension method, boxes of different sizes are used. Overlay the skeleton graph and compute the probability measure. ; Based on probability measure Define partition function The calculation formula is as follows: ; in, As a weighting factor; For scale The number of non-empty boxes; S222. Calculate the generalized fractal dimension using linear regression. The calculation formula is as follows: ; S223, different Generalized fractal dimension under the value One-to-one transformation into multifractal spectrum ,include: Constructing a quality index function The formula is: ; For the quality index function Regarding weighting factors Find the first derivative to obtain the singularity intensity. Calculate the public The formula is: ; Using Legendre transformation formula, different Generalized fractal dimension under the value from Domain mapping to domain, Obtain the multifractal spectrum The calculation formula is: ; Each Sequences are mapped one-to-one to corresponding Values, thus constituting physical characteristics .

[0010] Furthermore, the specific steps of the feature mapping module based on the Riemannian manifold tangent space to obtain geometric features based on the effective texture region map include: S201. Obtain a dense feature map of the entire image by performing multi-channel convolution operation on the effective texture region map and stacking the channels. The specific calculation process is as follows: Effective region map of texture Perform feature component operations separately to generate five feature components, including: Take directly The pixel grayscale value is used as the first feature component, that is, the grayscale value: ; Using a horizontal first-order derivative convolution kernel right Convolution is performed to obtain the second feature component, which is the first-order horizontal gradient: ; Using a first-order derivative convolution kernel in the vertical direction right Convolution is performed to obtain the third feature component, which is the vertical first-order gradient: ; Using a horizontal second-order derivative convolution kernel right Convolution is performed to obtain the fourth feature component, which is the horizontal second gradient: ; Using a vertical second-order derivative convolution kernel right Convolution is performed to obtain the fifth feature component, which is the vertical second gradient: ; The five feature components calculated above are processed along the channel dimension. By stitching the images together, a dense feature map of the entire image is obtained. ; S202, Calculate the dense feature map of the entire image. covariance matrix The calculation formula is: ; in, Total number of pixels; () represents the dense feature map of the entire image. The feature vector of each pixel and its neighborhood; S203. Using the logarithmic Euclidean metric, points on the manifold... Mapping to the Euclidean space, thus affecting the covariance matrix The eigenvalue decomposition formula is as follows: ; S204. Calculate the logarithm of the matrix to obtain the tangent space characteristic tensor. : ; in, The eigenvector matrix; For eigenvalues; This represents the diagonal matrix construction operation; S205, Extraction The upper triangular elements are serialized into a vector. , will vector As a geometric feature.

[0011] Furthermore, the accompanying mapping prediction network includes: a first fully connected layer, a second fully connected layer, a third fully connected layer, and an output layer; The first fully connected layer is used to extract a first feature from the hybrid adjoint feature vector that can reflect the adjoint relationship between texture and defects; The second fully connected layer is used to perform feature filtering on the first feature and output the second feature; The third fully connected layer is used to further filter the second feature and output the third feature; The output layer includes a classification branch and a regression branch, wherein: The classification branch Used to output a value between 0 and 1 representing internal memory based on the third feature. The confidence probability value of the shrinkage cavity; The regression branch This is used to output a scalar representing the predicted equivalent volume of the internal cavity based on the third feature.

[0012] Furthermore, the total loss function is composed of classification cross-entropy loss. Manifold distance constraint loss It consists of three parts: regression loss, regression loss, and regression loss, expressed as: ; in, For classification cross-entropy loss; Loss is due to manifold distance constraints; For regression loss; The actual cavity volume label for the sample; The predicted volume value output by the network regression branch; Classification cross-entropy loss function The formula is as follows: ; in, The true binary label for the sample is 1, which represents the presence of pinholes, and 0 represents the absence of pinholes. The predicted probability value output by the network classification branch; Natural logarithm function; Manifold distance constraint loss function The formula is as follows: ; in, is the geodesic distance on the Riemannian manifold; The tangent space features of the current sample; To find the centroids of similar samples in the training set within the manifold space; The centroid of the outlier sample; This is a preset boundary threshold.

[0013] Furthermore, in S4, the specific steps for generating the accompanying texture heatmap include: Utilizing the full-image dense feature map Combined with the weight vector of the first fully connected layer The contribution of each pixel location to the fault feature is calculated using the following formula: ; in, coordinates First The values ​​of each feature component; The components corresponding to the weights; Will The image is normalized and mapped to a pseudo-color heatmap, which is then overlaid on the original riser fracture image to obtain an accompanying texture heatmap.

[0014] Beneficial Effects: This invention preprocesses the fracture surface image of the gating system to obtain a texture effective region map. The physical and geometric features of the fracture surface in the texture effective region map are captured by the fracture texture physical chaos feature extraction module and the Riemannian manifold tangent space-based feature mapping module in the constructed heterogeneous feature parallel extraction model, respectively. These features are then fused to obtain mixed accompanying texture features. An accompanying mapping prediction network is constructed to perform accompanying mapping inference on the mixed accompanying texture features, thereby outputting the fault prediction result and predicted volume of the internal shrinkage cavity. This invention effectively solves the interference problem caused by reflections and shadows on metal surfaces in industrial settings, significantly improves the signal-to-noise ratio of feature extraction, and greatly enhances the accuracy of complex fracture texture classification. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0016] Figure 1 This is a flowchart of a method for predicting shrinkage cavity faults inside castings based on the mapping of texture features associated with gating and risers, as described in this invention. Figure 2 This is a flowchart illustrating the three-stage processing in an embodiment of the present invention. Figure 3 This is a schematic diagram of the feature mapping principle of the feature mapping module based on the Riemannian manifold tangent space in an embodiment of the present invention; Figure 4 This is a flowchart of real-time prediction and visualization in an embodiment of the present invention. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0018] This embodiment provides a method for predicting shrinkage cavity faults inside castings based on the mapping of texture features accompanying the gating system. Figure 1 and Figure 2 As shown, the specific steps include: S1. Acquire images of the fracture surface of the gating and riser after the casting has been cleaned using an industrial camera. The cross-section image of the riser and gating system Preprocessing is performed to obtain a texture effective area map; In a specific embodiment, in S1, the cross-section image of the gating system is... The specific steps for preprocessing include: The dimensions of the fracture surface image of the gating gate are normalized. Single-channel grayscale image of a pixel ; The single-channel grayscale image is removed using a dark channel morphological decoupling algorithm. The metallic highlights in the fracture surface are preserved while retaining the deep topological structure of the fracture surface, including: Define a radius as Circular structural elements For single-channel grayscale images A morphological top-hat transformation is performed to extract and remove single-channel grayscale images. The high-frequency texture components with abrupt changes in brightness are calculated using the following formula, while suppressing low-frequency lighting background: ; in, This is the decoupled texture feature map; This represents the morphological opening operation, which is an operation of erosion followed by dilation. These are pixel coordinates; right Adaptive contrast enhancement includes: Calculate the local gradient magnitude of the decoupled texture feature map; Local gradient magnitude is below a set threshold The region is defined as a smooth region, and the pixel values ​​of the smooth region are set to 0, resulting in a texture effective region map containing only the tear and break textures. The effective texture area map eliminates background interference. Specifically, .

[0019] Specifically, this embodiment can eliminate the interference of complex lighting conditions in industrial settings and reflections from metal surfaces on texture extraction through preprocessing.

[0020] Specifically, this embodiment is based on computer vision and differential manifold geometry theory, runs on Ubuntu 20.04 operating system, uses PyTorch 1.12 deep learning framework, and is configured with a single NVIDIA RTX 3090 graphics card with 24GB of video memory. The image acquisition device is an industrial area scan camera with a resolution of 2448×2048.

[0021] S2. Establish a heterogeneous feature parallel extraction model, extract features from the effective texture region map based on the heterogeneous feature parallel extraction model, and output mixed accompanying texture features; The heterogeneous feature parallel extraction model includes a fracture texture physical chaos degree feature extraction module based on multifractal ridge spectrum, a feature mapping module based on Riemannian manifold tangent space, and a feature fusion module; The physical chaos degree feature extraction module for fracture texture is used to extract physical features from the effective region map of the texture. The feature mapping module based on the Riemannian manifold tangent space is used to obtain geometric features based on the effective texture region map; The feature fusion module is used to fuse the physical features and geometric features and output a mixed accompanying texture feature; Specifically, this embodiment utilizes multifractal ridge line spectrum and Riemannian manifold tangent space feature mapping to establish a strong correlation between the micro-texture of the riser fracture surface and the internal shrinkage state, which can achieve high-precision and interpretable fault prediction.

[0022] In a specific embodiment, the steps for the fracture texture physical chaos feature extraction module to extract physical features from the effective texture region map include: S21. Map of effective texture area Hessian matrix ridge detection is performed to extract the ridge skeleton map of the fracture surface, including; For each pixel in the effective texture region map, calculate its Hessian matrix. Two eigenvalues Assuming ; When satisfied When this happens, the pixel is determined to be a break ridge point; A binary ridge skeleton map is generated based on all fracture ridge points. ; S22. Calculate the multifractal spectrum of the ridge skeleton map to obtain the physical chaos characteristics of the fracture texture, including: S221. Using the box dimension method, boxes of different sizes are used. Overlay the skeleton graph and compute probability measures. ; Based on probability measure Define partition function The calculation formula is as follows: ; in, As a weighting factor, its value range is set to... The step size is 0.5; For scale The number of non-empty boxes; S222. Calculate the generalized fractal dimension using linear regression. The calculation formula is as follows: ; S223, different Generalized fractal dimension under the value One-to-one transformation into multifractal spectrum ,include: Constructing a quality index function The formula is: ; For the quality index function Regarding weighting factors Find the first derivative to obtain the singularity intensity. Calculate the public The formula is: ; Specifically, in discrete data processing, this embodiment uses the finite difference method to approximate the solution of the derivative.

[0023] Using the Legendre transformation formula, different Generalized fractal dimension under the value from Domain mapping to domain, Obtain the multifractal spectrum The calculation formula is: ; Specifically, the settings in S22 are implemented through S24. Range of values With a step size of 0.5, there are a total of 21 points. Sequences are mapped one-to-one to corresponding The values ​​thus constitute a physical feature of length 21. This vector describes the distribution pattern of fracture texture from sparse to dense, and is directly related to the feeding state inside the casting.

[0024] In a specific embodiment, such as Figure 3 As shown, the specific steps of the feature mapping module based on the Riemannian manifold tangent space to obtain geometric features based on the effective texture region map include: S201, By analyzing the effective texture area map Perform multi-channel convolution operations and stack the channels to obtain a dense feature map of the entire image. The specific calculation process is as follows: Effective region map of texture Perform feature component operations separately to generate five sizes. The characteristic components include: Take directly The pixel grayscale value is used as the first feature component, that is, the grayscale value: ; Use horizontal direction First derivative convolution kernel right Convolution is performed to obtain the second feature component, which is the first-order horizontal gradient: ; Specifically, in this embodiment, the size used to calculate the gradient is defined as follows: The convolution kernel, in order to... To obtain a more robust gradient estimate within a neighborhood window, it is typically adopted... The Sobel operator or Gaussian differential operator; Use vertical direction First derivative convolution kernel right Convolution is performed to obtain the third feature component, which is the vertical first-order gradient: ; Use horizontal direction Second derivative convolution kernel right Convolution is performed to obtain the fourth feature component, which is the horizontal second gradient: ; Use vertical direction Second derivative convolution kernel right Convolution is performed to obtain the fifth feature component, which is the vertical second gradient: ; The five feature components calculated above are processed along the channel dimension. By splicing, we obtain the dimension as Full-map dense feature map ; S202, Calculate the dense feature map of the entire image. covariance matrix The calculation formula is: ; in, The total number of pixels, and the covariance matrix. It is The symmetric positive definite matrix lies geometrically in the Riemannian manifold space. superior; () represents the dense feature map of the entire image. The feature vector of each pixel and its neighborhood; S203. In order to process manifold data using neural networks, the logarithmic Euclidean metric is used to represent the points on the manifold. Mapping to the Euclidean space, thus affecting the covariance matrix The eigenvalue decomposition formula is as follows: ; S204. Calculate the logarithm of the matrix to obtain the tangent space characteristic tensor. : ; in, The eigenvector matrix; For eigenvalues; This represents the diagonal matrix construction operation; S205, Extraction The upper triangular elements are serialized into a vector. , will vector As a geometric feature.

[0025] In a specific embodiment, the feature fusion module fuses the physical features and geometric features and outputs a mixed accompanying texture feature, including: Geometric features With physical eigenvectors The concatenated features are concatenated to generate a 36-dimensional hybrid adjoint feature vector. The calculation formula is as follows: ; in, This represents a vector concatenation operation; This represents the vectorization operation of the upper triangular matrix; For 21 dimensional vector; The number of independent elements in a 15-dimensional vector and a 5×5 symmetric matrix; Specifically, the feature mapping module based on the Riemannian manifold tangent space can solve the problem of nonlinear mapping between fracture texture and internal defects.

[0026] S3. Constructing the adjoint eigenvector of reaction mixtures The accompanying mapping prediction network for the mapping relationship to the internal constriction state is trained based on the hybrid accompanying feature vector. When the set total loss function converges, the trained accompanying mapping prediction network is obtained. S4. Based on the trained adjoint mapping prediction network, predict the internal shrinkage cavity fault of the casting and output the fault prediction result and predicted volume. At the same time, generate an adjoint texture heat map and visualize it.

[0027] In a specific embodiment, the adjoint mapping prediction network includes: a first fully connected layer, a second fully connected layer, a third fully connected layer, and an output layer; The first fully connected layer is used to extract a first feature from the hybrid adjoint feature vector that can reflect the adjoint relationship between texture and defects; The second fully connected layer is used to perform feature filtering on the first feature and output the second feature; The third fully connected layer is used to further filter the second feature and output the third feature; The output layer includes a classification branch and a regression branch, wherein: The classification branch This is used to output a confidence probability value between 0 and 1, representing the presence of a concave cavity, based on the third feature. The regression branch This is used to output a scalar representing the predicted equivalent volume of the internal cavity based on the third feature.

[0028] Specifically, the number of nodes in the first fully connected layer, the second fully connected layer, and the third fully connected layer are 128, 64, and 32, respectively, and each fully connected layer is followed by a Leaky ReLU activation function.

[0029] In a specific embodiment, in order for the adjoint mapping prediction network to learn the adjoint relationship between "texture and defect", an adjoint consistency loss function is designed. The loss function consists of classification cross-entropy loss. Manifold distance constraint loss It consists of three parts: regression loss, regression loss, and regression loss. First, calculate the classification cross-entropy loss function. The formula used to measure the accuracy of cavity detection is as follows: ; in, The true binary label for the sample is 1, which represents the presence of pinholes, and 0 represents the absence of pinholes. The predicted probability value output by the network classification branch; Natural logarithm function; Secondly, calculate the manifold distance constraint loss function. The topological structure used to constrain the feature space is given by the following formula: ; in, is the geodesic distance on the Riemannian manifold; The tangent space features of the current sample; To train the centroids of similar samples (e.g., all of them are pinhole components) in the manifold space; The centroid of the out-of-class sample; The preset boundary threshold is set to 1.0; Specifically, the manifold distance constraint loss function aims to bring similar texture features closer together in the manifold space and push dissimilar texture features further apart.

[0030] Finally, calculate the total loss function. The formula is as follows: ; in, The classification cross-entropy loss is calculated above; The manifold distance constraint loss calculated above; For regression loss; The actual cavity volume label for the sample; This refers to the predicted volume value output by the network regression branch; specifically, , , , are hyperparameters that balance the weights of each loss term.

[0031] In a specific embodiment, to visually demonstrate which part of the surface texture leads to the pinhole detection, this embodiment utilizes the Class Activation Mapping (CAM) principle to calculate the texture saliency map. Specifically, in S4, the specific steps for generating the accompanying texture heatmap include: Utilizing the full-image dense feature map Combined with the weight vector of the first fully connected layer The contribution of each pixel location to the fault feature is calculated using the following formula: ; in, coordinates First The values ​​of each feature component; The components corresponding to the weights; Will Normalized and mapped to a pseudo-color heatmap, then overlaid on the original riser fracture image. This allows us to obtain a heatmap of the accompanying texture.

[0032] In this embodiment, the Adam optimizer is used to train the adjoint mapping prediction network based on the total loss function, with a learning rate of 0.001 and a training period of 200 epochs.

[0033] Specifically, in actual industrial scenarios, the complete process of real-time inference, decision-making, and visualization feedback of newly acquired casting images, utilizing the overall model architecture constructed and trained as described above, is as follows: Figure 4 As shown, it is: First, image acquisition and data stream input. An industrial camera captures real-time images of the gating and riser area of ​​the casting to be inspected, obtaining the image under test. In the first stage, a dark channel morphological decoupling algorithm is used to... Perform a morphological top-hat transformation and adaptive contrast enhancement to generate a texture effective region map. ; Secondly, feature extraction and fusion are performed in parallel. Simultaneously distributed to the two branches of the second stage, in the physical feature branch, the physical feature vector is extracted from the effective region map of the texture based on the fracture texture physical chaos degree feature extraction module. In the geometric feature branch, a covariance matrix is ​​constructed based on the feature mapping module of the Riemannian manifold tangent space, and a log-Euclidean mapping is performed to obtain the tangent space eigenvectors. ,extract The upper triangular elements are converted into vectors. ; Then, and By concatenating the features, real-time mixed adjoint features are obtained. ; Next, forward inference is performed using an adjoint mapping prediction network. This involves a 36-dimensional... Input to the adjoint mapping prediction network The data is processed through three fully connected layers, yielding two results at the output layer: classification probability values. (i.e., in S4) ) and predicted volume values (i.e., in S4) ); Next, the fault determination logic is executed. A determination threshold is set. .like If the casting has a shrinkage cavity, the system determines that the casting has a shrinkage cavity and issues a "scrap" command; if If so, the casting is determined to be a qualified product; Finally, a heatmap of accompanying textures is generated for visualization. Specifically, red highlighted areas indicate the location of abnormally loose textures on the fracture surface caused by insufficient feeding, enabling the tracing of the accompanying source of the fault from the surface to the interior. In this embodiment, the "fault-feature" association learned by the accompanying mapping prediction network is back-projected onto the micro-geometry of the fracture surface to visually display the location of the accompanying textures that lead to internal shrinkage cavities, rather than identifying the object outline.

[0034] Experimental verification: To verify the effectiveness and superiority of the casting internal shrinkage cavity fault prediction method based on the texture feature mapping associated with the gating system proposed in this embodiment, a rigorous comparative experiment was conducted on real industrial casting production line data, including: Dataset construction and experimental environment: A total of 2400 images of the gating and riser gates of aluminum alloy castings were collected from an automotive parts casting production line. The internal true state of all samples (whether shrinkage cavities are present and their volume) was calibrated using industrial CT and used as the ground truth. 1680 images (70%) were randomly selected as the training set and 720 images (30%) as the test set. The test set contained 480 qualified products and 240 shrinkage cavity defective products.

[0035] To simulate the instability of industrial environments, 30% of the images in the test set were randomly selected and Gaussian noise was added. ) and brightness fluctuation ( This was done to test the robustness of the algorithm.

[0036] To comprehensively evaluate the performance of this embodiment, three representative comparative models were set up and tested against the model proposed in this embodiment: (1) Comparative Example 1 (Traditional Texture Method): Texture features (energy, entropy, contrast, correlation) are extracted using GLCM (Gray-Level Co-occurrence Matrix) and input into SVM (Support Vector Machine) for binary classification. This method represents a traditional industrial vision solution; (2) Comparative Example 2 (General Deep Learning Method): The standard ResNet-50 convolutional neural network is used. This network processes images directly in Euclidean space and does not introduce the morphological decoupling and manifold mapping mechanisms used in this embodiment. This method represents the current mainstream black-box deep learning scheme; (3) Comparative Example 3 (Ablation Experiment - No Manifold Mapping): The front-end processing (morphological decoupling + multifractal) of this embodiment is adopted, but the Riemann manifold mapping is removed, and the covariance matrix is ​​directly flattened into a vector input fully connected network. This method is used to verify the contribution of the specific technical feature of Riemann manifold tangent space mapping; Set evaluation indicators: (1) Accuracy: The proportion of correctly classified samples out of the total sample; (2) Miss Rate: The proportion of shrinkage defective products that are incorrectly judged as qualified products (the most important indicator in industrial quality inspection, as missing a product means a safety hazard). (3) Volume prediction error (MSE): For the regression branch, calculate the mean square error between the predicted pore volume and the CT measured volume.

[0037] Experimental Results and Analysis: The performance of each model on the test set is shown in the table below:

[0038] Compared to Comparative Example 1, the accuracy of this embodiment is improved by 16.7%. Analysis suggests that traditional GLCM methods rely on pixel statistics and cannot resist the interference of reflections and oil stains on metal surfaces, while the dark channel morphological decoupling in this embodiment effectively removes such background noise.

[0039] Compared to Comparative Example 2, the false negative rate in this embodiment was significantly reduced from 6.5% to 0.8%. Analysis suggests that the general ResNet network focuses on macroscopic contours and easily overlooks the microscopic intergranular tearing features of the fracture surface; while the multifractal ridge spectrum introduced in this embodiment can keenly capture the microscopic chaos changes caused by shrinkage cavities.

[0040] Compared to Comparative Example 3, this embodiment further improves accuracy by introducing Riemannian manifold mapping, and the volume prediction MSE is reduced by 43.7% (from 0.032 to 0.018). This strongly demonstrates that the essential structure of fracture texture data is a non-linear manifold structure, and forcing processing in Euclidean space (Comparative Example 3) will lead to feature distortion; while this embodiment projects features to tangent space through logarithmic Euclidean metric, preserving the geodesic distance structure of the features, thereby achieving higher accuracy in classification and regression.

[0041] In summary, this invention solves the problem of inaccurate and incomplete judgment in complex working conditions by deeply integrating physical features (fractals) and geometric features (manifolds).

[0042] Compared with the prior art, this embodiment has the following advantages: (1) This embodiment proposes an image preprocessing method based on dark channel morphological decoupling, which can effectively separate the illumination background from the physical texture of the fracture, solve the interference problem caused by reflection and shadow on the metal surface in industrial sites, and significantly improve the signal-to-noise ratio of feature extraction; (2) This embodiment innovatively introduces a multifractal ridge spectrum as a physical feature descriptor, and uses the chaotic distribution of fracture ridges to directly correlate with the rheological stress state during metal solidification. Compared with traditional texture features, it more accurately characterizes the weakening of intergranular bonding caused by internal shrinkage cavities. (3) In this embodiment, the Riemann manifold tangent space mapping technique is used to process the texture covariance matrix, which captures the nonlinear gradual change law of features in curved space. The network is forced to learn the topological association of "texture-defect" through the accompanying consistency loss function, which effectively solves the problem of difficult classification of complex fracture textures. (4) This embodiment provides an intuitive visual traceability mechanism. The micro-texture areas that lead to rejection are highlighted by the texture saliency map. This not only provides the fault prediction results, but also points out the specific accompanying texture locations on the fracture surface, which enhances the physical interpretability and user trust of the system.

[0043] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for predicting shrinkage cavity faults inside castings based on the mapping of texture features associated with the gating system and risers, characterized in that, The specific steps include: S1. Acquire images of the fracture surface of the gating and riser after the casting has been cleaned using an industrial camera, and preprocess the images of the fracture surface of the gating and riser to obtain a texture effective area map; S2. Establish a heterogeneous feature parallel extraction model, extract features from the effective texture region map based on the heterogeneous feature parallel extraction model, and output mixed accompanying texture features; The heterogeneous feature parallel extraction model includes a fracture texture physical chaos degree feature extraction module based on multifractal ridge spectrum, a feature mapping module based on Riemannian manifold tangent space, and a feature fusion module; The physical chaos degree feature extraction module for fracture texture is used to extract physical features from the effective region map of the texture. The feature mapping module based on the Riemannian manifold tangent space is used to obtain geometric features from the effective texture region map; The feature fusion module is used to fuse the physical features and geometric features and output a mixed accompanying texture feature; S3. Construct an adjoint mapping prediction network that maps the reaction mixture adjoint feature vector to the internal constriction state. Train the adjoint mapping prediction network based on the mixture adjoint feature vector. When the set total loss function converges, obtain the trained adjoint mapping prediction network. S4. Based on the trained adjoint mapping prediction network, predict the internal shrinkage cavity fault of the casting and output the fault prediction result and predicted volume. At the same time, generate an adjoint texture heat map and visualize it.

2. The method for predicting shrinkage cavity faults inside castings based on the mapping of texture features accompanying the gating system as described in claim 1, characterized in that, In S1, the specific steps for preprocessing the fracture surface image of the riser and grate include: The dimensions of the riser and gating fracture image are normalized to a single-channel grayscale image; A dark channel morphological decoupling algorithm is used to remove metallic highlights from the single-channel grayscale image while preserving the deep topological structure of the fracture surface, including: Define a radius as Circular structural elements A morphological top-hat transform is performed on a single-channel grayscale image, and the calculation formula is as follows: ; in, This is the decoupled texture feature map; This represents the morphological opening operation, which is an operation of erosion followed by dilation. These are pixel coordinates; right Adaptive contrast enhancement includes: Calculate the local gradient magnitude of the decoupled texture feature map; Regions with local gradient magnitudes below a set threshold are defined as smooth regions, and the pixel values ​​of smooth regions are set to 0, resulting in a texture effective region map containing only fracture and tear textures.

3. The method for predicting shrinkage cavity faults inside castings based on the mapping of texture features accompanying the gating system as described in claim 2, characterized in that, The specific steps by which the fracture texture physical chaos degree feature extraction module extracts physical features from the effective texture region map include: S21. Perform Hessian matrix ridge detection on the effective texture area map to extract the ridge skeleton map of the fracture surface, including; For each pixel in the effective texture region map, calculate its Hessian matrix. Two eigenvalues Assuming ; When satisfied When this happens, the pixel is determined to be a break ridge point; A binary ridge skeleton map is generated based on all fracture ridge points. ; S22. Calculate the multifractal spectrum of the ridge skeleton map to obtain the physical chaos characteristics of the fracture texture, including: S221. Using the box dimension method, boxes of different sizes are used. Overlay the skeleton graph and compute the probability measure. ; Based on probability measure Define partition function The calculation formula is as follows: ; in, As a weighting factor; For scale The number of non-empty boxes; S222. Calculate the generalized fractal dimension using linear regression. The calculation formula is as follows: ; S223, different Generalized fractal dimension under the value One-to-one transformation into multifractal spectrum ,include: Constructing a quality index function The formula is: ; For the quality index function Regarding weighting factors Find the first derivative to obtain the singularity intensity. Calculate the public The formula is: ; Using Legendre transformation formula, different Generalized fractal dimension under the value from Domain mapping to domain, Obtain the multifractal spectrum The calculation formula is: ; Each Sequences are mapped one-to-one to corresponding Values, thus constituting physical characteristics .

4. The method for predicting shrinkage cavity faults inside castings based on the mapping of texture features accompanying the gating system as described in claim 3, characterized in that, The specific steps of the feature mapping module based on the Riemannian manifold tangent space to obtain geometric features based on the effective texture region map include: S201. Obtain a dense feature map of the entire image by performing multi-channel convolution operation on the effective texture region map and stacking the channels. The specific calculation process is as follows: Effective region map of texture Perform feature component operations separately to generate five feature components, including: Take directly The pixel grayscale value is used as the first feature component, that is, the grayscale value: ; Using a horizontal first-order derivative convolution kernel right Convolution is performed to obtain the second feature component, which is the first-order horizontal gradient: ; Using a first-order derivative convolution kernel in the vertical direction right Convolution is performed to obtain the third feature component, which is the vertical first-order gradient: ; Using horizontal second-order derivative convolution kernels right Convolution is performed to obtain the fourth feature component, which is the horizontal second gradient: ; Using a vertical second-order derivative convolution kernel right Convolution is performed to obtain the fifth feature component, which is the vertical second gradient: ; The five feature components calculated above are processed along the channel dimension. By stitching the images together, a dense feature map of the entire image is obtained. ; S202, Calculate the dense feature map of the entire image. covariance matrix The calculation formula is: ; in, Total number of pixels; () represents the dense feature map of the entire image. The feature vector of each pixel and its neighborhood; S203. Using the logarithmic Euclidean metric, points on the manifold... Mapping to the Euclidean space, thus affecting the covariance matrix The eigenvalue decomposition formula is as follows: ; S204. Calculate the logarithm of the matrix to obtain the tangent space characteristic tensor. : ; in, The eigenvector matrix; For eigenvalues; This represents the diagonal matrix construction operation; S205, Extraction The upper triangular elements are serialized into a vector. , will vector As a geometric feature.

5. The method for predicting shrinkage cavity faults inside castings based on the mapping of texture features accompanying the gating system as described in claim 4, characterized in that, The adjoint mapping prediction network includes: a first fully connected layer, a second fully connected layer, a third fully connected layer, and an output layer; The first fully connected layer is used to extract a first feature from the hybrid adjoint feature vector that can reflect the adjoint relationship between texture and defects; The second fully connected layer is used to perform feature filtering on the first feature and output the second feature; The third fully connected layer is used to further filter the second feature and output the third feature; The output layer includes a classification branch and a regression branch, wherein: The classification branch Used to output a value between 0 and 1 representing internal memory based on the third feature. The confidence probability value of the shrinkage cavity; The regression branch This is used to output a scalar representing the predicted equivalent volume of the internal cavity based on the third feature.

6. The method for predicting shrinkage cavity faults inside castings based on the texture feature mapping associated with the gating system as described in claim 5, characterized in that, The total loss function is composed of classification cross-entropy loss. Manifold distance constraint loss It consists of three parts: regression loss, regression loss, and regression loss, expressed as: ; in, For classification cross-entropy loss; Loss is due to manifold distance constraints; For regression loss; The actual cavity volume label for the sample; The predicted volume value output by the network regression branch; Classification cross-entropy loss function The formula is as follows: ; in, The true binary label for the sample is 1, which represents the presence of pinholes, and 0 represents the absence of pinholes. The predicted probability value output by the network classification branch; Natural logarithm function; Manifold distance constraint loss function The formula is as follows: ; in, is the geodesic distance on the Riemannian manifold; The tangent space features of the current sample; To find the centroids of similar samples in the training set within the manifold space; The centroid of the out-of-class sample; This is a preset boundary threshold.

7. The method for predicting shrinkage cavity faults inside castings based on the mapping of texture features accompanying the gating system as described in claim 6, characterized in that, In S4, the specific steps for generating the accompanying texture heatmap include: Utilizing the full-image dense feature map Combined with the weight vector of the first fully connected layer The contribution of each pixel location to the fault feature is calculated using the following formula: ; in, coordinates First The values ​​of each feature component; The components corresponding to the weights; Will The image is normalized and mapped to a pseudo-color heatmap, which is then overlaid on the original riser fracture image to obtain an accompanying texture heatmap.