Aluminum alloy die-casting process optimization method and system based on defect identification

By identifying sticking and tearing defects in aluminum alloy die castings using a visual imaging system and a multi-task classification decision network, and by optimizing process parameters using a process knowledge graph, the problem of real-time and accurate detection and quantification of sticking and tearing defects in aluminum alloy die casting production has been solved, thereby improving production stability and product quality.

CN121928010APending Publication Date: 2026-04-28SHANGHAI HONGZHI METAL PROD CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI HONGZHI METAL PROD CO LTD
Filing Date
2026-03-12
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

In current aluminum alloy die casting production, the detection of sticking and tearing defects relies on manual visual inspection or offline equipment, which leads to detection lag and subjectivity, making it difficult to achieve real-time, accurate identification and quantification, thus affecting the pass rate of die-cast products.

Method used

By acquiring video streams of die-cast parts through a visual imaging system, and combining a dual-path video analysis network and a multi-task classification decision network, real-time identification and quantitative calculation of sticking and tearing defects are achieved. Attribution analysis is then performed using a die-casting process knowledge graph to dynamically optimize process parameters.

Benefits of technology

It enables rapid and accurate detection and quantitative assessment of sticking and tearing defects, accurately locates the dominant process parameters that cause defects, reduces the defect incidence rate, and improves production stability and product yield.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121928010A_ABST
    Figure CN121928010A_ABST
Patent Text Reader

Abstract

The invention discloses an aluminum alloy die-casting process optimization method and system based on defect identification, and relates to the technical field of aluminum alloy die-casting processing. The method comprises the steps that after an aluminum alloy die casting is demolded, a die casting video stream is collected through a visual imaging system, and whether the surface of the aluminum alloy die casting has the die sticking strain defect or not is recognized; when it is identified that the mold sticking strain defect exists, quantitative calculation is conducted on the mold sticking strain defect, and a mold sticking strain defect index is obtained; on the basis of the mold sticking strain defect index, attribution analysis is carried out in combination with a pre-constructed die-casting process knowledge graph, and dominant process parameters causing the mold sticking strain defect are determined; and the determined dominant process parameters are dynamically optimized with the purpose of minimizing the mold sticking strain defect index, an optimized dominant process parameter combination is generated, and the optimized dominant process parameter combination is fed back to an aluminum alloy die casting machine control system to be executed. According to the invention, the accuracy of mold sticking strain defect identification is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of aluminum alloy die casting technology, and more specifically to a method and system for optimizing aluminum alloy die casting process based on defect identification. Background Technology

[0002] With the large-scale application of aluminum alloy die casting technology in high-end manufacturing fields such as automotive parts, communication equipment, and mechanical structural components, surface quality control of die castings has become a key aspect of production management. Among these, sticking and tearing defects are one of the main problems affecting the pass rate of die casting products. In current aluminum alloy die casting production, the detection of sticking and tearing defects mainly relies on manual visual sampling or offline equipment inspection, while the adjustment and optimization of process parameters mainly depend on the experience and judgment of operators.

[0003] However, traditional detection and control methods have obvious limitations: process adjustments often rely on engineers' experience and judgment, which are lagging and subjective; process parameter corrections are mostly done offline, which cannot achieve online dynamic optimization based on real-time defect feedback, resulting in the recurrence of similar defects and making it difficult to identify and quantify sticking and tearing defects in real time during high-speed continuous production. Summary of the Invention

[0004] This invention provides a method and system for optimizing aluminum alloy die casting process based on defect identification, aiming to solve the technical problem that existing technologies are unable to accurately identify defects such as sticking and tearing.

[0005] In view of the above problems, the present invention provides a method and system for optimizing aluminum alloy die casting process based on defect identification.

[0006] In a first aspect, the present invention provides a method for optimizing aluminum alloy die-casting processes based on defect identification, comprising:

[0007] After the aluminum alloy die casting is demolded, a video stream of the die casting is acquired through a vision imaging system, and the presence of sticking and tearing defects on the surface of the aluminum alloy die casting is identified based on the video stream.

[0008] When a sticking mold tear defect is identified, the sticking mold tear defect is quantitatively calculated to obtain the sticking mold tear defect index.

[0009] Based on the sticking and tearing defect index, and combined with the pre-constructed die casting process knowledge graph, attribution analysis is performed to determine the dominant process parameters that lead to sticking and tearing defects.

[0010] With the goal of minimizing the sticking and tearing defect index, the determined dominant process parameters are dynamically optimized to generate an optimized combination of dominant process parameters, which is then fed back to the aluminum alloy die-casting machine control system for execution.

[0011] Secondly, the present invention provides an aluminum alloy die-casting process optimization system based on defect identification, comprising:

[0012] The visual defect recognition module is used to collect video streams of the die-cast parts through a visual imaging system after the die-cast parts are demolded, and to identify whether there are sticking and tearing defects on the surface of the die-cast parts based on the video streams.

[0013] The defect index calculation module is used to quantitatively calculate the mold sticking and tearing defect when the existence of the defect is identified, and obtain the mold sticking and tearing defect index.

[0014] The defect attribution analysis module is used to perform attribution analysis based on the sticking and tearing defect index and in combination with the pre-constructed die casting process knowledge graph to determine the dominant process parameters that cause sticking and tearing defects.

[0015] The parameter dynamic optimization module is used to dynamically optimize the determined dominant process parameters with the goal of minimizing the sticking and tearing defect index, generate an optimized combination of dominant process parameters, and feed the optimized combination of dominant process parameters back to the aluminum alloy die casting machine control system for execution.

[0016] One or more technical solutions provided in this invention have at least the following technical effects or advantages:

[0017] This invention provides a method and system for optimizing aluminum alloy die casting process based on defect identification. By real-time acquisition and defect identification of video streams after die casting demolding, it achieves rapid and accurate detection of sticking and tearing defects. Quantitative calculation of defects yields a defect index, enabling standardized and quantitative assessment of defect severity. Combining a die casting process knowledge graph with defect attribution analysis, it accurately identifies the dominant process parameters causing sticking and tearing. With the goal of minimizing the defect index, it dynamically optimizes the dominant process parameters and provides feedback for execution, achieving closed-loop intelligent optimization of the die casting process. This effectively reduces the incidence of sticking and tearing defects, improving die casting production stability and product yield. Attached Figure Description

[0018] Figure 1 A flowchart illustrating the aluminum alloy die-casting process optimization method based on defect identification provided in this embodiment of the invention;

[0019] Figure 2 A schematic diagram of the structure of the aluminum alloy die-casting process optimization system based on defect identification provided in an embodiment of the present invention;

[0020] The components represented by each number in the attached diagram are explained below:

[0021] Visual defect recognition module 11, defect index calculation module 12, defect attribution analysis module 13, and parameter dynamic optimization module 14. Detailed Implementation

[0022] This invention provides a method and system for optimizing aluminum alloy die casting process based on defect identification, which is used to address the technical problem of accurately identifying sticking and tearing defects that are difficult to achieve in existing technologies.

[0023] Example 1, as Figure 1 As shown, this invention provides a method for optimizing aluminum alloy die-casting process based on defect identification, the method comprising:

[0024] S100: After the aluminum alloy die casting is demolded, a video stream of the die casting is acquired through a vision imaging system, and the presence of sticking and tearing defects on the surface of the aluminum alloy die casting is identified based on the video stream.

[0025] In this embodiment of the invention, after the aluminum alloy die casting is demolded, a video stream of the die casting is acquired through a visual imaging system, and the presence of sticking and tearing defects on the surface of the aluminum alloy die casting is identified based on the video stream. In the actual production process of aluminum alloy die castings, the die casting is usually in continuous motion after demolding. Traditional static image detection methods can only acquire images from a single angle, making it difficult to capture surface defects that are fully exposed during the motion of sticking and tearing. Sticking and tearing defects are often accompanied by the pulling action at the moment of demolding, and their surface features not only manifest as static texture damage but may also include dynamic changes, such as local bulges and springback deformation at the moment of demolding. If visual detection relies solely on a single frame image, it is easy to miss detection due to poor shooting angle, light reflection, or the defect being temporarily obscured. Therefore, it is necessary to use video stream analysis, combining spatial semantic information and temporal motion information, to achieve accurate identification of sticking and tearing defects.

[0026] Step S100 in the method provided in this embodiment of the invention includes:

[0027] The video stream of the die-cast aluminum alloy die-casting part during its movement after demolding is acquired using a visual imaging system;

[0028] A dual-path video analysis network is constructed to identify defects in the video stream of the die-casting part, wherein the dual-path video analysis network includes a slow path branch and a fast path branch;

[0029] Key frames in the die-cast part video stream are extracted at a low frame rate through the slow path branch, and spatial semantic features are extracted from the key frames to obtain the spatial structure features and texture features of the die-cast part surface.

[0030] The continuous frame sequence in the video stream of the die casting is extracted at a high frame rate through the fast path branch, and the temporal motion feature is extracted from the continuous frame sequence to obtain the dynamic change features of the die casting surface during the demolding process.

[0031] The spatial structure features, texture features, and dynamic change features are fused to obtain the fused multidimensional defect features.

[0032] Based on the fused multidimensional defect features, the system identifies whether there are sticking and tearing defects on the surface of die castings, and outputs the identification results and defect confidence scores for sticking and tearing defects.

[0033] First, a video stream of the die-cast aluminum alloy die-casting part during its movement after demolding is acquired using a vision imaging system. The vision imaging system is a hardware device consisting of an industrial camera, lens, light source, and image acquisition card, used to capture visual images of the die-casting part's movement after demolding. The die-casting part video stream refers to a continuously acquired, chronologically arranged sequence of images, reflecting the complete movement process of the die-casting part from the moment of demolding to its transfer to the next workstation. An industrial camera is installed to the side or above the demolding station of the die-casting machine. The camera triggering mode is set to a hard trigger mode linked to an external programmable logic controller, ensuring that acquisition begins the moment the die-casting part is ejected. The acquisition frame rate is set to 30 frames per second (fps), and acquisition continues for 3 seconds, forming a die-casting part video stream containing 90 frames. During the acquisition process, constant illumination is maintained to avoid flicker and ambient light interference.

[0034] For example, taking a die-cast part of a motor housing for a new energy vehicle as an example, after it is demolded, it is transported outward along the conveyor belt at a speed of 0.5 m / s. The vision imaging system is automatically triggered when the die-cast part passes through the shooting area, and a video stream with a duration of 3 seconds and a resolution of 1920×1080 pixels is captured. The video stream contains a complete dynamic picture of the die-cast part from demolding to stable transmission.

[0035] Secondly, a dual-path video analysis network is constructed to identify defects in the die-casting video stream. This dual-path video analysis network includes a slow path branch and a fast path branch. The dual-path video analysis network refers to a software algorithm model deployed in an industrial control computer, consisting of two independent feature extraction paths. These two paths process the same die-casting video stream in parallel, focusing on extracting static spatial features and dynamic temporal features respectively, ultimately achieving comprehensive capture of defect features. Specifically, the slow path branch focuses on extracting detailed features from a single frame, while the fast path branch focuses on extracting motion features from consecutive frames.

[0036] Specifically, in industrial control computers, a dual-path video analysis network is constructed based on the Python programming language and the PyTorch framework. The network input is a 1920×1080 pixel video stream, and the output is the feature vectors extracted from the two paths respectively. The slow path branch uses: 3 convolutional layers with kernel sizes of 3×3, 5×5, and 3×3, all with a stride of 1; 2 pooling layers with a kernel size of 2×2 and a stride of 2; and 1 fully connected layer. The fast path branch uses: 2 convolutional layers with a kernel size of 3×3 and a stride of 1; 1 pooling layer with a kernel size of 2×2 and a stride of 2; and 1 temporal convolutional layer with a kernel size of 3×3 and a stride of 1. Both branches take the same video stream as input and are processed in parallel. Overfitting is reduced during processing using batch normalization. The ReLU function is used for activation. The Adam optimizer is used for network training with a learning rate of 0.001 and a batch size of 32. The training dataset is a labeled dataset containing 10,000 segments of video streams of die-cast motor housing demolding. Training stops when the loss function value is below 0.01. The network is then built and the model is saved to the local disk of the industrial control computer.

