Method, device, electronic device and storage medium for detecting inkjet coding images

By training dynamic models to learn the wear rules of the inkjet image, and using convolutional neural networks and recurrent neural networks to detect and correct the inkjet image, the problem of difficult identification of the inkjet image after wear is solved, and the accuracy and reliability of the inkjet image are improved.

CN116485756BActive Publication Date: 2025-08-29NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310453572.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-23
Publication Date
2025-08-29
Estimated Expiration
2043-04-23

AI Technical Summary

Technical Problem

The inkjet image is difficult to be correctly identified after wear and contamination, resulting in misjudgment of the inkjet image recognition and verification, and the prior art cannot effectively improve the accuracy of the comparison.

Method used

The pre-trained dynamic model is used to detect and correct the ink-coded images according to the wear rules of the ink-coded images. The characteristic information is extracted through the convolutional neural network and the recurrent neural network, the wear rules of the ink-coded images are learned and corrected, and then the corrected images are obtained for comparison and detection.

Benefits of technology

Improve the accuracy of the alignment of the ink-coded images in the case of wear or contamination, ensuring the reliability and detection accuracy of the ink-coded images application.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116485756B_ABST
    Figure CN116485756B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method, device, electronic device, and storage medium for detecting inkjet coding images. The method includes: searching a database for the original image corresponding to the inkjet coding image to be detected based on a character string contained in the inkjet coding image to be detected; inputting the inkjet coding image to be detected and the original image into a dynamic model for wear detection; if the dynamic model outputs that the inkjet coding image to be detected conforms to the wear pattern, correcting the inkjet coding image to be detected based on the wear pattern to obtain a corrected image; and performing a comparative test on the corrected image and the original image to obtain a detection result of the inkjet coding image to be detected. The technology disclosed herein can reduce misjudgments in inkjet coding image recognition and verification, and improve the accuracy of inkjet coding image comparison.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of inkjet coding detection, and in particular to a method, device, electronic device, and storage medium for detecting inkjet coding images. Background Art

[0002] Inkjet images are often used on product surfaces for product identification and anti-counterfeiting verification. Commonly used methods for image recognition and anti-counterfeiting verification include Local Binary Pattern (LBP), Multi-scale Block LBP (MB-LBP), and Binarized Statistical Image Features (BSIF).

[0003] The LBP algorithm is widely used in face recognition and anti-counterfeiting. It uses a 3×3 pixel block as a processing unit. The grayscale value of the center pixel in the block is compared with the grayscale value of the eight adjacent pixels, and after determining the magnitude, an 8-bit binary bit pattern is generated clockwise. If the grayscale value of the surrounding pixels is greater than the center pixel, the position is marked as 1; otherwise, it is marked as 0, resulting in an 8-bit binary number. This binary pattern is then converted to a decimal number, which describes the intensity of texture information in the area centered on that pixel.

[0004] The MB-LBP algorithm divides the image into S×S blocks. When S=1, it is the basic LBP operator. When S=2, the image is divided into 2×2 blocks. The average grayscale value of the four pixels in the block is used as the grayscale value of the entire area. This is then compared with the average grayscale value of the eight surrounding blocks of the same size to calculate the MB-LBP feature value.

[0005] BSIF is similar to LBP. The descriptor of the BSIF algorithm calculates a binary code for each pixel in the image, where each bit is obtained by convolving the image with a linear filter.

[0006] Inkjet coding images usually lose some features over time. When the same inkjet coding image is taken again after a period of time, the pixel values ​​or features in the image will change accordingly. Since the above-mentioned algorithms usually use one or a few features (color, texture, etc.) for comparison, they cannot correctly identify the inkjet coding image, which in turn causes misjudgment in inkjet coding image recognition and verification. Summary of the Invention

[0007] The purpose of the embodiments of the present disclosure is to provide a method, device, electronic device and storage medium for detecting inkjet coding images, so as to reduce misjudgments in inkjet coding image recognition and verification and improve the comparison accuracy of inkjet coding images.

[0008] An embodiment of the present disclosure provides a method for detecting a code inkjet image, wherein an electronic device provides a pre-trained dynamic model, wherein the dynamic model is trained based on the wear pattern of the code inkjet image, and the characters on the code inkjet image constitute a character string that identifies the identity of the product, and the characters are composed of randomly arranged ink dots and / or random watermarks superimposed on the ink dots. The method comprises: searching a database for an original image corresponding to the code inkjet image to be inspected based on the character string contained in the code inkjet image to be inspected; inputting the code inkjet image to be inspected and the original image into the dynamic model for wear detection; if the dynamic model outputs that the code inkjet image to be inspected conforms to the wear pattern, correcting the code inkjet image to be inspected based on the wear pattern to obtain a corrected image; and comparing the corrected image with the original image to obtain a detection result of the code inkjet image to be inspected.

