A flange plate quality detection method and system based on image recognition

By using an image recognition-based flange quality inspection method, regions are divided according to the positions of vent holes and center holes, abnormal pixel features are determined, and quality influence coefficients are calculated. This solves the problems of false defect detection and boundary misjudgment in traditional inspection, and achieves accurate and refined judgment of flange quality grading inspection.

CN122243998APending Publication Date: 2026-06-19JIANGXI MODERN POLYTECHNIC COLLEGE

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JIANGXI MODERN POLYTECHNIC COLLEGE
Filing Date
2026-04-22
Publication Date
2026-06-19

Smart Images

  • Figure CN122243998A_ABST
    Figure CN122243998A_ABST
Patent Text Reader

Abstract

This application provides a flange quality inspection method and system based on image recognition, relating to the field of quality inspection technology. The method involves acquiring a surface image of the flange to be inspected; dividing the surface image into working and non-working areas based on the relative positions of the vent holes and center holes on the flange, and determining abnormal pixel features within the defect contours of each area; performing defect matching based on pixel coordinates after image background separation according to all abnormal pixel features, generating defect attribution conditions including defect categories and defect boundaries, and determining the quality influence coefficient of the flange to be inspected based on the defect attribution conditions; determining the quality grade of the flange to be inspected based on the quality influence coefficient, and outputting the quality detection information of the flange to be inspected. This application can adaptively divide defects existing in the flange surface area to improve the accuracy of flange quality grading inspection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of quality inspection technology, and more specifically, to a flange quality inspection method and system based on image recognition. Background Technology

[0002] Quality inspection is a core process in the entire flange machining and manufacturing process, used to control the machining accuracy, surface quality, and service performance compliance of the workpiece. It is a technical link to ensure the sealing reliability, structural safety, and installation adaptability of flanges in industrial scenarios such as pipeline connections and pressure vessel matching. This process uses standardized testing methods to quantitatively test and verify the compliance of core quality indicators such as the structural dimensions, surface defects, and geometric tolerances of the flange. It provides a traceable judgment basis for the quality classification and factory control of flanges, and is the core support for the flange manufacturing industry to achieve standardized product quality control.

[0003] However, traditional image recognition-based flange quality inspection lacks an adaptive regional differentiation comparison mechanism that matches the inherent structure of the flange's center hole and vent hole. This leads to false defect detections and misjudgments of defect boundaries, making it difficult to balance inspection accuracy and efficiency. Therefore, how to adaptively classify defects on the flange surface to improve the accuracy of flange quality grading inspection is a challenge facing the industry. Summary of the Invention

[0004] This application provides a flange quality inspection method and system based on image recognition, which can adaptively divide the defects existing on the flange surface area to improve the accuracy of flange quality grading inspection.

[0005] In a first aspect, this application provides a flange quality inspection method based on image recognition, the inspection method comprising the following steps: Acquire a surface image of the flange to be inspected; The working and non-working areas in the surface image are divided according to the relative positions of the vent holes and the center hole on the flange to be inspected, and the abnormal pixel features within the bad point contours in each area are determined. Based on all abnormal pixel features, defect matching is performed on the pixel coordinates after image background separation to generate defect attribution conditions containing defect categories and defect boundaries. The quality influence coefficient of the flange to be inspected is determined by the defect attribution conditions. The quality grade of the flange to be tested is determined based on the quality influence coefficient, and the quality detection information of the flange to be tested is output.

[0006] In this embodiment, dividing the working and non-working areas in the surface image based on the relative positions of the vent holes and the center hole on the flange to be inspected specifically includes: The vent holes and center holes in the surface image are mapped to radial base extremum points by polar coordinate transformation; A dynamic mask template is constructed based on the radial base extreme point, with the central hole as the origin and the exhaust hole direction as the reference offset angle. The dynamic mask template is inversely transformed back to the original image coordinate system, and the working area and non-working area in the surface image that satisfy the relative position constraints are segmented through pixel-level logical operations.

[0007] In this embodiment, determining the abnormal pixel features within the bad pixel contours of each region specifically includes: Local morphological reconstruction is performed on the contours of bad pixels in each region, and the residual response maps of each pixel inside the bad pixel contour relative to the neighboring background are extracted. Based on the residual response map, the local self-similarity deviation factor of the pixels within the bad point contour is determined, and the saliency tensor of the abnormal pixels is constructed by combining the curvature distribution of the bad point contour edge. The saliency tensor is decomposed into structural anomaly components and scattered noise components, and a candidate set of real anomaly pixels is selected. Extract abnormal pixel features within the bad pixel contours of each region from the real abnormal pixel candidate set.

[0008] In this embodiment, decomposing the saliency tensor into structural anomaly components and scattered noise components, and then selecting a candidate set of true anomalous pixels specifically includes: The saliency tensor is decomposed into low-rank and sparse components to obtain low-rank structural components with continuous structural anomalies and sparsely distributed noise components with isolated abrupt changes. A pixel-level anomaly confidence function is constructed based on the spatial local clustering degree of the sparsely distributed noise components and the reconstruction error of the low-rank structural components. The candidate set of true anomalous pixels is determined based on the pixel-level anomaly confidence function.

[0009] In this embodiment, defect matching is performed based on the pixel coordinates after image background separation, according to all abnormal pixel features, to generate defect attribution conditions that include defect category and defect boundary. Specifically, this includes: The initial defect category probability of abnormal pixels is determined based on the spatial distribution of all abnormal pixel features and pixel coordinates after separation from the image background. Based on the initial defect category probability and the local neighborhood connectivity of abnormal pixels, conditional random field optimization is performed to iteratively update the category label of each abnormal pixel and simultaneously fit the implicit surface of the region contour. Extract the boundary point sequence and corresponding defect type identifier of each defect region from the implicit surface, and output the defect attribution conditions containing the defect category and defect boundary.

[0010] In this embodiment, determining the quality influence coefficient of the flange to be inspected based on the defect attribution conditions specifically includes: Based on the defect attribution criteria, damage weight vectors for various defects on the flange sealing surface, positioning reference, and structural continuity are constructed. Based on the severity of the anomaly of the pixels within the defect boundary and the distance from the defect center to the vent hole and the center hole, the position weighting correction factor is calculated. The damage weight vector and the position weighting correction factor are fused by producting them on a defect-by-defect basis, and attenuation correction is performed by the area ratio of the overlapping regions between defects. The quality influence coefficient of the flange to be tested is determined based on all the influence values ​​after attenuation correction.