[0037] Next, keyframes from the die-cast part video stream are extracted at a low frame rate using the slow path branch. Spatial semantic features are then extracted from these keyframes to obtain the spatial structural and textural features of the die-cast part surface. The slow path branch refers to the software algorithm branch in the dual-path video analysis network that processes the video stream at a low frame rate, focusing on extracting static features from the die-cast part surface in a single frame image. Spatial semantic features refer to the spatial structural and textural features of the die-cast part surface, serving as the static basis for determining the presence of die sticking and tearing defects.

[0038] Specifically, the slow path branch extracts keyframes from the video stream at a low frame rate of 10 frames per second, meaning one keyframe is extracted for every three video frames. Keyframe extraction uses inter-frame difference with a threshold of 20; a frame difference exceeding 20 pixels between adjacent frames is considered a keyframe, ensuring the extracted keyframes cover critical poses during the die-casting demolding process, such as the moment of ejection, the moment of complete mold separation, and the moment of landing on the conveyor belt. Each extracted keyframe undergoes preprocessing: first, Gaussian filtering removes image noise with a 5×5 kernel and a standard deviation of 0.5; then, grayscale conversion is performed using a weighted average method with weights R=0.299, G=0.587, and B=0.114, converting the color image to grayscale. Subsequently, spatial structure and texture features are extracted sequentially through convolutional and pooling layers in the slow path branch. Finally, a 128-dimensional spatial semantic feature vector is output through a fully connected layer and stored in the industrial control computer's memory for subsequent feature fusion.

[0039] For example, for the video stream of the motor housing, the slow path branch extracts keyframes at a frame rate of 10fps, extracting a total of 30 keyframes, corresponding to frames 3, 6, 9...90, covering the complete demolding process of the motor housing. After preprocessing the 15th keyframe, features are extracted through the slow path branch to obtain a 128-dimensional spatial semantic feature vector, which contains static information such as the contour structure and surface texture of the motor housing. If there are defects such as sticking and tearing, the feature vector will contain texture anomaly signals of the defect area.

[0040] Furthermore, the fast path branch extracts continuous frame sequences from the die-casting video stream at a high frame rate, and performs temporal motion feature extraction on these continuous frame sequences to obtain the dynamic change features of the die-casting surface during the demolding process. The fast path branch refers to the software algorithm branch in the dual-path video analysis network that processes the video stream at a high frame rate, focusing on extracting the dynamic features of the die-casting in the continuous frame sequence. Temporal motion features refer to the dynamic change features generated by the die-casting during the demolding process, including displacement features and deformation features, which can capture the changing patterns of sticking and tearing defects during the dynamic process.

[0041] Specifically, the fast path branch extracts continuous frame sequences from the video stream at a high frame rate, consistent with the acquisition frame rate of 30fps. Without needing to filter keyframes, all 90 frames are processed continuously. Each frame is first Gaussian filtered and converted to grayscale. Then, basic features are extracted through the convolutional and pooling layers of the fast path branch. Next, a temporal convolutional layer captures pixel changes between consecutive frames, extracting displacement and deformation features. Specifically, the displacement vector is obtained by calculating the coordinate difference between corresponding pixels in two adjacent frames, and the deformation vector is obtained by calculating the pixel grayscale change rate between two adjacent frames. Finally, the displacement and deformation vectors are integrated to output a 64-dimensional temporal motion feature vector, which is stored in the industrial control computer's memory and corresponds to the spatial semantic feature vector for subsequent feature fusion.

[0042] For example, for the motor housing video stream, the fast path branch processes all 90 frames of images continuously. After preprocessing, a temporal convolutional layer calculates the pixel coordinate difference and grayscale change rate between adjacent frames. For instance, in frames 20 and 21, the coordinate difference of the pixels at the edge of the motor housing is 0.8 pixels, corresponding to an actual displacement of 0.1 mm, which is determined to be a normal demolding displacement. If, in two adjacent frames, the grayscale change rate of a certain area on the surface of the housing exceeds 0.3 and the displacement vector is abnormal, it indicates that there may be a sticking and tearing defect in that area. Finally, a 64-dimensional temporal motion feature vector is output, containing all dynamic change information during the demolding process of the motor housing.

[0043] Subsequently, the spatial structure features, texture features, and dynamic change features are fused to obtain fused multidimensional defect features. Feature fusion refers to a software algorithm process that weights and integrates the spatial semantic features extracted by the slow path branch with the temporal motion features extracted by the fast path branch. The purpose is to obtain comprehensive features that include both static details and dynamic information, thereby improving the accuracy of defect identification and avoiding missed or false detections caused by single-dimensional features.

[0044] Specifically, a weighted fusion algorithm is used to fuse a 128-dimensional spatial semantic feature vector and a 64-dimensional temporal motion feature vector in the industrial control computer. The weight of the spatial semantic feature is set to 0.6, and the weight of the temporal motion feature is set to 0.4. The two feature vectors are weighted sequentially according to their dimensions and then concatenated to obtain a 192-dimensional multidimensional defect feature vector. After fusion, L2 normalization is applied to normalize the magnitude of the feature vector to 1, eliminating the dimensional differences between different dimensions and ensuring consistency in subsequent network processing. The normalized multidimensional defect feature vector is stored in the industrial control computer's memory as input to the multi-task classification decision network.

[0045] For example, the 128-dimensional spatial semantic feature vector of the motor housing is weighted and concatenated with the 64-dimensional temporal motion feature vector to obtain a 192-dimensional multidimensional defect feature vector. After L2 normalization, the vector magnitude is 1. If there is a mold adhesion and tearing defect on the surface of the motor housing, the fused feature vector includes both static texture anomalies of the defect area, such as uneven grayscale and irregular contours, and dynamic motion anomalies of the defect area, such as displacement lag and deformation anomalies, providing comprehensive feature support for subsequent defect identification.

[0046] Based on this, the presence of sticking and tearing defects on the surface of die castings is identified using the fused multidimensional defect features, and the identification results and defect confidence scores of sticking and tearing defects are output.

[0047] Specifically, based on the fused multidimensional defect features, the system identifies whether there are sticking and tearing defects on the surface of the die casting, and outputs the identification results and defect confidence scores for sticking and tearing defects, including:

[0048] The fused multidimensional defect features are input into a pre-trained multi-task classification decision network, wherein the multi-task classification decision network includes a first task branch and a second task branch.

[0049] The first task branch performs defect category probability calculation on the fused multidimensional defect features and outputs a binary classification result of whether there is a sticking and tearing defect on the surface of the die casting. The binary classification result includes whether there is a sticking and tearing defect or whether there is no sticking and tearing defect.

[0050] The second task branch performs confidence regression calculation on the fused multidimensional defect features and outputs the defect confidence value corresponding to the binary classification result, wherein the defect confidence value ranges from 0 to 1.

[0051] When the binary classification result output by the first task branch indicates the presence of a mold sticking tear defect, and the defect confidence value output by the second task branch is greater than or equal to a preset confidence threshold, the binary classification result and the defect confidence value are used as the identification result and defect confidence value of the mold sticking tear defect.

[0052] When the binary classification result output by the first task branch indicates the presence of a sticking and tearing defect, but the defect confidence value output by the second task branch is lower than the preset confidence threshold, a secondary analysis is performed on the corresponding suspicious video segment in the die casting video stream, and then the identification result of the sticking and tearing defect is output.

[0053] When the binary classification result output by the first task branch indicates that there is no sticking and tearing defect, but the defect confidence value output by the second task branch is lower than the preset confidence threshold, a re-acquisition command is triggered to control the visual imaging system to re-acquire the die-cast video stream of the current aluminum alloy die-casting.

[0054] First, the fused multidimensional defect features are input into a pre-trained multi-task classification decision network, which includes a first task branch and a second task branch. The multi-task classification decision network refers to a software algorithm model deployed in an industrial control computer, used to receive multidimensional defect feature vectors and simultaneously execute two parallel tasks, containing two independent task branches. The first task branch is a classification branch, used to determine whether there are sticking and tearing defects on the surface of the die-cast part; the second task branch is a regression branch, used to calculate the reliability of the classification result, realizing the reliability verification of the recognition result.

[0055] Specifically, a multi-task classification decision network is constructed based on the Python programming language and the PyTorch framework. The network input is a 192-dimensional multi-dimensional defect feature vector, and the output is the classification result and the corresponding confidence score. The first task branch uses two fully connected layers with 128 and 2 neurons respectively, and the activation function is the Softmax function. The output is the probability value of the two classification results: the presence of a mold tear defect and the absence of a mold tear defect. The higher probability value is the final classification result. The second task branch uses two fully connected layers with 64 and 1 neurons respectively, and the activation function is the Sigmoid function. The output is a confidence score between 0 and 1. The higher the score, the more reliable the classification result. The two task branches share the input layer and the first fully connected layer to reduce network parameters and improve processing efficiency. The network is trained using the same training dataset as the dual-path video analysis network. The training objective is to simultaneously minimize the cross-entropy loss function and the mean squared error loss function. Training stops when the classification accuracy exceeds 98% and the regression error is below 0.02. The network construction is then completed, and the model is saved to the local disk of the industrial control computer.

[0056] Secondly, the first task branch calculates the probability of defect categories for the fused multidimensional defect features, outputting a binary classification result indicating whether the die-cast part surface exhibits a sticking and tearing defect. This binary classification result includes either the presence or absence of the sticking and tearing defect. The first task branch refers to the software algorithm branch in the multi-task classification decision network that specifically performs the binary classification task. Its function is to analyze the multidimensional defect feature vector, calculate the probability of either the presence or absence of the sticking and tearing defect, and output the final classification result, providing a qualitative judgment for defect identification.

[0057] Specifically, the 192-dimensional multidimensional defect feature vector is input into the first task branch. First, a shared fully connected layer is used for feature dimensionality reduction, reducing the 192-dimensional feature vector to 128 dimensions. Then, the fully connected layer of the classification branch calculates the probability values ​​of the two classification results, with the sum of the probability values ​​being 1. A probability threshold of 0.5 is set. When the probability value of the presence of a mold sticking and tearing defect is ≥0.5, the output classification result is "mold sticking and tearing defect exists"; when the probability value of the presence of a mold sticking and tearing defect is <0.5, the output classification result is "mold sticking and tearing defect does not exist". The classification result is output in text form and stored in the industrial control computer memory, while simultaneously being transmitted to the second task branch for corresponding association in confidence score calculation.

[0058] For example, the 192-dimensional multidimensional defect feature vector is input into the first task branch. After feature dimensionality reduction and probability calculation, the probability value of having a mold sticking tear defect is 0.91, and the probability value of not having a mold sticking tear defect is 0.09. Since 0.91 ≥ 0.5, the first task branch outputs the classification result as "having a mold sticking tear defect" and transmits the classification result to the second task branch for subsequent confidence calculation and association matching.

[0059] Next, the second task branch performs confidence regression calculation on the fused multidimensional defect features, outputting the defect confidence value corresponding to the binary classification result. The defect confidence value ranges from 0 to 1. The second task branch refers to the software algorithm branch in the multi-task classification decision network that specifically performs the regression task. Its function is to analyze the multidimensional defect feature vector and calculate the reliability of the classification result output by the first task branch. The defect confidence value ranges from 0 to 1, where 0 represents a completely unreliable classification result and 1 represents a completely reliable classification result. The higher the value, the higher the reliability of the classification result, used to filter valid identification results.