[0009] In the second aspect, the embodiment of the present disclosure also provides a device for detecting inkjet coding images, wherein the device provides a pre-trained dynamic model through an electronic device, and the dynamic model is trained according to the wear pattern of the inkjet coding image. The characters on the inkjet coding image constitute a character string that identifies the identity of the product, and the characters are composed of randomly arranged ink dots and / or random watermarks superimposed on the ink dots. The device includes: an image search module, which is used to search the database for the original image corresponding to the inkjet coding image to be inspected according to the character string contained in the inkjet coding image to be inspected; a wear detection module, which is used to input the inkjet coding image to be inspected and the original image into the dynamic model for wear detection; an image correction module, which is used to correct the inkjet coding image to be inspected according to the wear pattern if the dynamic model outputs that the inkjet coding image to be inspected meets the wear pattern, so as to obtain a corrected image; a comparison detection module, which is used to compare and detect the corrected image with the original image to obtain a detection result of the inkjet coding image to be inspected.

[0010] In a third aspect, an embodiment of the present disclosure further provides an electronic device, including a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the above-mentioned method for detecting inkjet coding images.

[0011] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above-mentioned inkjet coding image detection method.

[0012] The disclosed embodiments provide a method, device, electronic device, and storage medium for detecting inkjet code images. During the inkjet code image detection process, considering that the characters in the inkjet code image are composed of ink dots, and the normal wear of the inkjet code image usually has a certain regularity, a dynamic model trained according to the wear pattern of the inkjet code image is used to perform wear detection on the inkjet code image to be inspected. This can accurately determine whether the inkjet code image to be inspected conforms to the wear pattern, and then correct the inkjet code image to be inspected that conforms to the wear pattern, so that the worn ink dots can be repaired. The image comparison detection performed on this basis has higher accuracy, effectively ensuring the reliability of the inkjet code image application. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0014] Figure 1 A schematic diagram of a coding image provided by an embodiment of the present disclosure;

[0015] Figure 2 A flowchart of a method for detecting a coding image provided by an embodiment of the present disclosure;

[0016] Figure 3 A schematic diagram comparing two inkjet-coded image characters provided by an embodiment of the present disclosure;

[0017] Figure 4 A schematic diagram showing a comparison of two inkjet-coded image characters provided in another embodiment of the present disclosure;

[0018] Figure 5 A schematic diagram of the structure of a coding image detection method provided by an embodiment of the present disclosure;

[0019] Figure 6 A schematic structural diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0020] The following will clearly and completely describe the technical solutions of the present disclosure in conjunction with the embodiments. Obviously, the embodiments described are only a part of the embodiments of the present disclosure, not all of them. Based on the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of the present disclosure.

[0021] Inkjet coding images have a certain degree of randomness and are flexible to implement, making them widely used in product anti-counterfeiting, product traceability, and management. However, because inkjet coding images use ink, they are easily worn and contaminated by external factors such as touch or friction during product circulation, making them difficult to read and identify correctly, affecting their normal use. Based on this, the embodiments of the present disclosure provide a method, device, electronic device, and storage medium for detecting inkjet coding images to improve the comparison accuracy of inkjet coding images in the event of wear or contamination.

[0022] The disclosed embodiment provides a method for detecting a code inkjet image, wherein the method provides a pre-trained dynamic model through an electronic device, and the dynamic model is trained based on the wear pattern of the code inkjet image. The characters on the code inkjet image of the embodiment constitute a character string that identifies the identity of the product, and these characters are composed of randomly arranged ink dots and / or random watermarks superimposed on the ink dots. The characters in the character string can be randomly arranged ink dots and / or random watermarks superimposed on the ink dots, specifically including one of the following: the characters themselves are composed of randomly arranged ink dots, or the characters themselves are composed of regular ink dots and a random watermark is superimposed on the characters, or the characters are composed of randomly arranged ink dots and a random watermark is superimposed on the characters. The original image of the above-mentioned code inkjet image can be pre-stored in a database, and the database also stores a character string that identifies the identity of the product, and the correspondence between the character string and the original image.

[0023] The above-mentioned electronic device can be a server or a terminal device. The original image in the above-mentioned database can be collected after the product is coded. Taking the above-mentioned electronic device as an example, the server can be connected to an optical scanning device to obtain the coded image on the product. These devices convert the light signal into a digital signal through an optical sensor, and then convert the digital signal into a digital image through software processing and other methods. The server then obtains the relevant feature information of the original image through image processing technology. Among them, on the product operation assembly line, the above-mentioned optical scanning device can be implemented by using a high-definition industrial camera with a telecentric magnification lens. This camera usually has a performance of 2000w pixels and can take at least 4 pictures per second. It is suitable for application scenarios with high operation intensity on the assembly line. In the circulation link such as dealers, the above-mentioned optical scanning device can use equipment such as automatic zoom linear array cameras. For the user end, optical devices such as mobile phone peripherals can be used.

