Beer cap defect detection system and method based on computer vision

Through a computer vision-based detection system, the comparison of feature extraction flow structure and reference images is solved, and the problem of low efficiency and susceptible to subjective factors is achieved, and efficient and accurate detection of beer cover defects is achieved.

CN118411557BActive Publication Date: 2025-02-07TIBET SANGDANGANG HIGHLAND BARLEY WINE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410517029.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-28
Publication Date
2025-02-07
Estimated Expiration
2044-04-28

AI Technical Summary

Technical Problem

Traditional beer cover defect detection relies on artificial visual inspection, which has problems such as high labor intensity, low efficiency, and susceptible to subjective factors.

Method used

Using a computer vision-based detection system, the image semantic features of beer cover images are captured through feature extraction fork flow structures, and compared with the features of the labeled defect-free reference images, quantifying the differences to achieve defect detection and recognition.

Benefits of technology

It improves the efficiency and accuracy of beer cover defect detection, reduces manual intervention, and can identify beer cover defects in real time and automatically.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118411557B_ABST
    Figure CN118411557B_ABST
Patent Text Reader

Abstract

The present application discloses a beer cap defect detection system and method based on computer vision, which utilizes computer vision technology and intelligent algorithms to respectively capture the image semantic features of a beer cap image of a beer cap to be detected and the image semantic features of a set of beer cap reference images that are marked as defect-free with a branch flow structure, and realizes defect detection and identification of beer caps by quantifying the difference in image semantic features between the two.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of intelligent detection, and more specifically, to a beer cap defect detection system and method based on computer vision. Background Art

[0002] With the rapid development of the beer industry, beer caps, as an important part of beer packaging, have a direct impact on the product's appearance and sealing performance, which in turn affects consumers' purchasing decisions and the company's brand image. Therefore, efficient quality testing of beer caps is of great practical significance.

[0003] Traditional beer cap defect detection mainly relies on manual visual inspection, which has the disadvantages of high labor intensity, low efficiency, and susceptibility to subjective factors. Therefore, an optimized beer cap defect detection system and method are expected. Summary of the invention

[0004] In order to solve the above technical problems, the present application is proposed. The embodiments of the present application provide a beer cap defect detection system and method based on computer vision, which uses computer vision technology and intelligent algorithms to capture the image semantic features of the beer cap image of the beer cap to be detected and the image semantic features of the set of beer cap reference images marked as defect-free with a bifurcated flow structure, and realizes the defect detection and identification of the beer cap by quantifying the difference in the image semantic features between the two.

[0005] According to one aspect of the present application, a method for detecting beer cap defects based on computer vision is provided, which comprises:

[0006] Acquire a beer cap image of the beer cap to be detected captured by a camera;

[0007] Extracting a set of beer cap reference images marked as defect-free from a background database;

[0008] Using a feature extraction fork structure to process the set of labeled defect-free beer cap reference images and the beer cap image to obtain a reference beer cap mark aggregation feature matrix and a beer cap detection feature matrix; and

[0009] Whether the beer cap to be inspected has a defect is determined based on the similarity between the reference beer cap mark aggregation feature matrix and the beer cap detection feature matrix.

[0010] According to another aspect of the present application, a beer cap defect detection system based on computer vision is provided, which comprises:

[0011] The image acquisition module to be detected is used to acquire the beer cap image of the beer cap to be detected collected by the camera;

[0012] A reference image acquisition module, used to extract a set of reference images of beer caps marked as defect-free from a background database;

[0013] A feature extraction module, used for processing the set of the labeled defect-free beer cap reference images and the beer cap image using a feature extraction bifurcation structure to obtain a reference beer cap mark aggregation feature matrix and a beer cap detection feature matrix; and

[0014] The detection result module is used to determine whether the beer cap to be detected has defects based on the similarity between the reference beer cap mark aggregation feature matrix and the beer cap detection feature matrix.