[0011] In this embodiment, the defect-by-defect product fusion of the damage weight vector and the position-weighted correction factor, and the attenuation correction based on the area ratio of the overlapping regions between defects, specifically includes: Based on the damage weight vector and the position weighting correction factor, perform element-wise multiplication operation on each defect to generate an initial fusion influence value vector; An attenuation matrix is ​​constructed by the area ratio of the overlapping regions between defects, and the joint impact compensation coefficient caused by the overlap of each defect is determined. Based on the initial fusion influence value vector and the attenuation matrix, iterative correction is performed on a defect-by-defect basis. The joint influence compensation coefficient is superimposed on the corresponding defect, and the influence value after attenuation correction is output.

[0012] In this embodiment, determining the quality level of the flange to be inspected based on the quality influence coefficient and outputting the quality detection information of the flange to be inspected specifically includes: The initial grade membership vector of the flange to be tested is determined based on the quality influence coefficient and multiple preset quality grade threshold ranges. The confidence level of the flange to be inspected is obtained by performing fuzzy rule reasoning based on the initial level membership vector and the defect attribution conditions. Based on the confidence level, the quality level of the flange to be inspected is determined according to the defect category information of the flange to be inspected, and the quality detection information of the flange to be inspected is output.

[0013] In this embodiment, the quality detection information includes the flange quality grade, full-dimensional details of defects, and detection process parameters.

[0014] Secondly, this application provides an image recognition-based flange quality inspection system for performing an image recognition-based flange quality inspection method, the inspection system comprising: The acquisition module is used to acquire surface images of the flange to be inspected; The segmentation module is used to segment the working area and non-working area in the surface image according to the relative position of the vent hole and the center hole on the flange to be inspected, and to determine the abnormal pixel features within the bad point contour in each area. The matching module is used to perform defect matching based on the pixel coordinates after image background separation according to all abnormal pixel features, generate defect attribution conditions containing defect category and defect boundary, and determine the quality influence coefficient of the flange to be inspected by the defect attribution conditions. The judgment module is used to determine the quality level of the flange to be tested based on the quality influence coefficient, and output the quality detection information of the flange to be tested.

[0015] The technical solutions provided by the embodiments disclosed in this application have the following beneficial effects: Acquire a surface image of the flange to be inspected; divide the surface image into working and non-working areas based on the relative positions of the vent holes and center holes on the flange, and determine the abnormal pixel features within the defect contours of each area; perform defect matching based on the pixel coordinates after image background separation according to all abnormal pixel features, generate defect attribution conditions including defect category and defect boundary, and determine the quality influence coefficient of the flange to be inspected based on the defect attribution conditions; determine the quality level of the flange to be inspected based on the quality influence coefficient, and output the quality detection information of the flange to be inspected.

[0016] Therefore, in this application, the quality level of the flange to be inspected is determined based on the quality influence coefficient, and the quality detection information of the flange to be inspected is output. Specifically, determining the abnormal pixel features yields a full-dimensional quantitative feature set covering defect grayscale, geometry, and texture dimensions, along with a precise selection result of true abnormal pixels after noise interference is removed. This provides a standardized feature judgment benchmark for the differentiated management of defects in different functional areas of the flange, enabling adaptive differentiation and precise matching of defect features between working and non-working areas. It effectively eliminates the interference of inherent metal surface texture and random imaging noise on defect identification, solving the problems of missed detection of minor defects and false defects in traditional inspection methods. This addresses the issue of false positives. By determining the quality impact coefficient, a standardized quantitative index of the overall quality impact of the flange, which integrates inherent defect damage, location weight, and overlap attenuation correction, can be obtained. This enables a comprehensive quantitative assessment of the impact of defects in different areas of the flange on core service performance. It adapts to the functional importance differences between working and non-working areas to complete the adaptive weighted correction of defect impact, eliminates the problem of repeated overestimation of impact values ​​caused by multiple defect overlaps, and solves the problems of boundary misjudgment and large deviation in defect hazard assessment in traditional testing. This provides a basis for the refined determination of the compliance of flange quality grades and improves the assessment accuracy of flange quality grading testing.

[0017] In summary, the technical solution adopted in this application can adaptively classify defects existing on the surface area of ​​the flange, thereby improving the accuracy of flange quality grading and detection. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only for this embodiment of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is an exemplary flowchart of a flange quality inspection method based on image recognition provided in this application; Figure 2 This is a flowchart illustrating the process of determining abnormal pixel features according to the present application; Figure 3 This is a flowchart illustrating the determination of the quality influence coefficient provided in this application; Figure 4 This is a schematic diagram of flange surface abnormal pixel feature extraction and defect marking based on the application provided; Figure 5 This is a modular structure diagram of a flange quality inspection system based on image recognition provided in this application. Detailed Implementation

[0020] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0021] This application provides a flange quality inspection method and system based on image recognition. The core of the method is to acquire a surface image of the flange to be inspected; divide the surface image into working and non-working areas based on the relative positions of the vent holes and center holes on the flange, and determine the abnormal pixel features within the defect contours of each area; perform defect matching based on the pixel coordinates after image background separation according to all abnormal pixel features, generate defect attribution conditions including defect categories and defect boundaries, determine the quality influence coefficient of the flange to be inspected based on the defect attribution conditions; determine the quality grade of the flange to be inspected based on the quality influence coefficient, and output the quality detection information of the flange to be inspected.

[0022] Example 1: To better understand the above technical solution, the following will provide a detailed description of the technical solution in conjunction with the accompanying drawings and specific implementation methods. (Refer to...) Figure 1 As shown in the figure, this is an exemplary flowchart of an image recognition-based flange quality inspection method according to this embodiment of the present application. The inspection method includes the following steps: In step S1, a surface image of the flange to be inspected is acquired.

