Die casting defect detection method and system based on multi-scale analysis
By using multi-scale analysis and defect distribution statistics, key defect features of die-cast parts are identified, and an image recognition network is trained. This solves the problem of insufficient accuracy and efficiency in multi-scale defect detection in existing technologies, and achieves efficient and accurate defect detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SUZHOU JIADU MASCH TECH CO LTD
- Filing Date
- 2025-08-26
- Publication Date
- 2026-06-23
AI Technical Summary
Existing industrial vision-based methods for detecting defects in die castings cannot effectively handle multi-scale defects, resulting in insufficient detection accuracy and efficiency.
By collecting historical defect detection records of die castings, multi-scale defect distribution analysis is performed to construct multi-scale defect distribution statistics, identify joint features of target multi-scale defects with a joint distribution probability greater than or equal to a preset threshold, train a defect image recognition network, and establish mapping relationships for defect analysis.
It improves the accuracy and efficiency of defect detection in die castings, optimizes the detection process, reduces missed and false detections, and lowers computational complexity.
Smart Images

Figure CN121032992B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of defect detection technology, specifically to a method and system for detecting defects in die-castings based on multi-scale analysis. Background Technology
[0002] In the industrial manufacturing sector, die-cast parts are core components in industries such as automotive, electronics, and aerospace. The accurate detection of internal defects in die-cast parts directly impacts the safety and reliability of the final product. However, various defects inevitably arise during the die-casting process, often exhibiting significant multi-scale characteristics: macroscopically, visible defects such as cracks and cold shuts may appear, while microscopically, minute defects requiring high magnification exist, such as micropores and inclusions. Traditional industrial vision inspection systems typically employ a single-scale inspection strategy, either scanning the entire workpiece at high resolution, resulting in low inspection efficiency, or using low-resolution rapid inspection, leading to missed microscopic defects. This fails to meet the dual requirements of modern production lines for both inspection accuracy and efficiency. Although some neural network-based defect detection methods have emerged, these methods often neglect the scale distribution patterns of defects at different locations, leading to wasted computational resources and unstable inspection results. Therefore, there is an urgent need for an intelligent inspection method that can automatically analyze the multi-scale distribution characteristics of defects and dynamically optimize the inspection strategy based on the inspection complexity, in order to achieve efficient and accurate quality control of die-cast parts in industrial production. Summary of the Invention
[0003] This application provides a method and system for detecting defects in die-casting parts based on multi-scale analysis, aiming to solve the technical problem that existing industrial vision-based defect detection methods are unable to effectively handle multi-scale defects, resulting in insufficient detection accuracy and efficiency.
[0004] The first aspect disclosed in this application provides a method for detecting defects in die-cast parts based on multi-scale analysis. The method includes: collecting historical defect detection records of a preset die-cast part, performing multi-scale defect distribution analysis, and constructing multi-scale defect distribution statistical results; analyzing multiple first defect joint features and multiple first joint distribution probabilities of a first location block based on the multi-scale defect distribution statistical results; identifying a first target multi-scale defect joint feature whose joint distribution probability is greater than or equal to a preset probability threshold based on the multiple first defect joint features and multiple first joint distribution probabilities; performing defect detection complexity analysis on each defect joint feature within the first target multi-scale defect joint feature, determining the defect feature with the minimum detection complexity, and training a first defect image recognition network; establishing a mapping relationship between the first defect image recognition network and the first location block, performing defect analysis on the image collected in the first location block, and generating a first location defect detection result.
[0005] Another aspect of this application discloses a die-casting defect detection system based on multi-scale analysis. The system includes: a defect analysis module: collecting historical defect detection records of a preset die-casting, performing multi-scale defect distribution analysis, and constructing multi-scale defect distribution statistical results; a location block analysis module: analyzing multiple first defect joint features and multiple first joint distribution probabilities of a first location block based on the multi-scale defect distribution statistical results; a joint feature recognition module: identifying a first target multi-scale defect joint feature with a joint distribution probability greater than or equal to a preset probability threshold based on the multiple first defect joint features and multiple first joint distribution probabilities; a network training module: performing defect detection complexity analysis on each defect joint feature within the first target multi-scale defect joint feature, determining the defect feature with the lowest detection complexity, and training a first defect image recognition network; and a defect analysis module: establishing a mapping relationship between the first defect image recognition network and the first location block, performing defect analysis on images collected in the first location block, and generating a first location defect detection result.
[0006] One or more technical solutions provided in this application have at least the following technical effects or advantages:
[0007] The aforementioned multi-scale analysis-based defect detection method for die castings first collects historical defect detection records of a preset die casting and performs multi-scale defect distribution analysis to construct multi-scale defect distribution statistics. Then, based on these statistics, it analyzes the joint features and distribution probabilities of multiple defects in a first location block. Next, by identifying target defect features with joint distribution probabilities greater than or equal to a preset threshold, it further filters out defects requiring focused detection. Then, it analyzes the complexity of these target defects, selects the simplest defect features, and uses these features to train a defect image recognition network. Finally, by establishing a mapping relationship between the trained recognition network and the location block, it performs defect analysis on the acquired images to generate the defect detection result for that location. This method effectively improves detection accuracy and efficiency through multi-scale analysis, optimizes the detection process, and reduces computational complexity. Simultaneously, by selecting the most representative defect features for training, it ensures the rapid and accurate identification of various defects in die castings, reducing missed and false detections.
[0008] The above description is merely an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, specific embodiments of this application are given below. Attached Figure Description
[0009] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 This is a flowchart illustrating a method for detecting defects in die-casting parts based on multi-scale analysis in one embodiment.
[0011] Figure 2 This is an architecture diagram of a die-casting defect detection system based on multi-scale analysis in one embodiment.
[0012] Figure labeling: Defect analysis module 11, Location block analysis module 12, Joint feature recognition module 13, Network training module 14, Defect analysis module 15. Detailed Implementation
[0013] This application provides a method and system for detecting defects in die-casting parts based on multi-scale analysis, which solves the technical problem that existing industrial vision-based defect detection methods cannot effectively handle multi-scale defects, resulting in insufficient detection accuracy and efficiency.
[0014] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0015] It should be noted that the terms “comprising” and “having”, and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or modules that are not explicitly listed or that are inherent to such process, method, product, or device.
[0016] Example 1, as Figure 1 As shown, this application provides a method for detecting defects in die-casting parts based on multi-scale analysis, the method comprising:
[0017] Collect historical defect detection records of preset die castings, conduct multi-scale defect distribution analysis, and construct multi-scale defect distribution statistical results.
[0018] In this embodiment, historical defect detection records of the pre-designed die-casting are first collected. These records include previous defect detection results for the same type of die-casting. Then, multi-scale analysis is performed based on the granularity (i.e., size) of the defects, classifying defects at different locations into different levels according to their size, such as large-scale defects (e.g., cracks, cold shuts), medium-scale defects (e.g., microcracks, bubbles), and small-scale defects (e.g., microcracks, micropores). Subsequently, these multi-scale defects are statistically analyzed to generate a multi-scale defect distribution statistical result. This result reflects the distribution of defects in the pre-designed die-casting at different scales, providing important evidence for subsequent defect identification and detection, and helping the system more accurately identify defects at different scales.
[0019] Furthermore, this application provides historical defect detection records of pre-selected die-cast parts for collection, performs multi-scale defect distribution analysis, and constructs multi-scale defect distribution statistical results, including:
[0020] The historical defect detection records are classified according to their defect distribution locations to generate multi-location defect detection records; the defect granularity of the multi-location defect detection records is identified to generate the multi-scale defect distribution statistical results.
[0021] Preferably, for the obtained historical defect detection records, the specific location of the defects in each record is analyzed (e.g., surface areas of the die casting, corners of the casting, thick-walled areas, etc.), and these records are classified according to defect location to generate multi-location defect detection records. Subsequently, the defect granularity of these multi-location defect detection records is identified, that is, the size of each defect in the multi-location defect detection records is compared according to a preset granularity level to identify which granularity level the defect at each location belongs to, such as large-scale granularity, medium-scale granularity, small-scale granularity, etc. This process ensures that the system can comprehensively analyze defects at different locations and scales. Finally, based on the results of these location classifications and granularity identifications, multi-scale defect distribution statistics are generated. These statistics will reflect the distribution of defects of different scales at each location. For example, in the surface area of the die casting, large-scale defects may be predominant, such as large cold shuts or cracks. These defects are usually caused by uneven mold temperature or improper pouring. In the corners of the casting, medium-scale defects may be dominant, such as microcracks or bubbles. These defects are usually formed under conditions of pressure concentration or uneven flow. Statistical analysis of historical defect detection records can provide a better understanding of the distribution characteristics of defects at different locations and scales, offering valuable insights for subsequent defect detection.
[0022] Based on the statistical results of the multi-scale defect distribution, the joint characteristics of multiple first defects and the probability of multiple first joint distributions of the first location block are analyzed.
[0023] In one embodiment, based on the statistical results of multi-scale defect distribution, a detailed analysis is performed on the first location block of the die-casting. This first location block is any one of the defect distribution locations, and it may simultaneously contain defects of multiple scales, such as large-scale and medium-scale defects. For the first location block, the joint features of multiple defects are extracted, i.e., the types of defects that may appear simultaneously at the same location (such as cracks and porosity). Then, the joint distribution probability of these defects is calculated, i.e., the probability that a certain defect co-occurs with other defects. For example, assuming that large cracks and porosity often appear simultaneously in the surface area, their joint distribution probability is calculated to quantify their correlation. If the correlation is high, it means that these two defects often appear simultaneously. In other words, if a crack is detected, porosity can be assumed to be present as well. Thus, in subsequent inspections, defects that are easier to detect and require fewer processing resources (such as cracks, which are relatively simple to detect) can be selected to indirectly infer the presence of porosity, thereby reducing computational resource consumption and inspection complexity, and improving inspection efficiency. In summary... By following the steps above, defect detection can be performed more intelligently, reducing redundant calculations and thus improving the real-time performance of die-casting defect detection through industrial vision.
[0024] Furthermore, this application provides analysis of multiple first defect joint features and multiple first joint distribution probabilities of the first location block based on the statistical results of the multi-scale defect distribution, including:
[0025] Extract the first multi-scale defect distribution corresponding to the first location block from the multi-scale defect distribution statistics; construct multiple first joint features containing two or more defect granularities based on the first multi-scale defect distribution; perform correlation analysis and fusion on the multiple first joint features at two or more defect granularities to generate the multiple first joint distribution probabilities.
[0026] Preferably, the first step is to extract the first multi-scale defect distribution corresponding to the first location block from the multi-scale defect distribution statistics. The purpose of this step is to obtain the distribution of defects of all different scales within the location block. For example, the location block may simultaneously contain large-scale defects such as cracks and bubbles, as well as medium-scale defects such as microcracks and micropores. Through multi-scale distribution statistics, the distribution characteristics of each scale of defects at this location are clarified. Subsequently, based on these defect distributions, multiple first defect joint features containing two or more defect granularities are constructed. That is, defects of different granularities involved in the first multi-scale defect distribution are randomly combined across granularities to obtain multiple first defect joint features. The combination method can be pairwise combination or every three combinations. Next, the correlation analysis and fusion are performed on each combination of these multiple first defect joint features. That is, the correlation between these defect granularities is analyzed based on the number of granularities involved in each combination, assessing their co-occurrence frequency and mutual influence. For example, for pairwise combinations, the correlation coefficient can be calculated, and a joint distribution probability can be obtained through weighted averaging. For combinations of more than two, the correlation coefficient of any defect granularity to other defect granularity combinations can be calculated, and a joint distribution probability can be obtained through weighted averaging. Finally, all the obtained joint distribution probabilities are added to a set to generate multiple first joint distribution probabilities. These first joint distribution probabilities reflect the probability of occurrence of different scale defect combinations within the location block, further helping to infer the probability of other defects occurring when a certain defect type occurs. Through these steps, the interrelationships between defects of different scales can be understood and predicted more accurately, improving the accuracy and efficiency of detection.
[0027] Furthermore, this application provides a method for analyzing and fusing the correlation between the multiple first defect joint features at two or more defect granularities to generate the multiple first joint distribution probabilities, including:
[0028] Determine the number of defect granularity combinations within any first defect joint feature; if the number of defect granularity combinations is 2, analyze the first correlation coefficient between the first defect granularity and the second defect granularity, and the second correlation coefficient between the second defect granularity and the first defect granularity; weightedly fuse the first correlation coefficient and the second correlation coefficient to obtain the corresponding joint distribution probability, and add it to the plurality of first joint distribution probabilities.
[0029] Optionally, a random first defect joint feature is extracted from multiple first defect joint features, and the number of defect granularity combinations for this first defect joint feature is obtained. Then, the number of defect granularity combinations is judged. If the number of defect granularity combinations is 2, it indicates that the currently extracted first defect joint feature is obtained by pairwise combinations. In this case, the probability that a second defect granularity (e.g., a crack) appears simultaneously when a first defect granularity (e.g., a pore) appears is calculated, and this probability is used as the first correlation coefficient between the first and second defect granularities. The calculation method is to divide the probability of both defects appearing simultaneously by the probability of the first defect granularity appearing. Similarly, the probability that a first defect granularity (e.g., a crack) appears when a second defect granularity (e.g., a pore) appears is calculated, obtaining the second correlation coefficient between the second and first defect granularities. Afterwards, these two correlation coefficients are weighted and fused to obtain the joint distribution probability of the combination, and this joint distribution probability is added to multiple first joint distribution probabilities as the association information of the defect combination of that granularity within the first location block. In summary, by analyzing the correlation between different defect granularities, we can understand which defects occur simultaneously, thereby optimizing the defect detection process, reducing computational resource consumption, and improving detection efficiency.
[0030] Furthermore, this application provides a method for analyzing the M correlation coefficients of any defect granularity to other defect granularity combinations if the number of defect granularity combinations is greater than 2, and performing weighted fusion to obtain the corresponding joint distribution probability, where M is the number of defect granularity combinations.
[0031] Optionally, when the number of defect granularity combinations is greater than 2, it indicates that any extracted joint feature of a defect is derived from two or more combinations. In this case, M correlation coefficients will be calculated for any defect granularity to other defect granularity combinations, where M is the number of defect granularity combinations. Taking three different granularity combinations (such as large cracks, microcracks, and porosity) as an example, the probability of microcracks and porosity occurring simultaneously when a large crack exists will be calculated, and this probability will be used as the correlation coefficient of large cracks to microcracks and porosity combinations. The correlation coefficient is calculated by dividing the support of large cracks, microcracks, and porosity occurring together by the probability of microcracks and porosity occurring together. The support is calculated by dividing the probability of simultaneous occurrence by the total number of occurrences. Similarly, the probability of large cracks and porosity occurring simultaneously when a microcrack exists will be calculated as the correlation coefficient of microcracks to large cracks and porosity combinations, and the probability of large cracks and microcracks occurring simultaneously when porosity exists will be calculated as the correlation coefficient of porosity to large cracks and microcracks combinations. Finally, all the obtained correlation coefficients are weighted and fused to obtain the joint probability distribution of the combination, and then added to multiple first joint probability distributions.
[0032] Based on the multiple first defect joint features and multiple first joint distribution probabilities, identify the first target multi-scale defect joint features whose joint distribution probability is greater than or equal to a preset probability threshold.
[0033] In one embodiment, each defect combination is evaluated based on multiple joint features of first defects and their corresponding joint probability distributions. Specifically, the joint probability distribution of each joint feature of first defects is compared with a preset probability threshold. If the joint probability distribution of a combination is greater than or equal to the threshold, the defect combination is considered to have a high probability of occurrence and correlation, and is a defect combination worthy of attention. For example, if the joint probability distribution of a large crack and a micro crack combination within a certain location block is calculated to be 0.75, and the preset probability threshold is 0.7, since 0.75 is greater than 0.7, this combination of large crack and micro crack is identified as a first target multi-scale defect joint feature, indicating that this combination has a high correlation in that location block. In this way, defect combinations with high probability of occurrence and correlation can be effectively screened out, reducing resource usage and improving detection efficiency and accuracy.
[0034] Furthermore, after identifying the joint features of a first target multi-scale defect with a joint distribution probability greater than or equal to a preset probability threshold, this application further includes:
[0035] Using the joint features of the first target multi-scale defects, the first defect joint features are used to perform defect granularity non-associative independent state identification to generate the first non-associative independent defect granularity; and a scale transformation defect identification network is constructed separately for the first non-associative independent defect granularity.
[0036] Preferably, based on the identified joint features of multi-scale defects of the first target, the granularity of each defect in the joint features is analyzed to identify their non-correlated independent states. That is, defects that do not belong to the joint features of multi-scale defects of the first target are extracted to obtain the first non-correlated independent defect granularity. The defects in this first non-correlated independent defect granularity are not related to the defects in the joint features of multi-scale defects of the first target. In other words, the occurrence of any defect will not affect the occurrence of defects in the first non-correlated independent defect granularity. Subsequently, for each defect granularity in the first non-correlated independent defect granularity, the corresponding defect detection image sample is obtained. Each defect detection image sample has a corresponding defect label. Then, a scale transformation defect recognition network for each defect granularity is initialized using a convolutional neural network (CNN), including an input layer, convolutional layers, pooling layers, fully connected layers, and an output layer. The training set based on the defect detection image sample division is then input into the CNN for forward propagation. The input layer receives the defect detection image, performs feature extraction through multiple convolutional layers, and uses pooling layers for downsampling to reduce computational complexity. Then, the extracted features are synthesized through a fully connected layer, and the defect category is predicted through the output layer. The cross-entropy loss function is then used to calculate the error between the predicted result and the actual label, and the gradient of the loss function with respect to the weights of each layer is calculated layer by layer through backpropagation. The Adam optimizer is used to optimize the model, adjusting the network weights to minimize the loss value. This training process is repeated until the network's accuracy on the test set based on defect detection image sample partitioning meets the expected standard. If the accuracy meets the target, training is complete, and the current scale-transformed defect recognition network is saved for subsequent identification of unrelated independent defects. If the accuracy does not meet the requirements, the network structure or hyperparameters are further adjusted to continue optimizing network performance for more accurate and efficient defect recognition.
[0037] For each defect joint feature within the multi-scale defect joint feature of the first target, a defect detection complexity analysis is performed to determine the defect feature with the minimum detection complexity, and the first defect image recognition network is trained.
[0038] In one embodiment, after obtaining the joint features of multi-scale defects of the first target, the detection complexity of each joint feature in the image recognition process is evaluated. Specifically, the image granularity processing complexity and image distortion degree of each defect granularity in the defect granularity combination are analyzed, and a comprehensive detection complexity index is calculated using a weighted average fusion method. This index reflects the resources required to identify a certain defect granularity and the required recognition accuracy. After obtaining the detection complexity index of each joint feature, the defect feature with the lowest detection complexity is selected. This feature with the lowest complexity is usually the easiest to identify and consumes the least computational resources; the system prioritizes processing this feature to improve efficiency. Finally, based on the selected defect granularity with the lowest complexity, defect detection image samples are collected, and a first defect image recognition network for this feature is constructed. The construction method of this first defect image recognition network is the same as described above. Through this process, the system can optimize the defect detection process, concentrate resources on detecting the easiest-to-identify defects, and then determine the existence of other defects based on the correlations recorded in the joint features of multi-scale defects of the first target, thereby improving detection efficiency and reducing computational resource consumption.
[0039] Furthermore, this application provides a method for fusing image granularity processing complexity and image distortion degree for each defect granularity in the defect granularity combination to generate a detection complexity index corresponding to the joint features of each defect, including:
[0040] The defect granularity combinations contained in each defect joint feature are determined; each defect granularity in the defect granularity combination is weighted and averaged by the image granularity processing complexity and the degree of image distortion to generate a detection complexity index corresponding to each defect joint feature; based on the detection complexity index, the defect granularity corresponding to the minimum complexity in each defect joint feature is selected for defect detection image sample collection to construct a first defect image recognition network for scale transformation detection.
[0041] Preferably, combinations of all defect granularities are extracted from the joint features of each defect. Then, a weighted average fusion of image granularity processing complexity and image distortion is performed on each defect granularity in these combinations. Image granularity processing complexity refers to the computational complexity required to process each defect granularity, such as the processing time for operations like resolution adjustment, scaling, and rotation; image distortion refers to the impact of these processing operations on image quality, such as increased noise. By weighted averaging the complexity and distortion of each defect granularity, a detection complexity index is obtained for each defect granularity. This index reflects the computational resources required to detect defects of that granularity and the potential difficulty of identification. Subsequently, based on the detection complexity index, the defect granularity with the lowest complexity is selected from the joint features of each defect. For example, if the processing complexity of large cracks is high, while the processing complexity of microcracks is low, microcracks are selected as the defect granularity with the lowest complexity for subsequent detection. The selected granularity with the lowest complexity will be the focus of subsequent training and detection. Finally, based on the selected minimum complexity defect granularity, defect detection image samples are acquired, and a first defect image recognition network for scale transformation detection is constructed. This recognition network focuses on detecting defects at that specific granularity and determines whether other defects exist based on the correlation of this defect. This process optimizes the defect detection process, ensuring greater efficiency and accuracy during processing, while reducing redundant computational resource usage. This allows the detection network to process defects of different granularities more quickly, improving overall performance.
[0042] Furthermore, this application provides a method for fusing image granularity processing complexity and image distortion degree for each defect granularity in the defect granularity combination to generate a detection complexity index corresponding to the joint features of each defect, including:
[0043] The original multi-scale detection network used for defect detection of preset die castings is collected, and the complexity of the image granularity transformation process and the degree of image distortion after granularity transformation are analyzed for each defect granularity. The image granularity transformation process complexity and the degree of image distortion are then fused after standardization processing.
[0044] Optionally, by collecting data from previously used defect detection model libraries, the original multi-scale detection network for detecting defects in preset die-cast parts can be obtained. This network is either a previously used or open-source detection model. Although it can identify die-cast parts, it has certain efficiency issues because it needs to traverse every scale for detection, resulting in high computational load, slow processing speed, and unsatisfactory detection results. Subsequently, these networks are used to analyze the defect images corresponding to each defect granularity, recording the image granularity transformation process complexity of each network (such as processing time and computational resource consumption for changing image resolution, scaling, rotation, etc.) and the degree of image distortion after granularity transformation (such as reduced contrast and increased noise). Then, the average of the image granularity transformation process complexity and the degree of image distortion after granularity transformation for each defect granularity of all original multi-scale detection networks is calculated to obtain the image granularity transformation process complexity and the degree of image distortion after granularity transformation corresponding to each defect granularity. Subsequently, the complexity of the image granularity transformation process and the degree of image distortion are standardized (e.g., by max-min normalization) to ensure that indicators such as processing time, computational resource consumption, contrast reduction, and noise increase are all within the same dimension (e.g., 0 to 1). Then, the indicators for each defect granularity are weighted and fused using the weights of each indicator constraint to obtain the detection complexity indicator corresponding to the joint features of each defect. This detection complexity indicator comprehensively considers the computational requirements and potential distortion of each defect granularity in image processing, helping to optimize the detection process, reduce unnecessary computational burden, improve detection efficiency, and ensure that the detection effect of defects at different scales reaches its optimal level, thereby optimizing the overall performance of the multi-scale defect detection network.
[0045] Furthermore, this application provides a method for selecting the defect granularity corresponding to the minimum complexity within each of the joint defect features based on the aforementioned detection complexity index, and further includes:
[0046] Determine whether there is a duplicate granularity for the defect granularity corresponding to the minimum complexity within each defect joint feature. If so, delete the duplicate granularity.
[0047] Optionally, after determining the minimum complexity defect granularity in each defect joint feature, the system checks whether there are duplicate granularities among these minimum complexity defect granularities. That is, it checks whether the same defect granularity appears in different combinations of defect granularities. For example, if a microcrack is the minimum complexity defect granularity in a certain defect granularity combination, but the system finds that the microcrack appears in multiple different joint features, then the microcrack can be considered a duplicate. In this case, duplicate granularities are deleted, i.e., the same granularity that appears multiple times is removed, thereby avoiding wasting computational resources in subsequent defect detection processes. The purpose of this process is to ensure that the same type of defect granularity is not processed repeatedly, reducing redundant computation, optimizing detection efficiency, and improving overall detection accuracy.
[0048] A mapping relationship is established between the first defect image recognition network and the first location block. Defect analysis is performed on the image collected in the first location block to generate a first location defect detection result.
[0049] In one embodiment, after the first defect image recognition network is established, it is mapped to a first location block in the die-casting part, clarifying the relationship between the location block and the recognition network. Subsequently, defect analysis is performed on the image acquired in the first location block. That is, using the established mapping relationship, based on the image data of the first location block, the first defect image recognition network is applied to analyze the image, identify and detect possible defects in the image. These defects may be large cracks, microcracks, porosity, etc. By classifying the defects in the image, defects can be accurately identified and located, and first location defect detection results can be generated, providing a basis for subsequent repair, optimization, or quality control, and helping users make quick decisions.
[0050] In summary, the embodiments of this application have at least the following technical effects:
[0051] This application embodiment first collects historical defect detection records of a preset die-cast part, performs multi-scale defect distribution analysis, and constructs multi-scale defect distribution statistical results. Then, based on the multi-scale defect distribution statistical results, it analyzes multiple first defect joint features and multiple first joint distribution probabilities of a first location block. Next, based on the multiple first defect joint features and multiple first joint distribution probabilities, it identifies a first target multi-scale defect joint feature whose joint distribution probability is greater than or equal to a preset probability threshold. Then, it performs defect detection complexity analysis on each defect joint feature within the first target multi-scale defect joint feature, determines the defect feature with the lowest detection complexity, and trains a first defect image recognition network. Finally, it establishes a mapping relationship between the first defect image recognition network and the first location block, performs defect analysis on the image collected in the first location block, and generates a first location defect detection result. These technical effects collectively solve the technical problem that existing industrial vision-based defect detection methods suffer from insufficient detection accuracy and efficiency due to their inability to effectively handle multi-scale defects. This achieves the technical effect of optimizing defect detection complexity through multi-scale defect distribution analysis, thereby improving the accuracy and real-time performance of die-cast part defect detection based on industrial vision.
[0052] Example 2 is based on the same inventive concept as the multi-scale analysis-based defect detection method for die castings in the previous examples, such as... Figure 2As shown, this application provides a die-casting defect detection system based on multi-scale analysis. The system includes: a defect analysis module 11: collecting historical defect detection records of a preset die-casting, performing multi-scale defect distribution analysis, and constructing multi-scale defect distribution statistical results; a location block analysis module 12: analyzing multiple first defect joint features and multiple first joint distribution probabilities of a first location block based on the multi-scale defect distribution statistical results; a joint feature recognition module 13: identifying a first target multi-scale defect joint feature with a joint distribution probability greater than or equal to a preset probability threshold based on the multiple first defect joint features and multiple first joint distribution probabilities; a network training module 14: performing defect detection complexity analysis on each defect joint feature within the first target multi-scale defect joint feature, determining the defect feature with the minimum detection complexity, and training a first defect image recognition network; and a defect analysis module 15: establishing a mapping relationship between the first defect image recognition network and the first location block, performing defect analysis on images collected in the first location block, and generating a first location defect detection result.
[0053] Furthermore, the defect analysis module 11 is also used to perform the following methods:
[0054] The historical defect detection records are classified according to their defect distribution locations to generate multi-location defect detection records; the defect granularity of the multi-location defect detection records is identified to generate the multi-scale defect distribution statistical results.
[0055] Furthermore, the location block analysis module 12 is also used to perform the following method:
[0056] Extract the first multi-scale defect distribution corresponding to the first location block from the multi-scale defect distribution statistics; construct multiple first joint features containing two or more defect granularities based on the first multi-scale defect distribution; perform correlation analysis and fusion on the multiple first joint features at two or more defect granularities to generate the multiple first joint distribution probabilities.
[0057] Furthermore, the location block analysis module 12 is also used to perform the following method:
[0058] Determine the number of defect granularity combinations within any first defect joint feature; if the number of defect granularity combinations is 2, analyze the first correlation coefficient between the first defect granularity and the second defect granularity, and the second correlation coefficient between the second defect granularity and the first defect granularity; weightedly fuse the first correlation coefficient and the second correlation coefficient to obtain the corresponding joint distribution probability, and add it to the plurality of first joint distribution probabilities.
[0059] Furthermore, the location block analysis module 12 is also used to perform the following method:
[0060] If the number of defect granularity combinations is greater than 2, analyze the M correlation coefficients of any defect granularity to other defect granularity combinations, and perform weighted fusion to obtain the corresponding joint distribution probability, where M is the number of defect granularity combinations.
[0061] Furthermore, the joint feature recognition module 13 is also used to perform the following method:
[0062] Using the joint features of the first target multi-scale defects, the first defect joint features are used to perform defect granularity non-associative independent state identification to generate the first non-associative independent defect granularity; and a scale transformation defect identification network is constructed separately for the first non-associative independent defect granularity.
[0063] Furthermore, the network training module 14 is also used to perform the following methods:
[0064] The defect granularity combinations contained in each defect joint feature are determined; each defect granularity in the defect granularity combination is weighted and averaged by the image granularity processing complexity and the degree of image distortion to generate a detection complexity index corresponding to each defect joint feature; based on the detection complexity index, the defect granularity corresponding to the minimum complexity in each defect joint feature is selected for defect detection image sample collection to construct a first defect image recognition network for scale transformation detection.
[0065] Furthermore, the network training module 14 is also used to perform the following methods:
[0066] The original multi-scale detection network used for defect detection of preset die castings is collected, and the complexity of the image granularity transformation process and the degree of image distortion after granularity transformation are analyzed for each defect granularity. The image granularity transformation process complexity and the degree of image distortion are then fused after standardization processing.
[0067] Furthermore, the network training module 14 is also used to perform the following methods:
[0068] Determine whether there is a duplicate granularity for the defect granularity corresponding to the minimum complexity within each defect joint feature. If so, delete the duplicate granularity.
[0069] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, the above description focuses on specific embodiments of this specification. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired results. In some implementations, multitasking and parallel processing are possible or may be advantageous.
[0070] The above description is only a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
[0071] This specification and accompanying drawings are merely illustrative examples of this application and are intended to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from its scope. Therefore, if such modifications and modifications fall within the scope of this application and its equivalents, this application intends to include such modifications and modifications.
Claims
1. A method for detecting defects in die-casting parts based on multi-scale analysis, characterized in that, include: Collect historical defect detection records of preset die castings, perform multi-scale defect distribution analysis, and construct multi-scale defect distribution statistical results; Based on the statistical results of the multi-scale defect distribution, analyze the joint characteristics of multiple first defects and the probability of multiple first joint distributions in the first location block; Based on the multiple first defect joint features and multiple first joint distribution probabilities, identify first target multi-scale defect joint features whose joint distribution probability is greater than or equal to a preset probability threshold; For each defect joint feature within the multi-scale defect joint feature of the first target, a defect detection complexity analysis is performed to determine the defect feature with the minimum detection complexity, and the first defect image recognition network is trained. Establish a mapping relationship between the first defect image recognition network and the first location block, perform defect analysis on the image collected in the first location block, and generate the first location defect detection result; This includes collecting historical defect detection records of pre-set die-cast parts, conducting multi-scale defect distribution analysis, and constructing multi-scale defect distribution statistical results, including: The historical defect detection records are classified according to the location of the defects to generate multi-location defect detection records. The defect granularity of the multi-location defect detection records is identified to generate the multi-scale defect distribution statistical results.
2. The method for detecting defects in die-casting parts based on multi-scale analysis as described in claim 1, characterized in that, Based on the statistical results of the multi-scale defect distribution, the analysis of multiple first defect joint features and multiple first joint distribution probabilities of the first location block includes: Extract the first multi-scale defect distribution corresponding to the first location block from the multi-scale defect distribution statistical results; Based on the first multi-scale defect distribution, construct multiple first defect joint features containing two or more defect granularities; The correlation degree of the multiple first defect joint features is analyzed and fused at two or more defect granularities to generate the multiple first joint distribution probabilities.
3. The method for detecting defects in die-casting parts based on multi-scale analysis as described in claim 2, characterized in that, The correlation analysis of the multiple first defect joint features at two or more defect granularities is performed and fused to generate the multiple first joint distribution probabilities, including: Determine the number of defect granularity combinations within any first defect joint feature; If the number of defect granularity combinations is 2, analyze the first correlation coefficient between the first defect granularity and the second defect granularity, and the second correlation coefficient between the second defect granularity and the first defect granularity. The first correlation coefficient and the second correlation coefficient are weighted and fused to obtain the corresponding joint distribution probability, which is then added to the plurality of first joint distribution probabilities.
4. The method for detecting defects in die-casting parts based on multi-scale analysis as described in claim 3, characterized in that, If the number of defect granularity combinations is greater than 2, analyze the M correlation coefficients of any defect granularity to other defect granularity combinations, and perform weighted fusion to obtain the corresponding joint distribution probability, where M is the number of defect granularity combinations.
5. The method for detecting defects in die-casting parts based on multi-scale analysis as described in claim 1, characterized in that, For each joint defect feature within the multi-scale defect joint features of the first target, a defect detection complexity analysis is performed to determine the defect feature with the minimum detection complexity. A first defect image recognition network is then trained, including: Determine the combination of defect granularities contained within each defect joint feature; For each defect granularity in the defect granularity combination, a weighted average fusion of image granularity processing complexity and image distortion degree is performed to generate a detection complexity index corresponding to the joint features of each defect. Based on the detection complexity index, the defect granularity corresponding to the minimum complexity is selected in each of the joint features of defects to collect defect detection image samples, and a first defect image recognition network for scale transformation detection is constructed.
6. The method for detecting defects in die-casting parts based on multi-scale analysis as described in claim 5, characterized in that, For each defect granularity in the defect granularity combination, the image granularity processing complexity and image distortion degree are fused to generate a detection complexity index corresponding to the joint features of each defect, including: The original multi-scale detection network used for defect detection of preset die castings was collected, and the complexity of the image granularity transformation process and the degree of image distortion after granularity transformation were analyzed for each defect granularity. The image granularity transformation process complexity and image distortion degree are standardized and then fused.
7. The method for detecting defects in die-casting parts based on multi-scale analysis as described in claim 5, characterized in that, Based on the aforementioned detection complexity index, the defect granularity corresponding to the minimum complexity is selected within each of the joint defect features, further including: Determine whether there is a duplicate granularity for the defect granularity corresponding to the minimum complexity within each defect joint feature. If so, delete the duplicate granularity.
8. The method for detecting defects in die-casting parts based on multi-scale analysis as described in claim 1, characterized in that, After identifying the joint features of the first target multi-scale defects with a joint distribution probability greater than or equal to a preset probability threshold, the process also includes: Using the first target multi-scale defect joint features, the first defect joint features are used to perform defect granularity non-associative independent state identification to generate the first non-associative independent defect granularity. For the first non-associated independent defect granularity, a scale transformation defect recognition network is constructed separately for the corresponding granularity.
9. A die-casting defect detection system based on multi-scale analysis, characterized in that, The system is used to execute the die-casting defect detection method based on multi-scale analysis as described in any one of claims 1-8, including: Defect Analysis Module: Collects historical defect detection records of preset die castings, performs multi-scale defect distribution analysis, and constructs multi-scale defect distribution statistical results; Location block analysis module: Based on the multi-scale defect distribution statistical results, analyze the joint characteristics of multiple first defects and the probability of multiple first joint distributions of the first location block; Joint feature recognition module: Based on the multiple first defect joint features and multiple first joint distribution probabilities, identify the first target multi-scale defect joint features whose joint distribution probability is greater than or equal to a preset probability threshold; Network training module: Perform defect detection complexity analysis on each defect joint feature within the multi-scale defect joint features of the first target, determine the defect feature with the minimum detection complexity, and train the first defect image recognition network. Defect Analysis Module: Establishes a mapping relationship between the first defect image recognition network and the first location block, performs defect analysis on the image collected in the first location block, and generates a first location defect detection result.