[0015] Compared with the prior art, the present application provides a computer vision-based beer cap defect detection system and method, which utilize computer vision technology and intelligent algorithms to capture the image semantic features of the beer cap image to be inspected and the image semantic features of a set of labeled defect-free beer cap reference images with a branch flow structure, and realizes defect detection and identification of the beer cap by quantifying the difference in image semantic features between the two. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] By describing the embodiments of the present application in more detail in conjunction with the accompanying drawings, the above and other purposes, features and advantages of the present application will become more apparent. The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the accompanying drawings, the same reference numerals generally represent the same components or steps.

[0017] Figure 1 is a flowchart of a beer cap defect detection method based on computer vision according to an embodiment of the present application;

[0018] Figure 2 is a system architecture diagram of a beer cap defect detection method based on computer vision according to an embodiment of the present application;

[0019] Figure 3 is a flowchart of the training phase of the beer cap defect detection method based on computer vision according to an embodiment of the present application;

[0020] Figure 4 is a flowchart of sub-step S3 of the beer cap defect detection method based on computer vision according to an embodiment of the present application;

[0021] Figure 5 is a flowchart of sub-step S31 of the beer cap defect detection method based on computer vision according to an embodiment of the present application;

[0022] Figure 6 It is a block diagram of a beer cap defect detection system based on computer vision according to an embodiment of the present application. DETAILED DESCRIPTION

[0023] Below, the exemplary embodiments according to the present application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application, and it should be understood that the present application is not limited to the exemplary embodiments described here.

[0024] As shown in this application and claims, unless the context clearly indicates an exception, the words "a", "an", "an" and / or "the" do not refer to the singular and may also include the plural. Generally speaking, the terms "include" and "comprise" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements.

[0025] Although the present application makes various references to certain modules in the system according to the embodiments of the present application, any number of different modules can be used and run on the user terminal and / or server. The modules are only illustrative, and different aspects of the system and method can use different modules.

[0026] Flowcharts are used in the present application to illustrate the operations performed by the system according to the embodiments of the present application. It should be understood that the preceding or following operations are not necessarily performed accurately in order. On the contrary, various steps may be processed in reverse order or simultaneously as required. Meanwhile, other operations may also be added to these processes, or a certain step or several steps of operations may be removed from these processes.

[0027] Below, the exemplary embodiments according to the present application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application, and it should be understood that the present application is not limited to the exemplary embodiments described here.

[0028] Traditional beer cap defect detection mainly relies on manual visual inspection, which has the disadvantages of high labor intensity, low efficiency, and susceptibility to subjective factors. Therefore, an optimized beer cap defect detection system and method are expected.

[0029] In the technical solution of the present application, a beer cap defect detection method based on computer vision is proposed. Figure 1 The figure is a flowchart of a beer cap defect detection method based on computer vision according to an embodiment of the present application. Figure 2 FIG. 1 is a system architecture diagram of a beer cap defect detection method based on computer vision according to an embodiment of the present application. Figure 1 and Figure 2As shown, according to the embodiment of the present application, the beer cap defect detection method based on computer vision includes the steps of: S1, acquiring a beer cap image of the beer cap to be detected captured by a camera; S2, extracting a set of beer cap reference images marked as non-defective from a background database; S3, using a feature extraction branch flow structure to process the set of beer cap reference images marked as non-defective and the beer cap image to obtain a reference beer cap mark aggregation feature matrix and a beer cap detection feature matrix; and, S4, determining whether the beer cap to be detected has defects based on the similarity between the reference beer cap mark aggregation feature matrix and the beer cap detection feature matrix.

[0030] In particular, the step S1 obtains a beer cap image of the beer cap to be inspected captured by a camera. The camera is used as an image acquisition device to capture the state information of the beer cap to be inspected in real time, providing important raw data for detecting and identifying defects of the beer cap. In addition, the image acquisition by the camera is non-contact, and will not cause physical damage to the beer cap, nor affect the normal operation of the production line.

[0031] In particular, the S2 extracts a set of labeled non-defective beer cap reference images from the background database. Here, the set of labeled non-defective beer cap reference images provides benchmark information, that is, provides the system with image information of non-defective beer caps, so that the subsequent model can intelligently identify the beer cap image of the beer cap to be detected by learning the core image semantic features of the set of labeled non-defective beer cap reference images.