[0023] In practice, a closed darkroom acquisition station is first set up to isolate the area from stray light interference. Inside the darkroom, a ring-shaped shadowless diffused white light source and a global shutter industrial area array camera are configured. The light source projects onto the flange surface to be inspected at an incident angle of 30°-45° to avoid overexposure or vignetting caused by metal mirror reflection. Before formal acquisition, the camera is calibrated using the Zhang Zhengyou calibration method to obtain the internal distortion coefficients of the camera, which are used to correct imaging distortion. The flange to be inspected is coaxially fixed on a high-precision rotating stage, aligning the rotation center of the stage with the center of the flange's central hole. During acquisition, the stage drives the flange to rotate 360° at a uniform speed, and the camera simultaneously acquires multiple frames of original images at a fixed frame rate. After distortion correction is performed on each frame, an image stitching algorithm based on feature point matching and homography transformation is used to generate a panoramic surface image that completely covers the entire surface of the flange to be inspected.

[0024] It should be noted that, in this application, the surface image refers to a digital image covering the surface of the flange to be inspected.

[0025] In step S2, the working area and non-working area in the surface image are divided according to the relative positions of the vent hole and the center hole on the flange to be inspected, and the abnormal pixel features within the bad point contour in each area are determined.

[0026] In this embodiment, the division of the working and non-working areas in the surface image based on the relative positions of the vent holes and the center hole on the flange to be inspected can be achieved by the following steps: The vent holes and center holes in the surface image are mapped to radial base extremum points by polar coordinate transformation; A dynamic mask template is constructed based on the radial base extreme point, with the central hole as the origin and the exhaust hole direction as the reference offset angle. The dynamic mask template is inversely transformed back to the original image coordinate system, and the working area and non-working area in the surface image that satisfy the relative position constraints are segmented through pixel-level logical operations.

[0027] In specific implementation, firstly, the surface image is processed by weighted averaging to obtain a single-channel grayscale image. Then, the Otsu method is used to perform adaptive threshold binarization. The closed contour of the central hole is extracted and its center coordinates are determined as the origin of polar coordinates. The linear transformation formula from Cartesian coordinates to polar coordinates is used to transform all pixels of the grayscale image to a polar coordinate system with radial distance as the vertical axis and circumferential angle as the horizontal axis, thus completing the polar coordinate expansion of the image. The grayscale gradient is calculated along the radial dimension of the expanded image, and the peak points of the grayscale gradient abrupt change are marked as radial base extreme points, thus completing the mapping and positioning of the central hole and the exhaust hole. Then, the polar coordinate parameters of all radial base extreme points are extracted to determine the radial reference corresponding to the origin of the central hole and the circumferential angle corresponding to the center of each vent hole. The circumferential angle between the centers of adjacent vent holes is calculated, and the average value is taken as the reference offset angle. Based on the radial range and circumferential indexing constraints of the sealing surface preset in the flange design drawings, a binary matrix that perfectly matches the size of the polar coordinate unfolded image is generated. The regions that meet the radial range and circumferential offset angle constraints are assigned a value of 1, and the remaining regions are assigned a value of 0, forming a dynamic mask template adapted to the current flange hole position characteristics. Finally, using the inverse transformation formula corresponding to the forward polar coordinate transformation, each pixel of the dynamic mask template in the polar coordinate system is mapped back to the Cartesian coordinate system of the original surface image, generating an original coordinate system mask image that is completely consistent with the size and resolution of the original image. A pixel-level logical AND operation is performed on the original surface image and the original coordinate system mask image to extract the pixel regions assigned a value of 1 in the mask, which are the working regions that satisfy the relative position constraints. After performing a logical NOT operation on the mask image, a logical AND operation is performed with the original image to extract the non-working regions.

[0028] It should be noted that, in this application, the vent hole refers to the through-hole structure distributed circumferentially on the flange to be inspected according to design requirements; the center hole refers to the main through-hole structure at the center of the flange to be inspected; polar coordinate transformation refers to the two-dimensional image coordinate system transformation method in industrial image processing; the radial base extreme point refers to the peak point of the gray-level gradient change along the radial dimension in the polar coordinate unfolded image; the dynamic mask template refers to the binary pixel matrix adapted to the current flange hole position characteristics; the reference offset angle refers to the circumferential included angle corresponding to the line connecting the centers of adjacent vent holes with the center hole as the origin; the original image coordinate system refers to the inherent Cartesian plane rectangular coordinate system of the surface image; pixel-level logical operation refers to the binary logical operation for a single pixel of the image; relative position constraint refers to the determination rule of the radial and circumferential positional relationship between the center hole and the vent hole of the flange to be inspected; the working area refers to the surface area on the flange surface that directly participates in the sealing and bonding of the mating surface and has a direct impact on the sealing performance and service safety of the flange; the non-working area refers to the surface area on the flange surface that does not participate in the sealing and bonding of the mating surface and has no direct impact on the sealing performance and service safety of the flange.

[0029] Preferably, in this embodiment, the abnormal pixel features within the bad pixel contours of each region are determined, with reference to... Figure 2 As shown in the figure, this is a flowchart illustrating the process of determining abnormal pixel features in some embodiments of this application. In this embodiment, the determination of abnormal pixel features can be achieved using the following steps: In step S21, local morphological reconstruction is performed on the bad point contours in each region, and the residual response map of each pixel inside the bad point contour relative to the neighboring background is extracted. In step S22, the local self-similarity deviation factor of the pixels within the bad point contour is determined based on the residual response map, and the saliency tensor of the abnormal pixels is constructed by combining the curvature distribution of the bad point contour edge. In step S23, the saliency tensor is decomposed into structural anomaly components and scattered noise components, and a candidate set of real anomaly pixels is selected. In step S24, abnormal pixel features within the bad pixel contours of each region are extracted from the real abnormal pixel candidate set.