[0024] When capturing inkjet images, it's best to use an optical scanning device with sufficiently high resolution to accurately capture the details of the inkjet image. To minimize the impact of reflective light spots or other obstructions on image clarity, consider implementing optical path design, such as using external light sources or reflective materials. Additionally, scanning speed can be constrained by keeping the optical scanning device relatively stationary relative to the product to achieve stable image capture.

[0025] The above-mentioned inkjet coding image has both the uniqueness of identifying the product and the randomness of the anti-counterfeiting function. Even if two characters representing the same number, letter or symbol appear in the inkjet coding image, the ink dots and / or the random watermarks superimposed on the ink dots are different. Figure 1 The diagram shows a schematic diagram of a coding image, in which the character strings 20230219 2022-035AH003044 are arranged in three rows. Each number is composed of a 5*8 ink dot array. The ink dots of each number have certain differences. In this way, when a character part is worn or contaminated, the authenticity of the coding image can be distinguished by the remaining parts of the character, as well as the ink dots or watermark information of other characters.

[0026] See also Figure 2 The flowchart of the method for detecting the inkjet coding image is shown. The method is executed by the above-mentioned electronic device and specifically includes the following steps:

[0027] Step S202: searching a database for an original image corresponding to the inkjet image to be inspected according to the character string contained in the inkjet image to be inspected.

[0028] The code image to be inspected can be an image printed on a bottled product, such as a liquor or red wine bottle. The code image to be inspected can be placed on the bottle cap or elsewhere on the bottle. In addition to the anti-counterfeiting and identity-identifying string, the code image to be inspected can also contain other information, such as a watermark, which can further enhance the anti-counterfeiting capabilities of the code image.

[0029] Step S204: input the inkjet coding image to be inspected and the original image into the dynamic model for wear detection.

[0030] The dynamic model of this embodiment is trained based on the wear patterns of inkjet images. Therefore, by comparing the feature differences between the inkjet image to be tested and the original image, the dynamic model can determine whether the inkjet image to be tested conforms to the wear pattern. The wear pattern of this embodiment is based on the fact that the characters in the inkjet image are composed of ink dots, and the initial ink dots are solid circular dots. If a certain number or percentage of ink dots are missing or incomplete (individual ink dots are not circular) in the inkjet image, the inkjet image is considered to conform to the wear pattern.

[0031] Step S206: If the dynamic model outputs that the inkjet coding image to be inspected conforms to the wear law, the inkjet coding image to be inspected is corrected according to the wear law to obtain a corrected image.

[0032] This correction process primarily involves filling in the worn characters in the inkjet code image to restore them based on wear patterns. For example, if a character has 20% of its ink dots worn away, filling in the dots can restore the worn dots. This will ensure that the character more closely matches the pre-wear ink dot characteristics, resulting in more accurate results during subsequent comparison testing.

[0033] If the inkjet coding image to be inspected does not conform to the wear pattern, other detection technologies may be used, which is not limited in the embodiments of the present disclosure.

[0034] Step S208: performing a comparative test on the corrected image and the original image to obtain a test result of the inkjet coding image to be tested.

[0035] This comparison test primarily involves feature point matching. The test results for the image under inspection are determined based on the matching feature points. Test results include: the image under inspection matches the original image; the image under inspection does not match the original image; or the image under inspection cannot be determined to match the original image. In cases where a match cannot be determined, further verification can be performed using manual testing or other detection models.

[0036] The above method takes into account that the characters in the inkjet coding image are composed of ink dots, and the normal wear of the inkjet coding image usually has a certain regularity. Therefore, a dynamic model trained according to the wear law of the inkjet coding image is used to perform wear detection on the inkjet coding image to be inspected. This can accurately determine whether the inkjet coding image to be inspected conforms to the wear law, and then correct the inkjet coding image to be inspected that conforms to the wear law, so that the worn ink dots can be repaired. The image comparison detection performed on this basis has higher accuracy, effectively ensuring the reliability of the inkjet coding image application.

[0037] Considering the correspondence between the original image and the character string in the database, as a possible implementation, the above-mentioned step S202 of searching the database for the original image corresponding to the inkjet code image to be inspected based on the character string contained in the inkjet code image to be inspected may include: performing character recognition processing on the inkjet code image to be inspected to obtain the character string contained in the inkjet code image to be inspected; and searching the database using the character string as an index to obtain the original image corresponding to the inkjet code image to be inspected. The character string contained in the inkjet code image to be inspected can be determined using OCR (Optical Character Recognition) technology. OCR technology refers to the process in which an electronic device (such as a scanner or digital camera) examines characters printed on paper, determines their shape by detecting dark and light patterns, and then uses character recognition methods to translate the shape into computer text. In other words, for printed characters, the text in a paper document is optically converted into a black and white dot matrix image file, and recognition software is used to convert the text in the image into text format for further editing and processing by word processing software. After obtaining the character string contained in the inkjet code image to be inspected, the database can be searched using the character string to find the original image corresponding to the inkjet code image to be inspected. The above-mentioned method of obtaining character strings through character recognition processing can simplify the process of obtaining the original image and improve the efficiency of image detection.