[0060] Specifically, the 192-dimensional multidimensional defect feature vector is input into the second task branch, while the classification result output from the first task branch is received. The feature dimensionality is reduced from 192-dimensional to 64-dimensional through a shared fully connected layer. Then, the confidence score of the corresponding classification result is calculated through the fully connected layer and the sigmoid activation function of the regression branch, with the value strictly controlled between 0 and 1. After the confidence score is calculated, the value is retained to two decimal places and corresponds one-to-one with the classification result of the first task branch. It is then stored in the memory of the industrial control computer for subsequent result determination.

[0061] For example, the second task branch receives a 192-dimensional multidimensional defect feature vector and the classification result "existing mold-sticking tear defect" output by the first task branch. After feature dimensionality reduction and regression calculation, the output confidence score is 0.93, which indicates that the confidence level of the existence of the mold-sticking tear defect is 93%, belonging to a high-confidence result, and can be directly used for subsequent judgment. If the first task branch outputs "no mold-sticking tear defect," and the output confidence score after regression calculation is 0.88, it indicates that the confidence level of this classification result is 88%, which is also a high-confidence result.

[0062] Furthermore, when the binary classification result output by the first task branch indicates the presence of a sticking and tearing defect, and the defect confidence value output by the second task branch is greater than or equal to a preset confidence threshold, the binary classification result and the defect confidence value are used as the identification result and defect confidence output for the sticking and tearing defect. The confidence threshold refers to a preset numerical standard used to determine the validity of the classification result. It is set by those skilled in the art based on production needs and recognition accuracy requirements, and is used to screen high-confidence identification results to avoid low-confidence results misleading subsequent process adjustments. A high-confidence result refers to an identification result whose confidence value is greater than or equal to the confidence threshold; it can be directly output as a valid result for subsequent quantitative defect calculation.

[0063] Specifically, a confidence threshold is preset, and a judgment program is written in the industrial control computer. The classification result and confidence value are called to make the following judgment: when the classification result output by the first task branch is that there is a mold sticking and tearing defect, and the confidence value output by the second task branch is ≥ the preset confidence threshold, it is judged as a high confidence defect result. The classification result and the corresponding confidence value are output in text form and stored in the local database of the industrial control computer. A signal is sent synchronously to the subsequent defect quantitative calculation step to start the subsequent operation.

[0064] For example, if the preset confidence threshold is 0.85, the classification result is that there is a sticking mold tear defect with a confidence value of 0.93. Since 0.93 ≥ 0.85, it is judged as a high-confidence defect result. The industrial control computer directly outputs the text information "There is a sticking mold tear defect with a confidence value of 0.93", stores it in the local database, and sends a signal to step S200 to start the quantitative calculation of the sticking mold tear defect.

[0065] Furthermore, when the binary classification result output by the first task branch indicates the presence of a sticking and tearing defect, but the defect confidence value output by the second task branch is lower than the preset confidence threshold, a secondary analysis is performed on the corresponding suspicious video segments in the die-casting video stream, and the identification result of the sticking and tearing defect is then output.

[0066] Specifically, when the binary classification result output by the first task branch indicates the presence of a sticking and tearing defect, but the defect confidence value output by the second task branch is lower than a preset confidence threshold, a secondary analysis is performed on the corresponding suspicious video segment in the die-casting video stream, and the identification result of the sticking and tearing defect is output again, including:

[0067] Based on the time interval and spatial region information corresponding to the fused multidimensional defect features in the die casting video stream, suspicious video segments are located and extracted from the die casting video stream.

[0068] Each frame of the suspicious video segment is magnified locally to extract the micro-texture features of the mold sticking and tearing defects within the magnified local area;

[0069] Optical flow field calculations were performed on the suspicious video segments to extract the micro-displacement and deformation features of the adhesive mold tear defect region between consecutive frames;

[0070] The suspicious video segments are segmented in the temporal domain at multiple scales, and short-term abrupt change features and long-term gradual change features are extracted respectively.

[0071] The micro-texture features, micro-displacement features, deformation features, short-term abrupt change features, and long-term gradual change features are fused at multiple levels to obtain refined defect features;

[0072] The refined defect features are input into a pre-trained refined classification model, and the identification result of the mold sticking and tearing defect is output, wherein the identification result includes the existence judgment of the mold sticking and tearing defect.

[0073] First, based on the fused multidimensional defect features and their corresponding time intervals and spatial regions in the die-casting video stream, suspicious video segments are located and extracted. Suspicious video segments refer to those segments in the die-casting video stream that correspond to low-confidence defect results within a given time interval and spatial region—that is, video segments corresponding to regions where sticking and tearing defects may exist, but whose confidence level is insufficient. Based on the fused multidimensional defect features, the time interval and spatial region information corresponding to the defects are extracted. Using a video extraction algorithm, suspicious video segments corresponding to these time intervals and spatial regions are extracted from the complete video stream. Each segment is 1 second long and maintains a resolution of 1920×1080 pixels.

[0074] Secondly, each frame of the suspicious video clip undergoes local region magnification processing to extract the microscopic texture features of the mold adhesion and tear defects within the magnified local region. A bilinear interpolation algorithm is used to magnify the spatial region corresponding to the defect in the suspicious video clip by a factor of 2, resulting in a magnified region resolution of 600×600 pixels, facilitating the extraction of microscopic texture features. After magnification, each frame is subjected to Gaussian filtering with a kernel size of 3×3 and a standard deviation of 0.3 to remove noise generated during the magnification process.

[0075] Next, optical flow field calculations were performed on the suspicious video clips to extract the micro-displacement and deformation features of the mold adhesion and tear defect region between consecutive frames. Optical flow field calculation refers to a software algorithm that extracts the micro-displacement and deformation features of the defect region by analyzing the motion trajectory of pixels in consecutive frame images. The Lucas-Kanade optical flow algorithm was used to perform optical flow field calculations on the magnified suspicious video clips, with a window size of 5×5 and 10 iterations. The micro-displacement and deformation features of the defect region between consecutive frames were extracted, and a 32-dimensional micro-displacement-deformation feature vector was output.

[0076] Simultaneously, the suspicious video segments are subjected to multi-scale temporal segmentation to extract short-term abrupt change features and long-term gradual change features. Multi-scale temporal segmentation refers to splitting the suspicious video segments into segments of different durations and extracting short-term abrupt change features and long-term gradual change features separately. The 1-second suspicious video segment is segmented into two durations: short-term segmentation, with each segment consisting of 1 frame, for a total of 30 short-term segments, and abrupt change features such as pixel grayscale abrupt changes and displacement abrupt changes are extracted from each short-term segment; long-term segmentation, with each segment consisting of 5 frames, for a total of 6 long-term segments, and gradual change features such as grayscale gradation and displacement gradation are extracted from each long-term segment. The final output is a 48-dimensional temporal feature vector.

[0077] Furthermore, the micro-texture features, micro-displacement features, deformation features, short-term abrupt changes, and long-term gradual changes are fused at multiple levels to obtain refined defect features. Refined defect features refer to more detailed and accurate defect features obtained by fusing multiple features such as micro-texture, micro-displacement, deformation, short-term abrupt changes, and long-term gradual changes, used to improve the accuracy of identifying low-confidence results. The 32-dimensional micro-texture features, 32-dimensional micro-displacement-deformation features, and 48-dimensional temporal feature vectors extracted after local magnification are weighted and fused, with weights set to 0.4, 0.3, and 0.3 respectively. The fused vector yields an 112-dimensional refined defect feature vector, which is then L2 normalized and stored in the industrial control computer memory.

[0078] Finally, the refined defect features are input into a pre-trained refined classification model, which outputs the identification result of the mold adhesion tear defect. The identification result includes a determination of the existence of the mold adhesion tear defect. The 112-dimensional refined defect feature vector is input into the pre-trained refined classification model, which is built based on a ResNet50 network. The training dataset consists of labeled data from 5000 low-confidence suspicious video segments. The refined classification model outputs the final identification result, which serves as the final result of the secondary analysis. This result is stored in a local database and a signal is simultaneously sent to the subsequent S200 step or the identification process ends.

[0079] For example, if the classification result indicates the presence of a mold sticking tear defect, and the confidence level is 0.79 < 0.85, the secondary analysis process is initiated: First, from the video stream of the motor housing, a suspicious video segment is located and extracted from frames 10-20, with a spatial region of x = 500-800 pixels and y = 300-600 pixels; after magnifying this region by 2 times, micro-texture features are extracted, such as fine scratches and uneven grayscale in the defect area; using the Lucas-Kanade optical flow algorithm, the micro-displacement vector of the defect area is extracted: 0.5 pixels / frame, and the deformation feature: grayscale change rate 0.25; the segment is divided into 1-frame and 5-frame segments, and short-term abrupt changes and long-term gradual changes are extracted; all features are fused to obtain a 112-dimensional refined defect feature vector, which is then input into the refined classification model, and finally the identification result of "mold sticking tear defect" is output, stored in the database, and step S200 is initiated.

[0080] Furthermore, when the binary classification result output by the first task branch indicates the absence of sticking and tearing defects, but the defect confidence value output by the second task branch is lower than a preset confidence threshold, a re-acquisition command is triggered, controlling the vision imaging system to re-acquire the video stream of the current aluminum alloy die-casting. The re-acquisition command is a control signal sent by the industrial control computer to the vision imaging system to trigger the system to re-acquire the video stream of the current aluminum alloy die-casting, resolving the uncertainty of low-confidence, defect-free results. The re-acquired video stream must have the same parameters as the initial acquisition to ensure the comparability of the recognition results.

[0081] Specifically, when the classification result output by the first task branch is "no sticking and tearing defects", but the confidence value output by the second task branch is <0.85, the industrial control computer immediately sends a re-acquisition command. The command includes acquisition parameters: frame rate 30fps, duration 3 seconds, resolution 1920×1080 pixels. After receiving the command, the PLC controls the vision imaging system to re-acquire the video stream of the current motor housing die-casting part. The re-acquired video stream overwrites the first acquired video stream and is stored in the industrial control computer. Then, defect identification is performed again. Re-acquisition is performed a maximum of 2 times. If, after 2 re-acquisitions, the classification result is still "no sticking and tearing defects" and the confidence value is <0.85, it is judged as suspected to be defect-free, the result is output and recorded in the database, and an equipment inspection prompt is issued at the same time.

[0082] For example, if the classification result is "no sticking and tearing defects," and the confidence level is 0.73 < 0.85, the industrial control computer sends a re-acquisition command to the PLC via the RS485 interface. The PLC controls the vision imaging system to re-acquire the video stream of the current motor housing die-casting part. The re-acquired video stream overwrites the content of the first acquisition, and then the defect identification steps are repeated. If, after re-acquisition, the classification result is still "no sticking and tearing defects," and the confidence level is 0.76 < 0.85, then re-acquisition is performed again. After the second re-acquisition, if the classification result is still "no sticking and tearing defects," and the confidence level is 0.78, which is still < 0.85, then a suspected defect-free result is output, recorded in the database, and a prompt is issued to remind the staff to check whether the lighting of the vision imaging system is normal and whether the camera lens is dirty.