[0032] In particular, the S3 uses a feature extraction branch flow structure to process the set of the labeled defect-free beer cap reference images and the beer cap image to obtain a reference beer cap mark aggregation feature matrix and a beer cap detection feature matrix. In particular, in a specific example of the present application, Figure 4 As shown, the S3 includes: S31, performing image feature extraction and image feature aggregation on the set of the labeled defect-free beer cap reference images to obtain the reference beer cap mark aggregation feature matrix; and, S32, performing image feature extraction on the beer cap images to obtain the beer cap detection feature matrix.

[0033] Specifically, the step S31 is to extract and aggregate image features from the set of reference images of beer caps that are marked as defect-free to obtain the reference beer cap marker aggregate feature matrix. In particular, in a specific example of the present application, Figure 5As shown, the S31 includes: S311, passing each labeled defect-free beer cap reference image in the set of labeled defect-free beer cap reference images through a beer cap image feature extractor based on a convolutional neural network model to obtain a set of reference beer cap feature matrices; and, S312, passing the set of reference beer cap feature matrices through a landmark feature extraction network to obtain the reference beer cap landmark aggregation feature matrix.

[0034] More specifically, in S311, each of the labeled non-defective beer cap reference images in the set of labeled non-defective beer cap reference images is respectively passed through a beer cap image feature extractor based on a convolutional neural network model to obtain a set of reference beer cap feature matrices. Here, the convolutional neural network extracts implicit local features of the image from each of the labeled non-defective beer cap reference images through layer-by-layer convolution and pooling processing, and converts these implicit local features into high-dimensional feature representations, so that it can describe and characterize the image content and semantic information of each of the labeled non-defective beer cap reference images. In a specific example, each layer of the beer cap image feature extractor based on the convolutional neural network model performs the following operations on the input data in the forward pass of the layer: convolution processing on the input data to obtain a convolutional feature map; pooling the convolutional feature map along the channel dimension to obtain a pooled feature map; and nonlinear activation on the pooled feature map to obtain an activation feature map; wherein the output of the last layer of the beer cap image feature extractor based on the convolutional neural network model is the set of the reference beer cap feature matrices, and the input of the first layer of the beer cap image feature extractor based on the convolutional neural network model is each labeled defect-free beer cap reference image in the set of labeled defect-free beer cap reference images.

[0035] Convolutional Neural Network (CNN) is a deep learning model that is specifically designed to process data with a grid structure, such as images and speech. The core idea of ​​CNN is to extract features of input data through convolution operations, and to perform high-level representation and abstraction of features by stacking layers. The following are the basic components and working principles of CNN: Convolution layer: The convolution layer is the core component of CNN and is used to extract features of input data. It performs convolution operations on input data by applying a set of learnable convolution kernels (filters). Convolution operations can capture local patterns and features in input data and generate a series of feature maps; Activation function: After the convolution layer, a nonlinear activation function such as ReLU is usually applied. The activation function introduces nonlinear features, allowing the network to learn more complex patterns and representations; Pooling layer: The pooling layer is used to reduce the size and number of parameters of the feature map and extract the most important features. Common pooling operations include maximum pooling and average pooling; Fully connected layer: After a series of convolutional and pooling layers, some fully connected layers are usually added. The fully connected layer converts the feature map of the previous layer into an output result, such as classification or regression; Dropout: In order to prevent overfitting, Dropout technology is often used in CNN. Dropout randomly discards a part of neurons during the training process to reduce the dependency between neurons and improve the generalization ability of the model. Through the back propagation algorithm, CNN can automatically learn to extract features from the input data and optimize according to the training objectives. During the training process, CNN adjusts the network parameters by minimizing the loss function so that the output results are as close to the true labels as possible.

