Industrial equipment anomaly detection method and system based on machine vision
By calculating high-dimensional feature spatial analysis of pixel gradient and texture change rate, dynamically adjusting the shrinkage factor, dividing local sensitive feature areas, and combining the overall feature correlation, the problem of insufficient detection stability and accuracy in the existing technology is solved, and more efficient detection of abnormalities in industrial equipment is achieved.
Patent Information
- Application Number
- CN202510489998.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-18
- Publication Date
- 2025-07-18
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art has poor adaptability to complex surfaces in the detection of abnormalities of industrial equipment and is easily disturbed by light, reflection, etc., resulting in poor detection stability, many misjudgment and misjudgment, insufficient correlation between local abnormalities and overall state, and difficult to distinguish subtle changes in complex areas of structural characteristics, affecting the accuracy and degree of automation.
By calculating the change rate of pixel gradient and texture direction in the surface of industrial equipment, a high-dimensional feature space is established, the shrinkage factor is dynamically adjusted, the local gradient change rate and texture direction change amplitude are divided, the image blocks are divided, the local sensitive feature area is calculated, and the overall feature vector correlation is combined with the weight correction is applied to obtain the contribution value of local anomaly feature.
It improves the adaptability and accuracy of detection, enhances the ability to identify complex structures, reduces misjudgments caused by environmental interference, improves the credibility and real-timeness of detection, and improves equipment maintenance efficiency.
Smart Images