[0083] In this embodiment of the invention, a complete and clear video stream of die-casting demolding is acquired through standardized visual imaging. Spatial semantic features and temporal motion features are extracted simultaneously using a dual-path video analysis network. Defect classification and confidence level are output synchronously using a multi-task classification decision network. Through a graded judgment mechanism of direct output of high confidence level, secondary analysis of suspected defects with low confidence level, and re-acquisition of defect-free low confidence level, the accuracy and reliability of mold sticking and tearing defect identification are effectively improved, avoiding missed detections and false detections. Real-time automated defect identification is achieved, providing accurate and reliable data support for subsequent quantitative calculation of defects and attribution analysis of process parameters.

[0084] S200: When a sticking and tearing defect is identified, the sticking and tearing defect is quantitatively calculated to obtain the sticking and tearing defect index.

[0085] In this embodiment of the invention, when a sticking and tearing defect is identified, the sticking and tearing defect is quantitatively calculated to obtain a sticking and tearing defect index. Step S100 only achieves qualitative identification of the sticking and tearing defect, but cannot quantify the severity of the defect. Die-casting process optimization requires the formulation of targeted control schemes based on the severity of the defect. Different degrees of sticking and tearing defects correspond to different adjustment ranges of process parameters. Without quantitative evaluation indicators, process optimization will be highly arbitrary and lack precision. Therefore, it is necessary to extract defect feature parameters, normalize them, and perform weighted calculations to obtain a quantifiable sticking and tearing defect index, providing accurate quantitative basis for subsequent process attribution analysis and parameter optimization, ensuring the targeting and effectiveness of process optimization.

[0086] Step S200 in the method provided in this embodiment of the invention includes:

[0087] Defect image feature parameters of the sticking and tearing defect are extracted from the fused multidimensional defect features, wherein the defect image feature parameters include defect geometric feature parameters and defect grayscale feature parameters;

[0088] The defect geometric feature parameters and the defect grayscale feature parameters are normalized to obtain standard defect geometric feature parameters and standard defect grayscale feature parameters.

[0089] Based on the standard defect geometric feature parameters and the standard defect grayscale feature parameters, the sticking and tearing defect index is obtained by weighted calculation.

[0090] First, defect image feature parameters of the sticking and tearing defects are extracted from the fused multidimensional defect features. The defect image feature parameters include defect geometric feature parameters and defect grayscale feature parameters.

[0091] Among them, the defect image feature parameters of the sticking and tearing defects are extracted from the fused multidimensional defect features, including:

[0092] Extract the geometric feature parameters of the sticking and tearing defects from the fused multidimensional defect features, wherein the geometric feature parameters include at least one of the following: defect length, defect width, defect area, and defect perimeter.

[0093] Extract the grayscale feature parameters of the sticking and tearing defects from the fused multidimensional defect features, wherein the grayscale feature parameters include at least one of the average grayscale value of the defect region, the grayscale variance of the defect region, and the grayscale gradient of the defect region.

[0094] First, the geometric feature parameters of the sticking and tearing defects are extracted from the fused multidimensional defect features. These geometric feature parameters include at least one of defect length, defect width, defect area, and defect perimeter. The geometric feature parameters are quantitative parameters used to describe the spatial morphology of the sticking and tearing defects, reflecting the contour features of the defect's physical dimensions, including defect length, defect width, defect area, and defect perimeter. They are fundamental physical indicators for measuring the severity of the defects. The fused multidimensional defect features refer to the 192-dimensional feature vector obtained in step S100, which includes static spatial features and dynamic temporal features, and already contains the spatial location and morphological information of the defect region.

[0095] Specifically, based on the OpenCV algorithm library in the industrial control computer, the spatial coordinates (x1, y1) - (x2, y2) corresponding to the mold adhesion and tearing defects are extracted from the multidimensional defect feature vector obtained from S100. Then, the geometric feature parameters of the defects are calculated: the defect length is calculated using the minimum bounding rectangle method, determining the length of the longer side of the minimum bounding rectangle of the defect area; the defect width is calculated using the shorter side of the minimum bounding rectangle of the defect area; the defect area is calculated using the pixel counting method, counting the number of pixels within the defect area whose grayscale values ​​match the defect features; and the defect perimeter is calculated using a contour tracking algorithm, extracting the edge contour of the defect area and counting the number of pixels on the contour. After extraction, the four geometric feature parameters are organized into a geometric feature vector and stored in the memory of the industrial control computer for subsequent processing.

[0096] For example, for the sticking and tearing defects of the new energy vehicle motor housing identified in step S100, the coordinates of the defect area are extracted from the multi-dimensional defect feature vector as (520,310)-(680,450). The following parameters are calculated using the above method: the defect length is 162.3 pixels, the defect width is 140.5 pixels, the defect area is 18620 pixels², and the defect perimeter is 489 pixels. These parameters are then organized into a geometric feature vector [162.3,140.5,18620,489] and stored in the memory of the industrial control computer.

[0097] Secondly, the grayscale feature parameters of the sticking and tearing defects are extracted from the fused multidimensional defect features. These grayscale feature parameters include at least one of the following: average grayscale value of the defect region, grayscale variance of the defect region, and grayscale gradient of the defect region. The grayscale feature parameters are quantitative parameters used to describe the grayscale distribution characteristics of the sticking and tearing defect region, reflecting the grayscale difference between the defect region and the normal surface. They include the average grayscale value of the defect region, the grayscale variance of the defect region, and the grayscale gradient of the defect region, which can help determine the depth and density of the defect and supplement the deficiencies of the geometric feature parameters.

[0098] Specifically, based on the Python programming language and the OpenCV algorithm library, using the defect region coordinates (x1, y1) - (x2, y2) extracted from S201 as the range, grayscale feature parameters of the defect region are extracted from the grayscale image preprocessed by S100: Average grayscale value of the defect region: the arithmetic mean of the grayscale values ​​of all pixels within the defect region, ranging from 0 to 255; Grayscale variance of the defect region: the variance between the grayscale values ​​of all pixels within the defect region and the average grayscale value, reflecting the uniformity of grayscale distribution; the larger the variance, the more uneven the grayscale distribution of the defect region; Grayscale gradient of the defect region: using the Sobel operator (Sobelx horizontal operator and Sobely vertical operator, 3×3), the grayscale gradient value of each pixel within the defect region is calculated, and the average of all gradient values ​​is taken, reflecting the clarity of the defect edge; the larger the gradient value, the more obvious the defect edge. After extraction, the three grayscale feature parameters are organized into a grayscale feature vector and stored in the memory of the industrial control computer, corresponding to the geometric feature vector.

[0099] For example, regarding the aforementioned defect of sticking and tearing in the motor housing, grayscale feature parameters are extracted from the grayscale image within the range of the defect area coordinates (520, 310) - (680, 450): the average grayscale value of the defect area is 89.6, the grayscale variance of the defect area is 38.72, and the grayscale gradient of the defect area is 28.3. This set of parameters is organized into a grayscale feature vector [89.6, 38.72, 28.3], stored in the memory of the industrial control computer, and associated with the corresponding geometric feature vector.

[0100] Furthermore, the defect geometric feature parameters and the defect grayscale feature parameters are normalized to obtain standard defect geometric feature parameters and standard defect grayscale feature parameters. Normalization refers to the process of converting defect geometric feature parameters and defect grayscale feature parameters with different dimensions and value ranges into standardized parameters of 0-1. Standard defect geometric feature parameters and standard defect grayscale feature parameters refer to the feature parameters obtained after normalization, with a value range of 0-1. The purpose is to eliminate dimensional differences between different parameters and ensure the rationality and accuracy of subsequent weighted calculations.

[0101] Specifically, the Min-Max normalization algorithm is used to normalize the defect geometric feature parameters and defect grayscale feature parameters in the industrial control computer. The normalization formula is: Standard parameter value = (Original parameter value - Minimum value of the parameter) / (Maximum value of the parameter - Minimum value of the parameter). The maximum and minimum values ​​of each parameter are determined based on the training dataset. For example, the specific preset values ​​are as follows: defect length 50-500 pixels, defect width 30-300 pixels, defect area 5000-100000 pixels. 2The defects have a perimeter of 100-1500 pixels, an average grayscale value of 50-150, a grayscale variance of 10-100, and a grayscale gradient of 10-80. After normalization, all standard parameter values ​​are strictly controlled between 0 and 1, and are organized into standard geometric feature vectors and standard grayscale feature vectors, which are then stored in the memory of the industrial control computer.

[0102] For example, the Min-Max normalization algorithm is used to process the defect feature parameters of the above motor housing: Geometric parameter normalization: defect length = (162.3-50) / (500-50)≈0.250; defect width = (140.5-30) / (300-30)≈0.409; defect area = (18620-5000) / (100000-5000)≈0.143; defect perimeter = (489-100) / (1500-100)≈0.278, resulting in the standard geometric feature vector [0.250, 0.409, 0.143, 0.278]. Gray-scale parameter normalization: average gray-scale value of defects = (89.6-50) / (150-50)≈0.396; gray-scale variance = (38.72-10) / (100-10)≈0.320; gray-scale gradient = (28.3-10) / (80-10)≈0.261, resulting in the standard gray-scale feature vector [0.396, 0.320, 0.261].

[0103] Finally, based on the standard defect geometric feature parameters and the standard defect grayscale feature parameters, a sticking and tearing defect index is obtained through weighted calculation. The sticking and tearing defect index is a comprehensive index used to quantify the severity of sticking and tearing defects, obtained by weighted summation of the standard defect geometric feature parameters and the standard defect grayscale feature parameters. Its value ranges from 0 to 1; the closer the value is to 1, the more severe the defect; the closer the value is to 0, the milder the defect. Weighted calculation refers to the process of weighted summation of standardized parameters according to the influence weight of each feature parameter on the severity of the defect.

[0104] Specifically, based on die-casting production practice data and training dataset verification, the total weight of standard defect geometric feature parameters is determined to be 0.6, and the total weight of standard defect grayscale feature parameters is determined to be 0.4. Geometric parameters reflect the physical size of defects and have a greater impact on defect severity. The internal weight allocation for geometric parameters is as follows: defect length 0.2, defect width 0.15, defect area 0.15, defect perimeter 0.1; the internal weight allocation for grayscale parameters is as follows: average grayscale value of defect area 0.2, grayscale variance of defect area 0.1, grayscale gradient of defect area 0.1. The calculation formula is: Sticking and tearing defect index = (standard length × 0.2 + standard width × 0.15 + standard area × 0.15 + standard perimeter × 0.1) × 0.6 + (standard average grayscale value × 0.2 + standard grayscale variance × 0.1 + standard grayscale gradient × 0.1) × 0.4.

[0105] For example, for the standard geometric feature vector [0.250, 0.409, 0.143, 0.278] and standard grayscale feature vector [0.396, 0.320, 0.261] of the motor housing, the following values ​​are calculated according to the above weights and formulas: Weighted sum of geometric parameters = (0.250×0.2+0.409×0.15+0.143×0.15+0.278×0.1) = 0.161; Weighted sum of grayscale parameters = (0.396×0.2+0.320×0.1+0.261×0.1) = 0.137; Sticking and tearing defect index = 0.161×0.6+0.137×0.4 = 0.151. This index indicates that the motor housing has a slight sticking and tearing defect. This index is stored in the database and a signal is sent to step S300 for subsequent attribution analysis of the dominant process parameters.

[0106] In this embodiment of the invention, by accurately extracting the geometric and grayscale feature parameters of the sticking and tearing defects, standardization and normalization are used to eliminate dimensional differences. Combined with a weighted calculation based on reasonable weight allocation verified in production practice, a quantifiable and comparable sticking and tearing defect index is obtained. This achieves accurate quantification of defect severity, solving the problem that traditional qualitative identification cannot support precise process optimization. The output defect index accurately reflects the severity of the defect, providing a quantitative basis for the subsequent process attribution analysis in step S300, and clarifying the optimization target for the dynamic optimization of process parameters in step S400. This ensures the pertinence and accuracy of the process optimization scheme, further improving the quality control level of aluminum alloy die-casting products.