[0036] More specifically, in S312, the set of reference beer cap feature matrices is passed through a mark feature extraction network to obtain the reference beer cap mark aggregation feature matrix. In particular, in a specific example of the present application, the feature difference coefficients of each reference beer cap feature matrix in the set of reference beer cap feature matrices relative to other reference beer cap feature matrices are calculated to obtain a sequence of feature difference coefficients; the sequence of feature difference coefficients is normalized to obtain a sequence of normalized feature difference coefficients; the sequence of normalized feature difference coefficients is masked using a gating unit to obtain a sequence of masked feature difference coefficients; and, the weighted sum of the set of reference beer cap feature matrices is calculated using the sequence of masked feature difference coefficients as weights to obtain the reference beer cap mark aggregation feature matrix. Considering that although obtaining a set of labeled defect-free beer cap reference images and performing image feature extraction on them can capture the diversity feature information about the beer cap status contained therein, the set of labeled defect-free beer cap reference images may contain some redundant information or background information, which may cause a deviation in the expression of the core state of the beer cap reference images. In the technical solution of the present application, it is expected that the set of reference beer cap feature matrices is passed through a landmark feature extraction network to capture the core feature distribution and essential image semantic information of the set of labeled defect-free beer cap reference images, thereby obtaining a reference beer cap landmark cluster feature matrix. Specifically, the landmark feature extraction network highlights its own contribution and importance by measuring the overall difference information between each of the reference beer cap feature matrices and other reference beer cap feature matrices, and introduces a mask mechanism to screen and distill such contribution and importance, thereby automatically selecting and emphasizing features that have a greater contribution to the target task and suppressing the deviation of the core feature distribution. Wherein, calculating the characteristic difference coefficient of each reference beer cap feature matrix in the set of reference beer cap feature matrices relative to other reference beer cap feature matrices to obtain a sequence of characteristic difference coefficients, includes: calculating the element-by-element difference between the reference beer cap feature matrix and other reference beer cap feature matrices in the set of reference beer cap feature matrices to obtain a set of difference feature matrices; calculating the 2-norm of each difference feature matrix in the set of difference feature matrices to obtain a sequence of difference quantization coefficients; and, calculating the mean of the sequence of difference quantization coefficients to obtain the characteristic difference coefficients. In a specific example, the set of reference beer cap feature matrices is processed with the following characteristic difference coefficient calculation formula to obtain the sequence of characteristic difference coefficients, wherein the characteristic difference coefficient calculation formula is: ;in, is the first in the set of reference beer cap feature matrices A reference beer cap feature matrix, is the first in the set of reference beer cap feature matrices A reference beer cap feature matrix, represents the 2-norm of the feature matrix, The value of is the length of the set of reference beer cap feature matrices minus one, is a representation of the set of reference beer cap feature matrices, The first The coefficient of variation of the characteristics.

[0037] It is worth mentioning that in other specific examples of the present application, image feature extraction and image feature aggregation can be performed on the set of labeled defect-free beer cap reference images in other ways to obtain the reference beer cap mark aggregation feature matrix, for example: input the set of labeled defect-free beer cap reference images; select a model or algorithm suitable for image feature extraction, such as a pre-trained convolutional neural network (CNN) model (such as ResNet, VGG, etc.) or a feature extraction algorithm (such as SIFT, HOG, etc.); apply the selected feature extractor to each beer cap reference image labeled as defect-free to extract the feature representation of the image; integrate the feature representation extracted from each image into a feature matrix to obtain the reference beer cap mark aggregation feature matrix.

[0038] Specifically, the S32 performs image feature extraction on the beer cap image to obtain the beer cap detection feature matrix. In particular, in a specific example, the beer cap image is passed through the beer cap image feature extractor based on the convolutional neural network model to obtain the beer cap detection feature matrix. That is, the excellent performance of the convolutional neural network in processing image data is used to capture the beer cap state characteristics of the beer cap image to describe and characterize the appearance and structural characteristics of the beer cap to be detected. More specifically, each layer of the beer cap image feature extractor based on the convolutional neural network model is used to perform the following operations on the input data in the forward pass of the layer: convolution processing on the input data to obtain a convolution feature map; pooling along the channel dimension of the convolution feature map to obtain a pooled feature map; and nonlinear activation on the pooled feature map to obtain an activation feature map; wherein the output of the last layer of the beer cap image feature extractor based on the convolutional neural network model is the beer cap detection feature matrix, and the input of the first layer of the beer cap image feature extractor based on the convolutional neural network model is the beer cap image.

