A real-time detection method and system for casting surface defects

By combining optical scanning and deep learning technology, three-dimensional casting models are built and real-time defect detection is carried out, the problem of insufficient processing speed and adaptability in the existing technology is solved, and defect detection with high accuracy and fast response is achieved, which significantly improves the efficiency of the production process and product quality.

CN118777305BActive Publication Date: 2025-03-11GAOMI GUOHAO PRECISION TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410814208.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2025-03-11
Estimated Expiration
2044-06-24

AI Technical Summary

Technical Problem

Existing surface defect detection technologies are insufficient in terms of processing speed and adaptability, and are difficult to meet the needs of rapid production, especially in identifying subtle surface changes and updating data in real time.

Method used

Optical scanning data is used to collect three-dimensional coordinate points on the casting surface, and a three-dimensional casting model is constructed through coordinate fitting. A deep learning network is used to combine spatial filtering and edge detection technology to extract concave and convex and particle size data, cluster and defect classification, and finally generate real-time defect reports and perform time series analysis.

Benefits of technology

It significantly improves the accuracy and reaction speed of defect detection, can identify small defects in the early stage, enhance the ability to identify diverse defects, improve the adaptability and response speed of the production process, reduce downtime and waste rate, and visualize long-term quality trends through time series analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118777305B_ABST
    Figure CN118777305B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of surface defect detection technology, specifically a method and system for real-time detection of casting surface defects, comprising the following steps: based on optical scanning data, collecting three-dimensional coordinate points of casting surface texture, constructing a three-dimensional casting model through coordinate fitting, optically analyzing the surface of the three-dimensional casting model, identifying the surface granularity and irregular texture, and establishing a casting surface feature map. In the present invention, by optimizing the detailed analysis of surface granularity and texture, early identification of tiny defects is achieved, and the ability to identify diversified defects is enhanced by clustering algorithm classification. The key lies in being able to adapt to various complex scenarios, and through real-time monitoring and data analysis, the adaptability and response speed in the production process are improved, and the downtime and scrap rate caused by defects are reduced. The introduction of time series analysis makes the long-term quality trend visualized, helping enterprises implement preventive maintenance strategies and avoiding major quality accidents and cost waste.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of surface defect detection, and in particular to a real-time detection method and system for casting surface defects. Background Art

[0002] Surface defect detection technology is a key industrial quality control method widely used in metal processing, casting, automotive manufacturing, semiconductor manufacturing and other manufacturing industries. The goal of this technology is to identify and classify defects on the surface of materials through automated vision systems or other sensing technologies such as optical scanning, ultrasonic or electromagnetic detection. Defects may include cracks, pores, inclusions, corrosion and other surface irregularities that affect the performance and appearance of the product. By detecting these defects in a timely manner, product quality can be improved, production costs can be reduced, and product failures can be avoided. Surface defect detection technology not only improves detection speed and accuracy, but also predicts potential production problems through data analysis, thereby providing real-time feedback and quality control during the manufacturing process.

[0003] Among them, the real-time detection method of casting surface defects is used to identify and evaluate defects on the surface of products during the casting process in real time. This technology usually uses high-resolution cameras, sensors and computer vision algorithms to monitor the surface of castings in real time to quickly identify any defects or non-conformance issues. The main use of this technology is to provide real-time quality control on the production line to ensure that each product meets quality standards. This not only reduces scrap and rework, but also improves production efficiency and the overall quality of the product.

[0004] Although existing surface defect detection technologies have a wide coverage, they are often insufficient in processing speed and adaptability to meet the needs of rapid production. These technologies usually rely on traditional vision systems, which are insufficient in identifying atypical or emerging defect types, especially in identifying subtle surface changes such as grain size and microcracks. In addition, these systems have significant defects in real-time updating and processing of data generated at high speeds, often leading to delays on the production line and increasing the risk of missed detection. The lack of effective data integration and analysis capabilities makes it difficult to provide targeted optimization suggestions, resulting in limited production efficiency and product quality. This technical limitation not only affects the overall quality assurance of the product, but also increases the economic burden on the company, because defects that are not discovered in time may lead to product rework or scrap, adding unnecessary costs. Summary of the invention

[0005] The purpose of the present invention is to solve the shortcomings of the prior art and to propose a method and system for real-time detection of casting surface defects.

[0006] In order to achieve the above object, the present invention adopts the following technical solution: a method for real-time detection of casting surface defects, comprising the following steps:

[0007] S1: Based on the optical scanning data, the three-dimensional coordinate points of the casting surface texture are collected, a three-dimensional casting model is constructed by coordinate fitting, the surface of the three-dimensional casting model is optically analyzed, the surface granularity and irregular texture are identified, and a casting surface feature map is established;

[0008] S2: Based on the surface feature map of the casting, spatial filtering and edge detection are used to extract the concave-convex and granularity data to obtain a spatial feature data set, and a clustering algorithm is used to sort and classify the feature data to identify key surface crack categories and establish defect classification data;

[0009] S3: Based on the defect classification data, adjust the weights and biases of the deep learning network for multiple types of defects, optimize the network, obtain an optimized detection model, use the detection model to perform real-time scanning and identification of surface material characteristics of new castings, predict defect types, and obtain a real-time defect report;

[0010] S4: Based on the real-time defect report, a time series analysis technique is applied to process defect data, map the time trend and change pattern of defect development, and obtain a defect development trend graph.

[0011] As a further solution of the present invention, the steps of constructing the three-dimensional casting model are specifically as follows:

[0012] S111: Use optical scanning to obtain the original scanning data of the casting surface, calculate the three-dimensional coordinates of each scanning point, and use the geometric reconstruction algorithm formula:

[0013]

[0014] Calculate the three-dimensional coordinates of each scanning point and generate an original three-dimensional coordinate data set;