[0107] S300: Based on the sticking and tearing defect index, and combined with the pre-constructed die casting process knowledge graph, attribution analysis is performed to determine the dominant process parameters that lead to sticking and tearing defects.

[0108] In this embodiment of the invention, based on the sticking and tearing defect index, attribution analysis is performed using a pre-constructed die-casting process knowledge graph to determine the dominant process parameters causing the sticking and tearing defects. Step S200 has obtained the sticking and tearing defect index, quantifying the severity of the defect, but it cannot clearly identify the process parameters causing the defect. During aluminum alloy die casting, die-casting process parameters, material parameters, and mold state parameters can all trigger sticking and tearing, and there are complex coupling relationships between these parameters. Traditional attribution methods rely on operator experience, which can easily lead to attribution bias and omission of key parameters, resulting in a lack of targeted optimization in subsequent processes. Therefore, it is necessary to first construct a die-casting process knowledge graph containing multiple types of entities and their relationships, integrate parameter and defect association information from historical production data, and then aggregate association information using a graph attention network and calculate parameter association degrees using a bi-branch inference network to accurately screen out the dominant process parameters. This provides clear control targets for subsequent process optimization, ensuring the targetedness and effectiveness of the optimization.

[0109] Step S300 in the method provided in this embodiment of the invention includes:

[0110] The sticking and tearing defect index is input into a pre-constructed die casting process knowledge graph. The neighborhood information of the node where the defect type corresponding to the sticking and tearing defect index is located in the die casting process knowledge graph is aggregated through a graph attention network to obtain the correlation information between multiple die casting process parameters and sticking and tearing defects.

[0111] Based on the aforementioned association information, a dual-branch inference network is used to calculate the association degree of multiple die casting process parameters in the die casting process knowledge graph. The dual-branch inference network includes a sparse parameter branch and a dense parameter branch. The sparse parameter branch is used to handle the inference task of sparsely distributed die casting process parameters, and the dense parameter branch is used to handle the inference task of densely distributed die casting process parameters.

[0112] Based on the correlation calculation results, one or more die casting process parameters with the highest correlation to the sticking and tearing defects are selected from multiple die casting process parameters and used as the dominant process parameters leading to the sticking and tearing defects.

[0113] The construction process of the die-casting process knowledge graph includes:

[0114] Using die casting process parameters, material parameters, mold state parameters, and defect types as entity categories, an ontology layer of the die casting process knowledge graph is constructed. The die casting process parameters include at least the iron content in the aluminum alloy, mold temperature, pouring temperature, injection pressure, injection speed, holding time, mold retention time, release agent spraying amount, suction cup vacuum degree, and gripper action sequence.

[0115] Based on the causal relationship between die casting process parameters and defect types, the coupling relationship between die casting process parameters, and the influence relationship between material parameters and defect types, connection edges between entities are constructed.

[0116] Multiple entity instances and associated instances between multiple entities are extracted from historical die-casting production data. The extracted entity instances and associated instances between multiple entities are then filled into the ontology layer to complete the construction of the die-casting process knowledge graph.

[0117] First, the ontology layer of the die-casting process knowledge graph is constructed, using die-casting process parameters, material parameters, mold state parameters, and defect types as entity categories. The die-casting process parameters include at least the iron content in the aluminum alloy, mold temperature, pouring temperature, injection pressure, injection speed, holding time, mold dwell time, release agent application amount, suction cup vacuum degree, and gripper action sequence. The ontology layer refers to the core framework of the die-casting process knowledge graph, used to define the entity categories and attributes of each entity, and is the foundation for knowledge graph construction. An entity category refers to a set of things with the same attributes and characteristics; in this invention, it specifically includes four categories: die-casting process parameters, material parameters, mold state parameters, and defect types. Among these, die-casting process parameters are the core parameters affecting die-casting quality, and at least include the iron content in the aluminum alloy, mold temperature, pouring temperature, injection pressure, injection speed, holding time, mold dwell time, release agent application amount, suction cup vacuum degree, and gripper action sequence.

[0118] Specifically, the ontology layer of the die-casting process knowledge graph is constructed using Protégé software: Four entity categories are defined, and the attributes of each category are clarified: Die-casting process parameter attributes: parameter name, value range, and unit; Material parameter attributes: parameter name, value range, and testing method; Mold condition parameter attributes: parameter name, value range, and testing frequency; Defect type attributes: defect name, defect description, and severity level. Each entity category is further refined to clarify specific entities: Die-casting process parameters are refined into 10 specific parameters such as iron content in the aluminum alloy and mold temperature; material parameters are refined into aluminum alloy composition and material hardness; mold condition parameters are refined into mold surface roughness and mold wear degree; and defect types are refined into sticking, porosity, and shrinkage cavities. Define specific value rules for entity attributes. For example, set the mold temperature range to 80-120℃ (unit: °C), and the iron content in the aluminum alloy range to 0.5%-1.5% (unit: %). The severity of sticking and tearing defects is graded according to the S200 defect index: 0-0.3 for slight, 0.3-0.6 for moderate, and 0.6-1.0 for severe. Save the body layer as an OWL format file to the local disk of the industrial control computer for subsequent connection edge construction and instance population.

[0119] For example, when constructing the body layer for die-cast motor housings of new energy vehicles, four types of entities and specific entities are defined: die-casting process parameters include 10 parameters such as mold temperature, pouring temperature, and injection pressure; material parameters include iron content in aluminum alloy and hardness of aluminum alloy; mold condition parameters include mold surface roughness and mold wear degree; defect types include sticking, tearing, porosity, etc., and the body layer is stored in an industrial control computer.

[0120] Secondly, connection edges between entities are constructed based on the causal relationship between die-casting process parameters and defect types, the coupling relationship between die-casting process parameters, and the influence relationship between material parameters and defect types. Connection edges refer to the links used to connect different entities in the knowledge graph and describe the relationships between entities; the relationship category refers to the type of connection edge, which specifically includes three categories in this invention: the causal relationship between die-casting process parameters and defect types, the coupling relationship between die-casting process parameters, and the influence relationship between material parameters and defect types.

[0121] Specifically, based on the Protégé software, on the basis of the constructed ontology layer, connection edges between entities are built: three types of relationship categories are defined, and the semantic expression of each relationship is clarified: causal relationships are represented by "cause," such as low mold temperature causing sticking and tearing; coupling relationships are represented by "related influence," such as injection speed related to injection pressure; and influence relationships are represented by "influence," such as low iron content in aluminum alloy affecting sticking and tearing. A correlation strength attribute is set for each type of relationship, with a value range of 0-1. The larger the value, the stronger the correlation. For example, the correlation strength of low mold temperature causing sticking and tearing is set to 0.85, and the correlation strength of low iron content in aluminum alloy affecting sticking and tearing is set to 0.7. Connection edges between each type of entity are established one by one, ensuring that all entities related to sticking and tearing defects have corresponding connections. For example, mold temperature and release agent spraying amount in die casting process parameters are established as causally related to sticking and tearing defects; injection pressure and injection speed are established as coupled; and iron content in aluminum alloy is established as an influence relationship with sticking and tearing defects. Save the connection edge configuration, update the knowledge graph ontology layer file, and ensure that the connection edges correspond to the entity categories.

[0122] For example, for the knowledge graph ontology layer of a die-cast motor housing, the following connection edges are constructed: Causal relationship: mold temperature causes sticking and tearing, correlation strength 0.85; release agent spraying amount causes sticking and tearing, correlation strength 0.8; pouring temperature causes sticking and tearing, correlation strength 0.75. Coupling relationship: injection speed affects injection pressure, correlation strength 0.9; holding time affects mold retention time, correlation strength 0.7. Influence relationship: iron content in aluminum alloy affects sticking and tearing, correlation strength 0.7. After all connection edges are configured, the ontology layer file is updated to ensure that the entities and relationships correspond correctly.

[0123] Next, multiple entity instances and associated instances between entities are extracted from historical die-casting production data. These extracted entity instances and associated instances are then populated into the ontology layer, completing the construction of the die-casting process knowledge graph. An entity instance refers to a specific value instance of various entities in the ontology layer; for example, "mold temperature = 90℃" is an instance of the mold temperature entity. An associated instance refers to a specific relationship instance between entity instances. By populating these instances, the knowledge graph transforms from an abstract framework into a usable knowledge system containing actual production data.

[0124] Specifically, historical die-casting production data for motor housing die-casting parts from the past three years were collected. This data includes the actual values ​​of die-casting process parameters, material parameters, and mold state parameters, as well as the corresponding defect types and defect indices. The TF-IDF algorithm combined with the BERT entity recognition model was used to extract entity instances and associated instances from the historical production data: specific values ​​of various entities were extracted as entity instances, and the relationships between entity instances were extracted as associated instances. The extracted entity instances and associated instances were then batch-populated into the ontology layer of the knowledge graph, establishing a correspondence between instances and entity categories and connecting edges. The populated knowledge graph was validated, deleting duplicate instances and incorrectly associated instances to ensure that instance values ​​were within the preset range of entity attributes and that relationships conformed to semantic rules. The Neo4j graph database was used to store the complete die-casting process knowledge graph, supporting subsequent neighborhood information aggregation and association degree calculation. The knowledge graph update cycle was set to one month.

[0125] For example, entity instances and related instances of motor housing die castings are extracted from historical production data: Entity instance: 0.8% iron content in aluminum alloy, mold temperature 85℃, pouring temperature 670℃, release agent spraying amount 8ml / time, sticking and tearing defect index 0.18. Related instances: Mold temperature of 85℃ causes sticking and tearing, defect index 0.18, correlation strength 0.85; release agent spraying amount of 8ml / time causes sticking and tearing, defect index 0.18, correlation strength 0.8; iron content of 0.8% in aluminum alloy affects sticking and tearing, defect index 0.18, correlation strength 0.7. These instances are populated into the knowledge graph. After verification, they are stored in the Neo4j graph database, completing the knowledge graph construction. This knowledge graph contains 10,000 sets of related instances, accurately reflecting the correlation patterns between various parameters and sticking and tearing defects.

[0126] Furthermore, the sticking and tearing defect index is input into a pre-constructed die-casting process knowledge graph. A graph attention network is then used to aggregate the neighborhood information of the node containing the defect type corresponding to the sticking and tearing defect index in the knowledge graph, obtaining the association information between multiple die-casting process parameters and the sticking and tearing defect. The graph attention network refers to a deep learning network deployed in an industrial control computer, used to aggregate the neighborhood node information of the target node in the knowledge graph, highlighting node information with high correlation to the target node. Neighborhood information refers to all nodes directly connected to the sticking and tearing defect node in the knowledge graph and their associated relationships. Association information refers to the strength and direction of influence of the association between various parameters and the sticking and tearing defect, obtained through the aggregation of neighborhood information.

[0127] Specifically, the sticking and tearing defect index obtained from S200 is input into the die-casting process knowledge graph in the Neo4j graph database to locate the sticking and tearing defect node corresponding to the defect index. A graph attention network is constructed based on the Python programming language and PyTorch framework. The input is the node features and adjacency matrix of the knowledge graph. The hidden layer dimension is set to 64, the number of attention heads is set to 4, the activation function is the ReLU function, and the training dataset is the associated instances in the knowledge graph. Training stops when the loss function value is lower than 0.01. The neighborhood information of the sticking and tearing defect node is aggregated through the graph attention network: the attention coefficient between the defect node and each neighboring node is calculated. The larger the attention coefficient, the stronger the association between the neighboring node and the defect node. The attention coefficient and node features are weighted and fused to obtain the association information between various parameters and the sticking and tearing defect. The aggregated association information is organized into an association matrix and stored in the memory of the industrial control computer for subsequent association degree calculation.

