Mold defect detection method and equipment based on deep learning
Through the saliency focus strategy and feature fusion technology, the accuracy problem of existing mold defect detection methods in complex images is solved, more efficient mold defect identification and positioning is achieved, and the detection accuracy and production quality are improved.
Patent Information
- Application Number
- CN202510204242.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2045-02-24
AI Technical Summary
Existing deep learning-based mold defect detection methods have difficulty accurately identifying and locating defects when processing complex mold machine vision images, especially when there are many image elements and their relationships are complex, resulting in low detection accuracy.
By obtaining the candidate feature representations of image elements in the mold machine vision image, the saliency focus strategy is used to perform feature fusion and element relationship classification, the feature representations of image elements are determined, and the element node relationship network is generated, and finally defect detection is performed.
The accuracy and efficiency of mold defect detection are improved, and defects on the mold surface can be more accurately identified and located, thereby improving production quality and efficiency.
Smart Images

Figure CN120259177B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to, but is not limited to, the fields of image processing and machine learning technology, and in particular to a mold defect detection method and device based on deep learning. Background Art
[0002] With the continuous advancement of industrial manufacturing technology, molds play a vital role in the production of various products. However, molds may develop various defects during use, which can seriously affect product quality and production efficiency. Therefore, accurate mold defect detection is particularly important.
[0003] Traditional mold defect detection methods rely primarily on manual inspection or simple image processing techniques. These methods are not only inefficient but also inaccurate and susceptible to human factors and complex environments. In recent years, the rapid development of deep learning technology has demonstrated outstanding performance in image processing and vision tasks, providing new solutions for mold defect detection.
[0004] In the field of deep learning, neural network models can automatically learn and extract features from images, enabling them to perform tasks such as image classification, recognition, and detection. However, existing deep learning-based mold defect detection methods often struggle to accurately identify and locate defects when processing complex mold machine vision images, especially when the image contains numerous elements (such as molds with complex textures) and complex relationships.
[0005] Furthermore, the relationships between elements in mold machine vision images are crucial for defect detection. Complex relationships can exist between different image elements, and these relationships are crucial for accurately determining the type and location of defects. Therefore, improving the accuracy of deep learning-based mold defect detection methods, especially when processing complex mold machine vision images, has become a pressing issue. Summary of the Invention
[0006] In view of this, the embodiments of the present application at least provide a mold defect detection method and device based on deep learning. The technical solution of the embodiments of the present application is implemented as follows:
[0007] In one aspect, an embodiment of the present application provides a mold defect detection method based on deep learning, the method comprising:
[0008] Acquire a mold machine vision image, wherein the mold machine vision image is composed of a plurality of image regions and includes X image elements, where X>1;
[0009] Obtaining a candidate feature representation for each of the X image elements, where each image element corresponds to at least one candidate feature representation;
[0010] Perform feature fusion operation on the candidate feature representation of each image element according to the saliency focus strategy to obtain the adjusted candidate feature representation of each image element;
[0011] determining an image element feature representation for each image element based on the adjusted candidate feature representation for each image element;
[0012] Performing element relationship classification on the image element feature representations of the X image elements to determine the element involvement relationship of the X image elements in the mold machine vision image.
[0013] In some embodiments, any one of the X image elements is regarded as a first image element, the first image element corresponds to Y candidate feature representations, and any one of the Y candidate feature representations of the first image element is regarded as the u-th candidate feature representation of the first image element; u and Y are both natural numbers greater than 0, and u≤Y;
[0014] The step of performing a feature fusion operation on the candidate feature representation of each image element according to the saliency focus strategy to obtain the adjusted candidate feature representation of each image element includes:
[0015] Obtaining commonality measurement coefficients between the u-th candidate feature representation of the first image element and each of the Y candidate feature representations of the first image element, to obtain a set of commonality measurement coefficients corresponding to the u-th candidate feature representation;
[0016] Obtaining a preset parameter, and performing a downsampling operation on each commonality metric coefficient in the set of commonality metric coefficients corresponding to the u-th candidate feature representation based on the preset parameter, to obtain a downsampling operation result of each commonality metric coefficient in the set of commonality metric coefficients corresponding to the u-th candidate feature representation;
[0017] Performing a normalization operation on downsampling operation results of each commonality metric coefficient in the commonality metric coefficient set corresponding to the u-th candidate feature representation to obtain an influence coefficient cluster corresponding to the u-th candidate feature representation;
[0018] Performing eccentricity adjustment processing on the Y candidate feature representations of the first image element according to the influence coefficient cluster corresponding to the u-th candidate feature representation to obtain the adjusted u-th candidate feature representation of the first image element.
[0019] In some embodiments, any one of the Y candidate feature representations of the first image element is regarded as the vth candidate feature representation of the first image element; v is a natural number greater than 0, and v≤Y; obtaining commonality measurement coefficients between the uth candidate feature representation of the first image element and each of the Y candidate feature representations of the first image element, and obtaining a set of commonality measurement coefficients corresponding to the uth candidate feature representation, includes:
[0020] Get the first variable two-dimensional array and the first variable one-dimensional array;
[0021] performing an integration operation on the uth candidate feature representation of the first image element and the vth candidate feature representation of the first image element based on the first variable two-dimensional array to obtain an integration operation result;
[0022] Performing a nonlinear transformation on the integration operation result, and determining a commonality metric coefficient between the u-th candidate feature representation and the v-th candidate feature representation based on the integration operation result after the nonlinear transformation and the one-dimensional array of the first variable;
[0023] Merging the commonality measurement coefficient between the u-th candidate feature representation and the v-th candidate feature representation into the commonality measurement coefficient set corresponding to the u-th candidate feature representation to obtain the commonality measurement coefficient set corresponding to the u-th candidate feature representation;
[0024] The influence coefficient cluster corresponding to the u-th candidate feature representation includes Y influence coefficients, and the Y influence coefficients correspond one-to-one to the Y candidate feature representations corresponding to the first image element;
[0025] The performing eccentricity adjustment processing on the Y candidate feature representations of the first image element according to the influence coefficient cluster corresponding to the u-th candidate feature representation to obtain the u-th candidate feature representation after adjustment of the first image element includes:
[0026] Multiplying the Y candidate feature representations corresponding to the first image element by the Y influence coefficients corresponding to the u-th candidate feature representation to obtain an influence adjustment result of the Y candidate feature representations corresponding to the first image element;
[0027] The influence adjustment results of the Y candidate feature representations corresponding to the first image element are summed to obtain the uth candidate feature representation after adjustment of the first image element.
[0028] In some embodiments, obtaining a candidate feature representation for each of the X image elements includes:
[0029] Performing an image block operation on the mold machine vision image to obtain an image block matrix corresponding to the mold machine vision image;
[0030] Performing image embedding processing on the image block matrix to obtain an image embedding matrix corresponding to the image block matrix;
[0031] According to the image embedding matrix of the image pixels contained in each image element, the candidate feature representation corresponding to each image element is determined.
[0032] In some embodiments, any one of the X image elements is considered as a first image element, and the number of the first image elements distributed in the mold machine vision image is Y, where Y is a natural number greater than 0; and determining the candidate feature representation corresponding to each image element based on the image embedding matrix of the image pixels contained in each image element includes:
[0033] Obtaining feature vectors of E image pixels corresponding to the u-th occurrence of the first image element in the mold machine vision image, where u≤Y and E is a natural number not equal to 0;
[0034] Determining a commonality metric coefficient corresponding to the eigenvector of each image pixel in the E image pixels based on a one-dimensional array of preset variables and the eigenvectors of the E image pixels;
[0035] performing a classification operation on the commonality metric coefficient corresponding to the feature vector of each image pixel in the E image pixels to obtain an influence coefficient corresponding to the feature vector of each image pixel in the E image pixels;
[0036] According to the influence coefficient corresponding to the feature vector of each image pixel in the E image pixels, an eccentricity adjustment process is performed on the feature vectors of the E image pixels to obtain a uth candidate feature representation corresponding to the first image element.
[0037] In some embodiments, any one of the X image elements is considered as a first image element, and the first image element corresponds to Y candidate feature representations, where Y is a natural number greater than 0; and determining the image element feature representation of each image element based on the adjusted candidate feature representation of each image element includes:
[0038] If Y is equal to 1, determining the candidate feature representation after adjustment of the first image element as the image element feature representation of the first image element;
[0039] If Y is greater than 1, a merging operation is performed on the adjusted Y candidate feature representations of the first image element to obtain an image element feature representation of the first image element.
[0040] In some embodiments, the merging operation on the adjusted Y candidate feature representations of the first image element to obtain the image element feature representation of the first image element includes:
[0041] A mean calculation operation is performed on the Y candidate feature representations corresponding to the first image element to obtain an image element feature representation of the first image element.
[0042] In some embodiments, any two image elements among the X image elements are regarded as the first image element and the second image element; and performing element relationship classification on the image element feature representations of the X image elements to determine the element involvement relationship of the X image elements in the mold machine vision image includes:
[0043] performing a feature combination operation on the image element feature representation of the first image element and the image element feature representation of the second image element to obtain a combined feature representation;
[0044] Obtaining a second variable two-dimensional array and a second variable one-dimensional array, and performing a full connection operation on the combined feature representation according to the second variable two-dimensional array and the second variable one-dimensional array to obtain a fully connected combined feature representation;
[0045] performing a classification operation on the fully connected combined feature representation to obtain confidence space information of the relationship between the first image element and the second image element;
[0046] An element involvement relationship between the first image element and the second image element in the mold machine vision image is determined based on confidence space information of the relationship between the first image element and the second image element.
[0047] In some embodiments, any two image elements among the X image elements are regarded as the first image element and the second image element; and the method further includes:
[0048] Based on the element involvement relationship between the first image element and the second image element in the mold machine vision image, the first image element and the second image element generate an element node relationship network corresponding to the mold machine vision image; and the element node relationship network corresponding to the mold machine vision image is integrated into the target image prior information library, wherein the element node relationship network includes the first image element, the second image element and the element involvement relationship.
[0049] In some embodiments, the method further comprises:
[0050] Acquire machine vision images of the mold to be inspected;
[0051] Performing target detection on the machine vision image of the mold to be inspected to obtain core components corresponding to the machine vision image of the mold to be inspected, wherein the core components include two image elements;
[0052] Searching the target image prior information library for a target element node relationship network that matches the core component content corresponding to the machine vision image of the mold to be inspected;
[0053] A defect detection result of the machine vision image of the mold to be inspected is generated based on the target element node relationship network.
[0054] On the other hand, the present application provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, the steps in the above method are implemented.
[0055] The beneficial effects of the present application include: providing a mold defect detection method and apparatus based on deep learning, obtaining a mold machine vision image, the mold machine vision image consisting of multiple image regions and including X image elements, obtaining candidate feature representations for each of the X image elements, with each image element corresponding to at least one candidate feature representation, performing a feature fusion operation on the candidate feature representations of each image element based on a saliency focus strategy to obtain an adjusted candidate feature representation for each image element, performing a merging operation on the adjusted candidate feature representations of each image element to obtain an image element feature representation for each image element, performing element relationship classification on the image element feature representations of the X image elements, and determining element involvement relationships of the X image elements in the mold machine vision image. Based on this, performing a feature fusion operation on the candidate feature representations of each image element based on the saliency focus strategy can optimize the candidate feature representations of each image element to increase the accuracy of the obtained element involvement relationships between the image elements.
[0056] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and do not limit the technical solutions of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] The drawings herein are incorporated into and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and, together with the specification, are used to illustrate the technical solutions of the present application.
[0058] Figure 1 A schematic diagram of the implementation flow of a mold defect detection method based on deep learning provided in an embodiment of the present application.
[0059] Figure 2 A hardware entity diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions of this application are further elaborated in detail below with reference to the accompanying drawings and embodiments. The described embodiments should not be regarded as limiting this application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0061] In the following description, references to "some embodiments" describe a subset of all possible embodiments. However, it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict. The terms "first / second / third" are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It is understood that the specific order or sequence of "first / second / third" may be interchanged where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0062] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing this application only and are not intended to limit this application.
[0063] The present invention provides a deep learning-based mold defect detection method that can be executed by a processor of a computer device, such as a server, laptop, tablet computer, or desktop computer, which has data processing capabilities.
[0064] Figure 1 A schematic diagram of the implementation process of a mold defect detection method based on deep learning provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method includes the following steps:
[0065] Step S100: Acquire a mold machine vision image, wherein the mold machine vision image is composed of a plurality of image regions and includes X image elements, where X>1.
[0066] In step S100, a computer device uses a machine vision system to capture an image of the mold, known as a mold machine vision image. The mold machine vision image is divided into several image regions, each of which may contain different parts or features of the mold. Together, these regions form a visual representation of the entire mold. The mold machine vision image contains multiple (X > 1) image elements. In the context of mold inspection, these image elements may represent different textures on the mold surface. For example, some textures may be normal design features of the mold, such as regular lines or patterns; while other textures may be abnormal textures caused by manufacturing defects or wear during use. For example, suppose a mold used to make plastic products is being inspected. In the machine vision image of this mold, multiple image elements are visible, including normal mold lines, possible cracks, and worn areas. These elements appear in different shapes, sizes, and colors in the image and require further analysis and identification in subsequent steps.
[0067] Step S200: Obtain a candidate feature representation for each of the X image elements, where one image element corresponds to at least one candidate feature representation.
[0068] In step S200, the computer device performs an in-depth analysis of each image element obtained in step S100 and extracts their features. Feature representation is an abstraction and encoding of the original data, which can reflect the essential attributes of the data. In the scenario of mold defect detection, features may include texture thickness, direction, density, etc., which are important clues to determine whether the mold is normal or has defects. Specifically, the computer device uses image processing technology and machine learning algorithms to extract features from each image element. These features can be visual information such as color, shape, texture, etc., or more complex structural information or spatial relationships. For example, in a mold surface image, a specific wear area may exhibit unique texture and color, which can be used as feature representations of the area.
[0069] It is important to note that each time an image element appears in an image, there will be a corresponding candidate feature representation. This means that if an image element appears multiple times in an image, it will have multiple candidate feature representations. These candidate feature representations can be in the form of vectors, and each vector contains a set of feature values for the image element. For example, suppose a crack-like image element appears twice in a mold image, then the computer device will extract two sets of candidate feature representations for this element. Each set of feature representations may include information such as the length, width, direction, and color of the crack, which is encoded into a feature vector. For example, a feature vector may be [0.5, 0.3, 45, 120], representing the relative length, relative width, direction, and color value of the crack, respectively. In this way, step S200 provides a rich data foundation for subsequent feature fusion and element relationship classification, which helps to accurately identify mold defects.
[0070] As an implementation manner, in step S200, obtaining a candidate feature representation of each of the X image elements specifically includes:
[0071] Step S210: performing an image block operation on the mold machine vision image to obtain an image block matrix corresponding to the mold machine vision image.
[0072] In step S210, the computer device uses a specific algorithm to divide the original mold image into a number of small blocks. These small blocks are arranged according to their positions in the original image to form an image block matrix.
[0073] The purpose of image segmentation is to analyze each area of the mold surface in more detail, thereby enabling more accurate detection of possible defects. By dividing the image into small blocks, we can extract and analyze features independently for each block, which helps to identify local defects that may not be obvious in the overall image. Specifically, the computer equipment will first determine the size and method of segmentation, which usually depends on the resolution of the original image and the type of defect to be detected. For example, if small cracks or scratches need to be detected, the size of the block should be relatively small to capture these subtle features.
[0074] During image segmentation, the computer divides the original image into multiple small blocks according to the preset block size. Each block contains a portion of the original image. These blocks are organized into a matrix based on their relative positions in the original image, known as the image segmentation matrix.
[0075] For example, consider a high-resolution mold image. To detect potential microcracks on the mold surface, the image can be segmented into dozens of small blocks. Each block may contain only a small area of the mold surface, such as a scribed line or a small bump. By analyzing these blocks individually, it's possible to more accurately determine which areas harbor potential defects. The image segmentation operation in step S210 provides the foundational data for subsequent feature extraction and defect detection. It enables the computer to more precisely analyze each area of the mold surface, thereby improving the accuracy and sensitivity of defect detection.
[0076] Step S220: performing image embedding processing on the image block matrix to obtain an image embedding matrix corresponding to the image block matrix.
[0077] In step S220, the computer device performs image embedding processing on the image block matrix obtained in step S210 to obtain an image embedding matrix. Image embedding processing is to convert image data from the original pixel space to a high-dimensional feature space. This conversion can be achieved through a machine learning model, especially a deep learning model. In the scenario of mold defect detection, the purpose of image embedding is to extract high-level features in each image block. These features can more effectively represent the image content and assist in subsequent defect identification. Specifically, the computer device uses a pre-trained deep learning model, such as a convolutional neural network (CNN), to process each image block and convert each block into a feature vector that captures the key visual information in the block. This process is automatic, and the model will learn from a large amount of training data how to effectively extract useful features from raw pixels.
[0078] For example, suppose a deep convolutional neural network is used to process image blocks. For each block, the network outputs a fixed-length feature vector, such as a 128-dimensional or 256-dimensional vector. This vector is a highly abstract representation of the content of the original image block, encoding key information such as the block's texture, shape, and edges, which are crucial for identifying mold defects.
[0079] By combining the feature vectors of all image blocks, we obtain an image embedding matrix. This matrix is actually a high-dimensional feature set that provides rich information for subsequent classification and recognition tasks. Overall, the image embedding process in step S220 converts the raw image data into a feature representation that is easier to analyze and compare. In the context of mold defect detection, this transformation can significantly improve the accuracy and efficiency of defect recognition.
[0080] Step S230: determining a candidate feature representation corresponding to each image element based on an image embedding matrix of image pixels contained in each image element.
[0081] In step S230, the computer device determines the candidate feature representations of these image elements based on the image embedding matrix of the image pixels contained in each image element. Specifically, each image element is composed of multiple pixels, and these pixels have been converted into an image embedding matrix in the previous step. The image embedding matrix is actually composed of a series of eigenvectors, and each eigenvector corresponds to the feature representation of an image block. Therefore, for the pixels contained in a certain image element, its corresponding eigenvector can be used to describe the characteristics of this image element. In order to determine the candidate feature representations of the image element, the computer device aggregates these eigenvectors. The aggregation method can be simple averaging, weighted averaging, maximum pooling, etc., depending on the actual application scenario and requirements. In this way, the computer device can extract features related to a specific image element from the image embedding matrix to form a candidate feature representation of the image element.
[0082] For example, in the scenario of mold defect detection, assume that there is an image element representing a potential defect area on the mold surface. This area may contain multiple pixels, and each pixel has a corresponding feature vector. By aggregating these feature vectors, a feature representation representing the overall characteristics of this potential defect area can be obtained. This feature representation can be used to determine whether there is actually a defect in this area, as well as the type and severity of the defect. In general, the purpose of step S230 is to extract features related to a specific image element from the image embedding matrix to form a candidate feature representation of the image element. This process is an important link in the mold defect detection process, which provides key feature information for subsequent classification and recognition tasks. In this way, computer equipment can more accurately identify defects on the mold surface, thereby improving production efficiency and product quality.
[0083] In one embodiment, any one of the X image elements is considered as a first image element, and the number of the first image elements distributed in the mold machine vision image is Y, where Y is a natural number greater than 0. Step S230, based on the image embedding matrix of the image pixels contained in each image element, determines the candidate feature representation corresponding to each image element, specifically including:
[0084] Step S231: Obtain feature vectors of E image pixels corresponding to the u-th occurrence of the first image element in the mold machine vision image, where u≤Y and E is a natural number not equal to 0.
[0085] Step S231 extracts the feature vector of a specific image element (i.e., the first image element) from the mold machine vision image. In this step, the computer device pays attention to each occurrence of the first image element in the mold machine vision image, and for each occurrence, obtains the feature vector of the image pixels contained in the image element. Specifically, when the computer device processes the mold machine vision image, it first identifies the first image element (which may be a potential defect area or an area that requires special attention). Since this image element may appear multiple times in the image (assuming the number of occurrences is Y), the computer device needs to analyze each occurrence. For each occurrence of the first image element (represented by u, where u is less than or equal to Y), the computer device determines the number of image pixels contained in this image element (assuming it is E pixels) and extracts the feature vector of these pixels.
[0086] Feature vectors are extracted from image blocks using a deep learning model (e.g., a convolutional neural network) in the previous step. They represent high-level features of the image pixels. In the context of mold defect detection, these feature vectors may contain key information about pixel color, texture, shape, and other key features, which are crucial for subsequent defect identification.
[0087] To illustrate, let's assume the first image element represents a potential crack region on the mold surface. This region appears three times in the mold machine vision image (i.e., Y = 3). The first time it appears (u = 1), it contains 10 image pixels (i.e., E = 10). A computer extracts feature vectors for these 10 pixels. Each vector is a multidimensional array, such as [0.2, 0.5, -0.1, ..., 0.3] (this array is for example only; actual vectors may have more dimensions and different values). These feature vectors are then used in subsequent operations such as commonality metric calculation, classification, and weighted summation to ultimately determine whether this potential crack region is a true defect.
[0088] Step S232: determining a commonality metric coefficient corresponding to the eigenvector of each of the E image pixels based on a preset one-dimensional array of variables and the eigenvectors of the E image pixels.
[0089] Step S232 determines the similarity between the image pixel feature vector and a preset standard during the mold defect detection process. The computer device uses a preset one-dimensional array of variables (also called a parameter vector) to compare the feature vectors of E image pixels extracted from the mold machine vision image to calculate a commonality metric coefficient between each feature vector and the preset variables. This coefficient effectively reflects the similarity between the feature vector and the preset standard. Specifically, the preset one-dimensional array of variables can be considered a standard vector representing the normal or expected mold surface characteristics. This standard vector may be learned through a machine learning algorithm based on a large amount of normal mold surface image data, or it may be manually set based on expert knowledge and experience. In the mold defect detection scenario, this standard vector typically represents the typical characteristics of a defect-free mold surface.
[0090] After the computer device obtains the feature vectors of the E image pixels in the first image element (potential defect area), it compares each of these feature vectors against a preset standard vector. This comparison can be performed by calculating cosine similarity, Euclidean distance, or other similarity metrics between the two vectors. This method allows the computer device to determine the degree of similarity between each pixel's feature vector and normal mold surface features. For example, suppose the preset one-dimensional array of variables is [0.1, 0.2, 0.3, 0.4], and the feature vector of a particular image pixel is [0.15, 0.18, 0.32, 0.36]. The computer device can use the cosine similarity formula to calculate the commonality coefficient between the two vectors. This coefficient represents the degree of similarity between the pixel's features and normal mold surface features. A higher coefficient indicates a more likely representation of the normal mold surface; a lower coefficient indicates a more likely representation of the defective area. In this way, step S232 helps the computer device identify image pixels that are inconsistent with normal mold surface features, providing an important basis for further defect assessment and classification.
[0091] Step S233: performing a classification operation on the commonality measurement coefficient corresponding to the feature vector of each image pixel in the E image pixels to obtain an influence coefficient corresponding to the feature vector of each image pixel in the E image pixels.
[0092] Step S233 is the step for further processing the image pixel features in the mold defect detection process. In this step, the computer device will classify the commonality measurement coefficients calculated in step S232 to assign an influence coefficient, also known as a weight, to the feature vector of each image pixel.
[0093] The commonality measurement coefficient reflects the similarity between the features of each image pixel and the preset standard. In step S233, the computer device classifies the image pixels according to the size of these coefficients. Generally speaking, pixels with higher commonality measurement coefficients, that is, pixels that are more similar to the preset standard, are considered more likely to belong to a normal mold surface, so their influence coefficients may be relatively low. On the contrary, pixels with lower commonality measurement coefficients indicate that they are significantly different from normal features and may belong to defective areas, so they will be assigned a higher influence coefficient. Specifically, in the scenario of mold defect detection, it is assumed that there is a threshold for the commonality measurement coefficient. Pixels above this threshold are considered normal, while pixels below this threshold are considered potential defects. The computer device will assign an influence coefficient to each pixel based on this classification. For example, normal pixels may be assigned a lower weight, such as 0.5, while potential defect pixels may be assigned a higher weight, such as 1.5.
[0094] This classification and weighting helps emphasize pixels that differ significantly from normal features during subsequent defect identification, thereby improving defect detection accuracy. In this way, step S233 helps the computer device more accurately locate and identify defective areas on the mold surface, providing strong support for subsequent defect repair or product quality control.
[0095] Step S234: performing eccentricity adjustment processing on the feature vectors of the E image pixels according to the influence coefficient corresponding to the feature vector of each image pixel in the E image pixels, to obtain the uth candidate feature representation corresponding to the first image element.
[0096] Step S234 involves weighting and combining the image pixel feature vectors to obtain a more accurate feature representation. In this step, the computer device performs an offset adjustment, or weighted summation, on the feature vectors of the E image pixels in the first image element based on the influence coefficients (weights) calculated in the previous step. Specifically, in the application scenario of mold defect detection, the feature vector of each image pixel contains certain information. However, due to the complexity of the mold surface and the potential defects, the importance of different pixels varies. Therefore, by assigning an influence coefficient (i.e., weight) to each pixel's feature vector, the contribution of each pixel in the feature representation can be more accurately reflected.
[0097] In step S234, the computer device weights each pixel's feature vector according to its influence coefficient. For example, if a pixel has an influence coefficient of 1.5, its feature vector contributes more to the weighted sum than pixels with an influence coefficient of 1. This way, pixel features that are more closely associated with the defect are more prominently represented in the final feature representation.
[0098] The specific operation of weighted summation can be to multiply the feature vector of each pixel by its corresponding influence coefficient, and then add all weighted feature vectors to obtain a comprehensive feature representation. This comprehensive feature representation is the u-th candidate feature representation corresponding to the first image element. It more accurately reflects the characteristics of the image element and facilitates subsequent defect identification and analysis.
[0099] For example, suppose three pixels have feature vectors of [0.1, 0.2, 0.3], [0.2, 0.3, 0.4], and [0.3, 0.4, 0.5], with influence coefficients of 1, 1.5, and 0.5, respectively. During the weighted summation process, the feature vector of the first pixel is multiplied by 1, the feature vector of the second pixel is multiplied by 1.5, and the feature vector of the third pixel is multiplied by 0.5. These three weighted feature vectors are then added together to form the u-th candidate feature representation for the first image element. This representation more accurately reflects the characteristics of that image element, providing a more robust basis for subsequent mold defect detection.
[0100] Step S300: performing a feature fusion operation on the candidate feature representation of each image element according to the saliency focus strategy to obtain an adjusted candidate feature representation of each image element.
[0101] Step S300 performs advanced processing and fusion of image element features for mold defect detection. In this step, the computer utilizes a saliency focus strategy (Attention Mechanism), also known as an attention mechanism, to perform feature fusion on the candidate feature representations of each image element. This aims to emphasize features that are more important for the defect detection task and suppress or ignore irrelevant or redundant information. In the specific application scenario of mold defect detection, the attention mechanism helps the computer focus on areas or features that are most likely to contain defects. For example, a mold surface may have tiny cracks or dents. These subtle features may not be noticeable in the overall image, but they are crucial for defect detection. The attention mechanism enables the computer to automatically identify and emphasize these key features. Feature fusion combines multiple candidate feature representations to form a more comprehensive and informative feature representation. During this process, the computer performs a weighted fusion on each candidate feature representation based on the weights calculated by the attention mechanism. Feature representations with higher weights receive greater weight in the fusion process, ensuring that important features are fully reflected in the final representation. The feature fusion operation is to optimize each candidate feature representation based on the element involvement relationship (i.e. the association relationship between elements) between the candidate feature representations, so that the adjusted candidate feature representation has integrity and increases the accuracy of each candidate feature representation.
[0102] For example, suppose an image element has three candidate feature representations, corresponding to different feature extraction methods and scales. Using the attention mechanism, the computer calculates the weights of these three candidate feature representations as 0.6, 0.3, and 0.1, respectively. During feature fusion, the first candidate feature representation contributes the most, followed by the second, and finally the third. This fused feature representation places greater emphasis on the information captured by the first candidate feature representation.
[0103] In this way, step S300 helps the computer device to more effectively utilize the feature information of image elements in mold defect detection, thereby improving the accuracy and efficiency of detection.
[0104] As an embodiment, any one of the X image elements is considered as the first image element, the first image element corresponds to Y candidate feature representations, and any one of the Y candidate feature representations of the first image element is considered as the u-th candidate feature representation of the first image element; u and Y are both natural numbers greater than 0, and u ≤ Y. Based on this, step S300 performs a feature fusion operation on the candidate feature representations of each image element according to the saliency focus strategy to obtain an adjusted candidate feature representation for each image element, specifically including:
[0105] Step S310: Obtain commonality measurement coefficients between the u-th candidate feature representation of the first image element and each of the Y candidate feature representations of the first image element, and obtain a set of commonality measurement coefficients corresponding to the u-th candidate feature representation.
[0106] Step S310 involves evaluating the similarity or correlation between the candidate feature representations of the image elements. In this step, the computer device calculates the commonality measurement coefficient between the u-th candidate feature representation of the first image element and all other candidate feature representations of the image element. The commonality measurement coefficient is a quantitative indicator used to measure the degree of similarity or correlation between two feature representations. In the application scenario of mold defect detection, this coefficient helps to identify which feature representations are similar or consistent when describing the same defect or area. Specifically, the computer device compares the u-th candidate feature representation with the other Y-1 candidate feature representations of the first image element one by one. This comparison process may be achieved by calculating the similarity, correlation or other measurement methods between the two feature representations. For example, methods such as cosine similarity, Pearson correlation coefficient or Euclidean distance can be used to measure the similarity between two feature vectors.
[0107] When calculating the commonality metric coefficients, the computer considers all dimensions between feature representations, including color, texture, shape, and other information, to ensure the accuracy and comprehensiveness of the coefficients. These coefficients are then collected to form a set of commonality metric coefficients for subsequent feature fusion operations.
[0108] For example, suppose the first image element has three candidate feature representations (Y=3). We now want to calculate the commonality metric coefficients between the first candidate feature representation (u=1) and the other two. The computer device will first extract the feature vector of the first candidate feature representation, such as [0.5, 0.3, 0.2], and then compare it with the feature vectors of the second and third candidate feature representations. Through calculation, we can obtain two commonality metric coefficients, such as 0.8 (similarity with the second feature representation) and 0.6 (similarity with the third feature representation). These two coefficients constitute the set of commonality metric coefficients for the first candidate feature representation. This set will be used in subsequent steps to determine the weight of each candidate feature representation in the feature fusion process.
[0109] As an implementation manner, any one of the Y candidate feature representations of the first image element is regarded as the vth candidate feature representation of the first image element; v is a natural number greater than 0, and v≤Y;
[0110] The step S310 of obtaining commonality measurement coefficients between the u-th candidate feature representation of the first image element and each of the Y candidate feature representations of the first image element, and obtaining a set of commonality measurement coefficients corresponding to the u-th candidate feature representation, includes:
[0111] Step S311: Obtain a first variable two-dimensional array and a first variable one-dimensional array.
[0112] The first variable two-dimensional array, also known as the parameter matrix, can be thought of as a transformation matrix used to convert features from one representation to another. In mold defect detection, this matrix may contain weight parameters learned from a large amount of training data, which help to extract and emphasize features related to mold defects. For example, certain elements in the matrix may be trained to pay special attention to specific defects such as cracks or dents on the mold surface. The first variable one-dimensional array, also known as the parameter vector, is usually used as a bias term to regulate the output of neurons in the neural network. In the scenario of mold defect detection, this bias vector can help the model better adapt to different lighting conditions, shooting angles, or subtle changes in the mold surface, thereby improving the robustness of detection.
[0113] For example, suppose there is a 3x3 parameter matrix W and a parameter vector b of length 3. The matrix W may be obtained through training to extract defect-related features in mold images; while the vector b serves as a bias term to adjust the model's output to make it more robust to small changes in the input data.
[0114] These two parameters are obtained through the training process of machine learning algorithms, such as deep learning networks. During the training process, the model continuously adjusts these parameters to minimize the difference between the predicted results and the actual results, thereby improving the accuracy of mold defect detection.
[0115] Step S312: performing an integration operation on the u-th candidate feature representation of the first image element and the v-th candidate feature representation of the first image element based on the first variable two-dimensional array to obtain an integration operation result.
[0116] Specifically, when the computer device executes step S312, it uses the previously acquired first variable two-dimensional array (parameter matrix) to integrate the u-th candidate feature representation and the v-th candidate feature representation of the first image element. This integration operation can be considered a feature fusion process, which aims to combine two or more feature representations into a more comprehensive and representative feature.
[0117] Taking mold surface defect detection as an example, suppose the uth candidate feature representation primarily captures the mold surface's texture information, while the vth candidate feature representation focuses more on the mold's edge contour information. Through integration, the computer can fuse these two pieces of information to generate a comprehensive feature representation that incorporates both texture and edge information.
[0118] The specific implementation of the integration operation may vary depending on the application scenario and the chosen machine learning model. In deep learning frameworks, this is typically implemented via convolutional layers, fully connected layers, or specialized feature fusion layers. For example, if a convolutional neural network (CNN) is used, the integration operation may be a convolution process, where a two-dimensional array of the first variable acts as a convolution kernel, which is slid across the feature map and a weighted sum is calculated to produce a new fused feature map.
[0119] In one example, assume that the u-th candidate feature representation is a tensor of shape [H, W, C1] (where H is the height, W is the width, and C1 is the number of channels), and the v-th candidate feature representation is a tensor of shape [H, W, C2]. The first-variable 2D array can be a convolution kernel of shape [C_out, C1+C2, K, K] (where C_out is the number of output channels and K is the kernel size). During the concatenation operation, the u-th and v-th candidate feature representations are first concatenated along the channel dimension to form a tensor of shape [H, W, C1+C2]. This is then convolved with the first-variable 2D array to produce a concatenation result of shape [H, W, C_out].
[0120] Step S313: performing a nonlinear transformation on the integration operation result, and determining a commonality measurement coefficient between the u-th candidate feature representation and the v-th candidate feature representation based on the integration operation result after the nonlinear transformation and the one-dimensional array of the first variable.
[0121] Step S313 involves performing a nonlinear transformation on the integration operation result and calculating a commonality metric coefficient, which is intended to capture the complex relationships between features and quantify the similarities between them.
[0122] First, the computer performs a nonlinear transformation on the integration results obtained in step S312. The purpose of this nonlinear transformation is to introduce more complex feature relationships, enabling the model to learn and adapt to nonlinear patterns in the data. In mold defect detection, this nonlinear transformation can help the model better identify subtle changes or irregularities on the mold surface, thereby improving detection sensitivity.
[0123] Specifically, nonlinear transformations can be implemented using activation functions such as ReLU (Rectified Linear Unit), Sigmoid, or Tanh. For example, the ReLU function sets all negative values to 0 while leaving positive values unchanged. This transformation helps the model learn more sparse and effective feature representations. Next, the computer device uses the result of the integration operation after the nonlinear transformation and the one-dimensional array of the first variable (i.e., the parameter vector) to determine the commonality measure coefficient between the uth candidate feature representation and the vth candidate feature representation. This coefficient reflects the similarity or correlation between the two feature representations.
[0124] In mold defect detection, the commonality metric coefficient can be viewed as the degree of synergy between two feature representations in defect detection. If both feature representations show a high response when detecting the same type of defect, their commonality metric coefficient will be large. Conversely, if both feature representations respond to different types of defects, or if one feature representation is unresponsive to the defect, their commonality metric coefficient will be small. For example, suppose there is a tiny crack defect on the mold surface. The uth candidate feature representation primarily captures the crack's edge information, while the vth candidate feature representation focuses more on the crack's internal texture. After integration and nonlinear transformation, if both feature representations have a strong response at the crack defect and their response patterns are similar, the calculated commonality metric coefficient will be high. This high coefficient instructs the computer to place greater emphasis on the synergy between the two feature representations during subsequent inspections.
[0125] In summary, step S313, through nonlinear transformation and calculation of commonality metrics, helps the computer more accurately capture and quantify the similarities and correlations between different feature representations in mold defect detection. This is crucial for improving the accuracy and reliability of defect detection.
[0126] Step S314: merging the commonality measurement coefficients between the u-th candidate feature representation and the v-th candidate feature representation into the commonality measurement coefficient set corresponding to the u-th candidate feature representation to obtain the commonality measurement coefficient set corresponding to the u-th candidate feature representation.
[0127] Step S314 integrates the calculated commonality metric coefficients into the set of commonality metric coefficients for the corresponding candidate feature representations. First, the computer has calculated the commonality metric coefficient between the uth and vth candidate feature representations through the previous steps. This coefficient reflects the similarity and correlation between these two feature representations when detecting mold defects.
[0128] Next, in step S314, the computer device merges this commonality metric coefficient into the set of commonality metric coefficients corresponding to the u-th candidate feature representation. This set may have previously contained commonality metric coefficients between the u-th candidate feature representation and other candidate feature representations. The fusion operation can be a simple addition or a more complex weighted average or screening and updating based on a certain strategy. For example, if the new commonality metric coefficient is more representative or more accurate than the existing coefficients in the set, the old coefficient can be replaced or updated with the new coefficient.
[0129] To illustrate this with a specific example: suppose the uth candidate feature representation primarily captures scratches on the mold surface, while the vth candidate feature representation focuses on rust. Through the previous steps, the computer has calculated a commonality metric between these two feature representations, for example, 0.7 (a value between 0 and 1 indicating similarity or correlation between the two). This 0.7 coefficient is now incorporated into the set of commonality metric coefficients for the uth candidate feature representation.
[0130] If the commonality metric coefficient set of the u-th candidate feature representation previously contains a coefficient of 0.6 with another feature representation of mold cracks, then after fusion, this set will be updated to contain two coefficients: one is a coefficient of 0.7 with the rust feature, and the other is a coefficient of 0.6 with the crack feature.
[0131] In this way, step S314 helps the computer device build a comprehensive view of the similarities and correlations between each candidate feature representation and other feature representations. This is crucial for subsequently selecting the most representative feature combination and improving the accuracy and efficiency of mold defect detection.
[0132] Step S320: Obtain preset parameters, and perform a downsampling operation on each commonality measurement coefficient in the set of commonality measurement coefficients corresponding to the u-th candidate feature representation based on the preset parameters, to obtain the downsampling operation results of each commonality measurement coefficient in the set of commonality measurement coefficients corresponding to the u-th candidate feature representation.
[0133] Step S320 involves downsampling the commonality metric coefficients to extract the most important correlation information. In this step, the computer device first obtains a preset parameter, which can be a threshold, sampling rate or other relevant parameters, to guide the downsampling operation.
[0134] Downsampling, also known as sparse processing, aims to filter out the most representative coefficients from a set of common metric coefficients to reduce data redundancy and noise. In the context of mold defect detection, this means that the computer will select the most relevant and informative coefficient from the set of common metric coefficients represented by the u-th candidate feature based on preset parameters.
[0135] Specifically, if the preset parameter is a threshold, the computer device will retain those commonality measurement coefficients greater than or equal to the threshold and ignore those coefficients less than the threshold. This ensures that only those significantly correlated feature representations are considered in subsequent feature fusion.
[0136] For example, suppose the set of commonality coefficients for the uth candidate feature is [0.8, 0.6, 0.3, 0.1], with a default parameter of 0.5. During downsampling, the computer retains coefficients greater than or equal to 0.5, namely 0.8 and 0.6, and ignores coefficients less than 0.5, namely 0.3 and 0.1. Thus, after downsampling, the resulting set of commonality coefficients becomes [0.8, 0.6], which is used in subsequent normalization and weighted summation operations.
[0137] In this way, step S320 helps the computer device filter the commonality metric coefficients before feature fusion, ensuring that only the most important correlation information is retained, thereby improving the accuracy and efficiency of feature fusion. This is particularly important in mold defect detection because it helps the device more accurately identify and locate defects on the mold.
[0138] Step S330: performing a normalization operation on the downsampling operation results of each commonality metric coefficient in the commonality metric coefficient set corresponding to the u-th candidate feature representation to obtain an influence coefficient cluster corresponding to the u-th candidate feature representation.
[0139] Step S330 is an important step in feature fusion during mold defect detection, which involves normalizing the downsampled commonality metric coefficients to generate an influence coefficient cluster for weighted summation, also known as a weight set.
[0140] In step S320, a set of important common metric coefficients have been screened out through the downsampling operation. However, the numerical ranges of these coefficients may be different, and directly using them for weighted summation may cause the influence of some coefficients to be too large or too small. Therefore, the purpose of step S330 is to standardize these coefficients so that they have the same scale, thereby ensuring that in the subsequent weighted summation process, each coefficient can play a reasonable role according to its importance. The standardization operation, also known as normalization, usually scales the data so that it falls into a smaller specific interval, such as [0,1] or [-1,1]. In the application scenario of mold defect detection, this means that the computer equipment will convert the downsampled common metric coefficients so that their values are all within the same range.
[0141] For example, suppose that after downsampling, the commonality metric coefficients for the uth candidate feature are [0.8, 0.6]. During normalization, the computer may use a maximum-minimum normalization method to convert these two coefficients to the range of [0, 1]. The specific calculation is as follows:
[0142] For the coefficient 0.8, the normalized value is: (0.8-0.6) / (0.8-0.6)=1.
[0143] For the coefficient 0.6, the normalized value is: (0.6-0.6) / (0.8-0.6)=0.
[0144] This results in a standardized influence coefficient cluster [1, 0]. Of course, this is just a simplified example, and the actual standardization process may be more complicated and require more factors to be considered.
[0145] Through the standardized operation of step S330 , the computer device can ensure that each commonality metric coefficient can reasonably play a role according to its importance in the subsequent weighted summation process, thereby improving the accuracy and reliability of mold defect detection.
[0146] Step S340: performing eccentricity adjustment processing on the Y candidate feature representations of the first image element according to the influence coefficient cluster corresponding to the u-th candidate feature representation, to obtain the u-th candidate feature representation after adjustment of the first image element.
[0147] Step S340 uses the influence coefficient cluster (weight set) calculated in the previous step to perform a weighted summation of the candidate feature representations to achieve feature eccentricity adjustment. In the application scenario of mold defect detection, this step is crucial for accurately combining multiple feature representations to more accurately describe and identify defects on the mold. Specifically, the computer device weights the Y candidate feature representations of the first image element based on the influence coefficient cluster calculated in step S330. Each candidate feature representation is assigned a weight that reflects its importance in describing the mold defect. The weighted summation process is actually a linear combination of different feature representations, where the contribution of each feature representation is determined by its corresponding influence coefficient (weight).
[0148] For example, suppose the first image element has three candidate feature representations, denoted as F1, F2, and F3, and their corresponding influence coefficient clusters have been calculated in the previous steps to be [0.5, 0.3, 0.2]. During the decentering process, the computer performs a weighted summation of the feature representations according to these weights. If F1, F2, and F3 are numerical feature vectors, the result of this weighted summation is a new feature vector, where each dimension is the weighted sum of the corresponding dimension values of the original feature vector.
[0149] Assuming F1=[1,2,3], F2=[4,5,6], F3=[7,8,9], the new feature Fn after weighted summation is expressed as:
[0150] Fn=0.5*F1+0.3*F2+0.2*F3=0.5*[1,2,3]+0.3*[4,5,6]+0.2*[7,8,9]=[ 0.51+0.34+0.27,0.52+0.35+0.28,0.53+0.36+0.2*9]=[3.1,4.1,5.1].
[0151] In this way, through the eccentricity adjustment process in step S340, the computer device obtains a new feature representation that integrates multiple candidate feature representation information. This new feature representation may be more accurate and comprehensive when describing mold defects.
[0152] In one embodiment, the influence coefficient cluster corresponding to the u-th candidate feature representation includes Y influence coefficients, and the Y influence coefficients correspond one-to-one to the Y candidate feature representations corresponding to the first image element. Based on this, step S340 of performing eccentricity adjustment processing on the Y candidate feature representations of the first image element according to the influence coefficient cluster corresponding to the u-th candidate feature representation to obtain the adjusted u-th candidate feature representation of the first image element includes:
[0153] Step S341: Multiplying the Y candidate feature representations corresponding to the first image element by the Y influence coefficients corresponding to the u-th candidate feature representation to obtain an influence adjustment result of the Y candidate feature representations corresponding to the first image element;
[0154] Step S342: summing the influence adjustment results of the Y candidate feature representations corresponding to the first image element to obtain the uth candidate feature representation after adjustment of the first image element.
[0155] The purpose of step S340 is to perform an offset adjustment on the candidate feature representations through the influence coefficient clustering to enhance the features most relevant to the defect detection task and suppress those features that may interfere with detection. The following will provide a detailed explanation and examples of steps S341 and S342.
[0156] Step S341 involves multiplying each candidate feature representation of the first image element by the corresponding influence coefficient to obtain a weighted result. This step actually weights each feature, and the size of the weight reflects the importance of the feature to the final defect detection task.
[0157] Taking crack detection on a mold surface as an example, assume the first image element has three candidate feature representations: F1, F2, and F3, corresponding to the crack's edge information, surface texture, and color information, respectively. For crack detection, edge information may be most important, while color and surface texture may be less important. Therefore, in step S341, the computer device multiplies F1 by a larger influence coefficient and multiplies F2 and F3 by smaller influence coefficients. This gives the edge information feature F1 a greater weight in subsequent processing.
[0158] Specifically, if the influence coefficient of F1 is 0.6, and the influence coefficients of F2 and F3 are 0.2 respectively, then step S341 will be executed as follows: F1_weighted = F1 * 0.6, F2_weighted = F2 * 0.2, F3_weighted = F3 * 0.2. In this way, each feature representation is weighted according to its importance to the crack detection task.
[0159] Step S342 sums the weighted candidate feature representations to obtain an adjusted feature representation. Continuing with the example above, the adjusted feature representation for the uth candidate feature would be F1_weighted + F2_weighted + F3_weighted. This new feature representation incorporates the information of all the original features while also reflecting the importance of each feature to the detection task through different weights.
[0160] In this way, step S340 can help the computer device more effectively utilize feature information in the mold defect detection task, thereby improving the accuracy and efficiency of detection.
[0161] Step S400: determining an image element feature representation for each image element based on the adjusted candidate feature representation for each image element.
[0162] Step S400 determines the final feature representation of each image element based on the adjustment results of the candidate feature representations of the image elements in the previous step. This step ensures that the feature representation of each image element can accurately reflect its key information in the mold defect detection task.
[0163] When executing step S400, the computer device first reviews the candidate feature representations after adjustment for each image element. These adjusted feature representations have been weighted and adjusted according to the previous step (such as S340) to emphasize features related to mold defects and suppress irrelevant or noise features.
[0164] Taking the specific example of mold surface crack detection, assume that in the previous steps, the computer device has adjusted multiple candidate feature representations for each image element, such as enhancing features related to crack edges and weakening features related to surface texture or lighting changes. In step S400, the computer device will combine these adjusted candidate feature representations to generate a final image element feature representation for each image element. This final feature representation may be a feature vector that contains information about all important features in the image element, and these features have been appropriately weighted to reflect their importance in crack detection. For example, the feature vector of an image element may include feature values representing the sharpness, length, direction, and contrast of the crack edge.
[0165] After determining the image element feature representations for each image element, these feature representations can be used as input to subsequent machine learning models to train and test the model's performance on mold defect detection tasks. In this way, step S400 provides a high-quality feature data foundation for subsequent defect identification and analysis.
[0166] In one embodiment, any one of the X image elements is considered as a first image element, and the first image element corresponds to Y candidate feature representations, where Y is a natural number greater than 0. Step S400, based on the adjusted candidate feature representations of each image element, determines the image element feature representation of each image element, specifically including:
[0167] Step S410: If Y is equal to 1, determining the candidate feature representation after adjustment of the first image element as the image element feature representation of the first image element;
[0168] Step S420: If Y is greater than 1, a merging operation is performed on the Y candidate feature representations after adjustment of the first image element to obtain an image element feature representation of the first image element.
[0169] If an image element (here, the first image element) has only one candidate feature representation (i.e., Y is 1), the adjusted candidate feature representation is directly determined as the image element feature representation of the image element. This situation may occur in certain specific detection tasks, such as when the feature information contained in the image element is relatively simple, or when only one feature representation is retained after the previous processing steps.
[0170] Step S420 targets image elements with multiple candidate feature representations (i.e., Y is greater than 1). In this case, the computer device needs to merge (i.e., aggregate) these adjusted candidate feature representations to obtain a unified feature representation for the image element. This merging operation can be simple feature concatenation, weighted averaging, maximum pooling, etc., depending on the nature of the features and the requirements of the subsequent task.
[0171] For example, in mold defect detection, an image element covers a complex defect area on the mold. This area may contain multiple features, such as cracks, rust, and color changes. In the previous steps, the computer may have generated corresponding candidate feature representations for each feature and adjusted them. In step S420, these adjusted candidate feature representations are merged into a unified feature vector to fully describe the feature information of the image element.
[0172] In this way, step S400 ensures that each image element has a clear and comprehensive feature representation, and whether it is a single feature or a composite feature, it can be effectively captured and utilized. This provides a solid foundation for subsequent defect recognition, classification, and location.
[0173] As an implementation method, the step S420 performs a merging operation on the Y candidate feature representations after adjustment of the first image element to obtain the image element feature representation of the first image element, specifically including: performing a mean calculation operation on the Y candidate feature representations corresponding to the first image element to obtain the image element feature representation of the first image element.
[0174] In this embodiment, when the first image element corresponds to multiple (Y) candidate feature representations, in order to obtain a unified image element feature representation, a mean calculation operation may be used.
[0175] The mean calculation operation averages the eigenvalues of each of the Y candidate feature representations corresponding to the first image element. This approach balances the influence of each feature representation, resulting in a relatively robust feature representation. Specifically, if each candidate feature representation is a feature vector, the mean calculation is performed by averaging the eigenvalues at the same position in each vector.
[0176] For example, assume that the first image element corresponds to three candidate feature representations, each of which is a four-dimensional vector, represented as:
[0177] Candidate feature representation 1: (F1=[0.5, 0.8, 0.1, 0.7]).
[0178] Candidate feature representation 2: (F2=[0.6,0.7,0.2,0.8]).
[0179] Candidate feature representation 3: (F3=[0.4, 0.9, 0.15, 0.6]).
[0180] In step S420, the computer device calculates the mean of each dimension of the three feature representations. The calculation results are as follows:
[0181] Mean of the first dimension: ((0.5+0.6+0.4) / 3=0.5).
[0182] Mean of the second dimension: ((0.8+0.7+0.9) / 3=0.8).
[0183] Mean of the third dimension: ((0.1+0.2+0.15) / 3=0.15).
[0184] Mean of the fourth dimension: ((0.7+0.8+0.6) / 3=0.7).
[0185] Therefore, through the mean calculation operation, the image element feature representation of the first image element is: ([0.5, 0.8, 0.15, 0.7]). This feature representation combines the information of the three candidate feature representations, providing a more comprehensive and robust feature foundation for subsequent mold defect detection and identification.
[0186] Step S500: performing element relationship classification on the image element feature representations of the X image elements to determine the element involvement relationship of the X image elements in the mold machine vision image.
[0187] In the embodiment of the present application, the feature representations of the image elements are classified into element relationships in step S500 to determine the mutual relationships between these image elements in the mold machine vision image.
[0188] During step S500, the computer analyzes the feature representations of each image element extracted in the previous step. These feature representations may contain information about shape, texture, color, edges, and other aspects, and serve as the basis for determining relationships between image elements. Element relationship classification can be implemented using machine learning algorithms such as support vector machines (SVMs), decision trees, random forests, or neural networks. These algorithms enable the computer to learn and identify underlying relationship patterns between image elements.
[0189] Taking crack detection on a mold surface as an example, assume that a mold machine vision image contains multiple image elements, some of which may represent the crack's starting point, extension path, or endpoint. In step S500, the computer analyzes the characteristic representations of these image elements, such as edge sharpness, color variation, and texture continuity, to determine the relationships between them. By classifying these element relationships, the computer identifies which image elements are interconnected, thereby constructing a network diagram of the crack distribution on the mold surface. This network diagram not only displays the overall crack morphology but also reveals the crack's starting location, development direction, and potential impact range. Ultimately, the output of step S500 may be an element relationship diagram or a set of classification labels. This information is of great significance for subsequent mold defect assessment, repair planning, and mold quality control. In this way, step S500 provides a deeper understanding and analysis tool for mold defect detection.
[0190] In one embodiment, any two image elements among the X image elements are regarded as the first image element and the second image element; and step S500 of performing element relationship classification on the image element feature representations of the X image elements to determine the element involvement relationship of the X image elements in the mold machine vision image specifically includes:
[0191] Step S510: performing a feature combination operation on the image element feature representation of the first image element and the image element feature representation of the second image element to obtain a combined feature representation.
[0192] In step S510, the computer performs a feature combination operation on the feature representations of the two image elements, concatenating their feature vectors to obtain a new combined feature representation. Specifically, assume there are two image elements—a first image element and a second image element—representing two different regions on the mold surface. Through the previous steps, the computer has already extracted feature representations for these two regions. These features may include information such as shape, texture, and color, and are encoded as feature vectors.
[0193] Taking a specific eigenvector as an example, suppose the eigenvector of the first image element is [0.5, 0.8, 0.1, 0.9], which indicates that the region has a certain texture and color distribution. The eigenvector of the second image element might be [0.3, 0.6, 0.7, 0.2], representing the characteristics of another region.
[0194] In step S510, the computer concatenates the two feature vectors to form a new combined feature representation. The resulting combined feature vector is [0.5, 0.8, 0.1, 0.9, 0.3, 0.6, 0.7, 0.2]. This new combined feature vector contains all the feature information of the two image elements, providing the data foundation for subsequent determination of the relationship between the two regions.
[0195] In the embodiments of this application, this feature combination allows for the simultaneous consideration of features from multiple regions, leading to a more comprehensive understanding of the mold surface condition. For example, if two adjacent regions exhibit significant differences in color or texture, this could signal a potential defect, such as a crack, wear, or impurity. By combining the feature representations of these regions, these defects can be more accurately identified and classified.
[0196] Step S520: Obtain a second variable two-dimensional array and a second variable one-dimensional array, and perform a full connection operation on the combined feature representation based on the second variable two-dimensional array and the second variable one-dimensional array to obtain a fully connected combined feature representation.
[0197] Step S520 involves further integration and refinement of the combined feature representation. In this step, the computer device obtains two important parameters: a two-dimensional array of the second variable (parameter matrix) and a one-dimensional array of the second variable (parameter vector). These parameters are typically obtained through machine learning training and are used to perform a fully connected operation on the combined feature representation. Specifically, the fully connected operation is a linear transformation process that multiplies the combined feature representation with the parameter matrix and parameter vector to obtain a new, integrated combined feature representation. This process can be viewed as a weighted summation of the original features, where the values in the parameter matrix and parameter vector serve as the weights.
[0198] To illustrate, assume that in step S510, a combined feature vector [0.5, 0.8, 0.1, 0.9, 0.3, 0.6, 0.7, 0.2] is obtained. In step S520, the computer device obtains a parameter matrix (a two-dimensional array of the second variable), such as an 8×4 matrix, and a parameter vector (a one-dimensional array of the second variable), such as a 4-dimensional vector. These parameters are obtained through training, aiming to capture correlations between features and extract more meaningful features.
[0199] The fully connected operation multiplies this 8-dimensional combined feature vector by the 8x4 parameter matrix and then adds the 4-dimensional parameter vector. The result is a 4-dimensional fully connected combined feature representation, which includes a weighted combination of the original features and an adjustment of the bias term.
[0200] This process is particularly important in mold defect detection because it helps computers better understand and identify the complex features of the mold surface. By fully connecting, we can extract the features most relevant to the mold defect, allowing us to more accurately determine whether the mold has a defect and determine the type and extent of the defect.
[0201] In general, the fully connected operation in step S520 is a further processing and treatment of the combined feature representation. It uses the trained parameters to weight and integrate the original features to extract more meaningful feature information and provide stronger support for subsequent classification and recognition tasks.
[0202] Step S530: performing a classification operation on the fully connected combined feature representation to obtain confidence space information of the relationship between the first image element and the second image element.
[0203] In step S530, the computer device performs a classification operation on the fully connected combined feature representation to determine the confidence space information of the relationship between the first image element and the second image element, that is, the probability distribution of each possible relationship. Specifically, the fully connected combined feature representation has been integrated with the feature information from both image elements and has been further refined. This feature representation is now input into a classifier, such as a softmax classifier, for final classification.
[0204] For example, the softmax classifier converts the fully connected feature representation into a probability distribution of various possible relationships. Suppose there are three possible relationships: normal region–normal region, crack initiation–crack extension, and impurity region–normal region. The softmax classifier outputs probabilities for these three categories, which sum to 1, representing the computer's confidence in the relationship between the first and second image elements. For example, if the softmax classifier outputs a probability distribution of [0.1, 0.7, 0.2], this means the computer believes the most likely relationship between the two image elements is "crack initiation–crack extension" (with a probability of 0.7), and less likely to be "normal region–normal region" or "impurity region–normal region." In mold defect detection, such classification results are crucial for accurately identifying defects such as cracks and impurities on molds. By determining the relationships between image elements, we can more precisely locate the location and type of defects, enabling timely repair or mold replacement, ensuring smooth production.
[0205] The classification operation in step S530 uses the fully connected combined feature representation to determine the relationship type between image elements, providing an accurate basis for subsequent defect recognition and classification.
[0206] Step S540: determining an element involvement relationship between the first image element and the second image element in the mold machine vision image based on the confidence space information of the relationship between the first image element and the second image element.
[0207] Step S540 determines the specific relationship between the first and second image elements in the mold machine vision image based on the confidence space information obtained in the previous step. This step is the logical judgment link in the entire inspection process and relies on the probability distribution of various possible relationships calculated in the previous step.
[0208] Specifically, the computer determines the relationship between two image elements based on the confidence space information output by the softmax classifier (or other classification algorithm), which is the probability distribution of various relationships. For example, if the probability of a certain relationship is much higher than that of other relationships, the computer will determine that this high-probability relationship exists between the two image elements.
[0209] For example, consider crack detection on a mold surface. Assume the first image element represents a crack initiation point, and the second image element represents the crack extension. In step S530, the softmax classifier outputs a high probability that these two elements represent a "crack initiation point - crack extension" relationship. In step S540, the computer system, based on this high probability, determines that these two image elements do indeed share this "crack initiation point - crack extension" relationship in the mold machine vision image.
[0210] This judgment is crucial for subsequent defect identification and processing. Once the relationship between image elements is determined, the computer equipment can more accurately identify cracks, impurities, or other types of defects on the mold and take appropriate repair or replacement measures in a timely manner.
[0211] As an embodiment, any two image elements among the X image elements are regarded as the first image element and the second image element. Based on this, the method further includes: generating an element node relationship network corresponding to the mold machine vision image based on the element involvement relationship between the first image element and the second image element in the mold machine vision image; and integrating the element node relationship network corresponding to the mold machine vision image into a target image prior information library, wherein the element node relationship network includes the first image element, the second image element, and the element involvement relationship.
[0212] Specifically, after the computer analyzes the relationships between multiple image elements in the mold machine vision image, it can further use this information to construct an element node relationship network. This relationship network is a graph structure that can clearly show the connections and involvements between image elements.
[0213] Specifically, the computer device considers any two of the X image elements as the first image element and the second image element. Based on their element-to-element relationship in the mold machine vision image, it generates a relationship network consisting of nodes and edges. In this relationship network, each image element is represented as a node, and the relationship between elements is represented as edges connecting these nodes.
[0214] For example, consider crack detection on a mold surface. Assume the computer has determined the relationships between a series of image elements, such as which elements represent the crack's starting point, which are crack extensions, and which are normal areas unrelated to the crack. Based on this information, the computer constructs an element-node relationship network, where nodes represent individual image elements and edges represent relationships between them, such as "starting point-extension" relationships and "crack-normal area" relationships.
[0215] The computer also integrates this element node relationship network into a priori information base for the target image. This information base can be considered a knowledge graph of image elements, storing a wealth of prior knowledge about image elements and their relationships. By integrating the newly generated element node relationship network into this information base, the computer can continuously enrich and update its understanding of the mold surface image elements and their relationships.
[0216] This fusion process is crucial for improving the accuracy and efficiency of mold defect detection. First, by constructing a network of element nodes, the computer can more intuitively understand the relationships between image elements, enabling more accurate identification of mold defects. Second, by integrating this newly generated network into a priori information database, the computer can leverage historical data and prior knowledge to optimize its detection algorithm, improving both sensitivity and specificity. By constructing a network of element nodes and integrating it into a priori information database, this provides a new, knowledge-graph-based analytical approach for mold defect detection, helping to improve both accuracy and efficiency.
[0217] As an embodiment, the method further includes:
[0218] Step S10: Acquire a machine vision image of the mold to be inspected;
[0219] Step S20: performing target detection on the machine vision image of the mold to be inspected, and obtaining core components corresponding to the machine vision image of the mold to be inspected, wherein the core components include two image elements;
[0220] Step S30: searching the target image priori information library for a target element node relationship network that matches the core component content corresponding to the machine vision image of the mold to be inspected;
[0221] Step S40: generating a defect detection result of the machine vision image of the mold to be inspected based on the target element node relationship network.
[0222] In step S10, the computer device acquires a machine vision image of the mold to be inspected. This is accomplished, for example, by using a camera, scanner, or other image acquisition device. For example, a camera on a production line can capture images of the mold in real time and transmit them to the computer device for subsequent processing.
[0223] In step S20, the computer analyzes the acquired image using an object detection algorithm (such as YOLO, SSD, or Faster R-CNN) to identify the core components of the image. These components typically include various parts of the mold and potential defect areas. In this step, the algorithm outputs two or more image elements that are key components of the image and may be related to mold defects.
[0224] Taking a crack on a mold as an example, an object detection algorithm may identify the crack’s starting point and extension as two key image elements.
[0225] In step S30, the target image prior information library is searched for a target element node relationship network that matches the core component content. The computer device searches the previously established target image prior information library for an element node relationship network that matches the core component content identified in step S20. This library contains a large number of element node relationship networks of previously analyzed mold images, each of which describes the relationships and involvements between image elements. By searching for matching relationship networks, the computer device can leverage previous knowledge and experience to assist in current defect detection.
[0226] In step S40, once a matching target element node relationship network is found, the computer device can use this relationship network to generate defect detection results. For example, if a certain image element is identified in the relationship network as being related to a crack defect, the computer device will mark this element in the currently detected image and generate a corresponding defect report. This process is automated and can greatly improve the efficiency and accuracy of defect detection. In summary, the embodiments of the present application utilize historical data and knowledge in the target image prior information library to enable the computer device to more accurately identify defects on the mold, thereby improving the sensitivity and specificity of detection. The method acquires a mold machine vision image, which is composed of several image regions and includes X image elements, obtains candidate feature representations for each of the X image elements, where each image element corresponds to at least one candidate feature representation, performs a feature fusion operation on the candidate feature representations of each image element according to a saliency focus strategy, obtains an adjusted candidate feature representation for each image element, performs a merging operation on the adjusted candidate feature representations of each image element, obtains an image element feature representation for each image element, performs element relationship classification on the image element feature representations of the X image elements, and determines the element involvement relationships of the X image elements in the mold machine vision image. Based on this, the feature fusion operation on the candidate feature representations of each image element according to the saliency focus strategy can optimize the candidate feature representations of each image element to increase the accuracy of the obtained element involvement relationships between the image elements.
[0227] It should be noted that, in the embodiment of the present application, if the above-mentioned mold defect detection method based on deep learning is implemented in the form of a software function module and is sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific hardware, software or firmware, or any combination of hardware, software and firmware.
[0228] An embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.
[0229] The present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements some or all of the steps in the above method. The computer-readable storage medium may be transient or non-transient.
[0230] An embodiment of the present application provides a computer program, including computer-readable code. When the computer-readable code is run in a computer device, a processor in the computer device executes some or all of the steps for implementing the above method.
[0231] An embodiment of the present application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and when the computer program is read and executed by a computer, implements some or all of the steps in the above method. The computer program product can be implemented specifically by hardware, software, or a combination thereof. In some embodiments, the computer program product is embodied as a computer storage medium. In other embodiments, the computer program product is embodied as a software product, such as a software development kit (SDK), etc.
[0232] It should be noted that the descriptions of the various embodiments above tend to emphasize the differences between the various embodiments, and their similarities or similarities can be referenced to each other. The descriptions of the above device, storage medium, computer program, and computer program product embodiments are similar to the descriptions of the above method embodiments and have similar beneficial effects as the method embodiments. For technical details not disclosed in the embodiments of the device, storage medium, computer program, and computer program product of this application, please refer to the description of the method embodiments of this application for understanding.
[0233] Figure 2 A hardware entity diagram of a computer device provided in an embodiment of the present application is shown as follows: Figure 2 As shown, the hardware entity of the computer device 1000 includes: a processor 1001 and a memory 1002, wherein the memory 1002 stores a computer program that can be run on the processor 1001, and when the processor 1001 executes the program, the steps in the method of any of the above embodiments are implemented.
[0234] The memory 1002 stores computer programs that can be run on the processor. The memory 1002 is configured to store instructions and applications executable by the processor 1001. It can also cache data to be processed or processed by the processor 1001 and various modules in the computer device 1000 (for example, image data, audio data, voice communication data, and video communication data). This can be achieved through flash memory (FLASH) or random access memory (RAM).
[0235] When the processor 1001 executes the program, the steps of any of the above-mentioned mold defect detection methods based on deep learning are implemented. The processor 1001 generally controls the overall operation of the computer device 1000.
[0236] An embodiment of the present application provides a computer storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps of the deep learning-based mold defect detection method of any of the above embodiments.
[0237] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of the present application, please refer to the description of the method embodiments of the present application for understanding. The above-mentioned processor can be at least one of a target application integrated circuit (Application Specific Integrated Circuit, ASIC), a digital signal processor (Digital Signal Processor, DSP), a digital signal processing device (Digital Signal Processing Device, DSPD), a programmable logic device (Programmable Logic Device, PLD), a field programmable gate array (Field Programmable Gate Array, FPGA), a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, and a microprocessor. It is understandable that the electronic device that realizes the above-mentioned processor function can also be other, and the embodiments of the present application are not specifically limited.
[0238] The above-mentioned computer storage medium / memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); it can also be various terminals including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0239] It should be understood that the “one embodiment” or “an embodiment” mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, the “in one embodiment” or “in an embodiment” appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned steps / processes does not mean the order of execution. The order of execution of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments. It should be noted that, in this article, the terms “comprises”, “includes” or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. Without further constraints, an element defined by the phrase "comprises a..." does not exclude the existence of other identical elements in the process, method, article or apparatus that includes the element.
[0240] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0241] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed across multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment.
[0242] In addition, all functional units in the embodiments of the present application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the above-mentioned integrated units can be implemented in the form of hardware or in the form of hardware plus software functional units.
[0243] Those skilled in the art will understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, and other media that can store program codes.
[0244] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0245] The above is only an implementation method of the present application, but the scope of protection of the present application is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed in this application, which should be covered by the scope of protection of the present application.
Claims
1. A mold defect detection method based on deep learning, characterized in that: The method comprises: Acquire a mold machine vision image, wherein the mold machine vision image is composed of a plurality of image regions and includes X image elements, where X>1; Obtaining a candidate feature representation for each of the X image elements, where each image element corresponds to at least one candidate feature representation; Perform feature fusion operation on the candidate feature representation of each image element according to the saliency focus strategy to obtain the adjusted candidate feature representation of each image element; determining an image element feature representation for each image element based on the adjusted candidate feature representation for each image element; Performing element relationship classification on the image element feature representations of the X image elements to determine the element involvement relationship of the X image elements in the mold machine vision image.
2. The method according to claim 1, wherein Any one of the X image elements is regarded as a first image element, the first image element corresponds to Y candidate feature representations, and any one of the Y candidate feature representations of the first image element is regarded as the u-th candidate feature representation of the first image element; u and Y are both natural numbers greater than 0, and u≤Y; The step of performing a feature fusion operation on the candidate feature representation of each image element according to the saliency focus strategy to obtain the adjusted candidate feature representation of each image element includes: Obtaining commonality measurement coefficients between the u-th candidate feature representation of the first image element and each of the Y candidate feature representations of the first image element, to obtain a set of commonality measurement coefficients corresponding to the u-th candidate feature representation; Obtaining a preset parameter, and performing a downsampling operation on each commonality metric coefficient in the set of commonality metric coefficients corresponding to the u-th candidate feature representation based on the preset parameter, to obtain a downsampling operation result of each commonality metric coefficient in the set of commonality metric coefficients corresponding to the u-th candidate feature representation; Performing a normalization operation on downsampling operation results of each commonality metric coefficient in the commonality metric coefficient set corresponding to the u-th candidate feature representation to obtain an influence coefficient cluster corresponding to the u-th candidate feature representation; Performing eccentricity adjustment processing on the Y candidate feature representations of the first image element according to the influence coefficient cluster corresponding to the u-th candidate feature representation to obtain the adjusted u-th candidate feature representation of the first image element.
3. The method according to claim 2, wherein Any one of the Y candidate feature representations of the first image element is regarded as the vth candidate feature representation of the first image element; v is a natural number greater than 0, and v≤Y; obtaining commonality measurement coefficients between the uth candidate feature representation of the first image element and each candidate feature representation in the Y candidate feature representations of the first image element, and obtaining a set of commonality measurement coefficients corresponding to the uth candidate feature representation, includes: Get the first variable two-dimensional array and the first variable one-dimensional array; performing an integration operation on the uth candidate feature representation of the first image element and the vth candidate feature representation of the first image element based on the first variable two-dimensional array to obtain an integration operation result; Performing a nonlinear transformation on the integration operation result, and determining a commonality metric coefficient between the u-th candidate feature representation and the v-th candidate feature representation based on the integration operation result after the nonlinear transformation and the one-dimensional array of the first variable; Merging the commonality measurement coefficient between the u-th candidate feature representation and the v-th candidate feature representation into the commonality measurement coefficient set corresponding to the u-th candidate feature representation to obtain the commonality measurement coefficient set corresponding to the u-th candidate feature representation; The influence coefficient cluster corresponding to the u-th candidate feature representation includes Y influence coefficients, and the Y influence coefficients correspond one-to-one to the Y candidate feature representations corresponding to the first image element; The performing eccentricity adjustment processing on the Y candidate feature representations of the first image element according to the influence coefficient cluster corresponding to the u-th candidate feature representation to obtain the u-th candidate feature representation after adjustment of the first image element includes: Multiplying the Y candidate feature representations corresponding to the first image element by the Y influence coefficients corresponding to the u-th candidate feature representation to obtain an influence adjustment result of the Y candidate feature representations corresponding to the first image element; The influence adjustment results of the Y candidate feature representations corresponding to the first image element are summed to obtain the uth candidate feature representation after adjustment of the first image element.
4. The method according to claim 1, wherein The obtaining of a candidate feature representation for each of the X image elements includes: Performing an image block operation on the mold machine vision image to obtain an image block matrix corresponding to the mold machine vision image; Performing image embedding processing on the image block matrix to obtain an image embedding matrix corresponding to the image block matrix; According to the image embedding matrix of the image pixels contained in each image element, the candidate feature representation corresponding to each image element is determined.
5. The method according to claim 4, wherein Any one of the X image elements is regarded as a first image element, and the number of the first image elements distributed in the mold machine vision image is Y, where Y is a natural number greater than 0; The determining of a candidate feature representation corresponding to each image element based on an image embedding matrix of image pixels contained in each image element includes: Obtaining feature vectors of E image pixels corresponding to the u-th occurrence of the first image element in the mold machine vision image, where u≤Y and E is a natural number not equal to 0; Determining a commonality metric coefficient corresponding to the eigenvector of each image pixel in the E image pixels based on a one-dimensional array of preset variables and the eigenvectors of the E image pixels; performing a classification operation on the commonality metric coefficient corresponding to the feature vector of each image pixel in the E image pixels to obtain an influence coefficient corresponding to the feature vector of each image pixel in the E image pixels; According to the influence coefficient corresponding to the feature vector of each image pixel in the E image pixels, an eccentricity adjustment process is performed on the feature vectors of the E image pixels to obtain a uth candidate feature representation corresponding to the first image element.
6. The method according to claim 1, wherein Any image element among the X image elements is regarded as a first image element, and the first image element corresponds to Y candidate feature representations, where Y is a natural number greater than 0; The determining of the image element feature representation of each image element based on the adjusted candidate feature representation of each image element includes: If Y is equal to 1, determining the candidate feature representation after adjustment of the first image element as the image element feature representation of the first image element; If Y is greater than 1, a merging operation is performed on the adjusted Y candidate feature representations of the first image element to obtain an image element feature representation of the first image element.
7. The method according to claim 6, wherein The merging operation on the Y candidate feature representations after adjustment of the first image element to obtain the image element feature representation of the first image element includes: A mean calculation operation is performed on the Y candidate feature representations corresponding to the first image element to obtain an image element feature representation of the first image element.
8. The method according to claim 1, wherein Any two image elements among the X image elements are regarded as a first image element and a second image element; performing element relationship classification on image element feature representations of the X image elements to determine the element involvement relationship of the X image elements in the mold machine vision image includes: performing a feature combination operation on the image element feature representation of the first image element and the image element feature representation of the second image element to obtain a combined feature representation; Obtaining a second variable two-dimensional array and a second variable one-dimensional array, and performing a full connection operation on the combined feature representation according to the second variable two-dimensional array and the second variable one-dimensional array to obtain a fully connected combined feature representation; performing a classification operation on the fully connected combined feature representation to obtain confidence space information of the relationship between the first image element and the second image element; An element involvement relationship between the first image element and the second image element in the mold machine vision image is determined based on confidence space information of the relationship between the first image element and the second image element.
9. The method according to claim 1, wherein Any two image elements among the X image elements are regarded as the first image element and the second image element; the method further includes: Based on the element involvement relationship between the first image element and the second image element in the mold machine vision image, the first image element and the second image element generate an element node relationship network corresponding to the mold machine vision image; and the element node relationship network corresponding to the mold machine vision image is integrated into the target image prior information library, wherein the element node relationship network includes the first image element, the second image element and the element involvement relationship.
10. The method according to claim 9, wherein The method further comprises: Acquire machine vision images of the mold to be inspected; Performing target detection on the machine vision image of the mold to be inspected to obtain core components corresponding to the machine vision image of the mold to be inspected, wherein the core components include two image elements; Searching the target image prior information library for a target element node relationship network that matches the core component content corresponding to the machine vision image of the mold to be inspected; A defect detection result of the machine vision image of the mold to be inspected is generated based on the target element node relationship network.
11. A computer device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the program, the steps of the method according to any one of claims 1 to 10 are implemented.