[0015] Among them, X i,j represents the three-dimensional coordinate point, α and β represent adjustment parameters used to match the differential scanning conditions, ε is the offset to avoid zero division error, and d i,j represents the distance, θ i and φ j represents the scanning angle;

[0016] S112: Perform data cleaning and outlier processing on the original three-dimensional coordinate data set using the formula:

[0017]

[0018] Process the noise and outliers in the data to obtain a cleaned three-dimensional coordinate data set;

[0019] in, represents the cleaned three-dimensional coordinate point, γ and δ represent weight coefficients to adjust data sensitivity and deviation processing, μ represents the mean, and σ represents the standard deviation;

[0020] S113: Using the cleaned three-dimensional coordinate data set to construct a three-dimensional model of the casting, using the formula:

[0021]

[0022] The three-dimensional volume is reconstructed by cumulative square root operations to generate a three-dimensional casting model.

[0023] As a further solution of the present invention, the steps of establishing the casting surface feature map are specifically as follows:

[0024] S121: Using the three-dimensional casting model, optical analysis technology is applied to identify the roughness and texture characteristics of the casting surface, and the optical characteristic analysis formula is used:

[0025]

[0026] Calculate the particle size and irregular texture of the surface and generate surface particle size analysis data;

[0027] Among them, F i,j represents the surface feature intensity, κ and λ represent sensitivity adjustment parameters, Represents the partial derivatives of the model in multiple directions;

[0028] S122: Process the surface particle size analysis data to highlight key features, using a data enhancement formula:

[0029]

[0030] Enhance the clarity and contrast of feature visualization to obtain enhanced surface feature data;

[0031] Among them, G i,j represents the enhanced surface feature data, η is the exponent of feature amplification, ρ is the contrast adjustment parameter, and θ is the parameter that determines the feature enhancement threshold;

[0032] S123: Integrate the enhanced surface feature data into a unified feature map, using a feature mapping formula:

[0033]

[0034] Generate casting surface feature map;

[0035] Among them, T represents the surface feature map of the casting, w i,j represents the weight coefficient of each feature point, ω is the nonlinear adjustment coefficient, G i,j Represents enhanced feature data.

[0036] As a further solution of the present invention, the step of acquiring the spatial feature data set is specifically:

[0037] S211: From the casting surface feature map, a spatial filter is applied to extract roughness and texture information using the formula:

[0038]

[0039] Calculate the weighted average around each pixel, add Gaussian weight to reduce the influence of pixels far from the center, and generate preliminary surface data;

[0040] Among them, S i,j Represents the intensity of the pixel after filtering, M i+k,j+l is the pixel value on the original feature map, F k,l is the weight parameter of the filter kernel, α is the attenuation coefficient, which affects the weight of pixels far away from the center;

[0041] S212: Perform edge detection on the preliminary surface roughness data using the formula:

[0042]

[0043] By calculating the combination of first-order derivatives and second-order derivatives, significant edges are identified and spatial feature data with edge emphasis is generated;

[0044] Among them, E i,j Represents the pixel intensity of edge emphasis, and is the first-order derivative, and is the second-order derivative, and β is the coefficient that weighs the contributions of the first-order and second-order derivatives;

[0045] S213: Integrate the edge-emphasized spatial feature data into a data set, using a clustering algorithm, formula:

[0046] D=∑ i,j (E i,j ·W i,j ·log(1+γ·E i,j ))

[0047] Generate spatial feature datasets;

[0048] Among them, D represents the integrated spatial feature dataset, E i,j Represents the pixel intensity of edge emphasis, W i,j represents the weight coefficient, and γ represents the gain coefficient, which is used to adjust the nonlinear enhancement of the feature intensity.

[0049] As a further solution of the present invention, the steps of establishing the defect classification data are specifically as follows:

[0050] S221: Integrate the results of edge detection and clustering algorithms, calculate the eigenvalue of the integrated data, using the formula:

[0051]

[0052] Calculate the intermediate results of the integrated data to generate intermediate integrated data;

[0053] Among them, I represents the intermediate result of integrated data, H i,j represents edge data, δ represents the feature significance adjustment parameter, and μ represents the linear adjustment coefficient, which affects the baseline strength of the feature;

[0054] S222: Apply a clustering algorithm to classify the intermediate integrated data, using the formula:

[0055]

[0056] Calculate the characteristic value of each cluster and generate a clustered characteristic data set;

[0057] Among them, C k Represents the eigenvalue of each cluster, I i represents the integrated value of each data point, and η represents the nonlinear adjustment coefficient, which is used to enhance or weaken the influence of feature strength;

[0058] S223: According to the clustered feature data set, identify and classify key surface cracks using the formula:

[0059] D=max k (C k )+λ·∑ k C k

[0060] Select clusters as key crack categories based on eigenvalues, and add the cumulative values ​​of clusters to evaluate the overall crack characteristics to generate defect classification data;

[0061] Among them, D represents defect classification data, C k represents the eigenvalue of multiple clusters, and λ is the global adjustment coefficient used to evaluate the importance of the overall crack distribution.

[0062] As a further solution of the present invention, the step of obtaining the real-time defect report is specifically as follows:

[0063] S311: Based on the defect classification data, adjust the weights and biases of the deep learning network using the formula:

[0064]

[0065] Generate updated weights;

[0066] Among them, W new represents the updated weight, W old represents the original weight, represents the gradient of the weight, α represents the learning rate, and ξ represents the regularization parameter;

[0067] S312: Update the bias of the network at the same time, referring to the formula:

[0068]

[0069] Among them, b old is the original bias, is the gradient of the bias, b new Represents the updated bias, obtains the updated bias;

[0070] S313: Recompile the deep learning model with updated weights and biases, using the formula:

[0071] M optimized =compile(W new , b new ,θ,λ)