[0038] In addition to determining the above-mentioned character strings through OCR technology, a character string input by the user can also be received, and the character string is used as the character string contained in the inkjet code image to be inspected, and the original image with the character string as the index is searched from the database. The image is the original image corresponding to the inkjet code image to be inspected.

[0039] The dynamic model consists of a convolutional neural network (CNN) model for extracting the characteristic information contained in the inkjet image and a recurrent neural network (RNN) model for learning the wear patterns of the inkjet image. Specifically, the CNN model is used to extract the characteristic representation (also known as the feature vector) of the inkjet image, and the RNN model is then used to learn the dynamic changes of the inkjet image after wear, thereby obtaining a dynamic model that learns the wear patterns.

[0040] The above-mentioned convolutional neural network model can use deep learning methods to learn more advanced and abstract features of the inkjet coding image. The recurrent neural network model moderately evolves these features to obtain the regularity of the wear of the inkjet coding image.

[0041] The above dynamic model can be used to learn the changing patterns of the inkjet coding image (such as the wear pattern), so as to correct the inkjet coding image to be inspected, thereby improving the accuracy of image detection.

[0042] As a possible implementation, the above-mentioned inputting the inkjet image to be inspected and the original image into the dynamic model for wear detection includes the following steps:

[0043] (1) Inputting the inkjet coding image to be inspected into a convolutional neural network model for feature extraction to obtain first feature information;

[0044] (2) Inputting the original image into the convolutional neural network model for feature extraction to obtain the second feature information;

[0045] (3) The first feature information and the second feature information are respectively input into the recurrent neural network model, and the feature point increase and decrease information of the first feature information relative to the second feature information is determined by the recurrent neural network model, and whether the inkjet coding image to be inspected conforms to the wear law is judged according to the feature point increase and decrease information.

[0046] If the inkjet image is worn during use, the ink dots will decrease, not increase. And the wear usually follows the wear law. Figure 3 The diagram below shows a comparison of two inkjet image characters. The character A on the left is the original image, and the character A on the right is the image to be inspected. As can be seen from the circled position in the figure, the ink dots on the right character A are obviously increased compared to the left character A. Therefore, it can be determined that the inkjet image on the right does not conform to the wear pattern. Figure 4 Another schematic diagram of the comparison of two inkjet coding image characters is shown. The character 5 on the left is the original image, and the character 5 on the right is the inkjet coding image to be inspected. When the inkjet coding image to be inspected is blurred, it can still be judged that the changes in the ink dots in the image on the right are all reduced, especially the circled position in the figure. Therefore, it can be determined that the inkjet coding image to be inspected on the right conforms to the wear law.

[0047] The convolutional neural network model and the recurrent neural network model in the above method determine the increase and decrease information of the feature points through the feature information in the inkjet image to be inspected and the original image, and then judge whether the inkjet image to be inspected conforms to the wear law. This method can make judgments based on deeper features of the inkjet image, making the judgment results more accurate.

[0048] The above-mentioned method of determining whether the inkjet image to be inspected conforms to the wear pattern based on the increase or decrease in feature point information may include: if the feature point increase or decrease information indicates that the first feature information has a first number of newly added feature points relative to the second feature information, determining that the inkjet image to be inspected does not conform to the wear pattern; if the feature point increase or decrease information indicates that the first feature information has a second number of fewer feature points relative to the second feature information, determining that the inkjet image to be inspected conforms to the wear pattern. The first and second numbers are pre-set values. This method of determining whether the inkjet image to be inspected conforms to the wear pattern based on the increase or decrease in feature point count is simple to implement, consistent with the actual wear phenomenon of the inkjet image, and relatively reasonable.

[0049] As another embodiment, determining whether the inkjet code image to be inspected conforms to the wear pattern based on the feature point increase / decrease information may include: if the feature point increase / decrease information indicates that the first feature information has a second number of feature points less than the second feature information, checking whether the reduced second number of feature points is evenly distributed within a preset range of the inkjet code image to be inspected. If they are evenly distributed, the inkjet code image to be inspected conforms to the wear pattern. If they are unevenly distributed, the user may be prompted to perform manual screening. The preset range may include multiple areas, such as the edge of the inkjet code image to be inspected, or the locations of one or more characters in the inkjet code image to be inspected. The uniform distribution of the reduced second number of feature points within the preset range of the inkjet code image to be inspected can be measured based on the distribution of the locations of the reduced feature points. If the difference in the number of reduced feature points within each preset range is less than a set value, the reduced second number of feature points is evenly distributed within the preset range of the inkjet code image to be inspected. If the difference in the number of reduced feature points within each preset range is greater than or equal to the set value, it indicates that some ranges have a larger reduction in feature points than others, and the reduced second number of feature points is unevenly distributed within the preset range of the inkjet code image to be inspected.