[0039] It is worth mentioning that in other specific examples of the present application, the set of the labeled defect-free beer cap reference images and the beer cap images can also be processed by other methods using the feature extraction fork structure to obtain the reference beer cap mark aggregation feature matrix and the beer cap detection feature matrix, for example: designing a feature extraction fork structure, determining the network structure of each branch, including convolution layer, pooling layer, activation function, etc.; performing data preprocessing on the set of beer cap reference images labeled as defect-free; inputting each defect-free beer cap reference image into the feature extraction fork structure, and obtaining the reference beer cap mark aggregation feature of each image through feature extraction; integrating all the reference beer cap mark aggregation features into a feature matrix to obtain the reference beer cap mark aggregation feature matrix. Performing necessary data preprocessing on the beer cap images; inputting each beer cap image into the same or similar branch in the feature extraction fork structure, and obtaining the beer cap detection feature of each image through feature extraction; integrating all the beer cap detection features into a feature matrix to obtain the beer cap detection feature matrix.

[0040] In particular, the S4 determines whether the beer cap to be detected has defects based on the similarity between the reference beer cap mark aggregation feature matrix and the beer cap detection feature matrix. In particular, in a specific example of the present application, the hash similarity between the beer cap detection feature matrix and the reference beer cap mark aggregation feature matrix is ​​calculated. It should be understood that hash similarity can be used to measure the similarity between two feature matrices. In the beer cap defect detection system, by calculating the hash similarity between the beer cap detection feature matrix and the reference beer cap mark aggregation feature matrix, the similarity between the beer cap image of the beer cap to be detected and the reference image of the beer cap without defects can be quantitatively evaluated. It is worth mentioning that compared with the traditional feature similarity calculation method, the hash similarity calculation usually has a lower computational complexity, which can reduce the computational cost while maintaining a certain accuracy. Further, based on the comparison between the hash similarity and a predetermined threshold, it is determined whether the beer cap to be detected has defects. That is, according to the predetermined threshold, the comparison result of the hash similarity can be converted into a binary judgment, that is, there is a defect or there is no defect. In a specific example of the present application, if the hash similarity exceeds the predetermined threshold, it can be determined that "the beer cap to be detected has no defects"; if it is lower than the predetermined threshold, it can be determined that "the beer cap to be detected has defects", and further inspection or processing is required in actual applications. It is worth mentioning that in the embodiment of the present application, the types of defects that can be detected by the beer cap defect detection system include but are not limited to: clarity and correctness of the printed pattern, stains, roundness deformation, missing material, overflow, burrs, etc.

[0041] It should be understood that before using the above neural network model for inference, the beer cap image feature extractor based on the convolutional neural network model and the logo feature extraction network need to be trained. That is to say, in the computer vision-based beer cap defect detection method of the present application, a training phase is also included for training the beer cap image feature extractor based on the convolutional neural network model and the logo feature extraction network.

[0042] Figure 3 FIG. 1 is a flowchart of the training phase of the beer cap defect detection method based on computer vision according to an embodiment of the present application. Figure 3 As shown, according to the beer cap defect detection method based on computer vision of the embodiment of the present application, the method comprises: a training stage, comprising: S110, obtaining training data, wherein the training data comprises a training beer cap image of a beer cap to be detected and a true value of a hash similarity; S120, extracting a set of training beer cap reference images marked as defect-free from a background database; S130, passing each of the training beer cap reference images marked as defect-free in the set of training beer cap reference images marked as defect-free through the beer cap image feature extractor based on the convolutional neural network model to obtain a set of training reference beer cap feature matrices; S140, passing the set of training reference beer cap feature matrices through the mark feature extraction network to obtain a training reference beer cap mark aggregation feature matrix. array; S150, passing the training beer cap image through the beer cap image feature extractor based on the convolutional neural network model to obtain a training beer cap detection feature matrix; S160, calculating the training hash similarity between the training beer cap detection feature matrix and the training reference beer cap logo aggregation feature matrix; S170, calculating the cross entropy function value between the training hash similarity and the true value of the hash similarity; and, S180, using the cross entropy function value as the difference loss function value to train the beer cap image feature extractor based on the convolutional neural network model and the logo feature extraction network, wherein in each round of iteration of the training, the training beer cap detection feature matrix and the training reference beer cap logo aggregation feature matrix are optimized.