[0072] Among them, θ is the activation function threshold, λ is the learning decay rate, and the optimized detection model is generated;

[0073] S314: Use the optimized detection model to scan and identify the surface material characteristics of new castings in real time, using the formula:

[0074] Report = scan (M optimized , NewCast, φ)

[0075] Generate real-time defect reports;

[0076] Among them, NewCast is the input data of the new casting, φ is the scanning accuracy parameter, and Report represents the generated real-time defect report.

[0077] As a further solution of the present invention, the step of obtaining the defect development trend diagram is specifically as follows:

[0078] S411: Collect defect data from the real-time defect report using the formula:

[0079]

[0080] Calculate the sum of weighted defect data at each time point to generate the weighted defect data set D t ;

[0081] Among them, Dt Represents the sum of weighted defect data at time point t, d i,t represents a single defect data, n represents the total number of defects, γ i Represents the defect type weight;

[0082] S412: Based on the weighted defect data set, the collected defect data is processed using a time series analysis technique, using the formula:

[0083]

[0084] Generate smoothed time series data;

[0085] Among them, S t represents the smoothed time series data, β represents the smoothing coefficient, and D t-1 represents the defect data at the previous time point, σ t represents the volatility at time t;

[0086] S413: Based on the time series data, the time trend and change pattern of defect development are mapped using the formula:

[0087]

[0088] Generate defect development trend graph T t ;

[0089] Among them, T t represents the defect development trend graph, α represents the trend adjustment coefficient, S t-1 represents the sequence data at the previous time point, ρ t Represents the trend smoothing adjustment factor.

[0090] A real-time detection system for casting surface defects, the real-time detection system for casting surface defects is used to execute the above-mentioned real-time detection method for casting surface defects, the system comprising:

[0091] The optical scanning and model building module collects the three-dimensional coordinate points of the casting surface based on the optical scanning data, uses the three-dimensional coordinate points to build a three-dimensional model of the casting, and simultaneously performs optical analysis to identify the particle size and texture of the surface, thereby generating a three-dimensional casting feature map;

[0092] The feature analysis and classification module extracts the concave-convex and granularity data based on the three-dimensional casting feature map, identifies and classifies key surface cracks using clustering processing, and generates surface crack classification data;

[0093] The deep learning and real-time detection module adjusts the weight and bias of the deep learning network based on the surface crack classification data. The optimized network is used for real-time scanning and recognition of the surface of new castings, predicts multiple types of defects, and generates real-time defect reports.

[0094] The data trend analysis module performs time series analysis on the defect data based on the real-time defect report, maps the time trend and change pattern of defect development, and generates a defect development trend graph.

[0095] Compared with the prior art, the advantages and positive effects of the present invention are:

[0096] In the present invention, the combination of optical scanning and deep learning is used to greatly improve the accuracy and response speed of defect detection. This method optimizes the detailed analysis of surface particle size and texture, and realizes the early identification of minor defects. The use of clustering algorithms to effectively classify and enhance the ability to identify diverse defects is key to being able to adapt to various complex scenarios. Through real-time monitoring and data analysis, this technology significantly improves the adaptability and response speed of the production process, and reduces downtime and scrap rate caused by defects. The introduction of time series analysis makes long-term quality trends visible, helping companies implement preventive maintenance strategies and avoid major quality accidents and cost waste. BRIEF DESCRIPTION OF THE DRAWINGS

[0097] Figure 1 It is a schematic diagram of the workflow of the present invention;

[0098] Figure 2 A flow chart of the steps for constructing a three-dimensional casting model of the present invention;

[0099] Figure 3 A flow chart of the steps for establishing a surface feature map of a casting according to the present invention;

[0100] Figure 4 A flowchart of the steps for obtaining a spatial feature data set of the present invention;

[0101] Figure 5 A flowchart of the steps for establishing defect classification data of the present invention;

[0102] Figure 6 A flowchart of the steps for obtaining a real-time defect report of the present invention;

[0103] Figure 7 The figure is a flow chart of the steps for obtaining the defect development trend diagram of the present invention. DETAILED DESCRIPTION

[0104] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0105] In the description of the present invention, it should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, in the description of the present invention, "multiple" means two or more, unless otherwise clearly and specifically defined.

[0106] Embodiment 1

[0107] See also Figure 1 The present invention provides a technical solution: a method for real-time detection of casting surface defects, comprising the following steps:

[0108] S1: Based on the optical scanning data, the three-dimensional coordinate points of the casting surface texture are collected, and a three-dimensional casting model is constructed by coordinate fitting. The surface of the three-dimensional casting model is optically analyzed to identify the surface grain size and irregular texture, and the casting surface feature map is established;

[0109] S2: Based on the casting surface feature map, spatial filtering and edge detection are used to extract the concave-convex and granularity data to obtain the spatial feature data set. The clustering algorithm is used to sort and classify the feature data, identify the key surface crack categories, and establish defect classification data;

[0110] S3: Based on the defect classification data, the weights and biases of the deep learning network are adjusted for multiple types of defects, the network is optimized, and the optimized detection model is obtained. The detection model is used to perform real-time scanning and identification of the surface material characteristics of the new casting, predict the defect types, and obtain real-time defect reports;

[0111] S4: Based on real-time defect reports, time series analysis technology is used to process defect data, map the time trend and change pattern of defect development, and obtain a defect development trend chart.

[0112] The surface feature maps of castings include texture analysis maps, particle size distribution maps, and surface irregularity maps. The spatial feature data sets include concave-convex data sets, particle size data sets, and edge detection data sets. The real-time defect report includes defect type identification, defect location information, and defect severity assessment. The defect development trend map includes time series analysis results, defect change patterns, and defect prediction trends.

[0113] See also Figure 2 , the specific steps of constructing the three-dimensional casting model are:

[0114] S111: Use optical scanning to obtain the original scanning data of the casting surface, calculate the three-dimensional coordinates of each scanning point, and use the geometric reconstruction algorithm formula:

[0115]

[0116] Calculate the three-dimensional coordinates of each scanning point and generate an original three-dimensional coordinate data set;

[0117] Among them, X i,j represents the three-dimensional coordinate point, α and β represent adjustment parameters used to match the differential scanning conditions, ε is the offset to avoid zero division error, and d i,j represents the distance, θ i and φ j represents the scanning angle;

[0118] S112: Perform data cleaning and outlier processing on the original three-dimensional coordinate data set using the formula:

[0119]

[0120] Process the noise and outliers in the data to obtain a cleaned three-dimensional coordinate data set;

[0121] in, represents the cleaned three-dimensional coordinate point, γ and δ represent weight coefficients to adjust data sensitivity and deviation processing, μ represents the mean, and σ represents the standard deviation;

[0122] S113: Use the cleaned 3D coordinate data set to construct a 3D model of the casting using the formula:

[0123]

[0124] The three-dimensional volume is reconstructed by cumulative square root operations to generate a three-dimensional casting model.

[0125] Formula and its parameters:

[0126]

[0127] in:

[0128] α and β are adjustment parameters used to adapt to different scanning conditions and surface materials.

[0129] ε is a small offset used to prevent division by zero errors.

[0130] d i,j is the distance from the scanner to the casting surface.

[0131] θ i is the azimuth during scanning.

[0132] φj is the elevation angle during scanning.

[0133] Assumed specific values ​​and examples:

[0134] Assuming that a point on the casting is 5 meters away from the scanner, the azimuth angle is 45 degrees, the elevation angle is 30 degrees, and the adjustment parameters α=1.5, β=2, ε=0.01, it can be calculated that:

[0135] d i,j =5,θ i =45°,φ j =30°

[0136]

[0137] X i,j =37.5+1.414=38.914

[0138] HereX i,j Represents the calculated 3D coordinate value at that point.

[0139] Formula and its parameters:

[0140]

[0141] in:

[0142] γ and δ are weight coefficients used to adjust data sensitivity and bias handling.

[0143] μ is the average value of the coordinate points.

[0144] σ is the standard deviation.

[0145] Assumed specific values ​​and examples:

[0146] Assume μ = 40, σ = 5, γ = 1.2, δ = 1.5 and use the previous X i,j =38.914:

[0147]

[0148] here represents the three-dimensional coordinate value after processing, and a smaller result indicates that the deviation between the original value and the average value is smaller.

[0149] Formula and its parameters:

[0150]

[0151] use

[0152]

[0153] M=0.089

[0154] This value M represents the contribution of the cleaned coordinate point to the overall model. There is only one point here, so the impact on the model is small.

[0155] See also Figure 3 , the specific steps for establishing the casting surface feature map are:

[0156] S121: Using the three-dimensional casting model, optical analysis technology is applied to identify the roughness and texture characteristics of the casting surface, and the optical feature analysis formula is used:

[0157]

[0158] Calculate the particle size and irregular texture of the surface and generate surface particle size analysis data;

[0159] Among them, F i,j represents the surface feature intensity, κ and λ represent sensitivity adjustment parameters, Represents the partial derivatives of the model in multiple directions;

[0160] S122: Process the surface particle size analysis data to highlight key features, using the data enhancement formula:

[0161]

[0162] Enhance the clarity and contrast of feature visualization to obtain enhanced surface feature data;

[0163] Among them, G i,j represents the enhanced surface feature data, η is the exponent of feature amplification, ρ is the contrast adjustment parameter, and θ is the parameter that determines the feature enhancement threshold;

[0164] S123: Integrate the enhanced surface feature data into a unified feature map using the feature mapping formula:

[0165]

[0166] Generate casting surface feature map;

[0167] Among them, T represents the surface feature map of the casting, w i,j represents the weight coefficient of each feature point, ω is the nonlinear adjustment coefficient, G i,j Represents enhanced feature data.

[0168] formula:

[0169]

[0170] Parameter Description:

[0171] Fi,j : Surface characteristic intensity

[0172] κ, λ: sensitivity adjustment parameters

[0173] Partial derivatives of the surface model in multiple directions

[0174] Assumed parameter values:

[0175] κ=1.5,λ=0.7

[0176]

[0177] Derivation process:

[0178] Compute the sum of the squares of the directional derivatives:

[0179]

[0180] Apply square root:

[0181]

[0182] Compute the logarithmic term:

[0183] log(1+|1|)=log(2)≈0.693

[0184] Application sensitivity adjustment parameters:

[0185] F i,j =1.5×3.605+0.7×0.693≈5.4075+0.4851=5.8926

[0186] Result interpretation:

[0187] F i,j ≈5.8926 represents the surface feature intensity at this point, and higher values ​​indicate more obvious surface texture features. Formula:

[0188]

[0189] Parameter Description:

[0190] G i,j : Enhanced surface feature data

[0191] η, ρ, θ: feature amplification index, contrast adjustment parameter, feature enhancement threshold

[0192] Assumed parameter values:

[0193] η=2,ρ=1,θ=4

[0194] F i,j =5.8926

[0195] Derivation process:

[0196] Calculate exponential amplification:

[0197]

[0198] Compute the base of an exponential function:

[0199]

[0200] Application formula:

[0201]

[0202] Result interpretation:

[0203] G i,j ≈25.208 indicates the feature intensity after enhancement, which is more suitable for visualization.

[0204] formula:

[0205]

[0206] Parameter Description:

[0207] T: Casting surface feature map

[0208] w i,j , ω: weight coefficient of feature points, nonlinear adjustment coefficient

[0209] Assumed parameter values:

[0210] w i,j =0.5,ω=0.1

