A method and system for quality inspection and monitoring of casting products
By dividing casting products into regions and analyzing data models, and combining historical and real-time data, the problems of lag and localization in casting product quality inspection were solved, enabling early warning and root cause analysis, and improving inspection accuracy and production efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-07
- Publication Date
- 2026-04-03
AI Technical Summary
Existing methods for testing the quality of casting products are outdated, partial, and lack predictive capabilities, leading to waste of resources, omission of defects, and difficulty in controlling defects at the source.
By extracting surface thickness data from the casting product model, dividing the area, and combining random forest model and gradient boosting decision tree model, historical and real-time data are used to monitor the quality of casting products, provide real-time early warning and root cause analysis, and dynamically adjust thresholds to judge defect risks.
It enables early warning and root cause analysis of casting products, improves the accuracy and timeliness of detection, reduces resource waste and scrap rate, and improves production efficiency and product quality.
Smart Images

Figure CN121073306B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of quality inspection of casting products. In particular, it relates to a method and system for quality inspection and monitoring of casting products. Background Technology
[0002] Casting is a traditional metalworking process that involves melting metal, pouring it into a mold, and allowing it to cool to form a casting with a specific shape and properties. Casting products are widely used in various fields such as automotive, aerospace, and machinery manufacturing, including components like automotive engine blocks, turbine blades, and wind turbine hubs. These castings have complex structures, significant variations in wall thickness, and extremely high requirements for dimensional accuracy and quality.
[0003] Quality monitoring of casting products is a crucial step in ensuring that castings meet design requirements and deliver reliable performance. High-quality castings not only improve product performance and lifespan but also reduce subsequent processing costs and potential safety risks. In fields such as aerospace and high-end equipment manufacturing, the quality of castings directly affects product safety and reliability. Therefore, accurate and efficient quality inspection and monitoring technologies are essential for guaranteeing casting quality.
[0004] Existing quality inspection methods for casting products are mostly conducted after casting is completed. This lag prevents real-time intervention and adjustment during production. Once defects are discovered, the casting becomes scrap, resulting in resource waste and increased production costs. Furthermore, traditional measurement methods are often sampling or localized inspections, such as pre-set measurement points, making it difficult to obtain full-dimensional and full-morphological data of the casting, easily overlooking defects such as localized deformation and dents. Current technologies primarily serve "post-production judgment" rather than "in-process prediction," failing to provide early warning and root cause analysis for defects such as dimensional deviations, thus hindering prevention and control at the process source. Summary of the Invention
[0005] To address the problems of existing casting product quality inspection methods, which suffer from lag, localization, and lack of predictive ability, leading to resource waste, defect omissions, and difficulty in controlling defects at the source, this invention provides solutions in the following aspects.
[0006] In the first aspect, a method for quality inspection and monitoring of casting products includes: extracting surface thickness data from a casting product model and converting it into a thickness distribution map; dividing the thickness distribution map into regions and obtaining the average thickness of each region; obtaining environmental vectors for different pouring stages of each casting process and standard environmental vectors for each pouring stage from historical data, and using the degree of deviation between the environmental vectors and the standard environmental vectors as a deviation vector; constructing a dataset using the deviation vectors, the thickness data of each region, and the actual dimensional deviations; training a random forest model using the dataset; after training, obtaining the importance score of each feature in the random forest model, normalizing it to obtain a weight vector, and using the weight vector to perform a weighted summation of the deviation vectors. A significant anomaly score is obtained; the relative deviation of thickness data for each region in history is used to calculate the size characteristics of each region, and the size characteristics of the region are used as the weight of the previous time step at the current time step, and the size characteristics of the region step step minus 1 are used as the weight of the current time step. The significant anomaly score accumulated at the previous time step and the significant anomaly score at the current stage are weighted and summed to obtain the cumulative anomaly score at the current time step; the historical cumulative anomaly score and the average thickness of each region are used to train a preset gradient boosting decision tree model to construct a size deviation prediction model to output the predicted size deviation, and the dynamic threshold is adjusted based on the time decay ratio. The predicted size deviation and the dynamic threshold are compared to determine whether there is a defect risk, thus completing the quality inspection and monitoring of the casting product.
[0007] Preferably, the step of dividing the thickness distribution map into regions includes the following steps:
[0008] A number of pixels are uniformly selected on the thickness distribution map as initial seed points, and the difference between the candidate points around the initial seed points and the average thickness of the current region is calculated.
[0009] If the difference is less than or equal to a preset threshold, the candidate point is merged into the current region as a new growth point and continues to expand outward. Otherwise, if the difference is greater than the preset threshold, the candidate point is not merged into the current region and does not meet the growth criterion. If there are no points in the neighborhood of all growth points in the current region that meet the growth criterion, the growth of the region stops.
[0010] After the initial growth is completed, if the average thickness of adjacent regions is less than the preset thickness threshold, they are merged into a larger region, and the surface of the casting is divided into several continuous regions.
[0011] Preferably, the training steps of the random forest model include:
[0012] The dataset is divided into a training set and a test set. The random forest model is trained using the training set. A portion of the samples are randomly selected from the training set as the training data for the current decision tree. At each node split, a portion of the features are randomly selected as candidate features from all features. The decision tree is constructed using the selected features until the stopping condition is met.
[0013] Preferably, the method for calculating the importance score includes:
[0014] The importance of each decision tree in the random forest model is obtained by summing the impurities of each feature across all split nodes and reducing the impurity of each node. The average importance of all decision trees is then normalized and used as the importance score of the random forest model.
[0015] Preferably, the calculation method for the region size feature includes:
[0016] The difference between the thickness of each region in the casting product model and the overall average thickness is taken as the thickness deviation of each region. The thickness deviation is exponentially mapped using a negative exponential function, and the reciprocal of the mapping result plus 1 is taken as the region size feature.
[0017] Preferably, the calculation method for the time decay ratio includes:
[0018] Obtain the preset total casting time, calculate the ratio of the preset total casting time to the current casting process time, and multiply the ratio by a preset constant as the time decay ratio.
[0019] Preferably, the determination of whether there is a defect risk includes the following steps:
[0020] If the predicted size deviation of a consecutive preset number of times exceeds the dynamic threshold, a defect risk is detected in the production of the cast product, triggering an early warning and adjusting the thickness data; otherwise, if the deviation is less than or equal to the dynamic threshold, the production of the cast product is normal.
[0021] Secondly, a casting product quality inspection and monitoring system includes a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the above-mentioned casting product quality inspection and monitoring method is implemented.
[0022] The present invention has the following effects:
[0023] 1. This invention, by comprehensively considering historical and current anomalies and combining random forest and gradient boosting decision tree models, can more accurately assess and predict dimensional deviations in cast products. It not only considers real-time data but also fully utilizes historical data, thereby improving detection accuracy and prediction reliability. By dynamically adjusting thresholds, it can better adapt to different production stages, further enhancing the accuracy and timeliness of detection.
[0024] 2. This invention, through region segmentation and feature extraction, particularly for identifying thick-walled and challenging regions, can accurately locate key areas. The size of these areas is more likely the result of accumulation across multiple stages, and historical anomalies have a significant impact on the final size. Therefore, they require special attention. Early warning and timely adjustments can avoid resource waste and reduce unnecessary detection and adjustments.
[0025] 3. This invention enables defect prevention and control from the source of the process through early warning and root cause analysis, which can not only reduce scrap rate and rework costs, but also improve production efficiency and product quality. Attached Figure Description
[0026] Figure 1 This is a flowchart of steps S1-S4 in a casting product quality inspection and monitoring method according to an embodiment of the present invention.
[0027] Figure 2 This is a structural block diagram of a casting product quality inspection and monitoring system according to an embodiment of the present invention. Detailed Implementation
[0028] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.
[0029] Reference Figure 1 A method for quality inspection and monitoring of casting products includes steps S1-S4, as detailed below:
[0030] S1: Extract surface thickness data from the casting product model and convert it into a thickness distribution map. Divide the thickness distribution map into regions and obtain the average thickness of each region. Obtain the environmental vectors of different casting stages of each casting process and the standard environmental vectors of each casting stage in historical data. Use the degree of deviation between the environmental vectors and the standard environmental vectors as the deviation vector.
[0031] Thickness data of the surface is extracted from the CAD model of the casting and transformed into a two-dimensional thickness distribution map. The grayscale value of each pixel represents the thickness data at the corresponding location. A number of pixels are uniformly selected on the thickness distribution map as initial seed points. These initial seed points serve as the starting point for region growth. The difference between the candidate points surrounding the initial seed points and the average thickness of the current region is calculated. If the difference between the candidate point and the average thickness of the current region is less than or equal to a preset threshold, the candidate point is incorporated into the current region and continues to expand outward as a new growth point. If the difference between the candidate point and the average thickness of the current region is greater than the preset threshold, the candidate point does not meet the growth criteria and is not incorporated into the current region. Region growth stops when there are no more points in the neighborhood of all growth points in the current region that meet the growth criteria.
[0032] After the initial growth is completed, adjacent regions are merged. If the average thickness difference between two adjacent regions is less than the preset thickness threshold of 0.1 mm, the two regions are merged into a larger region to ensure the continuity and rationality of the distinction. Finally, a region label is assigned to each pixel to divide the casting surface into several continuous regions, and the thickness difference in each region is controlled within a certain allowable range.
[0033] It should be noted that castings typically possess complex geometries and uneven thickness distributions. Traditional overall monitoring methods struggle to effectively handle this complexity; different areas of a casting may be affected differently during manufacturing, leading to localized dimensional deviations and quality variations. Therefore, zoned monitoring of castings is necessary to more accurately identify and address these localized issues. By dividing the casting surface into multiple zones, each zone can be monitored in greater detail. This method enables more accurate detection of localized dimensional deviations and defects. By dividing the casting surface into monitoring zones according to design thickness, precise monitoring and control of casting dimensions and quality can be achieved. This not only improves monitoring accuracy and efficiency but also optimizes resource allocation, ensuring castings meet industry standards, thereby improving product quality and production efficiency, and enhancing product market competitiveness.
[0034] In other words, multiple sensors are installed on the casting production line to monitor environmental parameters at different stages in real time. A data acquisition system (such as a PLC or DCS) reads the sensor data in real time and transmits it to the central control system. The data acquisition system can be configured to set the sampling frequency to ensure the real-time performance and accuracy of the data. The central control system preprocesses the collected data, removing noise and outliers, and stores the processed data in a database to form a real-time environmental parameter vector.
[0035] In this embodiment, data acquisition is conducted according to different stages of production. The casting stage includes activating casting temperature and casting speed parameters; the cooling stage includes activating cooling temperature and cooling speed; and the holding stage includes activating mold pressure. Thickness deviations in the cast product affect production quality at each stage of production. These effects may manifest as dimensional inaccuracies, insufficient structural strength, inconsistent cooling rates, and other problems. Therefore, real-time monitoring and control of thickness deviations are crucial for ensuring the quality of the cast product.
[0036] The real-time environmental vectors (such as temperature, velocity, and pressure) are then normalized to allow for comparison on the same scale. Normalization eliminates the influence of different parameter dimensions, resulting in the following real-time deviation vector: In the formula, Indicates the first Phase 1 At this moment The stage parameter vector for each region Indicates the first At this moment Temperature of each region This indicates the preset temperature reference value. Indicates the first At this moment The speed of each region Indicates the preset speed reference value. Indicates the first At this moment Pressure in each region This indicates the preset pressure reference value. It should be noted that the environmental vector is specific to each stage. For example, in the cooling stage, the environmental vector consists of temperature and velocity. During the pressure holding phase, the environmental vector is... .
[0037] During the casting process, different regions of the casting exhibit significantly different sensitivities to environmental data anomalies. For example, during the cooling stage, thin-walled areas are more susceptible to deformation due to changes in the cooling rate; while during the holding pressure stage, thicker areas are more sensitive to pressure changes, and pressure anomalies have a far greater impact on them than on thin-walled areas. Therefore, to more accurately reflect these differences, it is necessary to manually assign anomaly weights to parameters at each stage to highlight the contribution of key parameters to the anomaly score, making it more aligned with actual process requirements.
[0038] By assigning anomaly weights to parameters at each stage, the varying sensitivities of different regions to environmental data anomalies can be comprehensively considered. During the cooling stage, the cooling rate of thin-walled regions receives a higher weight; during the holding stage, the pressure of thicker regions receives a higher weight. This weighting ensures that key parameters contribute more significantly to the anomaly score, thus more accurately representing anomalies in the current casting process. This approach allows for more effective assessment and monitoring of quality risks during casting, ensuring that casting quality meets design requirements. Real-time parameter anomalies considering anomaly weights can indicate the degree of anomaly in the current casting process. The specific steps are as follows:
[0039] S2: Construct a dataset by combining the deviation vector, thickness data of each region, and actual size deviation. Use the dataset to train the random forest model. After training, obtain the importance score of each feature in the random forest model and normalize it to obtain the weight vector. Use the weight vector to perform a weighted summation on the deviation vector to obtain the significant anomaly score.
[0040] Historical casting data for each region was collected and a dataset was constructed. The historical casting data included: deviation vectors of real-time process parameters, thickness data for each region, and actual dimensional deviations.
[0041] The dataset is divided into a training set and a test set. The training set is used to train a random forest model. The random forest model learns the relationship between input features and target variables by building multiple decision trees. During training, each decision tree of the random forest model randomly draws a portion of samples from the training set (sampling with replacement, i.e., bootstrap) as the training data for the current decision tree. At each node split, a portion of features are randomly selected from all features as candidate features. The selected features are used to build the decision tree until the stopping condition is met, such as reaching the maximum depth or the number of leaf node samples.
[0042] The sum of the reduction in impurity of each feature in all decision trees in the statistical random forest model is calculated, and then the average value is taken to obtain the importance score of each feature. To further explain, the importance scores of each feature are normalized so that their sum is 1, thus obtaining the weight vector.
[0043] By obtaining significant anomaly scores for each region through random forests, the contribution of various environmental parameters to dimensional deviations at the current stage is reflected. This not only enables differentiated monitoring of different regions and improves the accuracy of monitoring, but also reduces scrap rates and rework costs through real-time early warning functions. It provides strong support for optimizing process parameters and reducing false alarms and missed alarms, thereby improving production efficiency and product quality.
[0044] S3: The relative deviation of the thickness data of each region in history is used to calculate the size characteristics of each region. The size characteristics of the region are used as the weight of the previous time, and 1 minus the size characteristics of the region are used as the weight of the current time. The cumulative abnormal score of the current time is obtained by weighted summation based on the cumulative significant abnormal score of the previous time and the significant abnormal score of the current stage.
[0045] In the initial stages of the production process, due to a lack of sufficient historical data, understanding of anomalies is limited. At this time, historical anomaly scores need to be given higher weight to better utilize limited historical information for anomaly risk assessment. A larger threshold ensures that historical anomaly scores have a significant impact on the cumulative anomaly score in the initial stage, thereby improving the accuracy of anomaly assessment. Special attention needs to be paid to thick-walled and high-difficulty areas in the initial stage, as these areas have a higher anomaly risk. A larger threshold ensures that historical anomaly scores in these critical areas receive sufficient attention, thus identifying potentially high-risk areas in the initial phase.
[0046] As production progresses, more historical data accumulates, leading to a more comprehensive understanding of anomalies. At this point, the weight of historical anomaly scores can be appropriately reduced, with greater focus placed on anomalies in the current stage. A smaller threshold allows the current anomaly score to account for a larger proportion of the accumulated anomaly score, thus reflecting real-time changes in the production process more promptly.
[0047] The difference between the thickness of each region in the casting product model and the overall average thickness is taken as the thickness deviation of each region. The thickness deviation is exponentially mapped using a negative exponential function, and the reciprocal of the mapping result plus 1 is taken as the region size feature.
[0048] Specifically, the region size characteristics satisfy the following relationship:
[0049] ;
[0050] In the formula, Indicates the size characteristics of the region. Indicates the first Thickness data for each region, This indicates the overall average thickness of the casting.
[0051] In other words, the negative exponential function is used to map the thickness deviation to a smooth curve, avoiding the influence of extreme values on the result. Adding 1 to the mapped result and taking the reciprocal ensures that the final result is normalized. Interval. This normalization process ensures that the weighting factors have a uniform range.
[0052] Thickness deviation is inversely proportional to the dimensional characteristics of the region; when the thickness deviation is positive, then... A value close to 1 indicates a larger amount of material in thick-walled regions, resulting in slower cooling and solidification processes, making them more susceptible to the cumulative effects of historical anomalies. Therefore, historical anomaly scores have a higher weight in thick-walled regions, while current anomaly scores have a lower weight; when the thickness deviation is negative, then... When the value is close to 0, the thin-walled region contains less material, and the cooling and curing process is faster, making it more susceptible to real-time process fluctuations. Therefore, the current anomaly score has a higher weighting in the thin-walled region, while the historical anomaly score has a lower weighting.
[0053] Due to historical cumulative effects, the dimensional formation of thick-walled regions is more likely the result of accumulation across multiple stages. Historical anomalies have a significant impact on the final dimensions, therefore, they should be given higher weight. For thin-walled regions, however, dimensional formation is more likely to be influenced by the real-time environment. Thin-walled regions cool faster and are highly sensitive to real-time cooling conditions, temperature changes, pouring speed, and other environmental factors. Even small changes in these real-time factors can directly lead to dimensional deviations. For example, temperature fluctuations during pouring can cause uneven solidification rates in thin-walled regions, thus affecting the final dimensions. Therefore, for thin-walled regions, current anomaly scores are given higher weight to more accurately reflect the impact of the real-time environment on the final dimensions, enabling timely detection and handling of potential problems, and ensuring the stability of the production process and product quality.
[0054] The cumulative anomaly score is calculated by combining historical anomaly scores with current anomaly scores, and the weights are dynamically adjusted based on the size, thickness, and production difficulty of the region. In other words, if a region has experienced anomalies multiple times in the past, its likelihood of experiencing anomalies in the future is relatively high. Furthermore, regions with larger dimensions and thicknesses may exhibit different physical characteristics such as cooling rates and stress distribution compared to other regions. Generally, thick-walled regions are more prone to defects during cooling, such as shrinkage cavities and porosity.
[0055] Thick-walled areas and areas with high production difficulty are assigned higher weights to historical anomaly scores, thus more accurately assessing anomaly risks. This setting improves the accuracy of anomaly assessment, optimizes production decisions and resource allocation, enhances the monitoring and early warning capabilities of the production process, helps to identify and address potential problems in advance, ensures casting quality, and improves production efficiency.
[0056] S4: Use historical cumulative anomaly scores and the average thickness of each region to train a preset gradient boosting decision tree model, build a size deviation prediction model to output predicted size deviation, adjust the dynamic threshold based on the time decay ratio, compare the predicted size deviation with the dynamic threshold, and determine whether there is a defect risk, thus completing the quality inspection and monitoring of casting products.
[0057] The gradient boosting decision tree model is a well-known technique in this field and will not be described in detail here.
[0058] Obtain the preset total casting time, calculate the ratio of the preset total casting time to the current casting process time, and multiply the ratio by a preset constant as the time decay ratio.
[0059] For example, the preset constant is 0.03. Specifically, it can be adjusted according to the requirements of the casting product. For example, for high-precision castings such as aerospace castings, it can be designed to be 0.001, while for ordinary castings it can be set to 0.05.
[0060] If the predicted size deviation of a consecutive preset number of times exceeds the dynamic threshold, a defect risk is detected in the production of the cast product, triggering an early warning and adjusting the thickness data; otherwise, if the deviation is less than or equal to the dynamic threshold, the production of the cast product is normal.
[0061] For example, if three consecutive predicted dimensional deviations exceed the dynamic threshold, there is a risk of defects in the produced castings, which can be adjusted according to the specific circumstances.
[0062] This invention also provides a quality inspection and monitoring system for casting products. For example... Figure 2As shown, the system includes a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement a casting product quality inspection and monitoring method according to the first aspect of the present invention. The system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface. Their configuration and functions are known in the art and will not be described in detail here.
[0063] It should be noted that those skilled in the art can make various modifications and improvements without departing from the inventive concept, and these all fall within the scope of protection of this invention. Therefore, the scope of protection of this patent should be determined by the appended claims.
Claims
1. A method for quality inspection and monitoring of casting products, characterized in that, include: Surface thickness data is extracted from the casting product model and converted into a thickness distribution map. The thickness distribution map is divided into regions and the average thickness of each region is obtained. Environmental vectors for different casting stages of each casting process and standard environmental vectors for each casting stage in historical data are obtained. The degree of deviation between the environmental vector and the standard environmental vector is used as the deviation vector. A dataset is constructed by combining the deviation vector, thickness data of each region, and actual size deviation. The random forest model is trained using the dataset. After training, the importance score of each feature in the random forest model is obtained and normalized to obtain a weight vector. The deviation vector is then weighted and summed using the weight vector to obtain the significant anomaly score. The relative deviation of the thickness data of each region in history is used to calculate the size characteristics of each region. The size characteristics of the region are used as the weight of the previous time in the current time, and the size characteristics of the region minus 1 are used as the weight of the current time. The cumulative anomaly score of the current time is obtained by weighted summation based on the cumulative significant anomaly score of the previous time and the significant anomaly score of the current stage. The model is trained using historical cumulative anomaly scores and average thickness of each region to construct a dimensional deviation prediction model. This model is used to output predicted dimensional deviations. The dynamic threshold is adjusted based on the time decay ratio. The predicted dimensional deviations and the dynamic threshold are compared to determine whether there is a risk of defects, thus completing the quality inspection and monitoring of casting products. The process of dividing the thickness distribution map into regions includes the following steps: A number of pixels are uniformly selected on the thickness distribution map as initial seed points, and the difference between the candidate points around the initial seed points and the average thickness of the current region is calculated. If the difference is less than or equal to a preset threshold, the candidate point is merged into the current region as a new growth point and continues to expand outward. Otherwise, if the difference is greater than the preset threshold, the candidate point is not merged into the current region and does not meet the growth criterion. If there are no points in the neighborhood of all growth points in the current region that meet the growth criterion, the growth of the region stops. After the initial growth is completed, if the average thickness of adjacent regions is less than the preset thickness threshold, they are merged into a larger region, and the surface of the casting is divided into several continuous regions. The calculation methods for the region size characteristics include: The difference between the thickness of each region in the casting product model and the overall average thickness is taken as the thickness deviation of each region. The thickness deviation is exponentially mapped using a negative exponential function. The reciprocal of the mapping result plus 1 is taken as the region size feature. The calculation method for the time decay ratio includes: Obtain the preset total casting time, calculate the ratio of the preset total casting time to the current casting process time, and multiply the ratio by a preset constant as the time decay ratio.
2. The method for quality inspection and monitoring of casting products according to claim 1, characterized in that, The training steps for the random forest model include: The dataset is divided into a training set and a test set. The random forest model is trained using the training set. A portion of the samples are randomly selected from the training set as the training data for the current decision tree. At each node split, a portion of the features are randomly selected as candidate features from all features. The decision tree is constructed using the selected features until the stopping condition is met.
3. The method for quality inspection and monitoring of casting products according to claim 1, characterized in that, The importance score is calculated in the following ways: The importance of each decision tree in the random forest model is obtained by summing the impurities of each feature across all split nodes and reducing the impurity of each node. The average importance of all decision trees is then normalized and used as the importance score of the random forest model.
4. The method for quality inspection and monitoring of casting products according to claim 1, characterized in that, The determination of whether there is a defect risk includes the following steps: If the predicted size deviation exceeds a dynamic threshold for a consecutive preset number of times, a defect risk is detected in the production of the cast product, triggering an early warning and adjusting the thickness data. Conversely, if the value is less than or equal to the dynamic threshold, then the production of casting products is normal.
5. A quality inspection and monitoring system for casting products, characterized in that, include: A processor and a memory, wherein the memory stores computer program instructions that, when executed by the processor, implement the casting product quality inspection and monitoring method according to any one of claims 1-4.
Citation Information
Patent Citations
Defect detection method and system for cast steel
CN116975770A
Reinforcing plate production risk perception and identification system based on big data analysis
CN120822826A