[0043] In particular, in the technical solution of the present application, in the technical solution of the present application, the set of the training reference beer cap feature matrices expresses the image semantic features of each labeled defect-free training beer cap reference image in the set of training labeled defect-free training beer cap reference images, and after passing through the landmark feature extraction network, intra-domain feature aggregation can be performed based on the image semantic features under the full sample domain, and the training beer cap detection feature matrix expresses the image semantic features of the training beer cap images in the single sample domain. In this way, when calculating the hash similarity between the training beer cap detection feature matrix and the training reference beer cap landmark aggregation feature matrix, the obtained hash similarity will have an image semantic feature association representation dimension based on the multi-dimensional image semantic feature interaction between the single sample domain and the full sample domain. Therefore, it is correspondingly expected to improve the mapping effect of the training beer cap detection feature matrix and the training reference beer cap landmark aggregation feature matrix to the interactive image semantic feature association representation dimension during the model iteration process. Based on this, the applicant of the present application, during each iteration of the model, for the training beer cap detection feature matrix, for example, is recorded as and the training reference beer cap logo aggregate feature matrix, for example, denoted as Optimize, expressed as: ;in, , and The feature sets are The mean, standard deviation and maximum value of , and The mean, standard deviation and maximum value of The mean, standard deviation and maximum value of is the base 2 logarithm, and and is the weight hyperparameter. is the reciprocal of the maximum value in the training beer cap detection feature matrix, is the reciprocal of the maximum value in the training reference beer cap logo cluster feature matrix, It is the point multiplication by position. is added by position, It is based on the position. and They are the optimized training beer cap detection feature matrix and the optimized training reference beer cap logo aggregation feature matrix. Here, by including the mean and standard value The interactive representation of the probability statistical features represented by and The short sequence of the distribution interaction representation is used as the training beer cap detection feature matrix and the training reference beer cap logo clustered feature matrix The submanifold potential motif under the interactive manifold network is used to obtain the training beer cap detection feature matrix and the training reference beer cap logo clustered feature matrix The latent motif feature information pattern and feature distribution pattern of the training beer cap detection feature matrix are used as its global structure inference unit, thereby reconstructing the training beer cap detection feature matrix in the form of a global structure latent motif dictionary based on the connection. and the training reference beer cap logo clustered feature matrix The interactive manifold structure is used to improve the model's ability to generate and evolve the manifold structure corresponding to the image semantic association features of the interactive image semantic feature association representation dimension during the iteration process, and to improve the mapping effect of the training beer cap detection feature matrix and the training reference beer cap logo aggregation feature matrix to the interactive image semantic feature association representation dimension during the model iteration process.

[0044] In summary, according to the embodiment of the present application, a beer cap defect detection method based on computer vision is explained, which utilizes computer vision technology and intelligent algorithms to capture the image semantic features of the beer cap image to be inspected and the image semantic features of a set of beer cap reference images that are marked as defect-free with a branch flow structure, and realizes defect detection and identification of the beer cap by quantifying the difference in image semantic features between the two.

[0045] Furthermore, a beer cap defect detection system based on computer vision is also provided.

[0046] Figure 6 FIG. 1 is a block diagram of a beer cap defect detection system based on computer vision according to an embodiment of the present application. Figure 6 As shown, according to the embodiment of the present application, the beer cap defect detection system 300 based on computer vision includes: an image acquisition module 310 to be detected, used to acquire the beer cap image of the beer cap to be detected captured by a camera; a reference image acquisition module 320, used to extract a set of beer cap reference images marked as non-defective from a background database; a feature extraction module 330, used to use a feature extraction branch flow structure to process the set of beer cap reference images marked as non-defective and the beer cap image to obtain a reference beer cap mark aggregation feature matrix and a beer cap detection feature matrix; and a detection result module 340, used to determine whether the beer cap to be detected has defects based on the similarity between the reference beer cap mark aggregation feature matrix and the beer cap detection feature matrix.