[0211] G i,j =25.208 (obtained from step B)

[0212] Derivation process:

[0213] Calculate the nonlinear adjustment term:

[0214]

[0215] Apply weights and nonlinear adjustments:

[0216]

[0217] Apply weight factor:

[0218] T = 0.5 × 9.423 = 4.712

[0219] T≈4.712 represents the strength of the integrated feature map, indicating the visualization effect of the overall features.

[0220] See also Figure 4 , the specific steps for obtaining the spatial feature dataset are:

[0221] S211: From the casting surface feature map, a spatial filter is applied to extract roughness and texture information using the formula:

[0222]

[0223] Calculate the weighted average around each pixel, add Gaussian weight to reduce the influence of pixels far from the center, and generate preliminary surface data;

[0224] Among them, S i,j Represents the intensity of the pixel after filtering, M i+k,j+l is the pixel value on the original feature map, F k,l is the weight parameter of the filter kernel, α is the attenuation coefficient, which affects the weight of pixels far away from the center;

[0225] S212: Perform edge detection on the preliminary surface roughness data using the formula:

[0226]

[0227] By calculating the combination of first-order derivatives and second-order derivatives, significant edges are identified and spatial feature data with edge emphasis is generated;

[0228] Among them, E i,j Represents the pixel intensity of edge emphasis, and is the first-order derivative, and is the second-order derivative, and β is the coefficient that weighs the contributions of the first-order and second-order derivatives;

[0229] S213: Integrate the edge-emphasized spatial feature data into a data set using a clustering algorithm. The formula is:

[0230] D=∑ i,j (E i,j ·W i,j ·log(1+γ·E i,j ))

[0231] Generate spatial feature datasets;

[0232] Among them, D represents the integrated spatial feature dataset, E i,j Represents the pixel intensity of edge emphasis, W i,j represents the weight coefficient, and γ represents the gain coefficient, which is used to adjust the nonlinear enhancement of the feature intensity.

[0233] formula:

[0234]

[0235] Parameter Description:

[0236] S i,j : Pixel intensity after filtering.

[0237] M i+k,j+l : Pixel value on the original feature map.

[0238] F k,l : The weight parameter of the filter kernel, the commonly used 3×3 Gaussian kernel assumption.

[0239] α: Attenuation coefficient, used for calculating Gaussian weight.

[0240] Assumed parameter values:

[0241] Assume α=1.

[0242] Gaussian kernel F weight parameters (assuming Gaussian kernel):

[0243]

[0244] Assume that the M value of a 3×3 region is as follows:

[0245]

[0246] Derivation process:

[0247] Apply Gaussian filtering to calculate:

[0248]

[0249] Result interpretation:

[0250] S i,j =360 represents the intensity of the central pixel after Gaussian filtering, reflecting the average intensity of the local area. Formula:

[0251]

[0252] Parameter Description:

[0253] E i,j : Pixel strength for edge emphasis.

[0254] The first-order derivative represents the gradient in the horizontal and vertical directions.

[0255] The second derivative represents the curvature.

[0256] β: coefficient that weighs the contribution of the first and second order derivatives.

[0257] Assumed parameter values:

[0258] β=0.5

[0259] Assume that the gradient is calculated as a simplified value (first-order derivative):

[0260]

[0261] Derivation process:

[0262] Calculate edge detection values:

[0263]

[0264] Result interpretation:

[0265] E i,j ≈14.3 represents the strength value after edge emphasis, and higher values ​​represent areas with more prominent edges or textures. Formula:

[0266]

[0267] Parameter Description:

[0268] D: The integrated spatial feature dataset.

[0269] W i,j : Weight coefficient.

[0270] γ: Gain coefficient, used to adjust the nonlinear enhancement of feature intensity.

[0271] Assumed parameter values:

[0272] W i,j =1,γ=0.1

[0273] Use the E from the previous step i,j =14.3

[0274] Derivation process:

[0275] Calculate the feature integration value:

[0276]

[0277] Result interpretation:

[0278] D≈12.737 represents the measure of the integrated and enhanced feature data, and a higher value indicates that the features in the region are more significant.

[0279] See also Figure 5 ,The specific steps for establishing defect classification data are:

[0280] S221: Integrate the results of edge detection and clustering algorithms, calculate the eigenvalue of the integrated data, using the formula:

[0281]

[0282] Calculate the intermediate results of the integrated data to generate intermediate integrated data;

[0283] Among them, I represents the intermediate result of integrated data, H i,j represents edge data, δ represents the feature significance adjustment parameter, and μ represents the linear adjustment coefficient, which affects the baseline strength of the feature;

[0284] S222: Apply clustering algorithm to classify the intermediate integrated data, using the formula:

[0285]

[0286] Calculate the characteristic value of each cluster and generate a clustered characteristic data set;

[0287] Among them, C k Represents the eigenvalue of each cluster, I i represents the integrated value of each data point, and η represents the nonlinear adjustment coefficient, which is used to enhance or weaken the influence of feature strength;

[0288] S223: Based on the clustered feature data set, identify and classify key surface cracks using the formula:

[0289] D=max k (C k )+λ·∑ k C k

[0290] Select clusters as key crack categories based on eigenvalues, and add the cumulative values ​​of clusters to evaluate the overall crack characteristics to generate defect classification data;

[0291] Among them, D represents defect classification data, C k represents the eigenvalue of multiple clusters, and λ is the global adjustment coefficient used to evaluate the importance of the overall crack distribution.

[0292] formula:

[0293]

[0294] Parameter Description:

[0295] H i,j : Data value after edge detection.

[0296] δ: Controls the rate of Gaussian decay, which is used to adjust feature significance.

[0297] μ: Linear enhancement coefficient, used to adjust the intensity of baseline characteristics.

[0298] Assumed values:

[0299] δ=0.5,μ=0.1

[0300] Assume that the value of H is in a 3×3 area, all H i,j The value of is 2.

[0301] Derivation process:

[0302] For H i,j =2:

[0303]

[0304] Insert all values:

[0305] I=9·(4·0.135+0.1·2)=9·(0.54+0.2)=9·0.74=6.66

[0306] Result interpretation:

[0307] I = 6.66 represents the integrated data value, which indicates that the integration strength of the edge feature is low, taking into account the effects of Gaussian attenuation and linear enhancement.

[0308] formula:

[0309]

[0310] Parameter Description:

[0311] C k : Eigenvalue after clustering.

[0312] I i : Integrate data point values.

[0313] η: Nonlinear adjustment coefficient, controlling the enhancement strength.

[0314] Assumed values:

[0315] η=0.05

[0316] Assume that cluster k contains three data points, all I i The value of is 6.66.

[0317] Derivation process:

[0318] For each I i =6.66:

[0319]

[0320] Total cluster value:

[0321] C k =3·33.3=99.9

[0322] Result interpretation:

[0323] C k = 99.9 represents the total eigenvalue of the cluster. This high value indicates that the data points in the cluster have significantly similar characteristics.

[0324] formula:

[0325]

[0326] Parameter Description:

[0327] D: Final defect classification data.

[0328] C k : Eigenvalue of clustering.

[0329] λ: global adjustment coefficient.

[0330] Assumed values:

[0331] λ=0.1

[0332] Assume there is only one cluster k.

[0333] Derivation process:

[0334] Weighted sum:

[0335] D=99.9+0.1·99.9=99.9+9.99=109.89

[0336] Result interpretation:

[0337] D = 109.89 represents the defect classification result after considering all clustering features. This value indicates the overall significance of the features and the potential importance of the cracks.

[0338] See also Figure 6 ,The specific steps for obtaining real-time defect reports are:

[0339] S311: Based on the defect classification data, adjust the weights and biases of the deep learning network using the formula:

[0340]

[0341] Generate updated weights;

[0342] Among them, W new represents the updated weight, W old represents the original weight, represents the gradient of the weight, α represents the learning rate, and ξ represents the regularization parameter;

[0343] S312: Update the bias of the network at the same time, referring to the formula:

[0344]

[0345] Among them, b old is the original bias, is the gradient of the bias, b new Represents the updated bias, obtains the updated bias;

[0346] S313: Recompile the deep learning model with updated weights and biases, using the formula:

[0347] M optimized =compile(W new , b new ,θ,λ)

[0348] Among them, θ is the activation function threshold, λ is the learning decay rate, and the optimized detection model is generated;

[0349] S314: Use the optimized detection model to scan and identify the surface material characteristics of new castings in real time, using the formula:

[0350] Report = scan (M optimized , NewCast, φ)

[0351] Generate real-time defect reports;

[0352] Among them, NewCast is the input data of the new casting, φ is the scanning accuracy parameter, and Report represents the generated real-time defect report.

[0353] formula:

[0354]

[0355] Parameter explanation:

[0356] W old : Original weight

[0357] Gradient of weights

[0358] α: learning rate

[0359] ξ: regularization parameter

[0360] Assumed values:

[0361] W old =0.5

[0362]

[0363] α=0.01

[0364] ξ=0.001

[0365] Derivation process:

[0366] Calculate the weight of the current contribution part:

[0367]

[0368] Update weights:

[0369] W new =0.5+0.01·0.1005=0.501005

[0370] Result interpretation:

[0371] The updated weight W new = 0.501005. Small updates indicate that the learning process is slowly adapting and maintaining stability.

[0372] formula:

[0373]

[0374] Parameter explanation:

[0375] b old : Original bias

[0376] Bias gradient

[0377] Assumed values:

[0378] b old =0.3

[0379]

[0380] Derivation process:

[0381] Calculate the bias and more current contribution:

[0382]

[0383] Update bias:

[0384] b new =0.3+0.01·0.0503=0.300503

[0385] Result interpretation:

[0386] Updated bias b new= 0.300503. This shows a slight bias adjustment that optimizes model performance.

[0387] formula:

[0388] M optimized =compile(W new , b new ,θ,λ)

[0389] Parameter explanation:

[0390] θ: activation function threshold

[0391] λ: learning decay rate

[0392] Assumed values:

[0393] θ=0.05

[0394] λ=0.1

[0395] Derivation process:

[0396] Compile the model with the updated weights and biases and the given activation threshold and learning decay rate. The exact compilation details depend on the deep learning framework and hardware configuration, but the process is logically expressed here.

[0397] Result interpretation:

[0398] M optimized The compiled model is now ready for more efficient training and prediction, optimizing performance and response time.

[0399] See also Figure 7 , the specific steps for obtaining the defect development trend graph are:

[0400] S411: Collect defect data from real-time defect reports using the formula:

[0401]

[0402] Calculate the sum of weighted defect data at each time point to generate the weighted defect data set D t ;

[0403] Among them, D t Represents the sum of weighted defect data at time point t, d i,t represents a single defect data, n represents the total number of defects, γ i Represents the defect type weight;

[0404] S412: Based on the weighted defect data set, the collected defect data is processed using time series analysis technology, using the formula:

[0405]

[0406] Generate smoothed time series data;

[0407] Among them, S t represents the smoothed time series data, β represents the smoothing coefficient, and D t-1 represents the defect data at the previous time point, σ t represents the volatility at time t;

[0408] S413: Based on time series data, map the time trend and change pattern of defect development, using the formula:

[0409]

[0410] Generate defect development trend graph T t ;

[0411] Among them, T t represents the defect development trend graph, α represents the trend adjustment coefficient, S t-1 represents the sequence data at the previous time point, ρ t Represents the trend smoothing adjustment factor.

