Pig verification seal detection method

By preprocessing pig images and calculating signal strength of deep learning models, combining Euro-style distance difference and Gaussian distribution judgment, the misjudgment problem in pig verification chapter detection is solved, and the detection accuracy and efficiency are improved.

CN120299048AActive Publication Date: 2025-07-11JIANGSU ZHIWEI AUTOMATION EQUIP CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202510784348.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-12
Publication Date
2025-07-11
Estimated Expiration
2045-06-12

AI Technical Summary

Technical Problem

Existing deep learning algorithms have misjudgment problems in pig verification chapter detection, which affects the accuracy of detection.

Method used

By collecting pig images for preprocessing, a deep learning model is constructed, and the verification chapter area is judged using signal intensity calculation and European distance difference, and combining Gaussian distribution conditions to determine whether there is a verification chapter, and text and shape information are extracted.

Benefits of technology

It effectively reduces the error detection rate, improves the accuracy of detection, simplifies the method, and saves time and computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120299048A_ABST
    Figure CN120299048A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of pork quarantine, in particular to a pig verification seal detection method, which comprises the following steps: acquiring a verification seal pig image, and preprocessing the pig image; constructing a deep learning model, identifying a verification seal in the image, and outputting a verification seal area image; performing signal intensity calculation on each pixel point of the verification seal area image; selecting feature points of which the signal intensity exceeds a set threshold value, calculating Euclidean distance differences among the feature points, and when the Euclidean distance differences of the feature points meet Gaussian distribution, judging that there is a verification seal in the verification seal region image; otherwise, determining that no verification seal exists in the verification seal area image. The problem of misjudgment of the verification seal detected by the existing deep learning algorithm is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of pork quarantine, and particularly to a method for detecting a pig verification seal. Background Art

[0002] The detection of pig verification seals is an important means to ensure the quality and safety of pork products; through technologies such as visual detection, spectral detection, fluorescence detection, and RFID, the verification seals can be effectively identified to ensure the reliable source and qualified quality of pork.

[0003] A pork quarantine seal recognition system based on machine vision with the publication number CN118072056A, after feature matching, the object recognition module compares and identifies the matched features with the known pork quarantine seal features; the feature matching uses classifiers or classification algorithms, such as support vector machine (SVM), k-nearest neighbor (KNN), and deep learning algorithms; it is determined whether the input image contains a pork quarantine seal through training; due to the influence of the quality of the collected image, the size of the dataset, and the accuracy of the algorithm, there will be misjudgments in the detected verification seals. How to reduce misjudgments and improve accuracy is an urgent problem to be solved. Summary of the Invention

[0004] Aiming at the deficiencies of the existing methods, the present invention solves the problem of misjudgments in the verification seals detected by the existing deep learning algorithms.

[0005] The technical solution adopted by the present invention is: a method for detecting a pig verification seal includes the following steps: Step 1: Collect images of pigs with verification seals and preprocess the pig images. As a preferred embodiment of the present invention, the classification of the verification seal includes: function, style, and color.

[0006] As a preferred embodiment of the present invention, the preprocessing includes: image enhancement, image denoising, and image geometric transformation.

[0007] Step 2: Build a deep learning model to identify the verification seal in the image and output the image of the verification seal area. As a preferred embodiment of the present invention, the deep learning model includes: Yolo network, CNN network.

[0008] Step 3: Calculate the signal intensity of each pixel point in the verification seal area image; select the feature points whose signal intensity exceeds the set threshold, and calculate the Euclidean distance difference between the feature points. When the Euclidean distance difference of the feature points satisfies the Gaussian distribution, it is determined that there is a verification seal in the verification seal area image; otherwise, there is no verification seal in the verification seal area image. As a preferred embodiment of the present invention, the signal intensity includes: comprehensive signal intensity, single-channel signal intensity, and hyperspectral image signal intensity.

[0009] As a preferred embodiment of the present invention, step three specifically includes: Step 31: When the signal intensity value of a pixel exceeds the first threshold, the pixel is determined as a feature point; Step 32: Calculate the Euclidean distance difference between any two feature points; Step 33: When the Euclidean distance difference satisfies a Gaussian distribution, and the calculated expectation μ 计 of the Gaussian distribution and the preset expectation μ 预 have an error less than the second threshold, and the calculated variance σ 计 2 and the preset variance σ 预 2 have an error less than the third threshold, it is determined that there is a verification seal in the verification seal area image.

[0010] As a preferred embodiment of the present invention, when there is a verification seal in the verification seal area image, the text of the verification seal is extracted.

[0011] As a preferred embodiment of the present invention, when there is a verification seal in the verification seal area image, the shape of the verification seal is extracted.

[0012] As a preferred embodiment of the present invention, a pig verification seal detection system includes: a memory for storing instructions executable by a processor; a processor for executing the instructions to implement the pig verification seal detection method.