Figure CN120339254A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of inspection or monitoring, and particularly to an industrial equipment anomaly detection method and system based on machine vision. Background Art
[0002] The technical field of inspection or monitoring includes methods and technologies for state monitoring, fault diagnosis, and operation evaluation of equipment, systems, or their components in the industrial production process. The core content of this field is to realize the real-time acquisition, analysis, and judgment of equipment operation parameters through sensors, data acquisition devices, and computer systems, ensure that industrial equipment operates in the best state, reduce equipment failure rates, and improve production efficiency. This field involves various technical means such as vibration analysis, acoustic monitoring, current signal detection, temperature monitoring, and visual detection. Different methods are applicable to different types of equipment state evaluation. In recent years, with the progress of computer vision technology, monitoring means based on visual images have gradually become an important research direction in this field and are widely used in scenarios such as automated production lines, intelligent manufacturing systems, and industrial robot monitoring.
[0003] Among them, the industrial equipment anomaly detection method based on machine vision refers to a method that uses industrial cameras, optical components, and image processing algorithms to perform real-time detection on the appearance, state, or operation parameters of industrial equipment. This method mainly includes links such as image acquisition, image preprocessing, feature extraction, and anomaly recognition. First, an industrial camera is used to capture images during the operation of the equipment, and the image quality is optimized through lighting adjustment and filtering techniques. Subsequently, edge detection, morphological analysis, or deep learning models are used for image feature extraction to obtain the state information of key components of the equipment. Finally, the image data is analyzed through pattern matching or classification algorithms to determine whether there are anomalies in the equipment, such as structural problems such as component wear, cracks, and misalignment, or abnormal operation states. This method can be applied to automated monitoring on the production line, reducing the workload of manual detection and improving the intelligent level of equipment state monitoring.
[0004] The prior art has poor adaptability to complex surfaces in feature extraction, is easily interfered by factors such as lighting and reflection, resulting in the loss of detailed information and affecting detection stability. Fixed threshold criteria are difficult to adapt to the dynamic changes of equipment states, with more false positives and false negatives, reducing detection accuracy. The correlation between local anomalies and the overall state is not sufficiently considered, and local feature anomalies are easily amplified or ignored, affecting global judgment. Subtle changes in complex-structured feature areas are difficult to distinguish between normal fluctuations and abnormal features, increasing the false positive rate. The global and local detections do not form an effective complement, resulting in a lack of comprehensiveness in detection, affecting the intelligent level of equipment monitoring, increasing the need for manual intervention, and reducing the degree of industrial production automation. Summary of the Invention
[0005] The object of the present invention is to solve the disadvantages existing in the prior art, and to propose an industrial equipment anomaly detection method and system based on machine vision.
[0006] To achieve the above object, the present invention adopts the following technical solution: An industrial equipment anomaly detection method based on machine vision, comprising the following steps:
[0007] S1: Obtain the multi-channel pixel matrix of the surface image of the industrial equipment, calculate the pixel gradient and the texture direction change rate, establish a high-dimensional feature space, calculate the Euclidean distance, cosine similarity, and distribution offset degree of the anomaly feature points based on the feature vector density, and establish the spatial distribution boundary of the anomaly feature vector.
[0008] S2: Based on the spatial distribution boundary of the anomaly feature vector, calculate the projection offset of the anomaly feature vector, and obtain the mean value and variance normalization value of the offset. Set the initial value of the dynamic shrinkage factor, adjust the update step of the shrinkage factor according to the offset distribution, and correct the shrinkage factor by combining the local gradient change rate and the texture direction change amplitude of the surface weld of the industrial equipment to obtain the offset dynamic shrinkage coefficient.
[0009] S3: Call the offset dynamic shrinkage coefficient, divide the image block according to the structural characteristics of the equipment components, calculate and sort the pixel gradient change rate, set a sensitivity threshold to screen the area where the gradient change rate exceeds the set value, and obtain the local sensitive feature area.
[0010] S4: According to the local sensitive feature area, calculate the correlation between the multi-region feature vector and the overall feature vector, apply weight correction to the target area based on the contribution degree, and obtain the local anomaly feature contribution value.
[0011] As a further solution of the present invention, the spatial distribution boundary of the anomaly feature vector includes the feature vector density threshold, the Euclidean distance of the anomaly feature point, the cosine similarity of the anomaly feature point, and the distribution offset degree of the anomaly feature point. The offset dynamic shrinkage coefficient is specifically the mean normalization value, the variance normalization value, the initial value of the dynamic shrinkage factor, the update step of the shrinkage factor, the local gradient change rate correction factor, and the texture direction change amplitude correction factor. The local sensitive feature area includes the image block division feature, the pixel gradient change rate sorting value, and the sensitivity threshold screening result. The local anomaly feature contribution value is specifically the multi-region feature vector correlation, the overall feature vector correlation, and the target area contribution degree weight.
[0012] As a further solution of the present invention, the specific steps for obtaining the spatial distribution boundary of the anomaly feature vector are as follows:
[0013] S101: Obtain the multi-channel pixel matrix of the industrial equipment surface image, calculate the gradient information of each pixel point, including the horizontal gradient component, vertical gradient component and gradient amplitude, and calculate its local texture change rate in combination with the gradient direction, construct the pixel gradient distribution matrix, and obtain the pixel gradient change rate matrix;
[0014] S102: Based on the pixel gradient change rate matrix, establish a high-dimensional feature space, calculate the feature vector density, and perform statistical analysis on the vector density distribution to obtain the density distribution offset value. By calculating the distribution offset of the feature points in the high-dimensional feature space, form the feature vector distribution offset degree;
[0015] S103: Based on the feature vector distribution offset degree, calculate the Euclidean distance, cosine fitting degree and offset degree of the abnormal feature points, and use the formula:
[0016]
[0017] Perform operations to obtain the multi-dimensional abnormality measurement value of the abnormal feature points, compare with the distribution boundary setting threshold, screen the abnormal feature points, and generate the abnormal feature vector space distribution boundary;
[0018] Among them, D an represents the comprehensive abnormality measurement value of the abnormal feature points, X f1i represents the distribution position of the i-th feature vector in the high-dimensional feature space, represents the mean vector of all feature vectors, Y v1j represents the j-th feature vector, Z v1j represents the reference vector of the j-th feature point, ||Y v1j ||, ||Z v1j || are the norms of Y v1j and Z v1j respectively, W d1k represents the offset value of the k-th feature point, μ Wd1 represents the mean of the offset values of all feature points, n f 1 represents the total number of feature vectors, n f 2 represents the comparison quantity for calculating the cosine fitting degree of the feature vectors, p d 1 represents the sample quantity for calculating the offset degree of the feature points.
[0019] As a further solution of the present invention, the obtaining steps of the offset dynamic contraction coefficient are specifically as follows:
[0020] S201: Based on the abnormal feature vector space distribution boundary, calculate the projection offset of the abnormal feature vector, determine the projection coordinates of the projection point on the boundary according to the spatial position of the vector, calculate the vector offset value, and at the same time call the offset values of all vectors to calculate the mean and variance normalization value to obtain the normalized offset;
[0021] S202: Invoke the normalized offset, set the initial value of the dynamic shrinkage factor, adjust the update step of the shrinkage factor according to the distribution range of the normalized offset, and calculate the average rate of change in combination with the local gradient rate of change of the surface weld of the industrial equipment. Use the formula:
[0022]
[0023] Calculate the adjustment amplitude of the shrinkage factor, and correct the shrinkage factor in combination with the change amplitude of the texture direction to obtain the dynamic shrinkage adjustment factor;
[0024] where S d represents the adjustment amplitude of the shrinkage factor, Q s1k represents the k-th data point of the normalized offset, represents the mean value of the normalized offset, ΔR s1k represents the local gradient rate of change of the k-th point, C represents the stability coefficient to avoid the denominator approaching zero, N s 1 represents the total number of data points;
[0025] S203: Invoke the dynamic shrinkage adjustment factor, adjust the shrinkage factor according to the normalized offset, combine the dynamic trend of the multi-vector offset, correct the calculation range, and adjust the shrinkage parameter to obtain the offset dynamic shrinkage coefficient.
[0026] As a further solution of the present invention, the specific steps for obtaining the locally sensitive feature region are as follows:
[0027] S301: Invoke the offset dynamic shrinkage coefficient, divide the image block according to the structural characteristics of the equipment component, obtain the pixel distribution matrix of multiple blocks, calculate the gradient change value of the pixels in multiple blocks, and obtain the pixel gradient change matrix;
[0028] S302: Based on the pixel gradient change matrix, calculate the gradient change rate of the pixels in multiple blocks, sort them in descending order according to the change rate, obtain the sorted gradient change rate sequence, and at the same time calculate the mean value and standard deviation of the change rate. Set the sensitivity threshold according to the mean value and standard deviation of the change rate, and screen the image regions where the gradient change rate exceeds the threshold to obtain the high-gradient change regions;
[0029] S303: Based on the high-gradient change region, extract the corresponding pixel coordinate distribution, calculate the local sensitivity coefficient of the pixel gradient change in the region, and use the formula:
[0030]
[0031] Calculate the sensitive feature value of each local region through operation, and construct the local sensitive feature distribution to obtain the local sensitive feature region;
[0032] where Sl represents the locally sensitive eigenvalue, G l1i represents the gradient change rate of the i-th pixel point, represents the mean value of the gradient change rates of all pixel points within the region, σ L1 represents the standard deviation of the gradient change rates of all pixel points within the region, α represents the gradient change stability adjustment coefficient, W i represents the weight factor of the i-th pixel point, N l 1 represents the total number of pixel points within the region.
[0033] As a further solution of the present invention, the steps for obtaining the local abnormal feature contribution value are specifically as follows:
[0034] S401: Based on the locally sensitive feature region, calculate the correlation between the multi-region feature vector and the overall feature vector, obtain the contribution degree of each feature region to the overall feature, and perform normalization processing on the feature vector. Calculate the deviation value between the normalized feature vector and the overall feature vector. At the same time, call the multi-region deviation value and the overall deviation trend for comparison, screen the feature regions that have a greater impact on the overall feature change, and generate the local feature deviation influence amount;
[0035] S402: Based on the local feature deviation influence amount, calculate the feature weight contribution degree of the target region, determine the weight correction coefficient of the feature region according to the contribution degree distribution, and use the formula:
[0036]
[0037] Calculate the corrected weight value, map the corrected weight to the multi-feature region, and obtain the feature weight correction value;
[0038] where, ΔW i represents the weight correction amount of the i-th region, F w1i,j represents the value of the j-th feature in the i-th region, G w1j represents the value of the j-th feature in the overall feature vector, n w 1 represents the total number of features, W w1 represents the original weight vector, G avg1 represents the average value of the overall feature vector;
[0039] S403: Call the feature weight correction value, adjust the feature value of the target region, and calculate the overall deviation value of the corrected feature region. Extract the deviation change rate. At the same time, calculate the contribution amount of the corrected feature region to the overall feature offset, and obtain the local abnormal feature contribution value.
[0040] As a further solution of the present invention, the method further includes:
[0041] S5: Invoke the local abnormal feature contribution value, calculate the distribution deviation degree of the abnormal feature vector, and make a discrimination in combination with the local abnormal sensitivity weight. Mark abnormal points in the region according to the deviation degree and contribution degree to obtain the abnormal feature screening and discrimination result;
[0042] The abnormal feature screening and discrimination result includes the distribution deviation degree of the abnormal feature vector, the local abnormal sensitivity weight, and the abnormal point marking information.
[0043] As a further solution of the present invention, the steps for obtaining the abnormal feature screening and discrimination result are specifically as follows:
[0044] S501: Invoke the local abnormal feature contribution value, calculate the distribution of multiple abnormal feature vectors, obtain the local mean and variance of each abnormal feature vector, and calculate the vector distribution deviation degree to obtain the vector distribution deviation degree value;
[0045] S502: Based on the vector distribution deviation degree value, in combination with the local abnormal sensitivity weight, weight each abnormal feature vector, and use the formula:
[0046]
[0047] Calculate the offset correction degree of multiple feature vectors to obtain the offset weight degree value;
[0048] where, P represents the offset correction degree, V p1i represents the i-th abnormal feature vector, represents the mean value of all abnormal feature vectors, σ P1 represents the standard deviation of all abnormal feature vectors, W x represents the local abnormal sensitivity weight, n p 1 represents the total number of abnormal feature vectors;
[0049] S503: Invoke the offset weight degree value, set the joint threshold of the deviation degree and contribution degree, screen the abnormal features in the region, and mark abnormal points at the positions that meet the conditions to obtain the abnormal feature screening and discrimination result.
[0050] An industrial equipment abnormal detection system based on machine vision, the industrial equipment abnormal detection system based on machine vision is used to execute the above-mentioned industrial equipment abnormal detection method based on machine vision, and the system includes:
[0051] The image feature extraction module obtains the multi-channel pixel matrix on the surface of the industrial device, calculates the pixel gradient value and extracts the texture direction change rate, constructs a high-dimensional feature space, calculates the distribution density of the multi-pixel gradient change rate and the texture direction change rate, calculates the Euclidean distance, cosine similarity and distribution offset degree of the feature points according to the density change, and determines the spatial distribution boundary of the feature vector in combination with the distribution density of the feature points to obtain the spatial boundary value of the feature vector;
[0052] Based on the spatial boundary value of the feature vector, the abnormal boundary calculation module calculates the projection offset of the abnormal feature vector, obtains the mean value and variance normalization value of the projection offset, and calculates the distribution limit of the abnormal vector in combination with the offset degree of the feature vector distribution to obtain the offset limit of the abnormal feature vector;
[0053] The dynamic offset correction module calls the offset limit of the abnormal feature vector, sets the initial value of the dynamic contraction factor, adjusts the update step of the contraction factor according to the projection offset distribution, and makes corrections in combination with the local gradient change rate and the texture direction change amplitude in the weld area to obtain the dynamic contraction coefficient of the offset;
[0054] The local sensitive area determination module calls the dynamic contraction coefficient of the offset, divides the image area according to the structural characteristics of the device components, calculates and sorts the pixel gradient change rates of multiple areas, sets a sensitive threshold to screen the areas where the change rate exceeds the set value, and obtains the local sensitive feature area;
[0055] Based on the local sensitive feature area, the abnormal feature screening module calculates the correlation between the multi-area feature vector and the overall feature vector, applies weight correction to the target area according to the contribution degree, calculates the contribution value of the local abnormal feature, calls the contribution value of the local abnormal feature to calculate the distribution offset degree of the abnormal feature vector, and makes a discrimination in combination with the local abnormal sensitive weight, marks the abnormal points according to the offset degree and the contribution degree, and obtains the discrimination result of the abnormal feature screening;
[0056] Compared with the prior art, the advantages and positive effects of the present invention are as follows:
[0057] In the present invention, by calculating the pixel gradient and the texture direction change rate and constructing a high-dimensional feature space, the distribution of abnormal feature points is made clearer, and the misjudgment probability is reduced. Based on the projection offset, the dynamic adjustment of the contraction factor is calculated, so that the detection standard is optimized with the change of data, and the adaptability is improved. The offset correction is made in combination with the local gradient change rate and the texture direction change amplitude on the surface of the device, so that the detection takes into account the surface structure characteristics and enhances the accuracy. The image block is divided and refined according to the structural characteristics, and the recognition ability of complex structures is improved. The calculation of the correlation between the local abnormal feature and the overall feature is combined with the weight correction to enhance the global accuracy. The sensitive weight is introduced in the abnormal point screening to improve the discrimination accuracy, enhance the credibility of the abnormal detection, effectively reduce the misjudgment caused by environmental interference, improve the real-time performance, and make the equipment maintenance more efficient. Brief Description of the Drawings
[0058] Figure 1 This is a schematic diagram of the working process of the present invention;
[0059] Figure 2 This is a flowchart of the steps for obtaining the boundary of the spatial distribution of abnormal feature vectors of the present invention;
[0060] Figure 3 This is a flowchart of the steps for obtaining the offset dynamic contraction coefficient of the present invention;
[0061] Figure 4 This is a flowchart of the steps for obtaining the locally sensitive feature region of the present invention;
[0062] Figure 5 This is a flowchart of the steps for obtaining the contribution value of local abnormal features of the present invention;
[0063] Figure 6 This is a flowchart of the steps for obtaining the screening and discrimination results of abnormal features of the present invention. Detailed Description of the Preferred Embodiments
[0064] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to 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 used to limit the present invention.
[0065] In the description of the present invention, it should be understood that the orientation or positional relationship indicated by the terms "length", "width", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. are based on the orientation or positional relationship shown in the accompanying 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 should not be construed as limiting the present invention. In addition, in the description of the present invention, the meaning of "a plurality of" is two or more unless otherwise specifically defined.
[0066] Embodiment 1
[0067] Please refer to Figure 1 , the present invention provides a technical solution: an industrial equipment abnormal detection method based on machine vision, including the following steps:
[0068] S1: Obtain the multi-channel pixel matrix of the surface image of the industrial equipment, calculate the pixel gradient and the texture direction change rate, establish a high-dimensional feature space, calculate the Euclidean distance, cosine similarity, and distribution offset degree of abnormal feature points according to the feature vector density, and establish the boundary of the spatial distribution of abnormal feature vectors;
[0069] S2: Based on the spatial distribution boundary of the abnormal feature vectors, calculate the projection offset of the abnormal feature vectors, obtain the mean value and variance normalization value of the offset, set the initial value of the dynamic shrinkage factor, adjust the update step of the shrinkage factor according to the offset distribution, and correct the shrinkage factor by combining the local gradient change rate and the texture direction change amplitude of the surface weld of the industrial equipment to obtain the offset dynamic shrinkage coefficient;
[0070] S3: Call the offset dynamic shrinkage coefficient, divide the image block according to the structural characteristics of the equipment components, calculate and sort the pixel gradient change rate, set a sensitivity threshold to filter the area where the gradient change rate exceeds the set value, and obtain the local sensitive feature area;
[0071] S4: According to the local sensitive feature area, calculate the correlation between the multi-region feature vector and the overall feature vector, apply weight correction to the target area based on the contribution degree, and obtain the local abnormal feature contribution value;
[0072] S5: Call the local abnormal feature contribution value, calculate the distribution offset degree of the abnormal feature vectors, and make a discrimination in combination with the local abnormal sensitivity weight. Mark the abnormal points in the area according to the offset degree and contribution degree to obtain the abnormal feature screening and discrimination result.
[0073] The spatial distribution boundary of the abnormal feature vectors includes the feature vector density threshold, the Euclidean distance of the abnormal feature points, the cosine similarity of the abnormal feature points, and the distribution offset degree of the abnormal feature points. The offset dynamic shrinkage coefficient specifically includes the mean normalization value, the variance normalization value, the initial value of the dynamic shrinkage factor, the update step of the shrinkage factor, the correction factor of the local gradient change rate, and the correction factor of the texture direction change amplitude. The local sensitive feature area includes the image block division feature, the sorting value of the pixel gradient change rate, and the sensitivity threshold screening result. The local abnormal feature contribution value specifically includes the multi-region feature vector correlation, the overall feature vector correlation, and the contribution degree weight of the target area. The abnormal feature screening and discrimination result includes the distribution offset degree of the abnormal feature vectors, the local abnormal sensitivity weight, and the abnormal point marking information.
[0074] Please refer to Figure 2 , and the specific steps for obtaining the spatial distribution boundary of the abnormal feature vectors are as follows:
[0075] S101: Obtain the multi-channel pixel matrix of the surface image of the industrial equipment, calculate the gradient information of each pixel point, including the horizontal gradient component, the vertical gradient component, and the gradient amplitude, and calculate its local texture change rate in combination with the gradient direction to construct a pixel gradient distribution matrix and obtain a pixel gradient change rate matrix;
[0076] First, the gradient information of pixel points needs to be calculated, specifically including obtaining the horizontal gradient component, vertical gradient component, and gradient magnitude, to ensure that the local features of the image are reflected. The gradient of each pixel point (x, y) is calculated using the Sobel operator for differential calculation, and the horizontal gradient G x (x, y) is calculated as follows:
[0077] G x (x, y) = I(x + 1, y) - I(x - 1, y);
[0078] where I(x, y) is the gray value of this pixel point. Similarly, the vertical gradient G y (x, y) is calculated as follows:
[0079] G y (x, y) = I(x, y + 1) - I(x, y - 1);
[0080] Next, the gradient magnitude G(x, y) is calculated as follows:
[0081]
[0082] Suppose the gray value of a certain pixel point (10, 15) is 120, and the gray values of its adjacent points (11, 15) and (9, 15) are 130 and 110 respectively, and the gray values of adjacent points (10, 16) and (10, 14) are 125 and 115 respectively. Then it can be calculated:
[0083] G x (10, 15) = 130 - 110 = 20;
[0084] G y (10, 15) = 125 - 115 = 10;
[0085]
[0086] The calculation method of the gradient direction is:
[0087]
[0088] For the above pixel point:
[0089]
[0090] Calculate the local texture change rate in combination with the gradient direction. Quantify the change rate by calculating the standard deviation std(θ(x,y)) of the gradient direction within the adjacent area of each pixel point. If the range of gradient direction changes in a certain area is large, it indicates that there may be surface texture abnormalities in this area. For example, if the gradient direction values within a local area of a window size of 5×5 are [20°, 25°, 30°, 22°, 28°], then the standard deviation is:
[0091]
[0092] Based on this, construct a pixel gradient distribution matrix and further generate a pixel gradient change rate matrix.
[0093] S102: Based on the pixel gradient change rate matrix, establish a high-dimensional feature space, calculate the feature vector density, and perform statistical analysis on the vector density distribution to obtain the density distribution offset value. By calculating the distribution offset of feature points in the high-dimensional feature space, form the feature vector distribution offset degree;
[0094] Based on the pixel gradient change rate matrix, it is necessary to construct a high-dimensional feature space, where each feature vector contains information on each dimension, such as local gradient amplitude, gradient direction, texture change rate, etc. Set the dimension d to 5, then each feature vector can be expressed as:
[0095] X f =(G x ,G y ,G,θ,std(θ));
[0096] As shown in Table 1, statistically analyze the feature data of multiple pixel points:
[0097] Table 1 Pixel Gradient Feature Vector Table
[0098] Pixel point number <![CDATA[G x > <![CDATA[G y > G θ stdθ 1 15 10 18.03 33.69° 3.5 2 12 8 14.42 33.69° 2.8 3 22 9 23.09 22.25° 4.1
[0099] As shown in Table 1, the feature information of each pixel point constitutes a high-dimensional feature space. Calculate the feature vector density and use the K-nearest neighbor method to calculate the local density of each point in the feature space:
[0100]
[0101] Among them, σ is the normalization coefficient. Let σ = 5 and calculate the density of pixel point 1:
[0102]
[0103] Calculate the density of all pixel points in sequence to obtain the density distribution offset value.
[0104] S103: Calculate the Euclidean distance, cosine fitting degree, and deviation degree of abnormal feature points based on the deviation degree of feature vector distribution. Use the formula:
[0105]
[0106] Through operations, obtain the multi-dimensional abnormality measurement value of abnormal feature points. Compare with the threshold set for the distribution boundary, screen abnormal feature points, and generate the spatial distribution boundary of abnormal feature vectors;
[0107] where, D an represents the comprehensive abnormality measurement value of abnormal feature points, X f1i represents the distribution position of the i-th feature vector in the high-dimensional feature space, represents the mean vector of all feature vectors, Y v1j represents the j-th feature vector, Z v1j represents the reference vector of the j-th feature point, ||Y v1j ||, ||Z v1j || are the norms of Y v1j and Z v1j respectively, W d1k represents the deviation value of the k-th feature point, represents the mean of the deviation values of all feature points, n f 1 represents the total number of feature vectors, n f 2 represents the number of comparisons for calculating the cosine fitting degree of feature vectors, p d 1 represents the number of samples for calculating the deviation degree of feature points.
[0108] Based on the deviation degree of feature vector distribution, calculate the Euclidean distance, cosine fitting degree, and deviation degree of abnormal feature points. Use the formula:
[0109]
[0110] Let Calculate D an for abnormal feature point 1:
[0111]
[0112] Set the threshold to 5, screen abnormal feature points, and generate the spatial distribution boundary of abnormal feature vectors. This result indicates that the comprehensive abnormality measurement value D an= 5.83 exceeds the set threshold of 5, which means that the position and distribution of this point in the feature space exhibit significant anomalies. This metric reflects the degree of anomaly of the point. By comparing it with the set threshold, we can effectively identify and isolate those abnormal feature points that may cause a decline in system performance, thus ensuring the accuracy and reliability of the surface analysis of industrial equipment. In this way, we can further organize and derive the step results, namely the screening of abnormal feature points and the determination of abnormal boundaries, which are crucial for early identification of potential faults and maintaining the stability of equipment operation.
[0113] Please refer to Figure 3 , and the specific steps for obtaining the offset dynamic contraction coefficient are as follows:
[0114] S201: Based on the spatial distribution boundary of the abnormal feature vector, calculate the projection offset of the abnormal feature vector, determine the projection coordinates of the projection point on the boundary according to the spatial position of the vector, calculate the vector offset value, and at the same time call the offset values of all vectors to calculate the mean and variance normalization values to obtain the normalized offset;
[0115] First, determine the spatial coordinate information of the abnormal feature vector. For example, assume that an abnormal feature vector V k =(x k , y k , z k ) is in a three-dimensional feature space. The boundary of this space can be obtained through the minimum outer bounding convex hull of the abnormal point cloud data. Use the support vector machine (SVM) or the minimum outer bounding sphere to calculate the farthest boundary value of the abnormal points, so as to obtain the outer boundary point set B ={(x b , y b , z b )}. Then calculate the projection point P k of the vector V k on the boundary, that is, find the nearest point B m in B. The calculation method is:
[0116]
[0117] Subsequently, calculate the vector offset value, that is, the Euclidean distance between the vector V k and the projection point P k :
[0118] D k =||V k - P k ||;
[0119] Calculate the mean k and standard deviation σ of all vector offset values {D D}, and perform normalization processing:
[0120]
[0121] At this time, the normalized offset {Q k} has been obtained, and data examples are shown in Table 2.
[0122] Table 2 Calculation Data of Normalized Offset
[0123] Vector number <![CDATA[x k > <![CDATA[y k > <![CDATA[z k > <![CDATA[Projection point P k > <![CDATA[Offset value D k > <![CDATA[Normalized offset Q k > 1 1.2 3.5 2.4 (1.1,3.6,2.5) 0.15 -0.32 2 4.2 2.8 5.3 (4.0,2.9,5.2) 0.26 0.17 3 2.1 4.7 1.3 (2.2,4.5,1.4) 0.19 -0.12
[0124] Normalized offset Q k After adjustment by the mean value and the standard deviation σ D all data points have a uniform dimension, and finally the normalized offset data is obtained, as shown in Table 2. This result shows that by calculating the normalized offset through the spatial projection of the abnormal feature vector, the offset degree of each point relative to the boundary can be obtained, and the subsequent steps can use this normalized offset to adjust the shrinkage factor to optimize the overall vector distribution trend.
[0125] S202: Call the normalized offset, set the initial value of the dynamic shrinkage factor, adjust the update step of the shrinkage factor according to the distribution range of the normalized offset, and calculate the mean value of the change rate in combination with the local gradient change rate of the surface weld of the industrial equipment. Use the formula:
[0126]
[0127] Calculate the adjustment amplitude of the shrinkage factor, and correct the shrinkage factor in combination with the change amplitude of the texture direction to obtain the dynamic shrinkage adjustment factor;
[0128] where S d represents the adjustment amplitude of the shrinkage factor, Q s1k represents the k-th data point of the normalized offset, represents the mean value of the normalized offset, ΔR s1k represents the local gradient change rate of the k-th point, C represents the stability coefficient to avoid the denominator approaching zero, and N s 1 represents the total number of data points;
[0129] When setting the initial value, select the mean value of the normalized offset as the reference benchmark, and adjust the update step of the shrinkage factor according to the distribution range of the normalized offset, and calculate the adjustment amplitude of the shrinkage factor. The specific calculation method is as follows:
[0130]
[0131] where ΔR s1k is the local gradient change rate of the k-th point, and the calculation method of this change rate is:
[0132]
[0133] Let the local gradient data of the weld area of a certain device be ΔR s = [0.02, 0.04, 0.01, 0.05], then:
[0134]
[0135] Finally, calculate the adjustment range S of the shrinkage factor d as:
[0136]
[0137] This result shows that the adjustment range of the shrinkage factor is calculated from the deviation of the normalized offset and the local gradient change rate. This parameter is used to control the dynamic shrinkage adjustment factor to ensure that the adjustment range of the shrinkage will not be affected by abnormal offset values.
[0138] S203: Call the dynamic shrinkage adjustment factor, adjust the shrinkage factor according to the normalized offset, combine the dynamic trend of the multi-vector offset, correct the calculation range, adjust the shrinkage parameter, and obtain the offset dynamic shrinkage coefficient.
[0139] Calculate the final shrinkage factor according to the normalized offset {Q k}, and make correction adjustments according to the trend of the offset. The adjustment process is as follows:
[0140] If the current data point Q k exceeds a certain range, for example, |Q k | > 2σ Q , then it is necessary to further reduce the shrinkage parameter to suppress the influence of abnormal points with large offset values on the overall trend.
[0141] Calculate the corrected shrinkage parameter λ s :
[0142]
[0143] Among them, λ0 = 0.5, α = 0.1, substitute into S d = 0.92:
[0144] λ s = 0.5e -0.1×0.92 = 0.455;
[0145] This result shows that through the calculation of the dynamic shrinkage adjustment factor, the final shrinkage factor λ sIt is jointly determined by the trend of the normalized offset and the adjustment of the local gradient change rate. The smaller the value, the greater the overall offset, and the shrinkage factor should be further adjusted to ensure the accuracy of the boundary dynamic adjustment. Finally, this result can be used to adjust the dynamic shrinkage coefficient of the offset. Combining the dynamic trend of the multi-vector offset, the calculation range is corrected to make the shrinkage parameter conform to the overall distribution trend of the data, thereby optimizing the processing method of the abnormal feature vector.
[0146] Please refer to Figure 4 , the steps for obtaining the locally sensitive feature region are specifically as follows:
[0147] S301: Call the dynamic shrinkage coefficient of the offset, divide the image block according to the structural characteristics of the device component, obtain the pixel distribution matrix of multiple blocks, calculate the gradient change value of the pixels in multiple blocks, and obtain the pixel gradient change matrix;
[0148] First, the structural characteristics of the device component need to be obtained to correctly divide the image block. This process can be achieved by detecting the edge contour of the device component. The specific operations include, after selecting the component image, calculating the gradient change value between each pixel point using the pixel intensity difference, determining the edge region with significant pixel changes, obtaining the edge line coordinates, and then dividing the image into multiple blocks according to the geometric characteristics and edge distribution of the component. Assuming the size of the component image is 1024×1024 pixels, it is divided into 64 blocks of 8×8, and each block contains 128×128 pixel points. When obtaining the pixel distribution matrix of multiple blocks, traverse each block and count the gray values of all pixel points in the block, and store them as a two-dimensional array M(x, y). Next, calculate the gradient change value of the pixels in each block. By calculating the gradient changes in the horizontal and vertical directions, they are respectively denoted as G x (i, j) and G y (i, j), using the formula:
[0149] G x (i, j) = M(i + 1, j) - M(i, j);
[0150] G y (i, j) = M(i, j + 1) - M(i, j);
[0151] After calculating the gradient change amount of the pixel points, the overall gradient change value is combined:
[0152]
[0153] For each block, traverse all the pixel points inside, accumulate and calculate the gradient change value of all the pixel points in the block, and store it as the pixel gradient change matrix G block(m, n), where m and n are block indices. For example, assume the pixel gradient change values within a certain block are {3, 5, 2, 8, 6, 7, 4, 3} in sequence, then the gradient change matrix of the block is stored as 3, 5, 2, 8, 6, 7, 4, 3. Finally, the gradient change matrix of the entire image is obtained. After the calculation of this matrix is completed, the next step of processing is entered. This result indicates that the pixel gradient changes within the image region have been gradually quantified and can be used for subsequent calculation of the gradient change rate to screen out the regions with significant local gradient changes in the image.
[0154] S302: Based on the pixel gradient change matrix, calculate the pixel gradient change rates of multiple blocks, sort them in descending order according to the change rate magnitudes, obtain the sorted gradient change rate sequence. At the same time, calculate the mean and standard deviation of the change rates, set a sensitivity threshold based on the mean and standard deviation of the change rates, and screen out the image regions where the gradient change rate exceeds the threshold to obtain the high-gradient change regions;
[0155] The calculation method of the gradient change rate is as follows: Traverse each block, calculate the gradient mean of all pixel points within the block, and divide it by the maximum value of the gradient change of the entire image. Assume the pixel gradient change matrix of a certain block is 3, 5, 2, 8, 6, 7, 4, 3, and calculate the gradient change mean
[0156]
[0157] Assume the maximum gradient value of the entire image is G max = 10, then the gradient change rate R of this block block is calculated as follows:
[0158]
[0159] Calculate the corresponding gradient change rates for all blocks, sort them in descending order according to the change rate magnitudes, obtain the sorted gradient change rate sequence. For example, the gradient change rate sequence obtained after sorting an image is
[0160] 0.91, 0.85, 0.79, 0.63, 0.58, 0.54, 0.48, 0.43. Calculate the mean μ and standard deviation σ of this sequence:
[0161]
[0162] Set the sensitivity threshold as μ + 0.5σ = 0.637 + 0.5 × 0.163 = 0.718, and screen out the image regions where the gradient change rate exceeds 0.718, that is, the image blocks corresponding to {0.91, 0.85, 0.79}, which are the high-gradient change regions. This result indicates that the regions with relatively high local gradient change rates have been successfully screened out, and these regions can be used for subsequent calculation of local sensitive features to further obtain more accurate sensitive regions.
[0163] S303: Extract the corresponding pixel coordinate distribution based on the high-gradient change region, calculate the local sensitivity coefficient of the pixel gradient change within the region, and use the formula:
[0164]
[0165] Perform operations to obtain the sensitivity feature values of each local region, construct the local sensitivity feature distribution, and obtain the local sensitivity feature region;
[0166] Among them, S l represents the local sensitivity feature value, G l1i represents the gradient change rate of the i-th pixel point, represents the mean value of the gradient change rates of all pixel points within the region, σ L1 represents the standard deviation of the gradient change rates of all pixel points within the region, α represents the gradient change stability adjustment coefficient, W i represents the weight factor of the i-th pixel point, N l 1 represents the total number of pixel points within the region.
[0167] For the selected high-gradient change regions, it is necessary to extract the corresponding pixel coordinate distribution and calculate the local sensitivity feature values, using the formula:
[0168]
[0169] Among them, represents the mean value of the gradient change rates of all pixel points within the region, σ L1 represents the standard deviation of the gradient change rates of all pixel points within the region, α is the gradient change stability adjustment coefficient. Suppose the gradient change rate values of the pixel points within a certain high-gradient change region are 0.9, 0.88, 0.87, 0.84, 0.81, calculate its mean value:
[0170]
[0171] Calculate the standard deviation σ L1 :
[0172]
[0173] Set α = 0.01, and the weight W of each pixel point i Suppose it is the mean weight 1, then calculate the sensitivity feature value:
[0174]
[0175] The result shows that the eigenvalue of the locally sensitive feature region has been quantified to 1.052, which reflects the sensitivity of pixel gradient changes within the local region and can be used for subsequent feature extraction and classification to further refine the boundary of the locally sensitive feature region.
[0176] Please refer to Figure 5 , and the specific steps for obtaining the contribution value of local abnormal features are as follows:
[0177] S401: Based on the locally sensitive feature region, calculate the correlation between the multi-region feature vector and the overall feature vector, obtain the contribution degree of each feature region to the overall feature, normalize the feature vector, calculate the deviation value between the normalized feature vector and the overall feature vector, and at the same time call the multi-region deviation value to compare with the overall deviation trend, screen out the feature regions that have a greater impact on the overall feature change, and generate the local feature deviation impact amount;
[0178] In the specific implementation process, first select multiple regions from the target object. The eigenvalue of each region can be represented as a vector. Set the total number of feature regions as n, where the feature vector of each region is where n w is the dimension of the feature. Each feature point represents a certain characteristic of the region, such as temperature, pressure, vibration frequency in industrial inspection or color gradient, edge information in image analysis, etc. These features need to be normalized to ensure that data with different dimensions have the same scale during calculation. The maximum-minimum normalization method is used for normalization, and the calculation formula is as follows:
[0179]
[0180] where, F′ ij represents the normalized eigenvalue, min(F j ) and max(F j ) are the minimum and maximum values of this feature respectively. Taking the temperature detection data of a certain device as an example, assuming the temperature range is [20°C, 80°C], when the original temperature data F ij of a certain region is 50°C, the normalized temperature value is calculated as follows:
[0181]
[0182] After normalization, calculate the deviation between the vectors of each feature region and the overall feature vector , and the deviation calculation is carried out in the way of Euclidean distance, that is:
[0183]
[0184] If the mean value G of the overall feature vector jThe average temperature data is 0.4, and the normalized temperature value of the area is 0.5. Then the deviation is calculated as follows:
[0185] D i = |(0.5 - 0.4)| = 0.1;
[0186] The calculated D i represents the deviation value between this area and the overall feature vector. Next, it is necessary to conduct an overall trend analysis of the deviation values of all feature areas to determine which feature area changes have a greater impact on the overall feature vector. The specific method is to calculate the average deviation value D avg and the standard deviation σ D :
[0187]
[0188] Set the influence determination threshold T, with a value of the mean plus twice the standard deviation, that is:
[0189] T = D avg + 2σ D ;
[0190] Screen out the feature areas that satisfy D i > T, and calculate their deviation influence on the overall feature to obtain the local feature deviation influence amount I i :
[0191]
[0192] If I1 = 0.18, I2 = 0.16, I3 = 0.28, I4 = 0.12, then the deviation influence amount of area 3 is the largest. This result indicates that this area has the most significant influence on the overall feature deviation and needs further optimization calculation.
[0193] S402: Based on the local feature deviation influence amount, calculate the feature weight contribution degree of the target area, and determine the weight correction coefficient of the feature area according to the contribution degree distribution, using the formula:
[0194]
[0195] Calculate the corrected weight value, map the corrected weight to multiple feature areas, and obtain the feature weight correction value;
[0196] Among them, ΔW i represents the weight correction amount of the i-th area, F w1i,j represents the value of the j-th feature in the i-th area, G w1j represents the value of the j-th feature in the overall feature vector, n w 1 represents the total number of features, W w1 represents the original weight vector, G avg1Represents the average value of the overall feature vector;
[0197] First, calculate the weight contribution value of the feature region:
[0198]
[0199] Taking region 3 as an example, calculate its weight contribution value:
[0200]
[0201] Next, use the weight contribution value to calculate the weight correction amount ΔW i , and adopt the formula:
[0202]
[0203] Assume max(W) = 0.38, G avg = 0.4, then the weight correction amount of region 3 is calculated as follows:
[0204]
[0205] This result indicates that the weight of region 3 should be increased by 0.66 to better reflect its impact on the overall feature.
[0206] S403: Call the feature weight correction value, adjust the feature value of the target region, calculate the overall deviation value of the corrected feature region, extract the deviation change rate, and at the same time calculate the contribution amount of the corrected feature region to the overall feature offset to obtain the local abnormal feature contribution value.
[0207] First, adjust the feature values of each feature region according to the corrected weight, and the adjustment method uses weighted mean calculation:
[0208] F″ ij = W″ i ·F′ ij ;
[0209] And calculate the new overall feature vector G′:
[0210]
[0211] Assume that the adjusted weight W″3 = 1.04, then the corrected feature value is calculated as follows:
[0212] F″ 3j = 1.04 × 0.5 = 0.52;
[0213] Subsequently, recalculate the adjusted overall deviation value D′ i And obtain the deviation change rate:
[0214]
[0215] If D′3 = 0.08 after adjustment, the deviation change rate is calculated as follows:
[0216]
[0217] Calculate the contribution value C of local abnormal features i :
[0218] C3 = W″3·R3 = 1.04×0.2 = 0.208;
[0219] Finally, C3 = 0.208 is obtained. This result indicates that Region 3 still has a significant impact on the overall feature deviation after correction, showing that it makes the greatest contribution among local abnormal features. Further attention should be paid to the optimization and adjustment of the data in this region.
[0220] Please refer to Figure 6 , and the steps to obtain the screening and discrimination results of abnormal features are specifically as follows:
[0221] S501: Invoke the contribution value of local abnormal features, calculate the distribution of multi-abnormal feature vectors, obtain the local mean and variance of each abnormal feature vector, and calculate the vector distribution offset degree to obtain the vector distribution offset degree value;
[0222] It is necessary to analyze each abnormal feature vector in turn. The value of each abnormal feature vector V p1i comes from a specific dimension data in the measurement dataset, such as the vibration frequency of industrial equipment, the readings of temperature sensors, the fluctuation of current and voltage, etc. For each abnormal feature vector, first calculate its local mean That is:
[0223]
[0224] Among them, n p1 represents the total number of abnormal feature vectors. For example, if 10 sensors are detected in the industrial equipment status monitoring, then n p1 = 10. Suppose the numerical values of the abnormal feature vectors of a certain sensor are as follows:
[0225] V p1 = [0.8, 1.2, 0.7, 0.9, 1.1, 1.3, 0.6, 1.0, 0.95, 1.15];
[0226] Then calculate its mean value:
[0227]
[0228] Then calculate its standard deviation σ P1 , that is:
[0229]
[0230] Substitute specific numerical values:
[0231]
[0232] σ P1 ≈0.22;
[0233] Subsequently, calculate the vector distribution deviation degree. Using the normalization of the absolute difference from the mean value, the calculation method is:
[0234]
[0235] Calculation partial examples:
[0236]
[0237] Finally, the vector distribution deviation degree values of each abnormal feature vector are calculated, as shown in Table 3.
[0238] Table 3 Calculation results of vector distribution deviation degree
[0239]
[0240] The results show that the data of each sensor deviates from the mean value to different degrees. Sensors with larger deviation degree values may be abnormal. In the next step, it is necessary to perform weighted processing in combination with the local anomaly sensitivity weight to further determine the deviation correction degree of the abnormal feature vector.
[0241] S502: Based on the vector distribution deviation degree value, in combination with the local anomaly sensitivity weight, weight each abnormal feature vector, using the formula:
[0242]
[0243] Calculate the deviation correction degree of multiple feature vectors to obtain the deviation weight degree value;
[0244] Among them, P represents the deviation correction degree, V p1i represents the i-th abnormal feature vector, represents the mean value of all abnormal feature vectors, σ P1 represents the standard deviation of all abnormal feature vectors, W x represents the local anomaly sensitivity weight, n p 1 represents the total number of abnormal feature vectors;
[0245] It is necessary to combine the local anomaly sensitivity weight W x , and perform weighted calculation on each abnormal feature vector. The calculation formula:
[0246]
[0247] Set the local anomaly-sensitive weight W x The value of is:
[0248] W x = [1.1, 0.9, 1.2, 1.0, 1.3, 0.8, 1.1, 1.0, 0.95, 1.05];
[0249] Substitute into the calculation:
[0250]
[0251] Calculation part examples:
[0252]
[0253]
[0254] Finally, calculate the offset correction degree of the multi-feature vector and obtain the offset weight degree value. This result shows that the feature vectors with higher offset correction degrees are more likely to belong to abnormal data. In the next step, these data will be screened, and a joint threshold of the offset degree and the contribution degree will be set to further determine the abnormal points.
[0255] S503: Call the offset weight degree value, set the joint threshold of the offset degree and the contribution degree, screen the abnormal features in the area, mark the abnormal points at the positions that meet the conditions, and obtain the discrimination result of abnormal feature screening.
[0256] Specifically, set θ = 15, and mark the abnormal points where P > θ. According to the aforementioned calculation results:
[0257] P1 = 20.6 > 15, P2 = 18.6 > 15;
[0258] Therefore, the sensors numbered 1 and 2 are marked as abnormal points. If the calculated values of other sensors are lower than the threshold, the abnormal points are not marked. Finally, obtain the discrimination result of abnormal feature screening. This result shows that the feature points with offset weight degree values higher than the threshold are identified as abnormal points, and these points will be key monitoring objects in subsequent fault analysis or warning systems to determine whether there are potential faults or abnormal conditions.
[0259] An industrial equipment anomaly detection system based on machine vision. The industrial equipment anomaly detection system based on machine vision is used to execute the above-mentioned industrial equipment anomaly detection method based on machine vision. The system includes:
[0260] The image feature extraction module obtains the multi-channel pixel matrix on the surface of the industrial device, calculates the pixel gradient value and extracts the texture direction change rate, constructs a high-dimensional feature space, calculates the distribution density of the multi-pixel gradient change rate and the texture direction change rate, calculates the Euclidean distance, cosine similarity and distribution offset degree of the feature points according to the density change, and determines the spatial distribution boundary of the feature vector in combination with the distribution density of the feature points to obtain the spatial boundary value of the feature vector;
[0261] The abnormal boundary calculation module calculates the projection offset of the abnormal feature vector based on the spatial boundary value of the feature vector, obtains the mean value and variance normalization value of the projection offset, and calculates the distribution boundary of the abnormal vector in combination with the offset degree of the feature vector distribution to obtain the abnormal feature vector offset boundary;
[0262] The dynamic offset correction module calls the abnormal feature vector offset boundary, sets the initial value of the dynamic shrinkage factor, adjusts the update step of the shrinkage factor according to the projection offset distribution, and makes corrections in combination with the local gradient change rate and the texture direction change amplitude in the weld area to obtain the offset dynamic shrinkage coefficient;
[0263] The local sensitive area determination module calls the offset dynamic shrinkage coefficient, divides the image area according to the structural characteristics of the device components, calculates and sorts the pixel gradient change rates of multiple regions, sets a sensitive threshold to screen the regions where the change rate exceeds the set value, and obtains the local sensitive feature area;
[0264] The abnormal feature screening module calculates the correlation between the multi-region feature vector and the overall feature vector based on the local sensitive feature area, applies weight correction to the target area according to the contribution degree, calculates the contribution value of the local abnormal feature, calls the contribution value of the local abnormal feature to calculate the distribution offset degree of the abnormal feature vector, and makes a discrimination in combination with the local abnormal sensitivity weight, marks the abnormal points according to the offset degree and contribution degree, and obtains the abnormal feature screening discrimination result.
[0265] The above is only the preferred embodiment of the present invention, and does not limit the present invention in other forms. Any person skilled in the art may use the disclosed technical content to make changes or modifications 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 content of the present invention still belong to the protection scope of the technical solution of the present invention.
Claims
1. An abnormal detection method for industrial equipment based on machine vision, characterized in that, It includes the following steps: S1: Obtain the multi-channel pixel matrix of the industrial equipment surface image, calculate the pixel gradient and texture direction change rate, establish a high-dimensional feature space, calculate the Euclidean distance, cosine similarity, and distribution offset degree of abnormal feature points based on the feature vector density, and establish the spatial distribution boundary of abnormal feature vectors; S2: Based on the spatial distribution boundary of the abnormal feature vectors, calculate the projection offset of the abnormal feature vectors, obtain the mean value and variance normalization value of the offset, set the initial value of the dynamic shrinkage factor, adjust the update step of the shrinkage factor according to the offset distribution, and correct the shrinkage factor by combining the local gradient change rate and texture direction change amplitude of the industrial equipment surface weld to obtain the offset dynamic shrinkage coefficient; S3: Call the offset dynamic shrinkage coefficient, divide the image block according to the structural characteristics of the equipment parts, calculate and sort the pixel gradient change rate, set a sensitivity threshold to screen the area where the gradient change rate exceeds the set value, and obtain the local sensitive feature area; S4: According to the local sensitive feature area, calculate the correlation between the multi-region feature vector and the overall feature vector, apply weight correction to the target area based on the contribution degree, and obtain the local abnormal feature contribution value.
2. The industrial equipment anomaly detection method based on machine vision according to claim 1, wherein The spatial distribution boundary of the abnormal feature vectors includes the feature vector density threshold, Euclidean distance of abnormal feature points, cosine similarity of abnormal feature points, and distribution offset degree of abnormal feature points. The offset dynamic shrinkage coefficient specifically includes the mean normalization value, variance normalization value, initial value of the dynamic shrinkage factor, update step of the shrinkage factor, local gradient change rate correction factor, and texture direction change amplitude correction factor. The local sensitive feature area includes the image block division feature, pixel gradient change rate sorting value, and sensitivity threshold screening result. The local abnormal feature contribution value specifically includes the multi-region feature vector correlation, overall feature vector correlation, and target area contribution degree weight.
3. The industrial equipment anomaly detection method based on machine vision according to claim 2, wherein The specific steps for obtaining the spatial distribution boundary of the abnormal feature vectors are as follows: S101: Obtain the multi-channel pixel matrix of the industrial equipment surface image, calculate the gradient information of each pixel point, including the horizontal gradient component, vertical gradient component, and gradient amplitude, and calculate its local texture change rate in combination with the gradient direction to construct a pixel gradient distribution matrix and obtain a pixel gradient change rate matrix; S102: Based on the pixel gradient change rate matrix, establish a high-dimensional feature space, calculate the feature vector density, and perform statistical analysis on the vector density distribution to obtain the density distribution offset value. By calculating the distribution offset of the feature points in the high-dimensional feature space, form the feature vector distribution offset degree; S103: Based on the feature vector distribution offset degree, calculate the Euclidean distance, cosine fitting degree, and offset degree of the abnormal feature points, and use the formula: Perform operations to obtain the multi-dimensional abnormality measurement value of the abnormal feature points, compare the distribution boundary setting threshold, screen the abnormal feature points, and generate the spatial distribution boundary of the abnormal feature vectors; Among them, D an represents the comprehensive anomaly measurement value of abnormal feature points, X f1i represents the distribution position of the i-th feature vector in the high-dimensional feature space, represents the mean vector of all feature vectors, Y v1j represents the j-th feature vector, Z v1j represents the reference vector of the j-th feature point, ||Y v1j ||, ||Z v1j || are the norms of Y v1j and Z v1j respectively, W d1k represents the offset value of the k-th feature point, represents the mean of the offset values of all feature points, n f 1 represents the total number of feature vectors, n f 2 represents the comparison quantity for calculating the cosine fitting degree of feature vectors, p d 1 represents the sample quantity for calculating the offset degree of feature points.
4. The industrial equipment anomaly detection method based on machine vision according to claim 3, wherein The specific steps for obtaining the offset dynamic shrinkage coefficient are as follows: S201: Calculate the projection offset of the abnormal feature vector based on the spatial distribution boundary of the abnormal feature vector space, determine the projection coordinates of the projection point on the boundary according to the spatial position of the vector, calculate the vector offset value, and at the same time call the offset values of all vectors to calculate the mean and variance normalization values to obtain the normalized offset. S202: Call the normalized offset, set the initial value of the dynamic contraction factor, adjust the update step of the contraction factor according to the distribution range of the normalized offset, and calculate the mean value of the change rate in combination with the local gradient change rate of the surface weld of the industrial equipment. Use the formula: Calculate the adjustment amplitude of the contraction factor, and correct the contraction factor in combination with the change amplitude of the texture direction to obtain the dynamic contraction adjustment factor. Among them, S d represents the adjustment amplitude of the contraction factor, Q s1k represents the k-th data point of the normalized offset, represents the mean value of the normalized offset, ΔR s1k represents the local gradient change rate of the k-th point, C represents the stability coefficient to avoid the denominator approaching zero, N s 1 represents the total number of data points; S203: Call the dynamic contraction adjustment factor, adjust the contraction factor according to the normalized offset, combine the dynamic trend of the multi-vector offset, correct the calculation range, and adjust the contraction parameter to obtain the offset dynamic contraction coefficient.
5. The industrial equipment anomaly detection method based on machine vision according to claim 4, wherein The specific steps for obtaining the locally sensitive feature region are as follows: S301: Call the offset dynamic contraction coefficient, divide the image block according to the structural characteristics of the equipment component, obtain the pixel distribution matrix of multiple blocks, calculate the gradient change value of the pixels in multiple blocks to obtain the pixel gradient change matrix. S302: Based on the pixel gradient change matrix, calculate the gradient change rate of the pixels in multiple blocks, sort them in descending order according to the change rate size, obtain the sorted gradient change rate sequence, and at the same time calculate the mean and standard deviation of the change rate. Set the sensitivity threshold according to the mean and standard deviation of the change rate, and filter the image regions where the gradient change rate exceeds the threshold to obtain the high-gradient change regions. S303: Based on the high-gradient change region, extract the corresponding pixel coordinate distribution, calculate the local sensitivity coefficient of the pixel gradient change in the region. Use the formula: Perform operations to obtain the sensitive feature values of each local region, and construct the local sensitive feature distribution to obtain the locally sensitive feature region. Among them, S l represents the locally sensitive eigenvalue, G l1i represents the gradient change rate of the i-th pixel point, represents the mean value of the gradient change rates of all pixel points within the region, σ L1 represents the standard deviation of the gradient change rates of all pixel points within the region, α represents the gradient change stability adjustment coefficient, W i represents the weight factor of the i-th pixel point, N l 1 represents the total number of pixel points within the region.
6. The method for abnormal detection of industrial equipment based on machine vision according to claim 5, characterized in that The specific steps for obtaining the contribution value of the local abnormal feature are as follows: S401: Based on the locally sensitive feature region, calculate the correlation between the multi-region feature vector and the overall feature vector, obtain the contribution degree of each feature region to the overall feature, and perform normalization processing on the feature vector. Calculate the deviation value between the normalized feature vector and the overall feature vector, and at the same time call the multi-region deviation value and the overall deviation trend for comparison, filter the feature regions that have a greater impact on the overall feature change, and generate the local feature deviation influence amount. S402: Based on the local feature deviation influence amount, calculate the feature weight contribution degree of the target region, determine the weight correction coefficient of the feature region according to the contribution degree distribution. Use the formula: Calculate the corrected weight value, map the corrected weight to multiple feature regions to obtain the feature weight correction value. Among them, ΔW i represents the weight correction amount of the i-th region, F w1i,j represents the value of the j-th feature in the i-th region, G w1j represents the value of the j-th feature in the overall feature vector, n w 1 represents the total number of features, W w1 represents the original weight vector, G avg1 represents the average value of the overall feature vector; S403: Call the feature weight correction value, adjust the feature value of the target region, calculate the overall deviation value of the corrected feature region, extract the deviation change rate, and at the same time calculate the contribution amount of the corrected feature region to the overall feature offset to obtain the contribution value of the local abnormal feature.
7. The method for detecting abnormalities in industrial equipment based on machine vision according to claim 6, wherein The method further includes: S5: Invoke the local abnormal feature contribution value, calculate the distribution offset degree of the abnormal feature vector, and make a discrimination in combination with the local abnormal sensitivity weight. Mark the abnormal points in the region according to the offset degree and contribution degree to obtain the abnormal feature screening and discrimination result; The abnormal feature screening and discrimination result includes the distribution offset degree of the abnormal feature vector, the local abnormal sensitivity weight, and the abnormal point marking information.
8. The industrial equipment anomaly detection method based on machine vision according to claim 7, wherein, The specific steps for obtaining the abnormal feature screening and discrimination result are as follows: S501: Invoke the local abnormal feature contribution value, calculate the distribution of multiple abnormal feature vectors, obtain the local mean and variance of each abnormal feature vector, calculate the vector distribution offset degree, and obtain the vector distribution offset degree value; S502: Based on the vector distribution offset degree value, in combination with the local abnormal sensitivity weight, weight each abnormal feature vector, and use the formula: Calculate the offset correction degree of multiple feature vectors to obtain the offset weight degree value; Among them, P represents the offset correction degree, V p1i represents the i-th abnormal feature vector, represents the mean of all abnormal feature vectors, σ P1 represents the standard deviation of all abnormal feature vectors, W x represents the local anomaly sensitivity weight, n p 1 represents the total number of abnormal feature vectors; S503: Invoke the offset weight degree value, set the combined threshold of the offset degree and contribution degree, screen the abnormal features in the region, and mark the abnormal points at the positions that meet the conditions to obtain the abnormal feature screening and discrimination result.
9. An industrial equipment anomaly detection system based on machine vision, characterized in that, According to the industrial equipment abnormal detection method based on machine vision according to any one of claims 1-8, the system includes: The image feature extraction module obtains the multi-channel pixel matrix on the surface of the industrial equipment, calculates the pixel gradient value and extracts the texture direction change rate, constructs a high-dimensional feature space, calculates the distribution density of the multi-pixel gradient change rate and the texture direction change rate, calculates the Euclidean distance, cosine similarity and distribution offset degree of the feature points according to the density change, and determines the spatial distribution boundary of the feature vector in combination with the distribution density of the feature points to obtain the feature vector space boundary value; The abnormal boundary calculation module calculates the projection offset amount of the abnormal feature vector based on the feature vector space boundary value, obtains the mean value and variance normalization value of the projection offset amount, and calculates the distribution boundary of the abnormal vector in combination with the offset degree of the feature vector distribution to obtain the abnormal feature vector offset boundary; The dynamic offset correction module invokes the abnormal feature vector offset boundary, sets the initial value of the dynamic shrinkage factor, adjusts the update step size of the shrinkage factor according to the projection offset distribution, and makes a correction in combination with the local gradient change rate and texture direction change amplitude of the weld area to obtain the offset dynamic shrinkage coefficient; The local sensitive area determination module invokes the offset dynamic shrinkage coefficient, divides the image area according to the structural characteristics of the equipment components, calculates and sorts the pixel gradient change rates of multiple areas, sets a sensitive threshold to screen the areas where the change rate exceeds the set value to obtain the local sensitive feature area; The abnormal feature screening module calculates the correlation between the multi-region feature vector and the overall feature vector based on the local sensitive feature area, applies weight correction to the target area according to the contribution degree, calculates the contribution value of the local abnormal feature, invokes the local abnormal feature contribution value to calculate the distribution offset degree of the abnormal feature vector, and makes a discrimination in combination with the local abnormal sensitivity weight. Mark the abnormal points according to the offset degree and contribution degree to obtain the abnormal feature screening and discrimination result.
Citation Information
Cited By
Aluminum profile defect analysis method and system based on texture features
CN120747116A
Aluminum profile defect analysis method and system based on texture features
CN120747116B
Motorcycle cylinder cover production line quality detection method and system
CN120806738A
Industrial feeding abnormity identification method based on visual flow detection
CN120953900A
Defect detection system for inner package
CN121033064A