[0128] For example, the motor housing sticking and tearing defect index of 0.151 obtained from S200 is input into the knowledge graph to locate the minor sticking and tearing defect node. The neighborhood information of this node is aggregated through a graph attention network to calculate the attention coefficients of each neighborhood node: mold temperature node 0.82, release agent spraying amount node 0.75, iron content in aluminum alloy node 0.70, pouring temperature node 0.68, and injection speed node 0.62. The attention coefficients are fused with the node features to obtain the association information: mold temperature and release agent spraying amount have the highest association strength with this defect, and both have negative effects. The association information is organized into an association matrix and stored in the industrial control computer.

[0129] Subsequently, based on the aforementioned association information, a dual-branch inference network is used to calculate the association degree of multiple die-casting process parameters in the die-casting process knowledge graph. This dual-branch inference network includes a sparse parameter branch and a dense parameter branch. The sparse parameter branch handles inference tasks for sparsely distributed die-casting process parameters, while the dense parameter branch handles inference tasks for densely distributed die-casting process parameters. The dual-branch inference network refers to a deep learning network deployed in an industrial control computer, containing two independent branches used to infer the aggregated association information and calculate the association degree between various die-casting process parameters and sticking / scratching defects. The sparse parameter branch handles inference tasks for die-casting process parameters with sparse value distributions, while the dense parameter branch handles inference tasks for die-casting process parameters with dense value distributions. The association degree refers to the degree of correlation between a die-casting process parameter and sticking / scratching defects, ranging from 0 to 1. A larger value indicates a greater influence of the parameter on the defect.

[0130] Specifically, a dual-branch inference network is constructed based on the Python programming language and the PyTorch framework. The two branches process the aforementioned association matrix in parallel: the sparse parameter branch uses one fully connected layer and one dropout layer to handle sparse parameters such as gripper action timing and suction cup vacuum; the dense parameter branch uses two fully connected layers and one batch normalization layer to handle dense parameters such as mold temperature and casting temperature. Network training: Association instances from the knowledge graph are used as training data. The sparse parameter branch trains on association instances between sparse parameters and defects, while the dense parameter branch trains on association instances between dense parameters and defects. The training objective is to minimize the association degree prediction error, using the mean squared error loss function. Training stops when the prediction error is below 0.02. The association matrix is ​​input into the dual-branch inference network. The sparse parameter branch calculates the association degree between sparse process parameters and defects, and the dense parameter branch calculates the association degree between dense process parameters and defects. The network outputs the association degree values ​​for all die-casting process parameters and stores them in the memory of the industrial control computer.

[0131] For example, the correlation matrix is ​​input into the bi-branch inference network. The dense parameter branch calculates the correlation degree of dense parameters such as mold temperature and pouring temperature: mold temperature 0.82, pouring temperature 0.68, injection pressure 0.65, injection speed 0.62, holding time 0.58, mold retention time 0.55, and release agent spraying amount 0.75. The sparse parameter branch calculates the correlation degree of sparse parameters: suction cup vacuum degree 0.42, and gripper action timing 0.38.

[0132] Finally, based on the correlation calculation results, one or more die-casting process parameters with the highest correlation to the sticking and tearing defects are selected from multiple die-casting process parameters as the dominant process parameters causing the sticking and tearing defects. The dominant process parameters refer to one or more die-casting process parameters with the highest correlation to the sticking and tearing defects; they are the core factors causing the defects. Subsequent process parameter optimization is only performed on the dominant process parameters, which can improve optimization efficiency and accuracy. The correlation threshold refers to a preset numerical standard used to select the dominant process parameters, set by those skilled in the art according to production needs, to ensure that the selected parameters are the core influencing factors.

[0133] Specifically, a correlation threshold is preset, and a filtering program is written in the industrial control computer to call up the correlation values ​​of all die-casting process parameters and filter out process parameters with a correlation degree greater than or equal to the correlation threshold. If multiple parameters with a correlation degree greater than or equal to the correlation threshold are filtered out, they are sorted from highest to lowest correlation degree. Based on the production process control requirements, the first two are selected as the dominant process parameters to avoid excessive parameters that would complicate optimization. The filtered dominant process parameters and their correlation values ​​are stored in the local database of the industrial control computer, and signals are simultaneously sent to subsequent S400 steps to clarify the optimization targets.

[0134] For example, with a preset correlation threshold of 0.7, process parameters with a correlation of ≥0.7 are selected: mold temperature 0.82 and release agent spraying amount 0.75. After sorting them from high to low correlation, they are identified as the dominant process parameters that cause sticking and tearing defects in the motor housing. They are stored in the database and a signal is sent to step S400 to clarify that subsequent dynamic optimization will only be performed on mold temperature and release agent spraying amount.

[0135] In this embodiment of the invention, a die-casting process knowledge graph containing multiple entities and multiple relationships is constructed, integrating the correlation patterns between parameters and defects in historical production data. This solves the problem of traditional attribution methods relying on experience and having large biases. The application of graph attention networks enables accurate aggregation of neighborhood information of defect nodes, highlighting the correlation information of core influencing parameters. A dual-branch inference network calculates the correlation degree for process parameters of different distribution types, improving the accuracy and efficiency of correlation degree calculation and avoiding calculation biases caused by a single inference method. The dominant process parameters are screened out through correlation degree thresholds, clarifying the objects of subsequent process optimization and avoiding the problems of low efficiency and increased costs caused by blindly optimizing all parameters. The screened dominant process parameters accurately correspond to the causes of defects, providing a clear target for the dynamic optimization of process parameters in step S400, ensuring the pertinence and accuracy of the process optimization scheme, and further promoting the intelligent and refined management and control of die-casting production.

[0136] S400: With the goal of minimizing the sticking and tearing defect index, the determined dominant process parameters are dynamically optimized to generate an optimized combination of dominant process parameters, and the optimized combination of dominant process parameters is fed back to the aluminum alloy die-casting machine control system for execution.

[0137] In this embodiment of the invention, with the goal of minimizing the sticking and tearing defect index, the determined dominant process parameters are dynamically optimized to generate an optimized combination of dominant process parameters. This optimized combination of dominant process parameters is then fed back to the aluminum alloy die-casting machine control system for execution. Traditional manual parameter adjustment relies on experience-based trial and error, which cannot accurately match the optimal mapping relationship between parameter combinations and the defect index. Parameter adjustment is highly arbitrary and time-consuming, making it difficult to quickly reduce the sticking and tearing defect index to a minimum. To achieve the optimization goal of minimizing the defect index, a quantitative optimization model of the dominant process parameters and the defect index needs to be constructed. The optimal parameter combination is obtained through intelligent algorithm iteration and directly sent to the die-casting machine control system for closed-loop execution, forming a complete automated control chain from defect identification, quantification, attribution to parameter optimization, thus suppressing the generation of sticking and tearing defects at their source.

[0138] Step S400 in the method provided in this embodiment of the invention includes:

[0139] A multi-objective optimization model for the dominant process parameters is constructed with the objective function of minimizing the sticking and tearing defect index. The objective function is the mapping relationship between the sticking and tearing defect index and the dominant process parameters.

[0140] An optimization algorithm is used to iteratively optimize the dominant process parameters. In each iteration, candidate combinations of dominant process parameters are generated, and the candidate combinations of dominant process parameters are input into the multi-objective optimization model to calculate the corresponding predicted sticking and tearing defect index.

[0141] When the predicted sticking and tearing defect index meets the preset termination condition, the iterative optimization is stopped, and the candidate dominant process parameter combination generated in the current iteration is used as the optimized dominant process parameter combination.

[0142] The optimized combination of dominant process parameters is written into the programmable logic controller of the aluminum alloy die-casting machine control system in real time through the industrial IoT interface, replacing the original dominant process parameter configuration, and used for parameter control of the next die-casting cycle.

[0143] First, a multi-objective optimization model for the dominant process parameters is constructed with the objective function of minimizing the sticking and tearing defect index. The objective function represents the mapping relationship between the sticking and tearing defect index and the dominant process parameters. The multi-objective optimization model refers to a mathematical model that establishes a quantitative mapping relationship between the dominant process parameters and the defect index, with the objective of minimizing the sticking and tearing defect index. The objective function is a quantitative function describing the change of the sticking and tearing defect index with the dominant process parameters, and it serves as the basis for the algorithm's optimization. The dominant process parameters refer to the process parameters with the highest correlation to defects selected by S300.

[0144] Specifically, based on an industrial control computer, a multi-objective optimization model is constructed using a BP neural network. The dominant process parameters determined by S300 are used as input variables, and the sticking and tearing defect index of S200 is used as the output variable. The number of neurons in the input layer is the same as the number of dominant process parameters, the hidden layer is set to 2 layers, and the number of neurons in the output layer is 1. The activation function is the ReLU function. The corresponding data of dominant parameters and defect index in historical production are used as the training set. The model is trained until the prediction error is ≤0.01. The objective function of the model is defined as: minf(X)=Y, where X is the combination of dominant process parameters, Y is the predicted sticking and tearing defect index, and the optimization objective is to minimize the value of Y.

[0145] For example, for die-cast parts of motor housings in new energy vehicles, S300 determines the main process parameters as mold temperature and release agent spraying amount, the input variables as mold temperature and release agent spraying amount, the output as predicted defect index, and the objective function as minimizing the defect index. After the multi-objective optimization model is trained, it can accurately predict the defect index corresponding to different parameter combinations.

[0146] Secondly, an optimization algorithm is used to iteratively optimize the dominant process parameters. In each iteration, candidate combinations of dominant process parameters are generated, and these combinations are input into the multi-objective optimization model to calculate the corresponding predicted sticking and tearing defect index. The optimization algorithm refers to an intelligent iterative algorithm used to quickly search for the optimal parameter combination, employing the particle swarm optimization (PSO) algorithm. Iterative optimization refers to the process by which the algorithm gradually approaches the optimal solution by repeatedly updating the parameter combination; candidate combinations of dominant process parameters refer to temporary combinations of dominant process parameters generated in each iteration and awaiting verification.

[0147] Specifically, a particle swarm optimization algorithm is used for iterative optimization, with fixed algorithm parameters: 20 particles, 50 maximum iterations, inertia weight of 0.7, cognitive learning factor c1=2, and social learning factor c2=2. The standard process range of the dominant process parameters is used as constraints: mold temperature 80-120℃, and release agent spraying amount 5-15ml / time. Initially, 20 sets of parameter combinations are randomly generated as initial particles. In each iteration, the predicted defect index corresponding to each candidate parameter combination is calculated, and the particle position is gradually updated towards parameters with smaller predicted defect indices, generating new candidate dominant process parameter combinations.

[0148] For example, for the main parameters of the motor housing, such as mold temperature and release agent spraying amount, the particle swarm algorithm initially generates candidate combinations such as (85℃, 8ml / time) and (90℃, 10ml / time). After the first iteration, new candidate groups (92℃, 11ml / time) and (94℃, 12ml / time) are generated. In each iteration, the candidate combinations are input into the multi-objective optimization model to calculate the predicted defect index.

[0149] Furthermore, when the predicted sticking and tearing defect index meets the preset termination condition, the iterative optimization stops, and the candidate dominant process parameter combination generated in the current iteration is taken as the optimized dominant process parameter combination. The preset termination condition refers to the judgment rule for stopping the algorithm iteration, which includes dual constraints of the predicted defect index threshold and the maximum number of iterations. The optimized dominant process parameter combination refers to the candidate parameter combination with the smallest predicted defect index when the termination condition is met.