[0047] As described above, the beer cap defect detection system 300 based on computer vision according to the embodiment of the present application can be implemented in various wireless terminals, such as a server with a beer cap defect detection algorithm based on computer vision. In a possible implementation, the beer cap defect detection system 300 based on computer vision according to the embodiment of the present application can be integrated into the wireless terminal as a software module and / or a hardware module. For example, the beer cap defect detection system 300 based on computer vision can be a software module in the operating system of the wireless terminal, or can be an application developed for the wireless terminal; of course, the beer cap defect detection system 300 based on computer vision can also be one of the many hardware modules of the wireless terminal.

[0048] Alternatively, in another example, the computer vision-based beer cap defect detection system 300 and the wireless terminal may also be separate devices, and the computer vision-based beer cap defect detection system 300 may be connected to the wireless terminal via a wired and / or wireless network and transmit interactive information in accordance with an agreed data format.

[0049] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A beer cap defect detection method based on computer vision, characterized in that: include: Acquire a beer cap image of the beer cap to be detected captured by a camera; Extracting a set of beer cap reference images marked as defect-free from a background database; Using a feature extraction bifurcation structure, the set of beer cap reference images marked as defect-free and the beer cap image are processed to obtain a reference beer cap mark aggregation feature matrix and a beer cap detection feature matrix; as well as Determine whether the beer cap to be inspected has a defect based on the similarity between the reference beer cap mark aggregation feature matrix and the beer cap detection feature matrix; The process of using a feature extraction branch flow structure to process the set of defect-free beer cap reference images and the beer cap image to obtain a reference beer cap mark aggregation feature matrix and a beer cap detection feature matrix includes: Performing image feature extraction and image feature aggregation on the set of the labeled defect-free beer cap reference images to obtain the reference beer cap mark aggregation feature matrix; and Performing image feature extraction on the beer cap image to obtain the beer cap detection feature matrix; The process of extracting and aggregating image features of the set of the defect-free beer cap reference images to obtain the reference beer cap mark aggregation feature matrix includes: Passing each of the labeled non-defective beer cap reference images in the set of labeled non-defective beer cap reference images through a beer cap image feature extractor based on a convolutional neural network model to obtain a set of reference beer cap feature matrices; and Passing the set of reference beer cap feature matrices through a sign feature extraction network to obtain the reference beer cap sign aggregation feature matrix; The step of passing the set of reference beer cap feature matrices through a sign feature extraction network to obtain the reference beer cap sign aggregation feature matrix comprises: Calculating the characteristic difference coefficient of each reference beer cap characteristic matrix in the set of reference beer cap characteristic matrices relative to other reference beer cap characteristic matrices to obtain a sequence of characteristic difference coefficients; Normalizing the sequence of characteristic difference coefficients to obtain a sequence of normalized characteristic difference coefficients; Using a gating unit, masking the sequence of normalized feature difference coefficients to obtain a sequence of masked feature difference coefficients; and The sequence of the masked feature difference coefficients is used as weights to calculate the weighted sum of the set of reference beer cap feature matrices to obtain the reference beer cap logo clustered feature matrix.

2. The method for detecting beer cap defects based on computer vision according to claim 1, characterized in that: Calculating the characteristic difference coefficient of each reference beer cap characteristic matrix in the set of reference beer cap characteristic matrices relative to other reference beer cap characteristic matrices to obtain a sequence of characteristic difference coefficients, including: Calculating element-by-element differences between the reference beer cap feature matrix and other reference beer cap feature matrices in the set of reference beer cap feature matrices to obtain a set of difference feature matrices; Calculating the 2-norm of each difference feature matrix in the set of difference feature matrices to obtain a sequence of difference quantization coefficients; and The mean of the sequence of the difference quantization coefficients is calculated to obtain the characteristic difference coefficient.

3. The beer cap defect detection method based on computer vision according to claim 2, characterized in that: Performing image feature extraction on the beer cap image to obtain the beer cap detection feature matrix includes: The beer cap image is passed through the beer cap image feature extractor based on the convolutional neural network model to obtain the beer cap detection feature matrix.