[0050] In order to avoid misjudgment due to wear of the inkjet code image, the above method corrects the inkjet code image to be inspected according to the wear law when it is determined that the inkjet code image to be inspected conforms to the wear law to obtain a corrected image. In this way, the worn ink dots in the corrected image can be repaired to a certain extent. Specifically, the correction process may include: (1) performing spatial alignment processing on the inkjet code image to be inspected based on the first feature information of the inkjet code image to be inspected and the second feature information of the original image to obtain an aligned image; wherein the characters of the aligned image are consistent with the characters of the original image in the coordinate space; (2) performing ink dot filling processing on the aligned image according to the wear law to obtain a corrected image. The characters in the aligned image are consistent with the characters in the original image in coordinate space. Specifically, the aligned image and the original image are at the same resolution, and the coordinate range of the position area occupied by each character in the aligned image and the original image is the same. For example, the coordinates of the position area occupied by the first character in the original image are from the upper left coordinate (110, 110) to the lower right coordinate (330, 330); then, through the above-mentioned spatial alignment process, the coordinates of the position area occupied by the first character in the aligned image are also from the upper left coordinate (110, 110) to the lower right coordinate (330, 330), and the other corresponding characters are similar. This method of first performing coordinate space alignment can correct image distortion problems caused by shooting, making the ink dot filling based on this more accurate and the corrected image restoration effect better.

[0051] During the spatial alignment process of the inkjet code image to be inspected, the overall distortion parameter of the inkjet code image to be inspected can be calculated based on the first feature information of the inkjet code image to be inspected and the second feature information of the original image. Then, the inkjet code image to be inspected can be corrected using the overall distortion parameter to straighten the deformation during the shooting process.

[0052] Considering the differences between the worn image and the original image, this embodiment performs appropriate correction processing on the worn image to better match the original image. In addition to the aforementioned spatial alignment (also known as image alignment) and ink dot filling, this correction processing may also include image enhancement, noise removal, and other operations to improve the quality and usability of the worn image.

[0053] In order to better repair the worn image, when filling in ink dots, targeted filling can be performed based on the missing ink dots, that is, the degree of wear. Based on this, the above-mentioned ink dot filling process of the aligned image according to the wear pattern to obtain the corrected image may include: determining the ink dot feature information of the aligned image according to the wear pattern; wherein the ink dot feature information includes the position information and the incomplete ratio information of the incomplete ink dots; filling the incomplete ink dots in the aligned image according to the ink dot feature information to obtain the corrected image. The above-mentioned position information of the incomplete ink dots may be the coordinate information of the incomplete ink dots determined based on the ink dots in the original image. The incomplete ratio information may refer to the ratio of the missing part of each ink dot. For example, if the ink dots with wear are 20% or 30% less than the ink dot pattern without wear, 20% or 30% of the ink dots may be filled according to the incomplete ratio information to restore the worn ink dots to their original shape.

[0054] The above process uses an encoder to obtain the first feature information of the inkjet-coded image to be inspected and the second feature information of the original image. The decoder then performs spatial alignment and ink dot filling based on the first and second feature information. This process primarily considers the characters in the inkjet-coded image to be a combination of circular ink dots. If most of the dots are not worn away, the dots can be filled into a complete circle. In other words, the encoder captures the low-level features of the image, and the decoder reconstructs the high-level features of the image, thus achieving high-quality image restoration.

[0055] The correction process mentioned above dynamically selects correction parameters based on the characteristic information of the coding image and the degree of wear, thereby ensuring that the corrected image is as consistent as possible with the original image.

[0056] To improve the training effect of the dynamic model, the model can be dynamically updated during use based on the increase in collected data samples. The data sample set used in the dynamic model training process includes the original inkjet image, images of wear corresponding to the original inkjet image at different times, and images of wear corresponding to different degrees of wear. Based on this, the method further includes: when the inspection result of the inkjet image to be inspected matches the original image, the inkjet image to be inspected and the original image are added to the data sample set to update the data sample set; the updated data sample set is used to dynamically train the dynamic model.

[0057] The above dynamic model can be trained by continuously adding new data samples, thereby gradually improving the performance and generalization ability of the dynamic model, and has strong scalability.

[0058] Negative samples used in the dynamic model training process can be images of other products or artificially forged images. Positive samples can be collected at different stages of the image usage process to enrich the number of data samples and provide images of varying quality. During training, the number of training iterations and the number of data samples trained in each iteration can be adjusted to identify the optimal dynamic model algorithm and optimize the model's parameters, thereby improving the model's performance and generalization capabilities.

[0059] The inkjet coding image is a logo image of a bottle-shaped object, and the inkjet coding image is set on the bottle cap of the bottle-shaped object. For example, the code is sprayed on the bottle cap of a bottle-shaped object such as white wine or red wine to generate a logo and an anti-counterfeiting inkjet coding image.