[0412] formula:

[0413]

[0414] Parameter explanation:

[0415] d i,t : Data of the i-th defect at time t

[0416] n: total number of defects

[0417] γ i : Weight coefficient of defect type i

[0418] D t : The sum of weighted defect data at time point t

[0419] Assumed values:

[0420] n = 3 (assuming there are three types of defects)

[0421] d 1,t =10,d 2,t =5,d 3,t =7 (assuming defect data)

[0422] γ1=1.0,γ2=0.8,γ3=0.5 (assumed weight coefficients)

[0423] Derivation process:

[0424] Calculate the sum of weighted defect data:

[0425] D t =10·1.0+5·0.8+7·0.5=10+4+3.5=17.5

[0426] Result interpretation:

[0427] Get D t =17.5 is the sum of defect data at time point t, and the weighting reflects the impact of different types of defects.

[0428] formula:

[0429]

[0430] Parameter explanation:

[0431] β: smoothing coefficient

[0432] D t-1 : Defect data at the previous time point

[0433] σ t :Estimation of data volatility at time t

[0434] S t : Smoothed time series data

[0435] Assumed values:

[0436] β=0.7

[0437] D t-1 =15 (assuming data from the previous time point)

[0438] σ t =0.1

[0439] Derivation process:

[0440] Compute smoothed time series data:

[0441]

[0442] Result interpretation:

[0443] S t ≈14.72 represents the time series data after smoothing, showing a stable trend of the defect data.

[0444] formula:

[0445]

[0446] Parameter explanation:

[0447] α: Trend adjustment coefficient

[0448] S t-1: Sequence data at the previous time point

[0449] ρ t : Trend smoothing adjustment factor

[0450] T t : Defect development trend chart

[0451] Assumed values:

[0452] α=0.5

[0453] S t-1 =13.5 (assuming smoothed data at the previous time point)

[0454] ρ t =0.05

[0455] Derivation process:

[0456] Computational defect development trend chart:

[0457]

[0458] Result interpretation:

[0459] T t ≈13.77 shows the trend of defect development, taking into account the changes in historical and current data, providing insights into the dynamics of defect development.

[0460] A real-time detection system for casting surface defects, which is used to execute the above-mentioned real-time detection method for casting surface defects, comprises:

[0461] The optical scanning and model building module collects the three-dimensional coordinate points of the casting surface based on the optical scanning data, uses the three-dimensional coordinate points to build a three-dimensional model of the casting, and simultaneously performs optical analysis to identify the particle size and texture of the surface, thereby generating a three-dimensional casting feature map;

[0462] The feature analysis and classification module extracts concave-convex and granularity data based on the three-dimensional casting feature map, applies clustering processing to identify and classify key surface cracks, and generates surface crack classification data;

[0463] The deep learning and real-time detection module adjusts the weights and biases of the deep learning network based on the surface crack classification data. The optimized network is used for real-time scanning and recognition of the surface of new castings, predicts multiple types of defects, and generates real-time defect reports.

[0464] The data trend analysis module performs time series analysis on defect data based on real-time defect reports, maps the time trend and change pattern of defect development, and generates a defect development trend chart.

[0465] The above are only preferred embodiments of the present invention and are not intended to limit the present invention in other forms. Any technician familiar with the profession may use the technical contents disclosed above to change or modify them into equivalent embodiments with equivalent changes and apply them to other fields. However, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present invention without departing from the technical solution of the present invention still falls within the protection scope of the technical solution of the present invention.

Claims

1. A method for real-time detection of casting surface defects, characterized in that: The following steps are involved: Based on the optical scanning data, three-dimensional coordinate points of the casting surface texture are collected, a three-dimensional casting model is constructed by coordinate fitting, the surface of the three-dimensional casting model is optically analyzed, the surface granularity and irregular texture are identified, and a casting surface feature map is established; Based on the casting surface feature map, spatial filtering and edge detection are used to extract concave-convex and granularity data to obtain a spatial feature data set, and a clustering algorithm is used to sort and classify the feature data to identify key surface crack categories and establish defect classification data; The steps for obtaining the spatial feature data set are specifically as follows: From the casting surface feature map, a spatial filter is applied to extract the roughness and texture information using the formula: Calculate the weighted average around each pixel, add Gaussian weight to reduce the influence of pixels far from the center, and generate preliminary surface data; in, represents the intensity of the pixel after filtering, is the pixel value on the original feature map, is the weight parameter of the filter kernel, is the attenuation coefficient, which affects the weight of pixels far away from the center; Perform edge detection on the preliminary surface roughness data using the formula: By calculating the combination of first-order derivatives and second-order derivatives, significant edges are identified and spatial feature data with edge emphasis is generated; in, Represents the pixel intensity of edge emphasis, and is the first-order derivative, and is the second-order derivative, is a coefficient that weighs the contribution of the first-order and second-order derivatives; The edge-emphasized spatial feature data are integrated into a data set, and a clustering algorithm is used. The formula is: Generate a spatial feature dataset; where represents the integrated spatial feature dataset, Represents the pixel intensity of edge emphasis, represents the weight coefficient, represents the gain coefficient, which is used to adjust the nonlinear enhancement of feature intensity; The steps for establishing the defect classification data are specifically as follows: Integrate the results of edge detection and clustering algorithms and calculate the eigenvalues ​​of the integrated data using the formula: Calculate the intermediate results of the integrated data to generate intermediate integrated data; in, represents the intermediate result of integrating data, Represents edge data, represents the feature significance adjustment parameter, represents the linear adjustment coefficient, which affects the baseline intensity of the feature; a clustering algorithm is applied to classify the intermediate integrated data, using the formula: Calculate the characteristic value of each cluster and generate a clustered characteristic data set; in, represents the eigenvalue of each cluster, represents the integrated value of each data point, represents a nonlinear adjustment coefficient, which is used to enhance or weaken the influence of feature intensity; according to the clustered feature data set, key surface cracks are identified and classified using the formula: Based on the eigenvalues, clusters are selected as key crack categories, and the cumulative values ​​of clusters are added to evaluate the overall crack characteristics to generate defect classification data; represents defect classification data, represents the eigenvalues ​​of multiple clusters, is the global adjustment factor used to assess the importance of the overall crack distribution; Based on the defect classification data, the weights and biases of the deep learning network are adjusted for multiple types of defects, the network is optimized, an optimized detection model is obtained, and the surface material characteristics of the new casting are scanned and identified in real time using the detection model to predict the types of defects and obtain a real-time defect report; The steps for obtaining the real-time defect report are specifically as follows: Based on the defect classification data, the weights and biases of the deep learning network are adjusted using the formula: Generate updated weights; in, represents the updated weight, represents the original weight, represents the gradient of the weight, represents the learning rate, Represents the regularization parameter; at the same time, the bias of the network is updated, referring to the formula: in, is the original bias, is the gradient of the bias, Represents the updated bias, obtains the updated bias; Recompile the deep learning model with the updated weights and biases using the formula: in, is the activation function threshold, is the learning decay rate, generating an optimized detection model; The optimized detection model is used to scan and identify the surface material characteristics of new castings in real time, using the formula: Report Generate real-time defect reports; Among them, NewCast is the input data of the new casting, is the scanning accuracy parameter, and Report represents the generated real-time defect report; Based on the real-time defect report, the time series analysis technology is applied to process the defect data, map the time trend and change pattern of the defect development, and obtain the defect development trend graph.