[0150] Specifically, a dual termination condition is set, and iteration stops when either condition is met: the predicted sticking and tearing defect index is ≤0.05; and the number of iterations reaches a maximum of 50. After each iteration, the predicted defect index of the current optimal candidate combination is compared with the termination condition. If the condition is met, iteration stops immediately, and the candidate combination with the smallest predicted defect index is taken as the final optimized dominant process parameter combination.

[0151] For example, when the particle swarm optimization algorithm iterates to the 12th iteration, it generates a candidate combination: mold temperature 95℃, release agent spraying amount 12ml / time. The defect index is predicted to be 0.042 by the multi-objective optimization model. 0.042≤0.05, which meets the termination condition. The iteration stops, and this combination is determined as the optimized dominant process parameter combination.

[0152] Finally, the optimized combination of dominant process parameters is written in real time into the programmable logic controller (PLC) of the aluminum alloy die-casting machine control system via an Industrial Internet of Things (IIoT) interface, replacing the original dominant process parameter configuration for parameter control in the next die-casting cycle. The IIoT interface refers to the communication interface between the industrial control computer and the die-casting machine control system, using a Modbus-TCP industrial Ethernet interface. The programmable logic controller (PLC) is the core control unit of the die-casting machine, used to receive and execute process parameter instructions; a Siemens S7-1200 PLC is used.

[0153] Specifically, the industrial control computer establishes real-time communication with the aluminum alloy die-casting machine control system through the Modbus-TCP industrial IoT interface; it packages the optimized main process parameters into standard data frames and writes them into the PLC's parameter configuration register in real time, overwriting the original process parameters; after the parameters are written, it sends a parameter activation command to the PLC, and the PLC automatically calls the new parameter configuration to complete the entire process control such as injection and demolding at the start of the next die-casting cycle.

[0154] For example, the industrial control computer writes "mold temperature 95℃, release agent spraying amount 12ml / time" into the Siemens S7-1200 PLC of the die-casting machine via the Modbus-TCP interface, replacing the original "mold temperature 85℃, release agent spraying amount 8ml / time". After the PLC receives the activation command, the next motor housing die-casting cycle will directly use the new parameters.

[0155] In this embodiment of the invention, a multi-objective optimization model is constructed to establish a precise mapping relationship between the dominant process parameters and the sticking and tearing defect index. A particle swarm optimization algorithm is used for rapid iterative optimization, which can obtain the optimal parameter combination that minimizes the defect index in a short time, avoiding the blindness and lag of manual trial and error. Dual termination conditions ensure optimization accuracy and efficiency, achieving precise and controllable parameter optimization. Optimization parameters are directly sent to the PLC for closed-loop execution via an industrial IoT interface, forming a complete automated control chain for defect identification, quantification, attribution, and optimization. The process can be adjusted in real time without manual intervention, continuously reducing the sticking and tearing defect index and improving the production yield and intelligent management level of aluminum alloy die castings.

[0156] Through the specific implementation methods described above, the embodiments of the present invention achieve the following technical effects:

[0157] This invention provides a method and system for optimizing aluminum alloy die casting processes based on defect identification. It achieves real-time and accurate identification of sticking and tearing defects through visual imaging and a dual-path video analysis network. Based on defect geometry and grayscale features, it completes standardized quantitative calculation of the defect index. Combining a die casting process knowledge graph and a dual-branch reasoning network, it achieves intelligent and accurate attribution of defect causes and locates the dominant process parameters. Then, with the goal of minimizing the defect index, it dynamically seeks optimization through an optimization algorithm and feeds back the optimal parameter combination in a closed loop to the die casting machine control system for execution. This forms a fully automated closed-loop control system from defect identification, quantitative assessment, intelligent attribution to process optimization, effectively improving the accuracy and reliability of defect identification, achieving accurate quantification of defect severity, accurately pinpointing defect causes, shortening the process adjustment cycle, reducing the incidence of sticking and tearing defects from the root cause, and improving the intelligence level and product yield of aluminum alloy die casting production.

[0158] Example 2, as Figure 2 As shown, this invention provides an aluminum alloy die-casting process optimization system based on defect identification, the system comprising:

[0159] The visual defect recognition module 11 is used to collect the video stream of the die casting through a visual imaging system after the aluminum alloy die casting is demolded, and to identify whether there are sticking and tearing defects on the surface of the aluminum alloy die casting based on the video stream of the die casting.

[0160] The defect index calculation module 12 is used to quantitatively calculate the mold sticking tear defect when the existence of the mold sticking tear defect is identified, and obtain the mold sticking tear defect index.

[0161] The defect attribution analysis module 13 is used to perform attribution analysis based on the sticking and tearing defect index and in combination with the pre-constructed die casting process knowledge graph to determine the dominant process parameters that cause sticking and tearing defects.

[0162] The parameter dynamic optimization module 14 is used to dynamically optimize the determined dominant process parameters with the goal of minimizing the sticking and tearing defect index, generate an optimized combination of dominant process parameters, and feed the optimized combination of dominant process parameters back to the aluminum alloy die casting machine control system for execution.

[0163] In one embodiment, the visual defect recognition module 11 is further configured to:

[0164] The video stream of the die-cast aluminum alloy die-casting part during its movement after demolding is acquired using a visual imaging system;

[0165] A dual-path video analysis network is constructed to identify defects in the video stream of the die-casting part, wherein the dual-path video analysis network includes a slow path branch and a fast path branch;

[0166] Key frames in the die-cast part video stream are extracted at a low frame rate through the slow path branch, and spatial semantic features are extracted from the key frames to obtain the spatial structure features and texture features of the die-cast part surface.

[0167] The continuous frame sequence in the video stream of the die casting is extracted at a high frame rate through the fast path branch, and the temporal motion feature is extracted from the continuous frame sequence to obtain the dynamic change features of the die casting surface during the demolding process.

[0168] The spatial structure features, texture features, and dynamic change features are fused to obtain the fused multidimensional defect features.

[0169] Based on the fused multidimensional defect features, the system identifies whether there are sticking and tearing defects on the surface of die castings, and outputs the identification results and defect confidence scores for sticking and tearing defects.

[0170] Specifically, based on the fused multidimensional defect features, the system identifies whether there are sticking and tearing defects on the surface of the die casting, and outputs the identification results and defect confidence scores for sticking and tearing defects, including:

[0171] The fused multidimensional defect features are input into a pre-trained multi-task classification decision network, wherein the multi-task classification decision network includes a first task branch and a second task branch.

[0172] The first task branch performs defect category probability calculation on the fused multidimensional defect features and outputs a binary classification result of whether there is a sticking and tearing defect on the surface of the die casting. The binary classification result includes whether there is a sticking and tearing defect or whether there is no sticking and tearing defect.

[0173] The second task branch performs confidence regression calculation on the fused multidimensional defect features and outputs the defect confidence value corresponding to the binary classification result, wherein the defect confidence value ranges from 0 to 1.

[0174] When the binary classification result output by the first task branch indicates the presence of a mold sticking tear defect, and the defect confidence value output by the second task branch is greater than or equal to a preset confidence threshold, the binary classification result and the defect confidence value are used as the identification result and defect confidence value of the mold sticking tear defect.

[0175] When the binary classification result output by the first task branch indicates the presence of a sticking and tearing defect, but the defect confidence value output by the second task branch is lower than the preset confidence threshold, a secondary analysis is performed on the corresponding suspicious video segment in the die casting video stream, and then the identification result of the sticking and tearing defect is output.

[0176] When the binary classification result output by the first task branch indicates that there is no sticking and tearing defect, but the defect confidence value output by the second task branch is lower than the preset confidence threshold, a re-acquisition command is triggered to control the visual imaging system to re-acquire the die-cast video stream of the current aluminum alloy die-casting.

[0177] Specifically, when the binary classification result output by the first task branch indicates the presence of a sticking and tearing defect, but the defect confidence value output by the second task branch is lower than a preset confidence threshold, a secondary analysis is performed on the corresponding suspicious video segment in the die-casting video stream, and the identification result of the sticking and tearing defect is output again, including:

[0178] Based on the time interval and spatial region information corresponding to the fused multidimensional defect features in the die casting video stream, suspicious video segments are located and extracted from the die casting video stream.

[0179] Each frame of the suspicious video segment is magnified locally to extract the micro-texture features of the mold sticking and tearing defects within the magnified local area;

[0180] Optical flow field calculations were performed on the suspicious video segments to extract the micro-displacement and deformation features of the adhesive mold tear defect region between consecutive frames;

[0181] The suspicious video segments are segmented in the temporal domain at multiple scales, and short-term abrupt change features and long-term gradual change features are extracted respectively.

[0182] The micro-texture features, micro-displacement features, deformation features, short-term abrupt change features, and long-term gradual change features are fused at multiple levels to obtain refined defect features;

[0183] The refined defect features are input into a pre-trained refined classification model, and the identification result of the mold sticking and tearing defect is output, wherein the identification result includes the existence judgment of the mold sticking and tearing defect.

[0184] In one embodiment, the defect index calculation module 12 is further configured to:

[0185] Defect image feature parameters of the sticking and tearing defect are extracted from the fused multidimensional defect features, wherein the defect image feature parameters include defect geometric feature parameters and defect grayscale feature parameters;

[0186] The defect geometric feature parameters and the defect grayscale feature parameters are normalized to obtain standard defect geometric feature parameters and standard defect grayscale feature parameters.

[0187] Based on the standard defect geometric feature parameters and the standard defect grayscale feature parameters, the sticking and tearing defect index is obtained by weighted calculation.

[0188] Among them, the defect image feature parameters of the sticking and tearing defects are extracted from the fused multidimensional defect features, including:

[0189] Extract the geometric feature parameters of the sticking and tearing defects from the fused multidimensional defect features, wherein the geometric feature parameters include at least one of the following: defect length, defect width, defect area, and defect perimeter.

[0190] Extract the grayscale feature parameters of the sticking and tearing defects from the fused multidimensional defect features, wherein the grayscale feature parameters include at least one of the average grayscale value of the defect region, the grayscale variance of the defect region, and the grayscale gradient of the defect region.

[0191] In one embodiment, the defect attribution analysis module 13 is further configured to:

[0192] The sticking and tearing defect index is input into a pre-constructed die casting process knowledge graph. The neighborhood information of the node where the defect type corresponding to the sticking and tearing defect index is located in the die casting process knowledge graph is aggregated through a graph attention network to obtain the correlation information between multiple die casting process parameters and sticking and tearing defects.

[0193] Based on the aforementioned association information, a dual-branch inference network is used to calculate the association degree of multiple die casting process parameters in the die casting process knowledge graph. The dual-branch inference network includes a sparse parameter branch and a dense parameter branch. The sparse parameter branch is used to handle the inference task of sparsely distributed die casting process parameters, and the dense parameter branch is used to handle the inference task of densely distributed die casting process parameters.

[0194] Based on the correlation calculation results, one or more die casting process parameters with the highest correlation to the sticking and tearing defects are selected from multiple die casting process parameters and used as the dominant process parameters leading to the sticking and tearing defects.

[0195] The construction process of the die-casting process knowledge graph includes:

[0196] Using die casting process parameters, material parameters, mold state parameters, and defect types as entity categories, an ontology layer of the die casting process knowledge graph is constructed. The die casting process parameters include at least the iron content in the aluminum alloy, mold temperature, pouring temperature, injection pressure, injection speed, holding time, mold retention time, release agent spraying amount, suction cup vacuum degree, and gripper action sequence.

[0197] Based on the causal relationship between die casting process parameters and defect types, the coupling relationship between die casting process parameters, and the influence relationship between material parameters and defect types, connection edges between entities are constructed.

