Valve seal surface detection method and system based on computer vision
By using computer vision technology to perform neighborhood pixel analysis and defect type classification on valve sealing surfaces, and combining this with production time to determine equipment failures, the detection frequency can be dynamically adjusted. This solves the problems of insufficient defect classification accuracy and unsuitable detection strategies in valve sealing surface inspection, and achieves efficient and accurate quality control and equipment diagnosis.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG UNIV
- Filing Date
- 2026-03-27
- Publication Date
- 2026-06-09
AI Technical Summary
Existing valve sealing surface inspection methods suffer from insufficient defect classification accuracy, lack of adaptability in inspection strategies, and failure to effectively correlate with equipment status, making it difficult to meet the requirements for high-precision and high-efficiency quality inspection.
By using computer vision-based methods, neighborhood pixel analysis of valve sealing surfaces is performed to determine normal areas, classify defect types, construct an image classification model, and combine production time to determine equipment faults, and dynamically adjust the detection frequency.
It enables intelligent classification of valve sealing surfaces and equipment fault diagnosis, optimizes the allocation of testing resources, improves the pertinence and economy of testing, and enhances the accuracy of production quality control and equipment maintenance.
Smart Images

Figure CN121937449B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of machine vision technology, and specifically to a method and system for detecting valve sealing surfaces based on computer vision. Background Technology
[0002] As a key component in industrial pipeline systems, the quality of valve sealing surfaces directly affects the sealing performance and operational safety of the entire system. Traditionally, valve sealing surface inspection mainly relies on manual visual inspection or contact measurement methods, which suffer from low efficiency, high subjectivity, and poor consistency, making it difficult to meet the demands of modern industrial production for high-precision and high-efficiency quality inspection.
[0003] In recent years, with the development of machine vision technology, image-based automated inspection methods have been increasingly applied to the identification and classification of surface defects in industrial products. Some existing visual inspection systems can achieve defect localization and classification to a certain extent by performing grayscale analysis, edge detection, or texture feature extraction on product surface images. However, in the specific application scenario of valve sealing surfaces, the following problems still exist:
[0004] Insufficient accuracy in defect classification: Existing methods mostly rely on general feature extraction algorithms, which have limited ability to distinguish the specific defect types (such as scratches and holes) of valve sealing surfaces and lack targeted classification models;
[0005] Lack of adaptability in detection strategies: Existing systems typically employ fixed detection frequencies and strategies, failing to dynamically adjust detection plans based on equipment operating status and defect occurrence patterns, resulting in unreasonable allocation of detection resources;
[0006] Failure to effectively link equipment status: Existing technologies mostly remain at the "product inspection" level, failing to deeply link defect information with the status of production equipment, thus failing to achieve early warning and diagnosis of periodic equipment failures;
[0007] Therefore, there is an urgent need for a comprehensive visual inspection method and system that can combine the characteristics of valve sealing surface defects with the equipment operating status to achieve intelligent classification, periodic diagnosis and dynamic detection scheduling, so as to improve the quality control efficiency of valve production and the accuracy of equipment maintenance. Summary of the Invention
[0008] The purpose of this invention is to provide a method and system for detecting valve sealing surfaces based on computer vision, so as to solve the above-mentioned problems in the prior art.
[0009] Firstly, this invention provides a valve sealing surface detection method based on computer vision, comprising the following steps:
[0010] The conformity analysis module analyzes the neighboring pixels of historical images of the valve sealing surface to determine the normal area within the valve sealing surface image. Based on the area deviation analysis results of the normal area, it determines whether the valve sealing surface image is conforming to the specifications.
[0011] Defect type classification module: If it is unqualified, the defect area outside the normal area in the valve sealing surface image is classified into historical scratch images and historical hole images.
[0012] Model training module: Based on historical scratch images and historical hole images, an image classification model is constructed, and all actual valve sealing surface images are taken as input. The output is the classification result of the actual valve sealing surface images, including actual scratch images and actual hole images.
[0013] Periodic Analysis Module: Analyzes the valve sealing surface corresponding to actual scratch images and actual hole images, and combined with the valve's production time, determines whether the valve's processing equipment has experienced periodic failures;
[0014] Inspection frequency allocation module: If a periodic fault occurs, the production time of the valve is analyzed intermittently to determine the optimal inspection time, and the inspection frequency of the valve sealing surface is rationally allocated to determine the actual inspection frequency of holes and scratches.
[0015] Preferably, the process for determining the normal area within the valve sealing surface image is as follows:
[0016] Convert the historical image of the valve sealing surface into a grayscale image, determine the edge pixels and neighboring pixels of the grayscale image; take the absolute value of the difference between the edge pixels and the neighboring pixels to obtain the pixel deviation value, and mark the neighboring pixels with a pixel deviation threshold as the same type of point;
[0017] Record any point of the same type as a new seed point. Based on the new seed point, determine other points of the same type until no new points of the same type can be obtained around all seed points. Then merge the regions corresponding to all points of the same type and mark them as normal regions.
[0018] Preferably, the process for determining whether the valve sealing surface image is qualified is as follows:
[0019] Measure the area of the normal area and take the absolute value of the difference with the standard value of the sealing surface area. Then, compare the absolute value with the standard value of the sealing surface area to obtain the area deviation ratio. If the area deviation ratio is greater than or equal to the area deviation ratio threshold, an unqualified signal is generated.
[0020] Preferably, the historical scratch images and historical hole images are obtained in the following way:
[0021] The defect areas of the valve sealing surface image are analyzed to obtain the roundness deviation value and aspect ratio deviation value, and then multiplied to obtain the defect classification value; the unqualified valve sealing surface images with a defect classification threshold are recorded as historical scratch images.
[0022] Otherwise, the image of the unqualified valve sealing surface will be recorded as a historical hole image.
[0023] Preferably, the method for obtaining the roundness deviation value and the aspect ratio deviation value is as follows:
[0024] Areas other than the normal areas in the valve sealing surface image are recorded as defect areas.
[0025] Measure the area and perimeter of the defect area and substitute them into the formula to calculate the roundness of the defect area; take the absolute value of the difference between the roundness C of the defect area and 1 to obtain the roundness deviation value of the defect area.
[0026] Measure the length of the major axis and the length of the minor axis of the defect area, and process the ratio to obtain the aspect ratio of the defect area. Subtract the aspect ratio of the defect area from 1 and take the absolute value to obtain the aspect ratio deviation value of the defect area.
[0027] Preferably, the process for determining whether the valve processing equipment experiences periodic malfunctions is as follows:
[0028] The valves corresponding to the images of perforated valves and scratched valves are respectively labeled as perforated valves and scratched valves; the production time of the valves is obtained and divided to determine the production time intervals of perforated valves and scratched valves;
[0029] The production time intervals of all adjacent orifice valves are subtracted and integrated into an interval time data group for orifice valves. Then, the variance is calculated to obtain the orifice valve time variance value. If the orifice valve time variance value is less than or equal to the orifice valve time variance threshold, the equipment used to process the orifice valve has a periodic failure, generating a periodic orifice signal.
[0030] The production time intervals of all adjacent scratched valves are subtracted and integrated into a data set of scratched valve interval times. Then, the variance is calculated to obtain the time variance value of the scratched valve. If the time variance value of the scratched valve is less than or equal to the time variance threshold of the scratched valve, the equipment used to process the scratched valve has a periodic failure, generating a periodic scratch signal.
[0031] Preferred: Preferred inspection time includes preferred inspection time for valves with holes during production, preferred inspection time for valves with scratches during production, and preferred inspection time for both valves with holes and valves with scratches during production;
[0032] The optimal detection time for valves with holes is determined by summing and averaging all the intervals for generating periodic signals of holes during production; similarly, the optimal detection time for valves with scratches is determined by summing and averaging all the intervals for generating periodic signals of scratches during production.
[0033] The intervals of the periodic signals of holes and the periodic signals of scratches are marked on the time axis in chronological order, and the overlap time between the intervals of the periodic signals of holes and the periodic signals of scratches is extracted.
[0034] If the overlap time is greater than the overlap time threshold, the overlap time will be used as the preferred detection time for perforated valves and scratched valves during valve production; otherwise, an allocation signal will be generated.
[0035] Preferably, the process for determining the actual detection frequency of holes and the actual detection frequency of scratches is as follows:
[0036] Based on the distribution signals, the mean interval time of the periodic signals of holes and the mean interval time of the periodic signals of scratches are analyzed to determine the frequency distribution coefficients of holes and scratches.
[0037] By combining the preset valve sealing surface detection frequency, the hole frequency allocation coefficient is multiplied with the valve sealing surface detection frequency to obtain the actual hole detection frequency. Similarly, the scratch frequency allocation coefficient is multiplied with the valve sealing surface detection frequency to obtain the actual scratch detection frequency.
[0038] Preferably, the process for determining the hole frequency allocation coefficient and the scratch frequency allocation coefficient is as follows:
[0039] Based on the average interval time of the periodic signals of holes and the average interval time of the periodic signals of scratches, the detection cycle of holes and scratches is obtained by multiplying them by a safety factor.
[0040] Taking the reciprocals of the hole defect detection cycle and the scratch defect detection cycle respectively, we obtain the hole defect detection frequency and the scratch defect detection frequency:
[0041] Through the formula: The hole frequency distribution coefficient was calculated. In the formula, It is the frequency of hole defect detection. This refers to the frequency of scratch defect detection. This refers to the scratch defect detection cycle. This refers to the inspection cycle for holes and defects;
[0042] Through the formula: The scratch frequency distribution coefficient was calculated. .
[0043] Secondly, this invention provides a valve sealing surface detection system based on computer vision, comprising:
[0044] The conformity analysis module analyzes the neighboring pixels of historical images of the valve sealing surface to determine the normal area within the valve sealing surface image. Based on the area deviation analysis results of the normal area, it determines whether the valve sealing surface image is conforming to the specifications.
[0045] Defect type classification module: If it is unqualified, the defect area outside the normal area in the valve sealing surface image is classified into historical scratch images and historical hole images.
[0046] Model training module: Based on historical scratch images and historical hole images, an image classification model is constructed, and all actual valve sealing surface images are taken as input. The output is the classification result of the actual valve sealing surface images, including actual scratch images and actual hole images.
[0047] Periodic Analysis Module: Analyzes the valve sealing surface corresponding to actual scratch images and actual hole images, and combined with the valve's production time, determines whether the valve's processing equipment has experienced periodic failures;
[0048] Inspection frequency allocation module: If a periodic fault occurs, the production time of the valve is analyzed intermittently to determine the optimal inspection time, and the inspection frequency of the valve sealing surface is rationally allocated to determine the actual inspection frequency of holes and scratches.
[0049] The beneficial effects of this invention are:
[0050] 1. This invention can determine whether a valve is qualified by identifying the normal area of the valve sealing surface, and identify and classify the defect types of unqualified valves, including scratch defects and hole defects, providing a basis for subsequent improvement and processing.
[0051] 2. This invention extends quality inspection from the product level to equipment fault diagnosis by judging the periodicity of equipment failures. It can accurately locate periodic or non-periodic equipment failures, providing a clear basis for equipment maintenance. For periodic failures, the optimal inspection time is determined by the average interval time. The inspection frequency is allocated by combining the frequency allocation coefficient with the total capacity of the production line, so as to tilt inspection resources towards high failure risk links, avoid waste of inspection resources and missed faults, improve the overall pertinence and economy of inspection, and provide full-chain technical support for valve production quality control and production efficiency optimization. Attached Figure Description
[0052] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0053] Figure 1 This is a system block diagram of the valve sealing surface detection system based on computer vision according to an embodiment of the present invention;
[0054] Figure 2 This is a flowchart of a valve sealing surface detection method based on computer vision according to an embodiment of the present invention. Detailed Implementation
[0055] To enable those skilled in the art to better understand the present invention, 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 only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0056] Example 1
[0057] See Figure 1 The valve sealing surface detection system based on computer vision provided in Embodiment 1 of the present invention includes:
[0058] The conformity analysis module analyzes the neighboring pixels of historical images of the valve sealing surface to determine the normal area within the valve sealing surface image. Based on the area deviation analysis results of the normal area, it determines whether the valve sealing surface image is conforming to the specifications.
[0059] Historical images of the valve sealing surface are acquired using an industrial camera. The acquired historical images are then converted into grayscale images using an image processing database. Based on the grayscale images, edge detection is performed using the Canny operator to obtain the edge pixels of the grayscale images.
[0060] Extract any edge pixel from the grayscale image and mark it as a seed point. Obtain the pixels of the neighboring pixels of the seed point and mark them as neighboring pixels.
[0061] The edge pixels corresponding to the seed point are compared with their neighboring pixels. The absolute value of the difference is then taken to obtain the pixel deviation value. This pixel deviation value is then compared with the pixel deviation threshold.
[0062] If the pixel deviation value is less than the pixel deviation threshold, it means that the seed point is similar to the neighboring pixels, and the corresponding neighboring pixels are marked as the same type of point.
[0063] If the pixel deviation value is greater than or equal to the pixel deviation threshold, it means that the seed point is not similar to the neighboring pixels, and the corresponding neighboring pixels are marked as outliers.
[0064] Based on any point of the same type, mark it as a new seed point, obtain points of the same type around the new seed point, and so on, until no new points of the same type can be obtained around all seed points. Then merge the regions corresponding to all points of the same type and mark them as normal regions.
[0065] Measure the area of the normal region and mark it as the normal area of the sealing surface. Calculate the difference between the normal area of the sealing surface and the standard value of the sealing surface area, and take the absolute value of the difference to obtain the deviation value of the sealing surface area. Calculate the ratio between the deviation value of the sealing surface area and the standard value of the sealing surface area to obtain the area deviation ratio.
[0066] It should be noted that the standard value of the sealing surface area was set by those skilled in the art based on historical experience;
[0067] Compare the area deviation ratio with the area deviation ratio threshold:
[0068] If the area deviation ratio is greater than or equal to the area deviation ratio threshold, the corresponding valve sealing surface image is marked as an unqualified valve sealing surface image, and an unqualified signal is generated.
[0069] If the area deviation ratio is less than the area deviation ratio threshold, the corresponding valve sealing surface image is marked as a qualified valve sealing surface image, and a qualified signal is generated.
[0070] Defect type classification module: If it is unqualified, the defect area outside the normal area in the valve sealing surface image is classified into historical scratch images and historical hole images.
[0071] Mark the areas other than the normal areas in the valve sealing surface image as defect areas;
[0072] Measure the area and perimeter of the defective region, and label the area of the defective region as A and the perimeter of the defective region as P;
[0073] Through the formula: The circularity C of the defect area is calculated.
[0074] The difference between the roundness C of the defect area and 1 is calculated, and the absolute value of the difference is taken to obtain the roundness deviation value of the defect area.
[0075] Measure the length of the major axis and the length of the minor axis of the defect area, and process the ratio of the length of the major axis and the length of the minor axis of the defect area to obtain the aspect ratio of the defect area. Subtract the aspect ratio of the defect area from 1 and take the absolute value to obtain the aspect ratio deviation value of the defect area.
[0076] It should be noted that the major axis length refers to the length of the axis passing through the center of the smallest circumscribed rectangle of the defect and parallel to its longer side, while the minor axis length refers to the length of the axis passing through the center of the smallest circumscribed rectangle of the defect and parallel to its shorter side.
[0077] The defect classification value is obtained by multiplying the roundness deviation value and the aspect ratio deviation value.
[0078] Compare the defect classification value with the defect classification threshold:
[0079] If the defect classification value is greater than the defect classification threshold, the corresponding defective valve sealing surface image will be marked as a historical scratch image.
[0080] If the defect classification value is less than or equal to the defect classification threshold, the corresponding defective valve sealing surface image will be marked as a historical hole image.
[0081] The technical solution of this embodiment is as follows: by performing neighborhood pixel analysis on historical images of the valve sealing surface, the normal area within the valve sealing surface image is determined. Based on the area deviation analysis results of the normal area, it is determined whether the valve sealing surface image is qualified. If it is not qualified, defect classification processing is performed on the defective areas outside the normal area in the valve sealing surface image, distinguishing the defective areas into historical scratch images and historical hole images. This invention can determine whether the valve sealing surface is qualified by determining the normal area of the valve sealing surface, and identify and classify the defect types of unqualified valve sealing surfaces. The defect types include scratch defects and hole defects, providing a basis for subsequent improvement and processing.
[0082] Example 2
[0083] Based on Example 1, please refer to Figure 1 As shown, the valve sealing surface detection method and system based on computer vision specifically include:
[0084] Model training module: Based on historical scratch images and historical hole images, an image classification model is constructed, and all actual valve sealing surface images are taken as input. The output is the classification result of the actual valve sealing surface images, including actual scratch images and actual hole images.
[0085] All valve sealing surface images labeled with different defect types (scratches or holes) were integrated into a dataset, and the dataset was divided into a training set and a validation set in an 8:2 ratio.
[0086] Based on a CNN model, an image classification model is constructed. The training set is input into the image classification model for training. The Softmax function is used to convert the output into a probability distribution of the valve sealing surface image for each defect type. The formula for the Softmax function is:
[0087]
[0088] Where i = 1, 2, ..., K, This is the input to the Softmax function, representing the output score of the CNN model for the i-th class. K represents the probability of the i-th category, and K is the total number of categories.
[0089] Understandably, the total number of categories includes scratches and holes;
[0090] Based on the probability distribution of the valve sealing surface image for each defect type output by the Softmax function, the loss function is substituted into the calculation. The specific loss function is as follows:
[0091]
[0092] Where N is the number of samples, It is the true label (0 or 1) of the i-th sample;
[0093] It should be noted that during the training process, the labels for historical scratch images are marked as 0, and the labels for historical hole images are marked as 1.
[0094] By minimizing the loss function, a trained image classification model is obtained. The trained image classification model is then validated using a validation set to obtain a validated image classification model.
[0095] All actual valve sealing surface images are input into the validated image classification model, and the output is the classification result of the actual valve sealing surface images, including actual scratch images and actual hole images;
[0096] Periodic Analysis Module: Analyzes the valve sealing surface corresponding to actual scratch images and actual hole images, and combined with the valve's production time, determines whether the valve's processing equipment has experienced periodic failures;
[0097] In some embodiments, the valves corresponding to the hole image and the scratch image are respectively labeled as hole valves and scratch valves;
[0098] The production time of the perforated valve and the production time of the scratched valve are obtained by using a timer. According to the time continuity (time continuity refers to valves that have the same signal in adjacent time periods), the production time of the perforated valve and the production time of the scratched valve are divided into multiple production time intervals for the perforated valve and the scratched valve.
[0099] The orifice valves are analyzed by subtracting the production time intervals of adjacent orifice valves to obtain the interval time of the orifice valves. The interval times of all orifice valves are integrated to obtain the interval time data set of the orifice valves. The variance of the data set is calculated to obtain the time variance value of the orifice valves.
[0100] Compare the time variance value of the orifice valve with the time variance threshold of the orifice valve:
[0101] If the time variance value of the orifice valve is greater than the time variance threshold of the orifice valve, it indicates that the equipment used in the processing of the orifice valve has a non-periodic failure, generating a non-periodic signal of orifice defect.
[0102] If the time variance value of the orifice valve is less than or equal to the time variance threshold of the orifice valve, it indicates that the equipment used in the processing of the orifice valve has a periodic failure, generating a periodic orifice signal.
[0103] Similarly, for the scratched valves, the production time intervals of adjacent scratched valves are subtracted to obtain the interval time of the scratched valves. The interval times of all scratched valves are integrated to obtain the interval time data set of the scratched valves. The variance of the data set is calculated to obtain the time variance value of the scratched valves.
[0104] Compare the time variance value of the scratched valve with the time variance threshold of the scratched valve:
[0105] If the time variance value of the scratch valve is greater than the time variance threshold of the scratch valve, it indicates that the equipment used to process the scratch valve has a non-periodic failure, generating a non-periodic signal of scratch defects.
[0106] If the time variance value of the scratch valve is less than or equal to the time variance threshold of the scratch valve, it indicates that the equipment used to process the scratch valve has a periodic failure, generating a periodic scratch signal.
[0107] It should be noted that periodic signals indicate that during the time of tracing valve production, there may be intermittent periodic failures in the equipment used for processing the valve sealing surface. For example, periodic abnormalities may occur in bearings, belts, or any other components in the production line of the valve processing equipment, thereby affecting the quality of the valve products. Based on the generated signals, the nature of the failure of the valve processing equipment can be further analyzed.
[0108] Inspection frequency allocation module: If a periodic fault occurs, the valve production time is analyzed intermittently to determine the optimal inspection time, and the inspection frequency of the valve sealing surface is rationally allocated to determine the actual inspection frequency of holes and scratches.
[0109] The preferred inspection time includes the preferred inspection time for the orifice valve during production, the preferred inspection time for the scratched valve during production, and the preferred inspection time for both the orifice valve and the scratched valve during production.
[0110] In some embodiments, if only periodic signals of holes are generated, the preferred detection time is analyzed, specifically as follows:
[0111] The interval time of the periodic signal of the hole is obtained. All the interval times of the periodic signal of the hole are summed and averaged to obtain the average interval time of the periodic signal of the hole. Based on the average interval time of the periodic signal of the hole, the adjacent detection time of the valve for the hole valve during production is determined.
[0112] If only periodic scratch signals are generated, the optimal detection time is analyzed as follows:
[0113] The interval time of the scratch periodic signal is obtained. All the interval times of the scratch periodic signal are summed and averaged to obtain the average interval time of the scratch periodic signal. Based on the average interval time of the scratch periodic signal, the optimal detection time for the scratch valve during production is determined.
[0114] If both periodic signals of holes and periodic signals of scratches are generated simultaneously, the optimal detection time is analyzed, specifically as follows:
[0115] The intervals of the periodic signals of holes and the periodic signals of scratches are marked on the time axis in chronological order, and the overlap time between the intervals of the periodic signals of holes and the periodic signals of scratches is extracted.
[0116] If the overlap time is greater than the overlap time threshold, the overlap time will be used as the preferred inspection time for perforated valves and scratched valves during valve production.
[0117] If the overlap time is less than or equal to the overlap time threshold, it indicates that the time when the production equipment experiences periodic failures when the perforated valve and the scratched valve appear is less overlapped, and a distribution signal is generated.
[0118] Based on the distribution signal, the average interval time of the periodic signal of the hole and the average interval time of the periodic signal of the scratch are multiplied by a safety factor to obtain the hole defect detection cycle and the scratch defect detection cycle. The safety factor is set by a person skilled in the art based on historical experience. The purpose of setting the safety factor is to ensure that the detection cycle is shorter than the fault interval and to avoid missed fault detection.
[0119] The detection frequency of hole defects and the detection frequency of scratch defects are obtained by taking the reciprocal of the detection cycle of hole defects and the detection cycle of scratch defects, respectively.
[0120] The detection frequency of holes and scratches reflects the number of inspections per unit time. The shorter the cycle, the more frequent the failures. A frequency allocation coefficient is used to allocate resources to defects with high failure risk (short intervals). The frequency allocation coefficient includes a hole frequency allocation coefficient and a scratch frequency allocation coefficient. The calculation process for the hole frequency allocation coefficient and the scratch frequency allocation coefficient is as follows:
[0121] Through the formula: The hole frequency distribution coefficient was calculated. In the formula, It is the frequency of hole defect detection. This refers to the frequency of scratch defect detection. This refers to the scratch defect detection cycle. This refers to the inspection cycle for holes and defects;
[0122] Through the formula: The scratch frequency distribution coefficient was calculated. ;
[0123] It should be noted that when the detection frequencies of hole defects and scratch defects are substituted into the calculation formulas for hole frequency allocation coefficient and scratch frequency allocation coefficient respectively, the safety factor will be canceled out. The final allocation coefficient is only related to the average interval time of the two types of failures. The allocation coefficient of the defect with the shorter interval time will be larger.
[0124] By combining the preset valve sealing surface detection frequency, the hole frequency allocation coefficient is multiplied with the valve sealing surface detection frequency to obtain the actual hole detection frequency. Similarly, the scratch frequency allocation coefficient is multiplied with the valve sealing surface detection frequency to obtain the actual scratch detection frequency.
[0125] For example, the actual detection frequency = allocation coefficient × preset valve sealing surface detection frequency (the total resources are allocated to the two defects according to the coefficient).
[0126] Assuming the average interval of the periodic signal from the hole is 10 hours and the average interval of the periodic signal from the scratch is 20 hours, and setting a safety factor of 1.2, the calculated frequency distribution coefficients for the hole and scratch are as follows: and ;
[0127] Actual detection frequency of holes = ×3 times / hour = 2 times / hour;
[0128] Actual scratch detection frequency = ×3 times / hour = 1 time / hour;
[0129] Hole failures were more frequent (with an interval of 10 hours), ultimately resulting in 2 inspections per hour, accounting for 2 / 3 of the total resources;
[0130] With fewer scratch defects (interval of 20 hours), the final inspection resource was 1 inspection per hour, accounting for 1 / 3 of the total resources;
[0131] The technical solution of this embodiment is as follows: Based on historical scratch images and historical hole images, an image classification model is constructed, and all actual valve sealing surface images are used as input. The classification results of actual valve sealing surface images are output, including actual scratch images and actual hole images. The actual scratch images and the valve sealing surfaces corresponding to the actual scratch images are analyzed. Combined with the valve's production time, it is determined whether the valve processing equipment has periodic failures. If periodic failures occur, the valve's production time is analyzed at intervals to determine the optimal detection time. The detection frequency of the valve is rationally allocated to determine the actual detection frequency of holes and actual detection frequency of scratches. This invention extends quality inspection from the product level to equipment fault diagnosis by judging the periodicity of equipment failures. It can accurately locate periodic or non-periodic equipment failures, providing a clear basis for equipment maintenance. For periodic failures, the optimal detection time is determined by the average interval time. The detection frequency is allocated by combining the frequency allocation coefficient and the total capacity of the production line, so as to tilt the detection resources towards high failure risk links, avoid waste of detection resources and missed fault detection, improve the overall detection pertinence and economy, and provide full-chain technical support for valve production quality control and production efficiency optimization.
[0132] Example 3
[0133] Based on Examples 1 and 2, please refer to Figure 2 As shown, the valve sealing surface detection method based on computer vision specifically includes the following steps:
[0134] Step 1: By performing neighborhood pixel analysis on historical images of the valve sealing surface, determine the normal area within the valve sealing surface image. Based on the area deviation analysis results of the normal area, determine whether the valve sealing surface image is qualified.
[0135] Step 2: If it is not up to standard, perform defect classification processing on the defect areas outside the normal area in the valve sealing surface image, and distinguish the defect areas into historical scratch images and historical hole images.
[0136] Step 3: Based on historical scratch images and historical hole images, construct an image classification model, and take all actual valve sealing surface images as input, outputting the classification results of actual valve sealing surface images, including actual scratch images and actual hole images;
[0137] Step 4: Analyze the actual scratch images and the corresponding valves, and in conjunction with the valve's production time, determine whether the valve's processing equipment is experiencing periodic failures.
[0138] Step 5: If periodic failures occur, perform an interval analysis of the valve's production time to determine the optimal inspection time, and rationally allocate the valve's inspection frequency to determine the actual inspection frequency for holes and scratches.
[0139] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.
[0140] The foregoing has provided a detailed description of one embodiment of the present invention, but this description is merely a preferred embodiment and should not be construed as limiting the scope of the invention. All equivalent variations and modifications made within the scope of the claims of this invention should still fall within the patent coverage of this invention.
Claims
1. A valve sealing surface detection method based on computer vision, characterized in that, Includes the following steps: By performing neighborhood pixel analysis on historical images of the valve sealing surface, the normal area within the valve sealing surface image is determined. Based on the area deviation analysis results of the normal area, it is determined whether the valve sealing surface image is qualified. If it is not up to standard, the defect areas outside the normal area in the valve sealing surface image are classified into historical scratch images and historical hole images. Based on historical scratch images and historical hole images, an image classification model is constructed. All actual valve sealing surface images are taken as input, and the classification results of actual valve sealing surface images are output, including actual scratch images and actual hole images. Analyze the valve sealing surfaces corresponding to actual scratch images and actual hole images, and combine this with the valve's production time to determine whether the valve's processing equipment has experienced periodic failures. If periodic failures occur, the production time of the valve is analyzed intermittently to determine the optimal inspection time, and the inspection frequency of the valve sealing surface is rationally allocated to determine the actual inspection frequency of holes and scratches.
2. The valve sealing surface detection method based on computer vision according to claim 1, characterized in that, The process for determining the normal area within the valve sealing surface image is as follows: Convert the historical image of the valve sealing surface into a grayscale image, determine the edge pixels and neighboring pixels of the grayscale image; take the absolute value of the difference between the edge pixels and the neighboring pixels to obtain the pixel deviation value, and mark the neighboring pixels with a pixel deviation threshold as the same type of point; Record any point of the same type as a new seed point. Based on the new seed point, determine other points of the same type until no new points of the same type can be obtained around all seed points. Then merge the regions corresponding to all points of the same type and mark them as normal regions.
3. The valve sealing surface detection method based on computer vision according to claim 2, characterized in that, The process for determining whether the valve sealing surface image is qualified is as follows: Measure the area of the normal area and take the absolute value of the difference with the standard value of the sealing surface area. Then, compare the absolute value with the standard value of the sealing surface area to obtain the area deviation ratio. If the area deviation ratio is greater than or equal to the area deviation ratio threshold, an unqualified signal is generated.
4. The valve sealing surface detection method based on computer vision according to claim 1, characterized in that, The historical scratch images and historical hole images are obtained in the following way: The defect areas of the valve sealing surface image are analyzed to obtain the roundness deviation value and aspect ratio deviation value, and then multiplied to obtain the defect classification value; the unqualified valve sealing surface images with a defect classification threshold are recorded as historical scratch images. Otherwise, the image of the unqualified valve sealing surface will be recorded as a historical hole image.
5. The valve sealing surface detection method based on computer vision according to claim 4, characterized in that, The roundness deviation value and aspect ratio deviation value are obtained as follows: Areas other than the normal areas in the valve sealing surface image are recorded as defect areas. Measure the area and perimeter of the defective region, and substitute them into the formula to calculate the roundness of the defective region; The absolute value of the difference between the roundness C of the defect area and 1 is taken to obtain the roundness deviation value of the defect area. Measure the length of the major axis and the length of the minor axis of the defect area, and process the ratio to obtain the aspect ratio of the defect area. Subtract the aspect ratio of the defect area from 1 and take the absolute value to obtain the aspect ratio deviation value of the defect area.
6. The valve sealing surface detection method based on computer vision according to claim 1, characterized in that, The process for determining whether the valve processing equipment experiences periodic malfunctions is as follows: The valves corresponding to the images of perforated valves and scratched valves are respectively labeled as perforated valves and scratched valves; the production time of the valves is obtained and divided to determine the production time intervals of perforated valves and scratched valves; The production time intervals of all adjacent orifice valves are subtracted and integrated into an interval time data group for orifice valves. Then, the variance is calculated to obtain the time variance value of the orifice valves. If the time variance value of the orifice valve is less than or equal to the time variance threshold of the orifice valve, the equipment used in the processing of the orifice valve will experience periodic failures, generating periodic orifice signals. The production time intervals of all adjacent scratched valves are subtracted and integrated into a data set of scratched valve interval times. Then, the variance is calculated to obtain the time variance value of the scratched valve. If the time variance value of the scratched valve is less than or equal to the time variance threshold of the scratched valve, the equipment used to process the scratched valve has a periodic failure, generating a periodic scratch signal.
7. The valve sealing surface detection method based on computer vision according to claim 1, characterized in that, The preferred inspection time includes the preferred inspection time for valves with holes during production, the preferred inspection time for valves with scratches during production, and the preferred inspection time for both valves with holes and valves with scratches during production. The optimal detection time for valves with holes is determined by summing and averaging all the intervals for generating periodic signals of holes during production; similarly, the optimal detection time for valves with scratches is determined by summing and averaging all the intervals for generating periodic signals of scratches during production. The intervals of the periodic signals of holes and the periodic signals of scratches are marked on the time axis in chronological order, and the overlap time between the intervals of the periodic signals of holes and the periodic signals of scratches is extracted. If the overlap time is greater than the overlap time threshold, the overlap time will be used as the preferred detection time for perforated valves and scratched valves during valve production; otherwise, an allocation signal will be generated.
8. The valve sealing surface detection method based on computer vision according to claim 7, characterized in that, The process for determining the actual detection frequency of holes and the actual detection frequency of scratches is as follows: Based on the distribution signals, the mean interval time of the periodic signals of holes and the mean interval time of the periodic signals of scratches are analyzed to determine the frequency distribution coefficients of holes and scratches. By combining the preset valve sealing surface detection frequency, the hole frequency allocation coefficient is multiplied with the valve sealing surface detection frequency to obtain the actual hole detection frequency. Similarly, the scratch frequency allocation coefficient is multiplied with the valve sealing surface detection frequency to obtain the actual scratch detection frequency.
9. The valve sealing surface detection method based on computer vision according to claim 8, characterized in that, The process for determining the frequency allocation coefficients for the holes and scratches is as follows: Based on the average interval time of the periodic signals of holes and the average interval time of the periodic signals of scratches, the detection cycle of holes and scratches is obtained by multiplying them by a safety factor. Taking the reciprocals of the hole defect detection cycle and the scratch defect detection cycle respectively, we obtain the hole defect detection frequency and the scratch defect detection frequency: Through the formula: The hole frequency distribution coefficient was calculated. In the formula, It is the frequency of hole defect detection. This refers to the frequency of scratch defect detection. This refers to the scratch defect detection cycle. This refers to the inspection cycle for holes and defects; Through the formula: The scratch frequency distribution coefficient was calculated. .
10. A valve sealing surface inspection system based on computer vision, characterized in that, include: The conformity analysis module analyzes the neighboring pixels of historical images of the valve sealing surface to determine the normal area within the valve sealing surface image. Based on the area deviation analysis results of the normal area, it determines whether the valve sealing surface image is conforming to the specifications. Defect type classification module: If it is unqualified, the defect area outside the normal area in the valve sealing surface image is classified into historical scratch images and historical hole images. Model training module: Based on historical scratch images and historical hole images, an image classification model is constructed, and all actual valve sealing surface images are taken as input. The output is the classification result of the actual valve sealing surface images, including actual scratch images and actual hole images. Periodic Analysis Module: Analyzes the valve sealing surface corresponding to actual scratch images and actual hole images, and combined with the valve's production time, determines whether the valve's processing equipment has experienced periodic failures; Inspection frequency allocation module: If a periodic fault occurs, the production time of the valve is analyzed intermittently to determine the optimal inspection time, and the inspection frequency of the valve sealing surface is rationally allocated to determine the actual inspection frequency of holes and scratches.