2. The method for real-time detection of casting surface defects according to claim 1, characterized in that: The steps of constructing the three-dimensional casting model are specifically as follows: Use optical scanning to obtain the original scanning data of the casting surface, calculate the three-dimensional coordinates of each scanning point, and use the geometric reconstruction algorithm formula: Calculate the three-dimensional coordinates of each scanning point and generate an original three-dimensional coordinate data set; in, Represents a three-dimensional coordinate point, and Represents adjustment parameters, used to match differential scanning conditions, is the offset to avoid division by zero error, Represents distance, and represents the scanning angle; the original three-dimensional coordinate data set is cleaned and outliers are processed using the formula: Process the noise and outliers in the data to obtain a cleaned three-dimensional coordinate data set; in, Represents the cleaned three-dimensional coordinate point, and Represents the weight coefficient, adjusts data sensitivity and bias processing, represents the average value, Represents standard deviation; the three-dimensional model of the casting is constructed using the cleaned three-dimensional coordinate data set, using the formula: The three-dimensional volume is reconstructed by cumulative square root operations to generate a three-dimensional casting model.

3. The method for real-time detection of casting surface defects according to claim 2, characterized in that: The steps for establishing the casting surface feature map are specifically as follows: The three-dimensional casting model is used to identify the roughness and texture characteristics of the casting surface using optical analysis technology, and the optical characteristic analysis formula is used: Calculate the particle size and irregular texture of the surface and generate surface particle size analysis data; in, represents the surface feature intensity, and represents the sensitivity adjustment parameter, Represents the partial derivatives of the model in multiple directions; The surface particle size analysis data is processed to highlight key features using the data enhancement formula: Enhance the clarity and contrast of feature visualization to obtain enhanced surface feature data; in, represents the enhanced surface feature data, is the exponent of the amplified feature, is the contrast adjustment parameter, is a parameter that determines the feature enhancement threshold; the enhanced surface feature data is integrated into a unified feature map, using the feature mapping formula: Generate casting surface feature map; in, Represents the surface characteristics of the casting. Represents the weight coefficient of each feature point, is the nonlinear adjustment coefficient, Represents enhanced feature data.

4. The method for real-time detection of casting surface defects according to claim 1, characterized in that: The steps for obtaining the defect development trend diagram are specifically as follows: Defect data is collected from the real-time defect report using the formula: Calculate the sum of weighted defect data at each time point to generate a weighted defect data set ;in, Representing time point The sum of weighted defect data, Represents a single defect data, Represents the total number of defects, Represents the defect type weight; based on the weighted defect data set, the collected defect data is processed using time series analysis technology, using the formula: Generate smoothed time series data; in, represents the smoothed time series data, represents the smoothing coefficient, Represents the defect data at the previous point in time, Representative moments Based on the time series data, the time trend and change pattern of defect development are mapped using the formula: Generate defect trend graph ;in, Representative defect development trend chart, represents the trend adjustment coefficient, Represents the sequence data at the previous time point Represents the trend smoothing adjustment factor.

5. A real-time detection system for casting surface defects, characterized in that: According to the method for real-time detection of casting surface defects according to any one of claims 1 to 4, the system comprises: The optical scanning and model building module collects the three-dimensional coordinate points of the casting surface based on the optical scanning data, uses the three-dimensional coordinate points to build a three-dimensional model of the casting, and simultaneously performs optical analysis to identify the particle size and texture of the surface, thereby generating a three-dimensional casting feature map; The feature analysis and classification module extracts the concave-convex and granularity data based on the three-dimensional casting feature map, identifies and classifies key surface cracks using clustering processing, and generates surface crack classification data; The deep learning and real-time detection module adjusts the weight and bias of the deep learning network based on the surface crack classification data. The optimized network is used for real-time scanning and recognition of the surface of new castings, predicts multiple types of defects, and generates real-time defect reports. The data trend analysis module performs time series analysis on the defect data based on the real-time defect report, maps the time trend and change pattern of defect development, and generates a defect development trend graph.

Citation Information

Patent Citations

  • Casting quality tracking system of numerical control machine tool

    CN118134062A