4. The method for detecting beer cap defects based on computer vision according to claim 3, characterized in that: Determining whether the beer cap to be inspected has a defect based on the similarity between the reference beer cap mark aggregation feature matrix and the beer cap detection feature matrix comprises: Calculating the hash similarity between the beer cap detection feature matrix and the reference beer cap logo aggregation feature matrix; and Based on the comparison between the hash similarity and a predetermined threshold, it is determined whether the beer cap to be inspected has defects.

5. The method for detecting beer cap defects based on computer vision according to claim 4, characterized in that: The method also includes a training step: training the beer cap image feature extractor based on the convolutional neural network model and the logo feature extraction network.

6. The method for detecting beer cap defects based on computer vision according to claim 5, characterized in that: The training step comprises: Acquire training data, wherein the training data includes a training beer cap image of a beer cap to be detected and a true value of a hash similarity; Extracting a set of training beer cap reference images annotated as defect-free from a backend database; Each labeled defect-free training beer cap reference image in the set of labeled defect-free training beer cap reference images is respectively passed through the beer cap image feature extractor based on the convolutional neural network model to obtain a set of training reference beer cap feature matrices; Passing the set of the training reference beer cap feature matrices through the logo feature extraction network to obtain a training reference beer cap logo aggregation feature matrix; Passing the training beer cap image through the beer cap image feature extractor based on the convolutional neural network model to obtain a training beer cap detection feature matrix; Calculating a training hash similarity between the training beer cap detection feature matrix and the training reference beer cap logo aggregation feature matrix; Calculating a cross entropy function value between the training hash similarity and a true value of the hash similarity; and The cross entropy function value is used as the difference loss function value to train the beer cap image feature extractor based on the convolutional neural network model and the logo feature extraction network, wherein in each round of iteration of the training, the training beer cap detection feature matrix and the training reference beer cap logo aggregation feature matrix are optimized.

7. A beer cap defect detection system based on computer vision, characterized in that: include: The image acquisition module to be detected is used to acquire the beer cap image of the beer cap to be detected collected by the camera; A reference image acquisition module, used to extract a set of reference images of beer caps marked as defect-free from a background database; A feature extraction module, used for processing the set of the labeled defect-free beer cap reference images and the beer cap image using a feature extraction bifurcation structure to obtain a reference beer cap mark aggregation feature matrix and a beer cap detection feature matrix; as well as A detection result module, used for determining whether the beer cap to be detected has a defect based on the similarity between the reference beer cap mark aggregation feature matrix and the beer cap detection feature matrix; The process of using a feature extraction branch flow structure to process the set of defect-free beer cap reference images and the beer cap image to obtain a reference beer cap mark aggregation feature matrix and a beer cap detection feature matrix includes: Performing image feature extraction and image feature aggregation on the set of the labeled defect-free beer cap reference images to obtain the reference beer cap mark aggregation feature matrix; and Performing image feature extraction on the beer cap image to obtain the beer cap detection feature matrix; The process of extracting and aggregating image features of the set of the defect-free beer cap reference images to obtain the reference beer cap mark aggregation feature matrix includes: Passing each of the labeled non-defective beer cap reference images in the set of labeled non-defective beer cap reference images through a beer cap image feature extractor based on a convolutional neural network model to obtain a set of reference beer cap feature matrices; and Passing the set of reference beer cap feature matrices through a sign feature extraction network to obtain the reference beer cap sign aggregation feature matrix; The step of passing the set of reference beer cap feature matrices through a sign feature extraction network to obtain the reference beer cap sign aggregation feature matrix comprises: Calculating the characteristic difference coefficient of each reference beer cap characteristic matrix in the set of reference beer cap characteristic matrices relative to other reference beer cap characteristic matrices to obtain a sequence of characteristic difference coefficients; Normalizing the sequence of characteristic difference coefficients to obtain a sequence of normalized characteristic difference coefficients; Using a gating unit, masking the sequence of normalized feature difference coefficients to obtain a sequence of masked feature difference coefficients; and The sequence of the masked feature difference coefficients is used as weights to calculate the weighted sum of the set of reference beer cap feature matrices to obtain the reference beer cap logo clustered feature matrix.

Citation Information

Patent Citations

  • Dynamic face recognition method and device based on video streaming

    CN111860165A

  • Omnibearing medicine bottle appearance defect detection method

    CN113324993A