[0198] Multiple entity instances and associated instances between multiple entities are extracted from historical die-casting production data. The extracted entity instances and associated instances between multiple entities are then filled into the ontology layer to complete the construction of the die-casting process knowledge graph.

[0199] In one embodiment, the parameter dynamic optimization module 14 is further configured to:

[0200] A multi-objective optimization model for the dominant process parameters is constructed with the objective function of minimizing the sticking and tearing defect index. The objective function is the mapping relationship between the sticking and tearing defect index and the dominant process parameters.

[0201] An optimization algorithm is used to iteratively optimize the dominant process parameters. In each iteration, candidate combinations of dominant process parameters are generated, and the candidate combinations of dominant process parameters are input into the multi-objective optimization model to calculate the corresponding predicted sticking and tearing defect index.

[0202] When the predicted sticking and tearing defect index meets the preset termination condition, the iterative optimization is stopped, and the candidate dominant process parameter combination generated in the current iteration is used as the optimized dominant process parameter combination.

[0203] The optimized combination of dominant process parameters is written into the programmable logic controller of the aluminum alloy die-casting machine control system in real time through the industrial IoT interface, replacing the original dominant process parameter configuration, and used for parameter control of the next die-casting cycle.

[0204] It should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for optimizing aluminum alloy die-casting process based on defect identification, characterized in that, The method includes: After the aluminum alloy die casting is demolded, a video stream of the die casting is acquired through a vision imaging system, and the presence of sticking and tearing defects on the surface of the aluminum alloy die casting is identified based on the video stream. When a sticking mold tear defect is identified, the sticking mold tear defect is quantitatively calculated to obtain the sticking mold tear defect index. Based on the sticking and tearing defect index, and combined with the pre-constructed die casting process knowledge graph, attribution analysis is performed to determine the dominant process parameters that lead to sticking and tearing defects. With the goal of minimizing the sticking and tearing defect index, the determined dominant process parameters are dynamically optimized to generate an optimized combination of dominant process parameters, which is then fed back to the aluminum alloy die-casting machine control system for execution.

2. The method for optimizing aluminum alloy die-casting process based on defect identification according to claim 1, characterized in that, After the aluminum alloy die casting is demolded, a video stream of the die casting is acquired using a visual imaging system. Based on this video stream, the system identifies whether there are defects such as sticking or tearing on the surface of the aluminum alloy die casting, including: The video stream of the die-cast aluminum alloy die-casting part during its movement after demolding is acquired using a visual imaging system; A dual-path video analysis network is constructed to identify defects in the video stream of the die-casting part, wherein the dual-path video analysis network includes a slow path branch and a fast path branch; Key frames in the die-cast part video stream are extracted at a low frame rate through the slow path branch, and spatial semantic features are extracted from the key frames to obtain the spatial structure features and texture features of the die-cast part surface. The continuous frame sequence in the video stream of the die casting is extracted at a high frame rate through the fast path branch, and the temporal motion feature is extracted from the continuous frame sequence to obtain the dynamic change features of the die casting surface during the demolding process. The spatial structure features, texture features, and dynamic change features are fused to obtain the fused multidimensional defect features. Based on the fused multidimensional defect features, the system identifies whether there are sticking and tearing defects on the surface of die castings, and outputs the identification results and defect confidence scores for sticking and tearing defects.

3. The method for optimizing aluminum alloy die-casting process based on defect identification according to claim 2, characterized in that, Based on the fused multidimensional defect features, the system identifies whether sticking and tearing defects exist on the surface of die-cast parts, and outputs the identification results and defect confidence scores for sticking and tearing defects, including: The fused multidimensional defect features are input into a pre-trained multi-task classification decision network, wherein the multi-task classification decision network includes a first task branch and a second task branch. The first task branch performs defect category probability calculation on the fused multidimensional defect features and outputs a binary classification result of whether there is a sticking and tearing defect on the surface of the die casting. The binary classification result includes whether there is a sticking and tearing defect or whether there is no sticking and tearing defect. The second task branch performs confidence regression calculation on the fused multidimensional defect features and outputs the defect confidence value corresponding to the binary classification result, wherein the defect confidence value ranges from 0 to 1. When the binary classification result output by the first task branch indicates the presence of a mold sticking tear defect, and the defect confidence value output by the second task branch is greater than or equal to a preset confidence threshold, the binary classification result and the defect confidence value are used as the identification result and defect confidence value of the mold sticking tear defect. When the binary classification result output by the first task branch indicates the presence of a sticking and tearing defect, but the defect confidence value output by the second task branch is lower than the preset confidence threshold, a secondary analysis is performed on the corresponding suspicious video segment in the die casting video stream, and then the identification result of the sticking and tearing defect is output. When the binary classification result output by the first task branch indicates that there is no sticking and tearing defect, but the defect confidence value output by the second task branch is lower than the preset confidence threshold, a re-acquisition command is triggered to control the visual imaging system to re-acquire the die-cast video stream of the current aluminum alloy die-casting.

4. The method for optimizing aluminum alloy die-casting process based on defect identification according to claim 3, characterized in that, When the binary classification result output by the first task branch indicates the presence of a sticking and tearing defect, but the defect confidence value output by the second task branch is lower than a preset confidence threshold, a secondary analysis is performed on the corresponding suspicious video segments in the die-casting video stream, and the identification result of the sticking and tearing defect is output again, including: Based on the time interval and spatial region information corresponding to the fused multidimensional defect features in the die casting video stream, suspicious video segments are located and extracted from the die casting video stream. Each frame of the suspicious video segment is magnified locally to extract the micro-texture features of the mold sticking and tearing defects within the magnified local area; Optical flow field calculations were performed on the suspicious video segments to extract the micro-displacement and deformation features of the adhesive mold tear defect region between consecutive frames; The suspicious video segments are segmented in the temporal domain at multiple scales, and short-term abrupt change features and long-term gradual change features are extracted respectively. The micro-texture features, micro-displacement features, deformation features, short-term abrupt change features, and long-term gradual change features are fused at multiple levels to obtain refined defect features; The refined defect features are input into a pre-trained refined classification model, and the identification result of the mold sticking and tearing defect is output, wherein the identification result includes the existence judgment of the mold sticking and tearing defect.

5. The method for optimizing aluminum alloy die-casting process based on defect identification according to claim 1, characterized in that, When a sticking and tearing defect is identified, the sticking and tearing defect is quantitatively calculated to obtain a sticking and tearing defect index, including: Defect image feature parameters of the sticking and tearing defect are extracted from the fused multidimensional defect features, wherein the defect image feature parameters include defect geometric feature parameters and defect grayscale feature parameters; The defect geometric feature parameters and the defect grayscale feature parameters are normalized to obtain standard defect geometric feature parameters and standard defect grayscale feature parameters. Based on the standard defect geometric feature parameters and the standard defect grayscale feature parameters, the sticking and tearing defect index is obtained by weighted calculation.

6. The method for optimizing aluminum alloy die-casting process based on defect identification according to claim 5, characterized in that, Defect image feature parameters of the sticking and tearing defects are extracted from the fused multidimensional defect features, including: Extract the geometric feature parameters of the sticking and tearing defects from the fused multidimensional defect features, wherein the geometric feature parameters include at least one of the following: defect length, defect width, defect area, and defect perimeter. Extract the grayscale feature parameters of the sticking and tearing defects from the fused multidimensional defect features, wherein the grayscale feature parameters include at least one of the average grayscale value of the defect region, the grayscale variance of the defect region, and the grayscale gradient of the defect region.

7. The method for optimizing aluminum alloy die-casting process based on defect identification according to claim 1, characterized in that, Based on the aforementioned sticking and tearing defect index, and combined with a pre-constructed die-casting process knowledge graph, attribution analysis is performed to determine the dominant process parameters leading to sticking and tearing defects, including: The sticking and tearing defect index is input into a pre-constructed die casting process knowledge graph. The neighborhood information of the node where the defect type corresponding to the sticking and tearing defect index is located in the die casting process knowledge graph is aggregated through a graph attention network to obtain the correlation information between multiple die casting process parameters and sticking and tearing defects. Based on the aforementioned association information, a dual-branch inference network is used to calculate the association degree of multiple die casting process parameters in the die casting process knowledge graph. The dual-branch inference network includes a sparse parameter branch and a dense parameter branch. The sparse parameter branch is used to handle the inference task of sparsely distributed die casting process parameters, and the dense parameter branch is used to handle the inference task of densely distributed die casting process parameters. Based on the correlation calculation results, one or more die casting process parameters with the highest correlation to the sticking and tearing defects are selected from multiple die casting process parameters and used as the dominant process parameters leading to the sticking and tearing defects.

8. The method for optimizing aluminum alloy die-casting process based on defect identification according to claim 7, characterized in that, The process of constructing the knowledge graph of the die-casting process includes: Using die casting process parameters, material parameters, mold state parameters, and defect types as entity categories, an ontology layer of the die casting process knowledge graph is constructed. The die casting process parameters include at least the iron content in the aluminum alloy, mold temperature, pouring temperature, injection pressure, injection speed, holding time, mold retention time, release agent spraying amount, suction cup vacuum degree, and gripper action sequence. Based on the causal relationship between die casting process parameters and defect types, the coupling relationship between die casting process parameters, and the influence relationship between material parameters and defect types, connection edges between entities are constructed. Multiple entity instances and associated instances between multiple entities are extracted from historical die-casting production data. The extracted entity instances and associated instances between multiple entities are then filled into the ontology layer to complete the construction of the die-casting process knowledge graph.

9. The method for optimizing aluminum alloy die-casting process based on defect identification according to claim 1, characterized in that, With the goal of minimizing the sticking and tearing defect index, the determined dominant process parameters are dynamically optimized to generate an optimized combination of dominant process parameters. This optimized combination of dominant process parameters is then fed back to the aluminum alloy die-casting machine control system for execution, including: A multi-objective optimization model for the dominant process parameters is constructed with the objective function of minimizing the sticking and tearing defect index. The objective function is the mapping relationship between the sticking and tearing defect index and the dominant process parameters. An optimization algorithm is used to iteratively optimize the dominant process parameters. In each iteration, candidate combinations of dominant process parameters are generated, and the candidate combinations of dominant process parameters are input into the multi-objective optimization model to calculate the corresponding predicted sticking and tearing defect index. When the predicted sticking and tearing defect index meets the preset termination condition, the iterative optimization is stopped, and the candidate dominant process parameter combination generated in the current iteration is used as the optimized dominant process parameter combination. The optimized combination of dominant process parameters is written into the programmable logic controller of the aluminum alloy die-casting machine control system in real time through the industrial IoT interface, replacing the original dominant process parameter configuration, and used for parameter control of the next die-casting cycle.

10. An aluminum alloy die-casting process optimization system based on defect identification, characterized in that, The system is used to implement the aluminum alloy die-casting process optimization method based on defect identification as described in any one of claims 1-9, the system comprising: The visual defect recognition module is used to collect video streams of the die-cast parts through a visual imaging system after the die-cast parts are demolded, and to identify whether there are sticking and tearing defects on the surface of the die-cast parts based on the video streams. The defect index calculation module is used to quantitatively calculate the mold sticking and tearing defect when the existence of the defect is identified, and obtain the mold sticking and tearing defect index. The defect attribution analysis module is used to perform attribution analysis based on the sticking and tearing defect index and in combination with the pre-constructed die casting process knowledge graph to determine the dominant process parameters that cause sticking and tearing defects. The parameter dynamic optimization module is used to dynamically optimize the determined dominant process parameters with the goal of minimizing the sticking and tearing defect index, generate an optimized combination of dominant process parameters, and feed the optimized combination of dominant process parameters back to the aluminum alloy die casting machine control system for execution.