[0060] The above-mentioned comparative detection of the corrected image and the original image to obtain the detection result of the inkjet coding image to be inspected may include: respectively obtaining the feature vectors of the corrected image and the original image, calculating the similarity between the corrected image and the original image based on the obtained feature vectors, and determining the detection result of the inkjet coding image to be inspected based on the similarity. For example, if the similarity is greater than a first threshold, the detection result of the inkjet coding image to be inspected is determined to be a credible image; if the similarity is less than a second threshold, the detection result of the inkjet coding image to be inspected is determined to be a forged image; if the similarity is between the first threshold and the second threshold, the detection result of the inkjet coding image to be inspected is determined to be a pending image, and manual intervention is required for further analysis. Among them, the first threshold is greater than the second threshold, and the first threshold and the second threshold can be set according to the actual application scenario.

[0061] Corresponding to the above method, the embodiment of the present disclosure further provides a device for detecting inkjet code images. The device provides a pre-trained dynamic model through an electronic device. The dynamic model is trained based on the wear pattern of the inkjet code image. The characters on the inkjet code image constitute a string that identifies the product identity. The characters are composed of randomly arranged ink dots and / or random watermarks superimposed on the ink dots. Figure 5 , the device includes the following modules:

[0062] An image search module 52 is used to search the database for the original image corresponding to the inkjet image to be inspected based on the character string contained in the inkjet image to be inspected;

[0063] Wear detection module 54, used for inputting the inkjet image to be inspected and the original image into the dynamic model for wear detection;

[0064] An image correction module 56 is configured to correct the image of the inkjet code to be inspected according to the wear pattern if the image of the inkjet code to be inspected output by the dynamic model conforms to the wear pattern, thereby obtaining a corrected image;

[0065] The comparison and detection module 58 is used to compare and detect the corrected image and the original image to obtain a detection result of the inkjet coding image to be detected.

[0066] The above-mentioned device takes into account that the characters in the inkjet coding image are composed of ink dots, and the normal wear of the inkjet coding image usually has a certain regularity. Therefore, a dynamic model trained according to the wear law of the inkjet coding image is used to perform wear detection on the inkjet coding image to be inspected. It can accurately determine whether the inkjet coding image to be inspected conforms to the wear law, and then correct the inkjet coding image to be inspected that conforms to the wear law, so that the worn ink dots can be repaired. The image comparison detection performed on this basis has higher accuracy, effectively ensuring the reliability of the inkjet coding image application.

[0067] The image search module 52 is also configured to perform character recognition on the image of the inkjet code to be inspected, obtaining a character string contained in the image; and then using the character string as an index to search a database to obtain the original image corresponding to the image of the inkjet code to be inspected. This method of obtaining the character string through character recognition simplifies the process of obtaining the original image and improves the efficiency of image inspection.

[0068] The dynamic model includes a convolutional neural network model for extracting the characteristic information contained in the inkjet image and a recurrent neural network model for learning the wear patterns of the inkjet image. This dynamic model can learn the wear patterns of the inkjet image and correct the inkjet image to be inspected, thereby improving the accuracy of image detection.

[0069] The wear detection module 54 is further configured to input the inkjet image to be inspected into the convolutional neural network model for feature extraction to obtain first feature information; input the original image into the convolutional neural network model for feature extraction to obtain second feature information; and input the first feature information and the second feature information into the recurrent neural network model, respectively, to determine the increase or decrease in feature points of the first feature information relative to the second feature information through the recurrent neural network model, and to determine whether the inkjet image to be inspected conforms to the wear pattern based on the increase or decrease in feature point information. The above method, which determines the increase or decrease in feature point information based on feature information in the inkjet image to be inspected and the original image, and then determines whether the inkjet image to be inspected conforms to the wear pattern, can make judgments based on deeper features of the inkjet image, resulting in more accurate judgment results.

[0070] The wear detection module 54 is also used to determine that the inkjet image to be inspected does not conform to the wear pattern if the feature point increase or decrease information indicates that the first feature information has a first number of newly added feature points relative to the second feature information; and to determine that the inkjet image to be inspected conforms to the wear pattern if the feature point increase or decrease information indicates that the first feature information has a second number of fewer feature points relative to the second feature information. This method of judging whether the inkjet image to be inspected conforms to the wear pattern by the increase or decrease in the number of feature points is simple to implement and consistent with the actual wear phenomenon of the inkjet image, and is relatively reasonable.

[0071] The image correction module 56 is further configured to perform spatial alignment on the inkjet code image to be inspected based on the first characteristic information of the inkjet code image to be inspected and the second characteristic information of the original image, thereby obtaining an aligned image; wherein the characters in the aligned image and the characters in the original image are consistent in coordinate space; and to perform ink dot filling on the aligned image based on the wear pattern, thereby obtaining a corrected image. This method of performing coordinate space alignment first can correct image distortion caused by filming, making the ink dot filling based on this alignment more accurate and the resulting corrected image more effectively restored.