[0013] As a preferred embodiment of the present invention, a computer-readable medium storing computer program code, the computer program code implementing the pig verification seal detection method when executed by a processor.

[0014] Advantages of the present invention: 1. The present invention calculates the signal intensity of each pixel in the verification seal area image, then calculates the Euclidean distance difference of the feature points with signal intensity meeting the threshold conditions, and determines whether there is a verification seal in the verification seal area image according to whether the Euclidean distance difference conforms to a Gaussian distribution and then comparing whether the errors between the calculated expectation, variance and the corresponding preset values are within the range; effectively reducing the misdetection problem of the deep learning model and improving the detection accuracy; 2. Compared with the existing method of optimizing the network model, the method of the present invention can effectively reduce the misdetection rate, the method is simpler and more applicable; and there is no need to repeatedly train the network, saving time and computing resources. Description of the Drawings

[0015] Figure 1 is a flowchart of the pig verification seal detection method of the present invention. Detailed Embodiments

[0016] The present invention will be further described below in conjunction with the accompanying drawings and embodiments. This figure is a simplified schematic diagram, which only illustrates the basic structure of the present invention in a schematic manner. Therefore, it only shows the components related to the present invention.

[0017] As Figure 1 shown, a detection method for pig verification seals includes the following steps: Step 1: Collect pig images with verification seals and preprocess the pig images. The pig verification seal is a mark used to identify that the pork has passed legal quarantine and inspection. The types and styles of verification seals vary due to different national, regional, industry standards, and specific uses. The verification seals can be classified by function as follows: quarantine seals, which are used to identify that the pork has passed animal quarantine and meets the health standards; inspection seals, which are used to identify that the pork has passed quality inspection and meets the food safety standards; enterprise seals, which are used to identify the source enterprise of the pork for traceability and management. The verification seals can be classified by style as circular, oval, rectangular, and square. The verification seals can be classified by color as blue, green, red, and purple. The preprocessing includes: image enhancement, image denoising, and image geometric transformation. Construct a dataset of pig images with verification seals and divide it into a training set and a test set. Step 2: Construct a deep learning model to identify the verification seals in the images and output the image of the verification seal area. The deep learning model includes: Yolo network, CNN network. The convolutional layer in the deep learning model can use a common convolutional layer or a dynamic convolutional layer; the number of convolutional layers can be set customarily.

[0018] The image of the verification seal area can be obtained through the detection box of the deep learning model.

[0019] Step 3: Calculate the signal intensity of each pixel point in the image of the verification seal area; select the feature points whose signal intensity exceeds the set threshold, and calculate the Euclidean distance difference between the feature points. When the Euclidean distance difference of the feature points satisfies the Gaussian distribution, it is determined that there is a verification seal in the image of the verification seal area; otherwise, there is no verification seal in the image of the verification seal area. When it is determined that there is no verification seal, the image of the verification seal area should be excluded.

[0020] The signal intensity of the pixel points includes: single-channel signal intensity, comprehensive signal intensity, and hyperspectral image signal intensity. The formula for the comprehensive signal intensity is: I z ( x ,y ) = 0.299 * R ( x , y ) + 0.587 * G ( x , y ) + 0.114 * B ( x , y ) (1) Among them, the coefficients 0.299, 0.587, and 0.114 are the weights of the human eye's sensitivity to different colors; R (x, y), G (x, y), B (x, y) are the red, green, and blue channel values of the pixel point respectively.

[0021] The formula for the single-channel signal intensity is: IR ( x , y ) = R ( x , y ), IG ( x , y ) = G ( x , y ), IB ( x , y ) = B ( x , y ) (2) The formula for the hyperspectral image signal intensity is: I ( x , y ) = ∑ w i * B i ( x , y ) (3) Among them, B i ( x , y ) is the pixel value of the i th band, w i is the weight of the i th band.

[0022] Step 31: When the signal intensity value of the pixel point exceeds the first threshold, the pixel point is determined as a feature point;

[0023] Taking the comprehensive signal strength as an example, feature points are extracted from the image of the verification seal area. The first threshold is set to 100. When I z ( x , y ) ≥ 100, 30 feature points are selected; Verification seals with different functions and styles can preset different first thresholds.

[0024] Step 32: Calculate the Euclidean distance difference between any two feature points;