[0030] In specific implementation, firstly, a preset pixel width is extended outward from the bounding rectangle of the defective pixel contour to adapt to the surface texture period, determining a local processing region containing the defective pixel contour and the surrounding complete normal background. A grayscale morphological opening and closing reconstruction algorithm is used, with the background pixels within the local processing region as the marker image and the original grayscale image of the local processing region as the mask image. Morphological reconstruction is performed to obtain the background estimation image. A pixel-by-pixel difference operation is then performed between the original local grayscale image and the background estimation image to obtain the residual response map corresponding to each pixel within the defective pixel contour. Next, a sliding analysis window of a preset size is constructed centered on each pixel in the residual response map. A normalized cross-correlation algorithm is used to calculate the cross-correlation coefficient between pixels within the window and pixels in the surrounding background window. The difference between 1 and the cross-correlation coefficient is determined as the local self-similarity deviation factor of that pixel. The Freeman chain code method is used to extract the curvature values ​​of each point on the edge of the defective pixel contour, obtaining the contour curvature distribution. The deviation factor, curvature value, and residual response value are used as components of three dimensions to construct a third-order saliency tensor corresponding to each pixel, i.e., the saliency tensor of the abnormal pixel. Then, the singular value decomposition algorithm of tensor is used to perform singular value decomposition on the saliency tensor corresponding to each pixel in the defect contour to obtain the principal component components and residual components of the tensor. Based on the spatial continuity constraint of defect features, the principal component components with continuous spatial distribution and singular values ​​greater than a preset threshold are identified as structural anomalous components, and the residual components with no spatial continuity and singular values ​​less than a preset threshold are identified as scattered noise components. Pixels containing only noise components are removed, and pixels containing structural anomalous components are retained to form a candidate set of real anomalous pixels. Finally, for the candidate set of real abnormal pixels, three types of core abnormal pixel features are extracted. All feature parameters are combined to form complete abnormal pixel features. The first type is grayscale features, which calculate the average residual response value, grayscale standard deviation, and average grayscale difference with the neighboring background of all pixels in the candidate set. The second type is geometric features, which calculate the area, perimeter, major axis-minor axis ratio, and circularity of the connected components of the candidate set pixels. The third type is texture features, which use the grayscale co-occurrence matrix to calculate the contrast, energy, entropy, and inverse difference moment of the candidate set pixels. The calculated results are used as the abnormal pixel features within the bad point contours of each region.

[0031] It should be noted that, in this application, the defective pixel contour refers to the closed boundary contour formed by connected regions of abnormal pixels in the flange surface image that have quantifiable differences in grayscale and texture features compared to the surrounding normal surface pixels; local morphological reconstruction refers to the restoration operation method that repairs the normal background texture around the defective pixel contour and eliminates interference from illumination and surface texture; neighborhood background refers to the set of pixels that belong to the same surface region as the defective pixel contour, are located around the defective pixel contour, are not affected by abnormal features, and conform to the grayscale and texture distribution rules of the normal flange surface; residual response map refers to a two-dimensional numerical matrix of the degree of grayscale difference between each pixel in the defective pixel contour and the neighboring normal background pixels; local self-similarity deviation factor. This refers to the numerical value that quantifies the degree of deviation in texture similarity between pixels within the defective pixel outline and surrounding normal background pixels; the curvature distribution of the defective pixel outline edge is an ordered set of numerical values ​​characterizing the degree of curvature at each point on the defective pixel outline edge; the saliency tensor of abnormal pixels refers to the quantization matrix of the degree of abnormality of pixels within the defective pixel outline; structural abnormality components refer to stable abnormal features caused by real defects; scattered noise components refer to pseudo-abnormal features caused by imaging noise and surface random texture fluctuations; the real abnormal pixel candidate set refers to the set of pixels that are truly abnormal within the defective pixel outline; and the abnormal pixel features are a set of feature parameters that quantify the grayscale, geometric, and texture characteristics of real abnormal pixels within the defective pixel outline.

[0032] Furthermore, in this embodiment, the decomposition of the saliency tensor into structural anomaly components and scattered noise components, and the selection of a candidate set of true anomaly pixels, can be achieved through the following steps: The saliency tensor is decomposed into low-rank and sparse components to obtain low-rank structural components with continuous structural anomalies and sparsely distributed noise components with isolated abrupt changes. A pixel-level anomaly confidence function is constructed based on the spatial local clustering degree of the sparsely distributed noise components and the reconstruction error of the low-rank structural components. The candidate set of true anomalous pixels is determined based on the pixel-level anomaly confidence function.

[0033] In specific implementation, firstly, the saliency tensors of all pixels within the defect contour are arranged into a third-order tensor structure according to pixel spatial coordinates. Using the robust principal component analysis algorithm in digital image processing, regularization parameters determined through cross-validation based on the NEU metal surface defect public dataset and the flange industry standard defect sample library are set. Iterative convergence decomposition is performed, decomposing the original saliency tensor into the sum of two tensors. The tensor with spatially continuous low-rank characteristics is the low-rank structural component, and the tensor with isolated random sparse characteristics is the sparsely distributed noise component. Then, a sliding analysis window adapted to the flange surface texture period is constructed with each pixel within the defect contour as the center. The proportion of non-zero elements and the spatial distribution variance of the sparsely distributed noise component within the window are calculated to obtain the spatial local clustering degree of that pixel. The pixel-by-pixel difference between the reconstructed tensor of the low-rank structural component and the original saliency tensor is calculated to obtain the reconstruction error of that pixel. Using the two calculated parameters as independent variables, a pixel-level anomaly confidence function is constructed using a logistic regression model. The parameters of the logistic regression model are determined through training and validation using the flange defect sample library. Finally, for each pixel within the defect contour, the constructed pixel-level anomaly confidence function is substituted to calculate the anomaly confidence value of that pixel. The anomaly confidence value ranges from 0 to 1, with a higher value indicating a higher probability that the pixel belongs to a true anomaly. Using the receiver operating characteristic curve method and the flange industry standard defect sample library as the validation set, the optimal confidence threshold is calculated and determined. Pixels with a built-in confidence value of the defect contour greater than or equal to the optimal threshold are retained, and all retained pixels form a candidate set of true anomaly pixels.

[0034] It should be noted that, in this application, low-rank and sparse decomposition refers to the process of decomposing a saliency tensor that integrates multi-dimensional features into continuous structural components corresponding to real defects and isolated random components corresponding to interference noise; the low-rank structural component is a stable anomalous feature with continuous spatial structure caused by real defects; the sparsely distributed noise component is an irregular pseudo-anomaly feature caused by imaging noise and surface random texture fluctuations; the spatial local clustering degree is a numerical value that quantifies the degree of distribution and clustering of the sparsely distributed noise component within the local spatial range of a pixel; the reconstruction error is the pixel-by-pixel difference between the tensor reconstructed from the low-rank structural component and the original saliency tensor; the pixel-level anomaly confidence function is a standardized mathematical function that quantifies the probability that a pixel belongs to a real anomaly, using a single pixel as the calculation unit; the real anomaly pixel candidate set is a set of pixels that meet the anomaly confidence requirements and correspond to real defects.

