A method for verifying the compliance of a cemented carbide tool based on image contrast
By combining a multi-scale adaptive Siamese neural network and an adaptive distance metric function, the problems of low efficiency, insufficient accuracy, and poor adaptability in the inspection of cemented carbide tools are solved, and high-precision and robust automated inspection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHUZHOU DONGYA TOOLS CO LTD
- Filing Date
- 2025-09-26
- Publication Date
- 2026-05-22
Smart Images

Figure CN121305126B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cemented carbide tool testing technology, and in particular to a method for verifying the conformity of cemented carbide tools based on image comparison. Background Technology
[0002] Carbide tools, as indispensable key components in modern manufacturing, are widely used in high-end manufacturing fields such as aerospace, automotive manufacturing, and precision machining. As manufacturing moves towards higher precision and efficiency, the quality requirements for carbide tools are becoming increasingly stringent. The geometric accuracy, surface quality, and dimensional conformity of these tools directly affect machining accuracy and production efficiency. Traditional quality inspection of carbide tools mainly relies on manual visual inspection and contact measurement methods, which are not only inefficient but also easily affected by the subjective factors and operational skills of the inspectors, making it difficult to meet the stringent requirements of modern production for inspection accuracy and consistency.
[0003] Currently, the most commonly used methods for inspecting carbide tools in industry include coordinate measuring machine (CMM) inspection, laser scanning measurement, and machine vision inspection. While CMMs offer high-precision dimensional measurements, they are slow, expensive, and limited to point-contact measurements, failing to comprehensively assess the tool's overall geometry and surface quality. Laser scanning measurement can quickly acquire the tool's three-dimensional geometry, but it requires high surface reflectivity, is prone to measurement errors when dealing with complex textures and coatings on carbide tool surfaces, and involves complex equipment with high maintenance costs.
[0004] While existing machine vision inspection methods offer advantages such as non-contact operation and high efficiency, most employ traditional image processing algorithms, including edge detection, template matching, and geometric feature extraction. These methods have significant limitations when dealing with the complex geometries and diverse surface features of carbide tools. Traditional edge detection algorithms are easily affected by changes in lighting, shadows, and reflections, making it difficult to accurately extract the tool's geometric contour information. Template matching methods are highly sensitive to changes in tool posture and size differences, lacking sufficient robustness and adaptability. Geometric feature-based inspection methods require pre-application of feature extraction rules, making them unsuitable for the diverse range of carbide tool types and shapes required in real-world applications.
[0005] While some deep learning-based tool detection methods have improved feature extraction capabilities in recent years, they generally suffer from problems such as simple network structures, rigid feature fusion strategies, and a lack of adaptive mechanisms. These methods often employ single-scale feature extraction, failing to fully capture the feature information of cemented carbide tools at different levels of detail, resulting in insufficient detection capabilities for subtle differences in tools. Existing methods mostly use fixed distance metrics for similarity calculation, failing to adjust evaluation strategies according to the geometric complexity of different tools. This lack of specificity in handling tools with simple and complex geometries affects the accuracy and reliability of detection.
[0006] Furthermore, current cemented carbide tool inspection technologies generally lack effective adaptability when dealing with challenges in real-world production environments, such as varying imaging conditions, differences in tool surface conditions, and diverse geometric complexities. Most existing methods require cumbersome parameter adjustments and algorithm optimizations for different application scenarios and tool types, making it difficult to achieve truly intelligent and automated inspection. Therefore, there is an urgent need to develop a novel inspection method that can adapt to different cemented carbide tool characteristics, possess multi-scale feature extraction capabilities, and employ intelligent similarity evaluation strategies to meet the technical requirements of modern manufacturing for cemented carbide tool quality inspection. Summary of the Invention
[0007] In view of this, the present invention provides a conformity verification method for cemented carbide tools based on image comparison. The purpose is to achieve comprehensive feature extraction of cemented carbide tool images by constructing a multi-scale adaptive Siamese neural network, enhance the expression of key features by combining a cross-attention mechanism, and dynamically adjust the similarity evaluation strategy according to the geometric complexity of the tool using an adaptive distance metric function. This enables high-precision, high-efficiency, and highly robust automated verification of the conformity of cemented carbide tools, meeting the technical requirements of modern manufacturing for the quality inspection of cemented carbide tools.
[0008] To achieve the above objectives, the present invention provides a conformity verification method for cemented carbide tools based on image comparison, comprising the following steps:
[0009] C1: Acquire high-resolution images of standard carbide tool parts, perform preprocessing steps such as size normalization, illumination equalization, and noise filtering on the images, and generate standardized standard part images.
[0010] C2: Acquire an image of the cemented carbide tool to be tested, and perform image standardization using the same preprocessing procedure as the standard part to generate a standardized image of the tool to be tested;
[0011] C3: The standardized standard part image and the standardized test tool image are respectively input into two shared weight branches of the multi-scale adaptive Siamese neural network. Features of different scales are extracted through the two shared weight branches, and two enhanced feature vectors are output by adaptive weight fusion and cross attention mechanism.
[0012] C4: An adaptive distance metric function is used to calculate the similarity score between two enhanced feature vectors. The adaptive distance metric function combines Euclidean distance and cosine similarity and dynamically adjusts the distance weight parameters according to the geometric complexity of the carbide tool.
[0013] C5: Compare the similarity score with the preset compliance threshold. If the similarity score exceeds the threshold, the tool under test is deemed to meet the standard requirements. Otherwise, it is deemed not to meet the requirements. Output the final compliance verification result and similarity quantification score.
[0014] As a further improvement of the present invention:
[0015] Optionally, step C1 involves acquiring a high-resolution image of a standard carbide tool part, performing preprocessing steps such as size normalization, illumination equalization, and noise filtering to generate a standardized standard part image, including:
[0016] Determine the imaging parameters of the standard carbide tool, including illumination intensity, imaging angle, and focal length;
[0017] The carbide tool standard part is placed on a standardized imaging platform for image acquisition, generating a standardized image of the standard part.
[0018] The preprocessing steps for image size normalization, illumination equalization, and noise filtering include:
[0019] Adjust the acquired standard part images to the preset resolution. ,in It is a positive integer;
[0020] Histogram equalization is performed on the adjusted image to eliminate the effects of uneven lighting.
[0021] A Gaussian filter is used to reduce noise in the image, with the filter parameters being: ,in This represents the standard deviation of the Gaussian kernel.
[0022] Optionally, in step C2, the image of the cemented carbide tool to be tested is acquired, and the image is standardized using the same preprocessing procedure as the standard part to generate a standardized image of the tool to be tested, including:
[0023] Images of the test tool are acquired using the same imaging parameters as those of the standard parts to obtain standardized images of the test tool.
[0024] Adjust the image of the tool under test to the same preset resolution. ;
[0025] Perform histogram equalization processing on the image of the tool to be tested;
[0026] Using the same parameters A Gaussian filter is used to reduce noise in the image of the tool under test.
[0027] Optionally, in step C3, the standardized standard part image and the standardized test tool image are respectively input into two shared weight branches of a multi-scale adaptive Siamese neural network. The multi-scale adaptive Siamese network extracts features at different scales, and uses adaptive weight fusion and cross-attention mechanisms to output two enhanced feature vectors, including:
[0028] Construct a multi-scale adaptive Siamese neural network, which contains two structurally identical shared weight branches, each of which is a convolutional neural network.
[0029] The weight parameters of the convolutional neural network in each shared weight branch are: ,in This represents a parameter matrix containing the weights of all convolutional and fully connected layers;
[0030] Set in the convolutional neural network of each shared weight branch There are 3 parallel feature extraction paths, each using convolutional kernels of different sizes for feature extraction. For positive integers, the first... The kernel size for each scale path is... ,in ;
[0031] An adaptive feature fusion mechanism is adopted to dynamically allocate the weights of features at each scale based on the dimensional characteristics of the cemented carbide tool;
[0032] Preprocessed standard parts images The input to the first shared weight branch of the convolutional neural network Each scale path is obtained. eigenvectors , … , Indicates the first Standard component image feature vectors extracted using a single-scale path;
[0033] Preprocessed image of the test tool The input to the second shared weight branch of the convolutional neural network Each scale path is obtained. eigenvectors , … , Indicates the first Feature vectors of the tool image extracted at each scale path;
[0034] Calculate the first Global feature statistics of each scale path The global feature statistics Including the The mean and standard deviation of the feature vectors of the standard component images of each scale path, and the first... The mean and standard deviation of the feature vectors of the tool image at each scale path;
[0035] The scale weights are calculated using a multilayer perceptron, as shown in the following formula:
[0036]
[0037]
[0038] in Indicates the first The vector output by the hidden layer of a multilayer perceptron with a scale path. Indicates the first Weights of each scale path, This represents the first-layer weight matrix. This represents the first-level bias vector. This represents the second-layer weight matrix. This represents the second-layer bias vector. This represents the modified linear unit activation function;
[0039] Applying the softmax function to normalize the weights yields the first... Normalized weights of each scale path ;
[0040] The fused feature vector is obtained through weighted fusion, as shown in the following formula:
[0041]
[0042]
[0043] in This represents the fused feature vector of the standard part. This represents the fused feature vector of the test tool;
[0044] The formula for calculating the query, key, and value transformation matrix is as follows:
[0045]
[0046] in This represents a standard parts query vector. Represents the key vector of the tool to be tested. Represents the vector of values of the instrument to be tested. These represent the transformation matrices for the query, key, and value, respectively.
[0047] The cross-attention weights are calculated using the following formula:
[0048]
[0049] in Indicates attention weights, Represents the sigmoid activation function. Indicates the scaling factor;
[0050] The feature representation is updated based on attention weights, as shown in the following formula:
[0051]
[0052]
[0053] in This represents the enhanced feature vector of the standard part. This represents the enhanced feature vector of the tool under test.
[0054] This step achieves refined feature extraction and intelligent feature enhancement of carbide tool images by constructing a multi-scale adaptive Siamese neural network, which has significant technical advantages. First, the multi-scale parallel feature extraction path can simultaneously capture feature information of carbide tools at different granular levels. Small-sized convolutional kernels focus on extracting fine textures and local details of the tool surface, medium-sized convolutional kernels focus on capturing the edge contours and structural features of the tool, and large-sized convolutional kernels are responsible for extracting the overall shape and global geometric features of the tool. This multi-scale parallel processing method ensures the comprehensiveness and completeness of feature extraction.
[0055] The adaptive feature fusion mechanism in this step dynamically adjusts the importance weights of features at each scale based on the actual size characteristics of the cemented carbide tool. This avoids the feature information loss or redundancy problems that may occur in traditional fixed-weight fusion methods, enabling the algorithm to automatically optimize feature representation strategies for different types and specifications of cemented carbide tools. The Siamese network architecture ensures that the standard part image and the image of the tool under test are processed in the exact same feature space by sharing weight parameters, eliminating feature biases that may be caused by differences in network parameters and providing a reliable basis for subsequent similarity comparisons.
[0056] Optionally, step C4 employs an adaptive distance metric function that combines Euclidean distance and cosine similarity, dynamically adjusting the distance weight parameters based on the geometric complexity of the carbide tool, to calculate a similarity score between the two enhanced feature vectors, including:
[0057] Calculate the enhanced feature vector of the standard part and the enhanced feature vector of the test tool Euclidean distance between ;
[0058] Calculate the enhanced feature vector of the standard part and the enhanced feature vector of the test tool Cosine similarity between ;
[0059] Based on the geometric complexity of cemented carbide tools Calculate adaptive weight parameters The formula is as follows:
[0060]
[0061] in Indicates the adaptive weight parameters. Indicates the adjustment parameter. Represents the geometric complexity index. Indicates the complexity threshold; Represents the natural constant; the geometric complexity index is specifically:
[0062]
[0063] in Indicates the perimeter of the outline. Represents the area of the outline. Represents pi (π). Indicates the number of corner points. Indicates the total number of contour points;
[0064] The formula for calculating the overall similarity score is as follows:
[0065]
[0066] in This represents the final similarity score. This represents the distance normalization parameter.
[0067] This step achieves intelligent and precise evaluation of carbide tool conformity verification by employing an adaptive distance metric function, demonstrating significant technical advantages. Traditional similarity calculation methods typically use a single distance metric, which cannot adequately adapt to the diverse geometric features and complexity variations of carbide tools. This step innovatively combines Euclidean distance and cosine similarity, two complementary metrics, fully leveraging their respective strengths. Euclidean distance accurately reflects the absolute differences in the numerical magnitude of feature vectors, making it particularly suitable for detecting significant changes in tool size and shape. Cosine similarity, on the other hand, focuses on the similarity along the direction of feature vectors, making it more sensitive to the relative patterns and structural relationships of features.
[0068] Optionally, in step C5, the similarity score is compared with a preset compliance threshold. If the similarity score exceeds the threshold, the tool under test is determined to meet the standard requirements; otherwise, it is determined to be non-compliant. The final compliance verification result and similarity quantification score are output, including:
[0069] Set compliance threshold ,in ;
[0070] when The test tool is determined to meet the standard requirements.
[0071] when If the test tool does not meet the standard requirements, it is determined that the test tool does not meet the standard requirements.
[0072] Output verification results And quantitative scoring .
[0073] Compared with the prior art, the present invention has at least the following beneficial effects:
[0074] This invention employs a multi-scale adaptive Siamese neural network architecture. By setting parallel feature extraction paths of different sizes, it can simultaneously capture feature information of cemented carbide tools at multiple levels, including detailed texture, edge contours, and overall shape. Compared to traditional single-scale feature extraction methods, it exhibits stronger feature representation capabilities and higher detection accuracy. The adaptive feature fusion mechanism dynamically allocates the weights of features at each scale based on the actual size characteristics of the tool, avoiding the feature information loss or redundancy problems that may occur with fixed-weight fusion. This allows the algorithm to automatically optimize feature representation strategies for different types and specifications of cemented carbide tools, significantly improving the method's adaptability and generalization ability.
[0075] The cross-attention mechanism introduced in this invention enables intelligent enhanced interaction between the features of the standard part and the features of the tool under test. By calculating the correlation weights between the two, it automatically focuses on the feature regions most critical to conformity determination, while suppressing interference from irrelevant noise features, significantly improving the algorithm's sensitivity to subtle differences in cemented carbide tools. The Siamese network architecture ensures that the standard part and the tool under test are processed in the exact same feature space by sharing weight parameters, eliminating feature bias caused by parameter differences and providing a reliable basis for similarity comparison. This design not only improves the discriminative power of feature representations but also enhances the stability and robustness of the algorithm in complex imaging environments, especially performing exceptionally well in handling challenges in real-world production environments such as changes in illumination, shadow interference, and surface reflection.
[0076] This invention innovatively combines Euclidean distance and cosine similarity—two complementary metrics—into an adaptive distance metric function. It dynamically adjusts weight allocation based on the geometric complexity of the carbide tool, achieving a differentiated evaluation strategy for tools of varying complexity. For tools with simple geometries, the algorithm prioritizes the consistency of the overall shape pattern, while for complex tools, it focuses on the precise matching of specific values. This adaptive mechanism significantly improves the accuracy and relevance of similarity evaluation. Attached Figure Description
[0077] Figure 1 This is a flowchart illustrating a conformity verification method for cemented carbide tools based on image comparison, according to an embodiment of the present invention.
[0078] Figure 2 A schematic diagram of a standardized part;
[0079] Figure 3 The diagram shows the feature vectors extracted from standard parts images by different paths of a multi-scale adaptive Siamese neural network. (a) Feature vector extraction result with a convolution kernel size of 3×3, (b) Feature vector extraction result with a convolution kernel size of 5×5, and (c) Feature vector extraction result with a convolution kernel size of 7×7.
[0080] Figure 4 This is a diagram illustrating attention weights. Detailed Implementation
[0081] The present invention will be further described below with reference to the accompanying drawings, but this is not intended to limit the present invention in any way. Any modifications or substitutions made based on the teachings of the present invention shall fall within the protection scope of the present invention.
[0082] Example 1: A conformity verification method for cemented carbide tools based on image comparison, such as... Figure 1 As shown, it includes the following steps:
[0083] C1: Acquire high-resolution images of standard carbide tool parts, perform preprocessing steps such as size normalization, illumination equalization, and noise filtering to generate standardized standard part images, such as... Figure 2 As shown:
[0084] Determine the imaging parameters of the standard carbide tool, including illumination intensity, imaging angle, and focal length;
[0085] The carbide tool standard part is placed on a standardized imaging platform for image acquisition;
[0086] The process of performing size normalization, illumination equalization, and noise filtering on the image to obtain a standardized standard part image includes:
[0087] Adjust the acquired standard part images to the preset resolution. ,in It is a positive integer;
[0088] Histogram equalization is performed on the adjusted image to eliminate the effects of uneven lighting.
[0089] A Gaussian filter is used to reduce noise in the image, with the filter parameters being: ,in In this embodiment, the standard deviation of the Gaussian kernel is represented. Set to 1.2, Gaussian kernel size is 5×5.
[0090] C2: Acquire an image of the cemented carbide tool to be tested, and perform image normalization using the same preprocessing procedure as for standard parts to generate a standardized image of the tool to be tested.
[0091] Images of the test tool are acquired using the same imaging parameters as those of the standard parts to obtain standardized images of the test tool.
[0092] The image standardization process, which uses the same preprocessing steps as standard parts, includes:
[0093] Adjust the image of the tool under test to the same preset resolution. ;
[0094] Perform histogram equalization processing on the image of the tool to be tested;
[0095] Using the same parameters A Gaussian filter is used to reduce noise in the image of the tool under test.
[0096] C3: The standardized image of the standard part and the standardized image of the test tool are input into two shared weight branches of the multi-scale adaptive Siamese neural network, respectively. Features at different scales are extracted through the two shared weight branches, and two enhanced feature vectors are output using adaptive weight fusion and cross-attention mechanisms.
[0097] Construct a multi-scale adaptive Siamese neural network, which contains two structurally identical shared weight branches, each of which is a convolutional neural network.
[0098] The weight parameters of the convolutional neural network in each shared weight branch are: ,in This represents a parameter matrix containing the weights of all convolutional and fully connected layers;
[0099] Set in the convolutional neural network of each shared weight branch There are 3 parallel feature extraction paths, each using convolutional kernels of different sizes for feature extraction. are positive integers and , No. The kernel size for each scale path is... ,in In this embodiment, the kernel sizes of the three parallel paths are 3×3, 5×5, and 7×7, respectively. Each path contains three convolutional layers with 64, 128, and 256 channels, respectively. Figure 3 As shown;
[0100] An adaptive feature fusion mechanism is adopted to dynamically allocate the weights of features at each scale based on the dimensional characteristics of the cemented carbide tool;
[0101] Preprocessed standard parts images The input to the first shared weight branch of the convolutional neural network Each scale path is obtained. eigenvectors , … , Indicates the first Standard component image feature vectors extracted using a single-scale path;
[0102] Preprocessed image of the test tool The input to the second shared weight branch of the convolutional neural network Each scale path is obtained. eigenvectors , … , Indicates the first Feature vectors of the tool image extracted at each scale path;
[0103] Calculate the first The global feature statistics for each scale path are calculated using the following formula:
[0104]
[0105] in, Indicates the first A 4-dimensional global feature statistics vector for each scale path. This represents the mean calculation function. This represents the function for calculating standard deviation.
[0106] The scale weights are calculated using a multilayer perceptron, and the calculation formula is as follows:
[0107]
[0108]
[0109] in, Let represent the vector output by the hidden layer of the multilayer perceptron at the i-th scale path. Indicates the first Weight scores for each scale path, This represents the first-layer weight matrix. This represents the first-level bias vector. This represents the second-layer weight matrix. This represents the second-layer bias vector. This represents the modified linear unit activation function;
[0110] The softmax function is used for weight normalization, and the calculation formula is as follows:
[0111]
[0112] in, Indicates the first Normalized weights for each scale path Represents the natural constant;
[0113] The fused feature vector is obtained through weighted fusion, and the calculation formula is as follows:
[0114]
[0115]
[0116] in, This represents the fused feature vector of the standard part. This represents the fused feature vector of the test tool;
[0117] The query, key, and value transformation matrix is calculated using the following formula:
[0118]
[0119] in This represents a standard parts query vector. Represents the key vector of the tool to be tested. Represents the vector of values of the instrument to be tested. These represent the transformation matrices for the query, key, and value, respectively.
[0120] The cross-attention weights are calculated using the following formula:
[0121]
[0122] in, Representing attention weights, such as Figure 4 As shown, Represents the sigmoid activation function. Indicates the scaling factor;
[0123] The feature representation is updated based on attention weights, and the calculation formula is as follows:
[0124]
[0125]
[0126] in, This represents the enhanced feature vector of the standard part. This represents the enhanced feature vector of the tool under test.
[0127] C4: An adaptive distance metric function is used, which combines Euclidean distance and cosine similarity, and dynamically adjusts the distance weight parameters according to the geometric complexity of the carbide tool to calculate the similarity score between the two enhanced feature vectors.
[0128] Calculate the enhanced feature vector of the standard part and the enhanced feature vector of the test tool The Euclidean distance between them is calculated using the following formula:
[0129]
[0130] in Represents Euclidean distance. Represents the L2 norm;
[0131] Calculate the enhanced feature vector of the standard part and the enhanced feature vector of the test tool The cosine similarity between them is calculated using the following formula:
[0132]
[0133] in Represents cosine similarity. This represents the dot product of two eigenvectors;
[0134] Based on the geometric complexity of cemented carbide tools Calculate adaptive weight parameters The calculation formula is as follows:
[0135]
[0136] in, Indicates the adaptive weight parameters. Indicates the adjustment parameter. Represents the geometric complexity index. Indicates the complexity threshold; Represents the natural constant; in this embodiment, Set to 5.0. The value is set to 1.5; the specific geometric complexity index is:
[0137]
[0138] in, Indicates the perimeter of the outline. Represents the area of the outline. Represents pi (π). Indicates the number of corner points. This represents the total number of contour points. In this embodiment, contour extraction uses the Canny edge detection algorithm, corner detection uses the Harris corner detector, and the corner detection threshold is set to 0.01. When the tool surface has complex textures or microstructures, fractal dimension can be introduced as a supplementary indicator of geometric complexity. ,in Denotes the fractal dimension. , , The weight coefficients represent the various factors, and the fractal dimension is calculated using the box counting method.
[0139] The overall similarity score is calculated using the following formula:
[0140]
[0141] in This represents the final similarity score. This represents the distance normalization parameter; in this embodiment, Set to 227; considering that the distance value may be close to 227 in extreme cases. The problem of the denominator approaching zero can be solved by smoothing: ,in This represents the hyperbolic tangent function.
[0142] C5: Compare the similarity score with a preset compliance threshold. If the similarity score exceeds the threshold, the tool under test is deemed to meet the standard requirements; otherwise, it is deemed not to meet the requirements. The final compliance verification result and similarity quantification score are output.
[0143] Set compliance threshold ,in In this embodiment, Set to 0.75;
[0144] when The test tool is determined to meet the standard requirements.
[0145] when If the test tool does not meet the standard requirements, it is determined that the test tool does not meet the standard requirements.
[0146] Output verification results And quantitative scoring .
[0147] It should be noted that the sequence numbers of the above embodiments of the present invention are merely for descriptive purposes and do not represent the superiority or inferiority of the embodiments. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, apparatus, article, or method. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.
[0148] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0149] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A method for conformity verification of cemented carbide tools based on image comparison, characterized in that, Includes the following steps: C1: Acquire high-resolution images of standard carbide tool parts, perform preprocessing steps such as size normalization, illumination equalization, and noise filtering on the images, and generate standardized standard part images. C2: Acquire an image of the cemented carbide tool to be tested, and perform image standardization processing using the same preprocessing procedure as the standard part to generate a standardized image of the tool to be tested; C3: The standardized standard part image and the standardized test tool image are respectively input into two shared weight branches of the multi-scale adaptive Siamese neural network. Features of different scales are extracted through the two shared weight branches, and two enhanced feature vectors are output by adaptive weight fusion and cross attention mechanism. C4: An adaptive distance metric function is used to calculate the similarity score between two enhanced feature vectors. The adaptive distance metric function combines Euclidean distance and cosine similarity and dynamically adjusts the distance weight parameters according to the geometric complexity of the carbide tool. Step C4 includes: Calculate the enhanced feature vector of the standard part and the enhanced feature vector of the test tool Euclidean distance between ; Calculate the enhanced feature vector of the standard part and the enhanced feature vector of the test tool Cosine similarity between ; Based on the geometric complexity of cemented carbide tools Calculate adaptive weight parameters The calculation formula is as follows: ; in, Indicates the adaptive weight parameters. Indicates the adjustment parameter. Represents the geometric complexity index. Indicates the complexity threshold; Represents the natural constant; the geometric complexity index is specifically: ; in, Indicates the perimeter of the outline. Represents the area of the outline. Represents pi (π). Indicates the number of corner points. Indicates the total number of contour points; The overall similarity score is calculated using the following formula: ; in, This represents the final similarity score. This represents the distance normalization parameter; C5: Compare the similarity score with the preset compliance threshold. If the similarity score exceeds the threshold, the tool under test is deemed to meet the standard requirements; otherwise, it is deemed not to meet the requirements. Output the final compliance verification result and similarity quantification score.
2. The image comparison-based conformity verification method for cemented carbide tools according to claim 1, characterized in that, Step C1 includes: Determine the imaging parameters of the standard carbide tool, including illumination intensity, imaging angle, and focal length; The carbide tool standard part is placed on a standardized imaging platform for image acquisition, generating a standardized image of the standard part. The preprocessing steps for image size normalization, illumination equalization, and noise filtering include: Adjust the acquired standard part images to the preset resolution. ,in It is a positive integer; Histogram equalization is performed on the adjusted image to eliminate the effects of uneven lighting. A Gaussian filter is used to reduce noise in the image, with the filter parameters being: ,in This represents the standard deviation of the Gaussian kernel.
3. The image comparison-based conformity verification method for cemented carbide tools according to claim 2, characterized in that, Step C2 includes: Images of the test tool are acquired using the same imaging parameters as those of the standard parts to obtain standardized images of the test tool. Adjust the image of the tool under test to the same preset resolution. ; Perform histogram equalization processing on the image of the tool to be tested; Using the same parameters A Gaussian filter is used to reduce noise in the image of the tool under test.
4. The image comparison-based conformity verification method for cemented carbide tools according to claim 3, characterized in that, Step C3 includes: Construct a multi-scale adaptive Siamese neural network, which contains two structurally identical shared weight branches, each of which is a convolutional neural network. The weight parameters of the convolutional neural network in each shared weight branch are: ,in This represents a parameter matrix containing the weights of all convolutional and fully connected layers; Set in the convolutional neural network of each shared weight branch There are 3 parallel feature extraction paths, each using convolutional kernels of different sizes for feature extraction. For positive integers, the first... The kernel size for each scale path is... ,in ; An adaptive feature fusion mechanism is adopted to dynamically allocate the weights of features at each scale based on the dimensional characteristics of the cemented carbide tool; Preprocessed standard parts images The input to the first shared weight branch of the convolutional neural network Each scale path is obtained. eigenvectors , … , Indicates the first Standard component image feature vectors extracted using a single-scale path; Preprocessed image of the test tool The input to the second shared weight branch of the convolutional neural network Each scale path is obtained. eigenvectors , … , Indicates the first Feature vectors of the tool image extracted at each scale path; Calculate the first Global feature statistics of each scale path The global feature statistics Including the The mean and standard deviation of the feature vectors of the standard component images of each scale path, and the first... The mean and standard deviation of the feature vectors of the tool image at each scale path; The scale weights are calculated using a multilayer perceptron, and the calculation formula is as follows: ; ; in, Let represent the vector output by the hidden layer of the multilayer perceptron for the i-th scale path. Indicates the first Weights of each scale path, This represents the first-layer weight matrix. This represents the first-level bias vector. This represents the second-layer weight matrix. This represents the second-layer bias vector. This represents the modified linear unit activation function; Applying the softmax function to normalize the weights yields the first... Normalized weights of each scale path ; The fused feature vector is obtained through weighted fusion, and the calculation formula is as follows: ; ; in, This represents the fused feature vector of the standard part. This represents the fused feature vector of the test tool; Two enhanced feature vectors are output using a cross-attention mechanism.
5. The image comparison-based conformity verification method for cemented carbide tools according to claim 4, characterized in that, The cross-attention mechanism includes: The query, key, and value transformation matrix is calculated using the following formula: ; in, This represents a standard parts query vector. Represents the key vector of the tool to be tested. Represents the vector of values of the instrument to be tested. These represent the transformation matrices for the query, key, and value, respectively. The cross-attention weights are calculated using the following formula: ; in, Indicates attention weights, Represents the sigmoid activation function. Indicates the scaling factor; Update feature representations based on attention weights: ; ; in, This represents the enhanced feature vector of the standard part. This represents the enhanced feature vector of the tool under test.
6. The image comparison-based conformity verification method for cemented carbide tools according to claim 5, characterized in that, Step C5 includes: Set compliance threshold ,in, ; when The test tool is determined to meet the standard requirements. when If the test tool does not meet the standard requirements, it is determined that the test tool does not meet the standard requirements. Output verification results And quantitative scoring .
Citation Information
Patent Citations
Seal identification method and device and storage medium
CN115810196A
New material production and processing process quality inspection method and system
CN119721855A