[0025] The formula for the Euclidean distance difference is: d ( P , Q ) = sqrt[( x 2 - x 1) 2 + ( y 2 - y 1) 2 (4) Among them, P 、 Q are different feature points; x 2、 y 2 are the pixel coordinates of the feature point Q , x 1, y 1 are the pixel coordinates of the feature point P ; sqrt is the square root.

[0026] For example: Pairwise calculations of 30 feature points result in C 30 2 = 435 Euclidean distance differences.

[0027] The probability density function curve of the Gaussian distribution is bell-shaped, so it is also called the bell curve, that is, the random variable X follows a Gaussian distribution with a mathematical expectation of μ 、variance of σ 2 , denoted as N( μ , σ 2 ); In the Gaussian distribution, the mathematical expectation μ represents the central position of the bell shape, that is, the position of the curve, while the standard deviation σ characterizes the degree of dispersion of the curve.

[0028] Step 33: The Euclidean distance differences satisfy the Gaussian distribution, and the calculation expectation μ 计 of the Gaussian distribution and the preset expectation μ 预 have an error less than the second threshold, and calculate the variance σ 计 2When the error from the preset variance σ 预 2 is less than the third threshold, it is determined that there is a verification seal in the verification seal area image.

[0029] Verification seals with different functions and styles have different μ 预 and σ 预 2 . When the Euclidean distance difference of the verification seal with a certain function and style conforms to the Gaussian distribution, and the calculated μ 计 and σ 计 2 have an error less than the set threshold from the preset μ 预 and σ 预 2 , it is determined that there is a verification seal in the verification seal area image; otherwise, it is determined that there is no verification seal in the verification seal area image. For example: | μ 预 - μ 计 | ≤ ɑ, ɑ = 0.1; |σ 预 2 - σ 计 2 | ≤ β, β = 0.2; ɑ is the second threshold, and β is the third threshold.

[0030] Among them, the formula of the Gaussian distribution is: f ( x ) = exp(−( x - μ )) 2 / 2 σ 2 ) / (sqrt(2 π )) * σ ) (5) Among them, x is the value of the random variable, exp(.) is the exponential function, σ is the standard deviation.

[0031] When there is a verification seal in the verification seal area image, text extraction and shape recognition are performed on the image of the verification seal; Among them, text recognition can perform text extraction through an ORC recognition tool; Shape recognition can adopt the geometric model method based on the least squares method, or the graph model method based on the Hungarian algorithm.

[0032] Taking the ideal embodiments of the present invention described above as inspiration, through the above description, relevant staff can make various changes and modifications completely within the scope not deviating from the technical idea of this invention. The technical scope of this invention is not limited to the content in the specification, and its technical scope must be determined according to the scope of the claims.

Claims

1. A method for detecting a pig verification seal, characterized in that, It includes the following steps: Step 1, collect the images of pigs with inspection seals and preprocess the pig images; Step 2, construct a deep learning model to identify the inspection seals in the images and output the images of the inspection seal areas; Step 3, calculate the signal intensity of each pixel point in the image of the inspection seal area; select the feature points whose signal intensity exceeds the set threshold, and calculate the Euclidean distance difference between the feature points. When the Euclidean distance difference of the feature points satisfies the Gaussian distribution, it is determined that there is an inspection seal in the image of the inspection seal area; otherwise, there is no inspection seal in the image of the inspection seal area.

2. The pig verification seal detection method according to claim 1, wherein Step 3 specifically includes: Step 31, when the signal intensity value of the pixel point exceeds the first threshold, the pixel point is determined as a feature point; Step 32, calculate the Euclidean distance difference between any two feature points; Step 33: The Euclidean distance difference satisfies a Gaussian distribution, and the calculated expectation μ 计 of the Gaussian distribution has an error less than a second threshold from the preset expectation μ 预 , and when the calculated variance σ 计 2 has an error less than a third threshold from the preset variance σ 预 2 , it is determined that there is a verification seal in the verification seal area image.

3. The pig verification seal detection method according to claim 1, wherein, The signal intensity includes: comprehensive signal intensity, single-channel signal intensity, hyperspectral image signal intensity.

4. The method for detecting a pig verification seal according to claim 1, characterized in that, The classification of the inspection seal includes: function, style, color.

5. The method for detecting a pig verification seal according to claim 1, characterized in that, The preprocessing includes: Image enhancement, image denoising, image geometric transformation.

6. The pig verification seal detection method according to claim 1, wherein The deep learning model includes: Yolo network, CNN network.

7. The pig verification seal detection method according to claim 1, wherein Extract the shape of the inspection seal when there is an inspection seal in the image of the inspection seal area.

8. The pig verification seal detection method according to claim 1, characterized in that, Extract the text of the inspection seal when there is an inspection seal in the image of the inspection seal area.

9. Pig verification seal detection system, characterized in that, It includes: A memory for storing instructions executable by a processor; A processor for executing the instructions to implement the pig inspection seal detection method according to any one of claims 1-8.

10. A computer-readable medium storing computer program code, characterized in that, The computer program code implements the pig inspection seal detection method according to any one of claims 1-8 when executed by the processor.

Citation Information

Patent Citations

  • Unsupervised human detecting and positioning method

    CN104267439A

  • Multi-target ISAR key point extraction method based on Gaussian mixture model

    CN111080674A

  • Adjustment method and device for binocular camera

    CN111862230A

  • Digital image stitching tampering blind detection method and system

    CN112465768A

  • Seamless situation awareness method for real-time fusion of unmanned ship-borne multi-element and multi-scale radar

    CN114879180A