[0072] The image correction module 56 is further configured to determine ink dot feature information of the alignment image based on the wear pattern; the ink dot feature information includes location information and defect ratio information of the missing ink dots; and fill the missing ink dots in the alignment image based on the ink dot feature information to obtain a corrected image. Filling based on the ink dot feature information can better restore the worn image.

[0073] The data sample set used in the dynamic model training process includes original inkjet images, images corresponding to wear at different times, and images corresponding to different degrees of wear. Accordingly, the comparison and detection module 58 is further configured to, when the inspection result of the inkjet image to be inspected matches the original image, add the inspection image and the original image to the data sample set to update the data sample set. The updated data sample set is then used to dynamically train the dynamic model. This approach can gradually improve the performance and generalization ability of the dynamic model and has strong scalability.

[0074] The above-mentioned inkjet coding image is a logo image of a bottle-shaped object, and the inkjet coding image is set on the bottle cap of the bottle-shaped object.

[0075] The implementation principle and technical effects of the device for detecting inkjet coding images provided in the embodiments of the present disclosure are the same as those of the aforementioned method embodiments. For the sake of brief description, for matters not mentioned in the embodiments of the device for detecting inkjet coding images, reference may be made to the corresponding contents in the aforementioned method embodiments for detecting inkjet coding images.

[0076] The above-mentioned inkjet coding image detection method and device can improve the following aspects of related inkjet coding image detection technology:

[0077] (1) Detection accuracy: The dynamic model used in the embodiment of the present disclosure can learn the change law and wear law of the inkjet coding image, thereby correcting the wear of the inkjet coding image to be inspected, thereby improving the accuracy of image detection.

[0078] (2) Adaptability: Traditional image detection technology is prone to failure when the inkjet image changes. The above-mentioned dynamic model adopted in the embodiment of the present disclosure can learn the changing patterns of image wear and tear, and can also adapt to correct or distinguish situations where a small amount of ink dot changes due to other factors, thereby improving the practicality of the technology.

[0079] (3) Degree of automation: The dynamic model used in the disclosed embodiment can automatically learn and extract features through deep learning, automatically correct and compare images, reduce the manual intervention process, and improve the degree of automation.

[0080] (4) Scalability: The dynamic model used in the disclosed embodiment can be iteratively trained by continuously adding new data samples, thereby gradually improving the performance and generalization ability of the model, and has strong scalability.

[0081] The present disclosure also provides an electronic device, such as Figure 6As shown, it is a structural diagram of the electronic device, wherein the electronic device includes a processor 61 and a memory 60, the memory 60 stores computer executable instructions that can be executed by the processor 61, and the processor 61 executes the computer executable instructions to implement the above-mentioned inkjet coding image detection method.

[0082] exist Figure 6 In the illustrated embodiment, the electronic device further includes a bus 62 and a communication interface 63 , wherein the processor 61 , the communication interface 63 and the memory 60 are connected via the bus 62 .

[0083] Among them, the memory 60 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 63 (which can be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. can be used. The bus 62 can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus 62 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0084] The processor 61 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method may be completed by hardware integrated logic circuits in the processor 61 or by software instructions. The processor 61 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in conjunction with the embodiments of the present disclosure may be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the memory, and the processor 61 reads the information in the memory and completes the steps of the inkjet coding image detection method of the aforementioned embodiment in combination with its hardware.

[0085] The embodiment of the present disclosure also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by the processor, the computer-executable instructions prompt the processor to implement the above-mentioned inkjet coding image detection method. The specific implementation can be found in the aforementioned method embodiment, which will not be repeated here.

[0086] The computer program product of the inkjet coding image detection method, device and electronic device provided in the embodiments of the present disclosure includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the previous method embodiments. The specific implementation can be found in the method embodiments and will not be repeated here.

[0087] Unless otherwise specifically stated, the relative steps, numerical expressions and numerical values ​​of the components and steps set forth in these embodiments do not limit the scope of the present disclosure.

[0088] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0089] In the description of this disclosure, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings and are intended solely to facilitate the description of this disclosure and simplify the description. They do not indicate or imply that the devices or components referred to must have a specific orientation, be constructed, or operate in a specific orientation. Therefore, they should not be construed as limitations on this disclosure. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0090] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The scope of protection of the present disclosure is not limited thereto. Although the present disclosure has been described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-described embodiments within the technical scope disclosed in the present disclosure, or replace some of the technical features therein with equivalents. Such modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure shall be subject to the scope of protection of the claims.

Claims