[0035] In step S3, defect matching is performed based on the pixel coordinates after image background separation, according to all abnormal pixel features, to generate defect attribution conditions that include defect category and defect boundary, and the quality influence coefficient of the flange to be inspected is determined by the defect attribution conditions.

[0036] In this embodiment, defect matching is performed based on the pixel coordinates after image background separation, according to all abnormal pixel features. The defect attribution criteria, which include defect category and defect boundary, can be generated by the following steps: The initial defect category probability of abnormal pixels is determined based on the spatial distribution of all abnormal pixel features and pixel coordinates after separation from the image background. Based on the initial defect category probability and the local neighborhood connectivity of abnormal pixels, conditional random field optimization is performed to iteratively update the category label of each abnormal pixel and simultaneously fit the implicit surface of the region contour. Extract the boundary point sequence and corresponding defect type identifier of each defect region from the implicit surface, and output the defect attribution conditions containing the defect category and defect boundary.

[0037] In practice, firstly, the surface defect categories of the flange are preset to include five categories: scratches, pitting, cracks, dents, and rust. Based on the NEU metal surface defect public dataset and the flange industry standard defect sample library, a multi-class logistic regression model is trained, and the model weight parameters are calibrated and cross-validated. For each abnormal pixel, the spatial distribution features corresponding to the pixel coordinates after separating the abnormal pixel features from the image background are used as input and substituted into the trained multi-class logistic regression model to output the initial defect category probability of the pixel corresponding to each preset defect category. Then, a fully connected conditional random field (CRF) model is constructed. The univariate potential function of the fully connected CRF model is determined by the initial defect category probability of the abnormal pixel, and the binary potential function is determined by the local neighborhood connectivity, feature similarity, and spatial distance of the abnormal pixel. The univariate potential function is the function representing the single-pixel category matching degree in the CRF model, and the binary potential function is the function representing the category consistency of adjacent pixels in the CRF model. The model parameters are determined by cross-validation using a flange defect sample library. Iterative optimization is performed using a mean-field approximation inference algorithm. After the iteration converges, the category label of each abnormal pixel is updated. At the same time, based on the spatial distribution of pixels of the same category, the implicit surface of the corresponding defect region contour is fitted using the level set method. Finally, for the fitted implicit surface, the zero-level set extraction algorithm is used to extract the contour lines with a surface function value of 0, thus obtaining the continuous closed boundary of the defect region. Subpixel-level uniform sampling is performed on the continuous boundary, and the coordinates of the sampling points are arranged in clockwise spatial order to form a boundary point sequence. The category label corresponding to the defect region surrounded by the boundary point sequence is converted into a standardized defect type identifier. The defect type identifier of each defect is combined with the boundary point sequence to generate and output the defect attribution conditions containing the defect category and defect boundary.

[0038] It should be noted that in this application, image background separation refers to the process of precisely separating the background pixels of the normal, defect-free surface of the flange in the surface image from the abnormal pixels of the suspected defect, thereby eliminating background interference caused by the inherent texture of the normal surface and uneven lighting; pixel coordinates refer to the two-dimensional plane coordinates of each abnormal pixel in the Cartesian coordinate system of the surface image; defect matching refers to the process of comparing and adapting the extracted multi-dimensional features and spatial location information of the abnormal pixels with the preset standard defect feature system of the flange; defect category refers to the standardized defect classification that divides the degree of impact on the sealing performance and service safety of the flange; defect boundary refers to the closed continuous contour that delineates the spatial range of a single complete defect area on the flange surface; spatial distribution refers to the positional arrangement of abnormal pixels in the surface image coordinate system. The laws governing connectivity and aggregation characteristics; the initial defect category probability refers to the numerical set of possibilities that a single abnormal pixel belongs to each of the preset defect categories; local neighborhood connectivity refers to the spatial connectivity and feature similarity relationship between an abnormal pixel and its neighboring pixels within a preset range; conditional random field optimization refers to sequence labeling and category optimization algorithms in digital image processing; category label refers to the standardized identifier that marks the defect category to which a single abnormal pixel belongs; implicit surface refers to the surface model of the defect region contour represented by a continuous mathematical function; boundary point sequence refers to the ordered set of pixel coordinates that constitute the closed boundary of the defect region, arranged in spatial order; defect type identifier refers to the standardized identifier symbol corresponding to the defect category; defect attribution conditions refer to the standardized judgment rule set that includes defect category, defect boundary, and spatial location.

[0039] Preferably, in this embodiment, the quality influence coefficient of the flange to be inspected is determined by the defect attribution conditions, with reference to... Figure 3 As shown in the figure, this is a flowchart illustrating the process of determining the quality influence coefficient in some embodiments of this application. In this embodiment, the quality influence coefficient can be determined using the following steps: In step S31, damage weight vectors for various defects on the flange sealing surface, positioning reference and structural continuity are constructed according to the defect attribution conditions. In step S32, a position weighting correction factor is calculated based on the severity of the anomaly of the pixels within the defect boundary and the distance from the defect center to the exhaust hole and the center hole. In step S33, the damage weight vector and the position weighting correction factor are fused by defect-by-defect product, and attenuation correction is performed by the area ratio of the overlapping regions between defects; In step S34, the mass influence coefficient of the flange to be tested is determined based on all the influence values ​​after attenuation correction.

[0040] In specific implementation, firstly, based on the national standard GB / T9113 for integral steel pipe flanges and the defect assessment specification for pressure vessel flanges, combined with the flange industry failure analysis database and standard defect sample library, basic damage weights for the core performance of various defects on the sealing surface, positioning reference, and structural continuity are preset. According to the defect category clearly defined by the defect attribution conditions, the weight parameters corresponding to the three performance dimensions of that category are extracted to construct a three-dimensional damage weight vector. The three components of this three-dimensional damage weight vector correspond to the standardized damage weights of the three performance dimensions, with weight values ​​ranging from 0 to 1. Then, based on the defect boundary in the defect attribution conditions, the residual response values ​​of all real abnormal pixels within the defect boundary are extracted, the average value is calculated, and 0-1 normalization is performed to obtain the defect severity. The center coordinates of the defect area are calculated, and the Euclidean distances between this center and the center of the central hole and the center of the nearest vent hole are solved. Normalization is then performed using the flange design reference dimensions. The severity of the abnormality and the two normalized distance parameters are substituted into a linear weighted model cross-validated by the industry sample library to calculate the position weighting correction factor. Next, for a single defect, the L2 norm of its damage weight vector is first calculated to obtain the basic damage influence value of the defect. This basic damage influence value is then multiplied by the corresponding positional weighting correction factor to obtain the initial influence value of the single defect. For all defects, the Sutherland-Hodgman polygon clipping algorithm is used to calculate the overlapping area of ​​any two defect boundaries. The ratio of the overlapping area to the total area of ​​the two defects is calculated and used as the overlapping area ratio. Based on this ratio, an attenuation coefficient is set to reduce and correct the influence value of the overlapping portion. Finally, the attenuated and corrected single-defect influence values ​​of all defects on the flange surface are summed to obtain the total defect influence value of the flange. Based on the flange's specifications, nominal pressure, and design grade, the baseline allowable total influence value for that flange is extracted from the defect allowable limits corresponding to the GB / T9113 national standard. The ratio of the total defect influence value to the baseline allowable total influence value is determined as the quality influence coefficient of the flange under test, with the value ranging from 0 to positive infinity.

[0041] It should be noted that, in this application, the flange sealing surface refers to the working surface that directly adheres to the flange during mating to achieve medium sealing; the positioning datum refers to the installation positioning datum structure formed by the flange center hole and the vent hole; structural continuity refers to the structural integrity and mechanical continuity of the flange metal matrix; the damage weight vector refers to a standardized three-dimensional numerical vector that quantifies the degree of damage to the service performance of the flange sealing surface, positioning datum, and structural continuity caused by various defects; pixels within the defect boundary refer to the set of all pixels completely enclosed by the closed defect boundary of a single defect; the anomaly severity is a standardized numerical value that quantifies the degree of feature difference between pixels inside the defect and normal background pixels; the defect center refers to the geometric centroid of the complete defect area enclosed by the defect boundary of a single defect; and the position weighting correction factor refers to the correction factor for different The quality impact of similar defects in spatial location; correction coefficients for the difference in stress distribution and functional importance in actual service of the flange; defect-by-defect product fusion refers to the process of multiplying the basic damage weight of a single defect with the location-weighted correction factor; overlapping area ratio refers to the ratio of the overlapping area of ​​multiple defects to the total area of ​​a single defect; attenuation correction refers to the process of reducing and correcting the initial impact value of the overlapping area of ​​multiple defects; the attenuated and corrected impact value refers to the quantitative value of the single defect quality impact obtained after the basic damage impact value of a single defect is corrected by location weighting and then the repeated impact is reduced and corrected by the overlapping area ratio of defects; the quality impact coefficient refers to the standardized value that quantifies the degree of influence of all defects on the surface of the flange under inspection on its overall quality and service performance.

[0042] In addition, in this embodiment, the defect-by-defect product fusion of the damage weight vector and the position weighting correction factor, and the attenuation correction based on the area ratio of the overlapping regions between defects, can be achieved by the following steps: Based on the damage weight vector and the position weighting correction factor, perform element-wise multiplication operation on each defect to generate an initial fusion influence value vector; An attenuation matrix is ​​constructed by the area ratio of the overlapping regions between defects, and the joint impact compensation coefficient caused by the overlap of each defect is determined. Based on the initial fusion influence value vector and the attenuation matrix, iterative correction is performed on a defect-by-defect basis. The joint influence compensation coefficient is superimposed on the corresponding defect, and the influence value after attenuation correction is output.

[0043] In practice, firstly, the three-dimensional damage weight vector corresponding to each defect is multiplied element-wise by the position weighting correction factor, which is a scalar coefficient. This is then operated on sequentially with the three dimensions of the vector: sealing surface, positioning reference, and structural continuity. All operations are performed based on real-domain algebraic rules, without introducing nonlinear transformations. The result is an initial fusion influence value vector retaining the three performance dimensions. The L2 norm of the vector is then calculated to transform the multidimensional influence into a single-valued initial fusion influence value vector. Next, a polygon clipping algorithm is used to calculate the area of ​​the intersection region between any two defect boundaries. The ratio of the intersection area to the area of ​​each defect is calculated to obtain the bidirectional overlapping area ratio. A square matrix is ​​constructed with the total number of defects as the row and column dimensions, with diagonal elements set to 1 and off-diagonal elements filled with the corresponding overlapping area ratios between defects, forming an attenuation matrix. According to industry defect assessment standards, the overlapping area ratio is substituted into a linear decreasing model to calculate the joint influence compensation coefficient. This coefficient ranges from 0 to 1; the larger the overlap, the smaller the joint influence compensation coefficient. Finally, using the initial fusion impact value as the initial value for iteration, each defect is traversed, and the impact value of each defect is multiplied by the element of the corresponding row in the attenuation matrix to obtain the overlapping impact term of other defects on the current defect. The joint impact compensation coefficient is multiplied by the overlapping impact term to obtain the compensation amount to be deducted. This compensation amount is subtracted from the initial fusion impact value to complete one iteration. The traversal is repeated until the change in the impact value of all defects is less than the preset minimum threshold, thus achieving convergence. The final stable value obtained is the impact value after attenuation correction.

[0044] It should be noted that, in this application, element-wise multiplication refers to the mathematical operation of multiplying the damage weight vector and the position weighting correction factor according to their respective dimensions; the initial fusion influence value vector refers to the three-dimensional influence vector after fusing the defect type hazard and the position weight; the overlapping area ratio refers to the ratio of the intersection area between defects to the total area of ​​a single defect; the attenuation matrix refers to a two-dimensional numerical matrix with the defect number as the row and column and the overlapping area ratio as the element; the joint influence compensation coefficient refers to the reduction coefficient for deducting and compensating the influence value of the overlapping area that has been repeatedly calculated; and the defect-wise iterative correction refers to the iterative calculation process of sequentially performing overlap correction on the influence value of each defect.

[0045] In step S4, the quality level of the flange to be tested is determined based on the quality influence coefficient, and the quality detection information of the flange to be tested is output.

[0046] In this embodiment, determining the quality grade of the flange to be tested based on the quality influence coefficient and outputting the quality detection information of the flange to be tested can be achieved through the following steps: The initial grade membership vector of the flange to be tested is determined based on the quality influence coefficient and multiple preset quality grade threshold ranges. The confidence level of the flange to be inspected is obtained by performing fuzzy rule reasoning based on the initial level membership vector and the defect attribution conditions. Based on the confidence level, the quality level of the flange to be inspected is determined according to the defect category information of the flange to be inspected, and the quality detection information of the flange to be inspected is output.