1. A method for detecting a coding image, characterized in that: A pre-trained dynamic model is provided by an electronic device. The dynamic model is trained based on the wear pattern of the inkjet code image. The dynamic model includes a convolutional neural network model for extracting feature information contained in the inkjet code image and a recurrent neural network model for learning the wear pattern of the inkjet code image. The characters on the inkjet code image constitute a string identifying the product identity. The characters are composed of randomly arranged ink dots and / or random watermarks superimposed on the ink dots. The method includes: According to the character string contained in the inkjet image to be inspected, searching the database for the original image corresponding to the inkjet image to be inspected; Inputting the inkjet coding image to be inspected into the convolutional neural network model for feature extraction to obtain first feature information; inputting the original image into the convolutional neural network model for feature extraction to obtain second feature information; inputting the first feature information and the second feature information into the recurrent neural network model respectively, determining the increase or decrease information of feature points of the first feature information relative to the second feature information through the recurrent neural network model, and judging whether the inkjet coding image to be inspected conforms to the wear pattern based on the increase or decrease information of feature points; If the dynamic model outputs the inkjet coding image to be inspected that conforms to the wear pattern, the inkjet coding image to be inspected is corrected according to the wear pattern to obtain a corrected image; The corrected image and the original image are compared and detected to obtain a detection result of the inkjet coding image to be detected.

2. The method according to claim 1, characterized in that According to the character string contained in the inkjet image to be inspected, searching the database for the original image corresponding to the inkjet image to be inspected includes: Performing character recognition processing on the inkjet code image to be inspected to obtain a character string contained in the inkjet code image to be inspected; The database is searched using the character string as an index to obtain the original image corresponding to the inkjet coding image to be inspected.

3. The method according to claim 1, characterized in that Judging whether the inkjet coding image to be inspected conforms to the wear pattern according to the feature point increase and decrease information includes: If the feature point increase and decrease information indicates that the first feature information has a first number of newly added feature points relative to the second feature information, it is determined that the inkjet coding image to be inspected does not conform to the wear pattern; If the feature point increase and decrease information indicates that the first feature information has fewer feature points than the second feature information, it is determined that the inkjet coding image to be inspected meets the wear pattern.

4. The method according to claim 1, wherein Correcting the inkjet coding image to be inspected according to the wear law to obtain the corrected image includes: Performing spatial alignment processing on the inkjet code image to be inspected based on the first feature information of the inkjet code image to be inspected and the second feature information of the original image to obtain an aligned image; wherein the characters in the aligned image are consistent with the characters in the original image in the coordinate space; The aligned image is subjected to ink dot filling processing according to the wear rule to obtain a corrected image.

5. The method according to claim 4, characterized in that Performing ink dot filling processing on the aligned image according to the wear law to obtain a corrected image includes: Determining ink dot feature information of the alignment image according to the wear pattern; wherein the ink dot feature information includes position information and defective ink dot ratio information; Filling processing is performed on the incomplete ink dots in the aligned image according to the ink dot feature information to obtain a corrected image.

6. The method according to claim 1, characterized in that The data sample set used in the dynamic model training process includes original inkjet images, wear images corresponding to different times of the original inkjet images, and wear images corresponding to different degrees of the original inkjet images; The method also includes: when the detection result of the inkjet coding image to be inspected matches the original image, adding the inkjet coding image to be inspected and the original image to the data sample set to update the data sample set; wherein the updated data sample set is used to dynamically train the dynamic model.

7. The method according to claim 1, characterized in that The inkjet coding image is a logo image of a bottle-shaped object, and the inkjet coding image is set on a bottle cap of the bottle-shaped object.

8. A device for detecting a coding image, characterized in that: The device provides a pre-trained dynamic model through an electronic device. The dynamic model is trained based on the wear pattern of the inkjet code image. The dynamic model includes a convolutional neural network model for extracting feature information contained in the inkjet code image and a recurrent neural network model for learning the wear pattern of the inkjet code image. The characters on the inkjet code image form a string that identifies the product identity. The characters are composed of randomly arranged ink dots and / or random watermarks superimposed on the ink dots. The device includes: An image search module is used to search the database for the original image corresponding to the inkjet image to be inspected according to the character string contained in the inkjet image to be inspected; A wear detection module is configured to input the inkjet coding image to be inspected into the convolutional neural network model for feature extraction to obtain first feature information; input the original image into the convolutional neural network model for feature extraction to obtain second feature information; input the first feature information and the second feature information into the recurrent neural network model respectively, determine the increase or decrease information of feature points of the first feature information relative to the second feature information through the recurrent neural network model, and determine whether the inkjet coding image to be inspected conforms to the wear pattern based on the increase or decrease information of the feature points; An image correction module is configured to correct the inkjet image to be inspected according to the wear law if the dynamic model outputs the inkjet image to be inspected and the wear law is met, so as to obtain a corrected image; The comparison and detection module is used to compare and detect the corrected image and the original image to obtain a detection result of the inkjet coding image to be detected.

9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Missing character detection method and device and missing character detection model establishing method and device

    CN110705531A

  • Jet printing code identification and detection method based on high-speed production line

    CN114511704A