[0047] In practical implementation, firstly, four quality levels are preset: superior, qualified, rework, and unqualified. Based on the national standard GB / T9113-2019 for integral steel pipe flanges and the flange industry quality grading specifications, the threshold range of the quality influence coefficient corresponding to each level is determined. Using the triangular membership function in the field of fuzzy mathematics, the quality influence coefficient of the flange to be tested is substituted into the membership function corresponding to each level to calculate the membership value of the flange to each quality level. All membership values ​​are arranged in order of level to form an initial level membership vector. Then, based on the flange industry failure analysis database and industry expert experience, a Mamdani-type fuzzy rule base is constructed. This rule base uses the initial level membership vector, defect category and defect area attribution in the defect attribution conditions as antecedents, and level correction coefficients as consequents. The initial level membership vector and defect attribution conditions of the flange to be tested are substituted into this fuzzy rule base, and the maximum-minimum synthesis method is used to complete fuzzy inference to obtain the level correction coefficients. The correction coefficients are then weighted and fused with the initial membership vector to calculate the level determination confidence level corresponding to each level. Finally, the grade with the highest confidence level in the grade determination is selected as the pre-determined quality grade. Then, combined with the defect category information in the defect attribution conditions, the one-vote veto verification stipulated by the national standard is performed. If there is an irreparable fatal defect that is explicitly prohibited by the standard, the quality grade is directly corrected to non-conforming. After the verification is completed, the final quality grade is determined. At the same time, the flange basic information, quality influence coefficient, defect attribution conditions, and detection process parameters are integrated to generate standardized quality detection information and complete multi-channel output.

[0048] It should be noted that, in this application, the quality grade threshold range refers to the range of quality influence coefficient values ​​corresponding to different quality grades, pre-defined based on national standards and industry quality grading specifications for flanges; the initial grade membership vector is a multi-dimensional numerical vector quantifying the degree to which the flange under test belongs to each preset quality grade; fuzzy rule reasoning refers to a multi-condition logical reasoning method in the field of fuzzy mathematics; the grade determination confidence is a standardized numerical value quantifying the credibility of the final quality grade determination result of the flange under test; defect category information refers to the set of full-dimensional information on the standardized classification, inherent hazard level, and compliance constraint attributes of a single defect on the flange surface; quality grade refers to the standardized quality grading result defined for the flange under test; and quality detection information refers to the set of standardized test results containing the flange quality grade, full-dimensional details of defects, and test process parameters.

[0049] In this embodiment, reference Figure 4 As shown in the figure, this diagram illustrates the extraction of abnormal pixel features and defect marking on the surface of a flange. From top to bottom, the diagram presents three technical stages: original image input, feature extraction processing, and detection result output. The left side shows the original image input stage, including a panoramic image of the flange surface to be inspected and a reference image of the actual flange. This image is acquired through a high-precision imaging system, completely covering the central hole, vent hole, and the entire surface area to be inspected. The middle section is the feature extraction processing module, which integrates methods such as pixel feature threshold setting, local morphological reconstruction, residual response spectrum analysis, and tensor decomposition denoising. By performing multi-dimensional analysis of the grayscale, geometric, and texture features of pixels in the original image, it accurately separates normal background pixels from suspected abnormal pixels, effectively eliminating inherent textures and imaging noise interference from the metal surface, achieving accurate screening of true abnormal pixels. The right side shows the detection result output stage, presenting the flange surface image after abnormal pixel marking. By visually annotating the true abnormal pixels output from the feature extraction stage, the spatial distribution and clustering characteristics of defects are clearly presented.

[0050] Therefore, in this application, the quality level of the flange to be inspected is determined based on the quality influence coefficient, and the quality detection information of the flange to be inspected is output. Specifically, determining the abnormal pixel features yields a full-dimensional quantitative feature set covering defect grayscale, geometry, and texture dimensions, along with a precise selection result of true abnormal pixels after noise interference is removed. This provides a standardized feature judgment benchmark for the differentiated management of defects in different functional areas of the flange, enabling adaptive differentiation and precise matching of defect features between working and non-working areas. It effectively eliminates the interference of inherent metal surface texture and random imaging noise on defect identification, solving the problems of missed detection of minor defects and false defects in traditional inspection methods. This addresses the issue of false positives. By determining the quality impact coefficient, a standardized quantitative index of the overall quality impact of the flange, which integrates inherent defect damage, location weight, and overlap attenuation correction, can be obtained. This enables a comprehensive quantitative assessment of the impact of defects in different areas of the flange on core service performance. It adapts to the functional importance differences between working and non-working areas to complete the adaptive weighted correction of defect impact, eliminates the problem of repeated overestimation of impact values ​​caused by multiple defect overlaps, and solves the problems of boundary misjudgment and large deviation in defect hazard assessment in traditional testing. This provides a basis for the refined determination of the compliance of flange quality grades and improves the assessment accuracy of flange quality grading testing.

[0051] In summary, the technical solution adopted in this application can adaptively classify defects existing on the surface area of ​​the flange, thereby improving the accuracy of flange quality grading and detection.

[0052] Example 2: This application provides a flange quality inspection system based on image recognition, referencing... Figure 5As shown in the figure, this is a modular structure diagram of an image recognition-based flange quality inspection system according to this embodiment of the present application. The inspection system includes: The acquisition module 100 is used to acquire a surface image of the flange to be inspected; The segmentation module 200 is used to segment the working area and non-working area in the surface image according to the relative position of the vent hole and the center hole on the flange to be inspected, and to determine the abnormal pixel features within the bad point contour in each area. The matching module 300 is used to perform defect matching based on the pixel coordinates after image background separation according to all abnormal pixel features, generate defect attribution conditions including defect category and defect boundary, and determine the quality influence coefficient of the flange to be inspected by the defect attribution conditions. The judgment module 400 is used to determine the quality level of the flange to be tested based on the quality influence coefficient, and output the quality detection information of the flange to be tested.

[0053] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0054] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, including read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-Erasable Programmable Read-Only Memory (EEPROM), compactdisc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium capable of carrying or storing data.

[0055] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

Claims

1. A flange quality inspection method based on image recognition, characterized in that, The detection method includes the following steps: Acquire a surface image of the flange to be inspected; The working and non-working areas in the surface image are divided according to the relative positions of the vent holes and the center hole on the flange to be inspected, and the abnormal pixel features within the bad point contours in each area are determined. Based on all abnormal pixel features, defect matching is performed on the pixel coordinates after image background separation to generate defect attribution conditions containing defect categories and defect boundaries. The quality influence coefficient of the flange to be inspected is determined by the defect attribution conditions. The quality grade of the flange to be tested is determined based on the quality influence coefficient, and the quality detection information of the flange to be tested is output.

2. The flange quality inspection method based on image recognition as described in claim 1, characterized in that, The working and non-working areas in the surface image are divided according to the relative positions of the vent holes and the center hole on the flange to be inspected. Specifically, this includes: The vent holes and center holes in the surface image are mapped to radial base extremum points by polar coordinate transformation; A dynamic mask template is constructed based on the radial base extreme point, with the central hole as the origin and the exhaust hole direction as the reference offset angle. The dynamic mask template is inversely transformed back to the original image coordinate system, and the working area and non-working area in the surface image that satisfy the relative position constraints are segmented through pixel-level logical operations.

3. The flange quality inspection method based on image recognition as described in claim 1, characterized in that, Determining the abnormal pixel features within the bad pixel contours of each region specifically includes: Local morphological reconstruction is performed on the contours of bad pixels in each region, and the residual response maps of each pixel inside the bad pixel contour relative to the neighboring background are extracted. Based on the residual response map, the local self-similarity deviation factor of the pixels within the bad point contour is determined, and the saliency tensor of the abnormal pixels is constructed by combining the curvature distribution of the bad point contour edge. The saliency tensor is decomposed into structural anomaly components and scattered noise components, and a candidate set of real anomaly pixels is selected. Extract abnormal pixel features within the bad pixel contours of each region from the real abnormal pixel candidate set.

4. The flange quality inspection method based on image recognition as described in claim 3, characterized in that, The process of decomposing the saliency tensor into structural anomaly components and scattered noise components, and then selecting a candidate set of true anomalous pixels, specifically includes: The saliency tensor is decomposed into low-rank and sparse components to obtain low-rank structural components with continuous structural anomalies and sparsely distributed noise components with isolated abrupt changes. A pixel-level anomaly confidence function is constructed based on the spatial local clustering degree of the sparsely distributed noise components and the reconstruction error of the low-rank structural components. The candidate set of true anomalous pixels is determined based on the pixel-level anomaly confidence function.

5. The flange quality inspection method based on image recognition as described in claim 1, characterized in that, Based on all abnormal pixel features, defect matching is performed using the pixel coordinates after image background separation to generate defect attribution conditions that include defect category and defect boundary. Specifically, these conditions include: The initial defect category probability of abnormal pixels is determined based on the spatial distribution of all abnormal pixel features and pixel coordinates after separation from the image background. Based on the initial defect category probability and the local neighborhood connectivity of abnormal pixels, conditional random field optimization is performed to iteratively update the category label of each abnormal pixel and simultaneously fit the implicit surface of the region contour. Extract the boundary point sequence and corresponding defect type identifier of each defect region from the implicit surface, and output the defect attribution conditions containing the defect category and defect boundary.

6. The flange quality inspection method based on image recognition as described in claim 1, characterized in that, The determination of the quality influence coefficient of the flange to be inspected based on the defect attribution conditions specifically includes: Based on the defect attribution criteria, damage weight vectors for various defects on the flange sealing surface, positioning reference, and structural continuity are constructed. Based on the severity of the anomaly of the pixels within the defect boundary and the distance from the defect center to the vent hole and the center hole, the position weighting correction factor is calculated. The damage weight vector and the position weighting correction factor are fused by producting them on a defect-by-defect basis, and attenuation correction is performed by the area ratio of the overlapping regions between defects. The quality influence coefficient of the flange to be tested is determined based on all the influence values ​​after attenuation correction.

7. The flange quality inspection method based on image recognition as described in claim 6, characterized in that, The process of fusing the damage weight vector and the location-weighted correction factor through a defect-by-defect product, and then performing attenuation correction based on the area ratio of overlapping regions between defects, specifically includes: Based on the damage weight vector and the position weighting correction factor, perform element-wise multiplication operation on each defect to generate an initial fusion influence value vector; An attenuation matrix is ​​constructed by the area ratio of the overlapping regions between defects, and the joint impact compensation coefficient caused by the overlap of each defect is determined. Based on the initial fusion influence value vector and the attenuation matrix, iterative correction is performed on a defect-by-defect basis. The joint influence compensation coefficient is superimposed on the corresponding defect, and the influence value after attenuation correction is output.

8. The flange quality inspection method based on image recognition as described in claim 1, characterized in that, The quality grade of the flange to be inspected is determined based on the aforementioned quality influence coefficient, and the quality detection information of the flange to be inspected is output, specifically including: The initial grade membership vector of the flange to be tested is determined based on the quality influence coefficient and multiple preset quality grade threshold ranges. The confidence level of the flange to be inspected is obtained by performing fuzzy rule reasoning based on the initial level membership vector and the defect attribution conditions. Based on the confidence level, the quality level of the flange to be inspected is determined according to the defect category information of the flange to be inspected, and the quality detection information of the flange to be inspected is output.

9. The flange quality inspection method based on image recognition as described in claim 1, characterized in that, The quality inspection information includes the flange quality grade, full-dimensional details of defects, and inspection process parameters.

10. A flange quality inspection system based on image recognition, used to perform a flange quality inspection method based on image recognition as described in any one of claims 1 to 9, characterized in that, The detection system includes: The acquisition module is used to acquire surface images of the flange to be inspected; The segmentation module is used to segment the working area and non-working area in the surface image according to the relative position of the vent hole and the center hole on the flange to be inspected, and to determine the abnormal pixel features within the bad point contour in each area. The matching module is used to perform defect matching based on the pixel coordinates after image background separation according to all abnormal pixel features, generate defect attribution conditions containing defect category and defect boundary, and determine the quality influence coefficient of the flange to be inspected by the defect attribution conditions. The judgment module is used to determine the quality level of the flange to be tested based on the quality influence coefficient, and output the quality detection information of the flange to be tested.