CN113936164A - Recognition method, network and training method of hidden coding composed of directional primitives - Google Patents
Recognition method, network and training method of hidden coding composed of directional primitives Download PDFInfo
- Publication number
- CN113936164A CN113936164A CN202111027485.XA CN202111027485A CN113936164A CN 113936164 A CN113936164 A CN 113936164A CN 202111027485 A CN202111027485 A CN 202111027485A CN 113936164 A CN113936164 A CN 113936164A
- Authority
- CN
- China
- Prior art keywords
- network
- hidden
- coding
- graphic element
- primitives
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/25—Fusion techniques
Landscapes
- Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Image Analysis (AREA)
Abstract
The invention discloses an identification method, a network and a training method of hidden codes composed of directional primitives.A hidden pattern is formed on a commodity page through the directional primitives, and the hidden pattern is identified by utilizing the identification network to obtain a corresponding code so as to obtain value-added resources associated with commodities; by training the recognition network, the recognition network has excellent recognition speed and recognition accuracy. Compared with two-dimensional codes and bar codes, the hidden pattern adopted by the invention realizes a more beautiful coding mode in commodity application, and retains the original artistic value; for scenes needing simple coding, the method has higher detection precision and more attractive expression form; after the recognition network is trained, the recognition network can detect and obtain codes within 3s, the accuracy of actually detecting the codes is more than 98%, and better use experience is achieved.
Description
Technical Field
The invention relates to the technical field of image coding, in particular to a method for identifying hidden codes consisting of directional primitives, a network and a training method.
Background
Currently, printed products such as books and product packages on the market are widely used in the forms of two-dimensional codes and bar codes to store additional information related to commodities such as sales promotion links and commodity numbers of the products. For another example, the children's book capable of being used with the touch and talk pen uses the invisible pattern printed by the special infrared sensitive pigment to code the corresponding audio resource, thereby realizing the reading experience of ' reading where the touch and talk ' is realized.
However, in some special scenarios, these methods also have certain disadvantages. For example, in order to realize interactive reading, such as code scanning to view associated content, adding a large number of two-dimensional codes in the content page of the children's picture book will seriously affect the beauty and layout of the content page. The hidden codes of the audio reading material matched with the point reading pen are printed by using special pigment and can only be recognized by the point reading pen and can not be seen by naked eyes, but the codes are matched with the appointed point reading pen hardware for use, and meanwhile, the point reading pen adopts a scheme that the hidden OID codes are printed by using special coating capable of reflecting infrared light in a very high ppi mode, so that the requirements on the coating and printing equipment are high, and the hidden codes cannot be printed on the surfaces of rough materials such as cloth and the like, so that the audio reading material does not have the possibility of further popularization and application. The invention provides a method for identifying hidden codes consisting of directional primitives, a network and a training method, which are used for solving the problems.
Disclosure of Invention
The invention provides an identification method, a network and a training method of hidden codes composed of directional primitives, which have the characteristic of attractive appearance and effectively reduce the process cost.
The technical scheme adopted by the invention for solving the technical problems is as follows:
a method for identifying hidden codes composed of directional primitives comprises the following steps:
s1, randomly generating a primitive: randomly generating a group of primitives, arranging the primitives according to a corresponding sequence to form a hidden pattern, and laying the hidden pattern on a commodity page;
s2, code scanning identification: using app and calling a camera to scan a commodity page, and scanning the commodity page by the app and identifying a hidden pattern;
s3, pattern decoding: decoding the identified hidden pattern by using an identification algorithm built in the app to obtain an identifiable code corresponding to the hidden pattern, and calling a corresponding function in the app according to the identifiable code;
s4, outputting the code: and displaying the function corresponding to the hidden pattern on the display page of the app, and performing subsequent operation.
Further, in step S1, the hidden pattern includes encoding primitives and positioning primitives, where the encoding primitives correspond to the recognizable codes one by one, and the positioning primitives are used for positioning during code scanning recognition; the color of the hidden pattern is similar to that of the commodity page.
Further, in step S3, the decoding procedure of the identified network is as follows:
s31, primitive identification and detection: the method comprises the steps that a recognition network recognizes a hidden pattern obtained by a camera, and detects the type, position, size, rotation angle and confidence coefficient of a graphic element in the hidden pattern;
s32, primitive confidence filtering: filtering the primitives according to the confidence coefficient, and deleting the primitives with the confidence coefficient smaller than 0.5;
s33, primitive hierarchy filtering: filtering the primitive according to the category, the position and the size, and deleting the primitive detection result which does not meet the preset hierarchical structure limiting condition;
s34, encoding mapping: mapping the primitive to a final code according to a preset hierarchical structure and a mapping relation between the primitive and the code;
s35, outputting the recognizable code: and the identification network outputs the decoded identifiable code to a corresponding module of the app and calls a corresponding function.
Furthermore, the coding primitives are patterns with directivity and correspond to different identifiable codes according to different directions and orientations; the positioning graphic element is a rectangular pattern and comprises a rectangular solid line outer frame, an internal filling color, a preset pattern located in the center and a blank area reserved for the encoding graphic element.
Furthermore, the coding primitives are arranged into two rows, and each row is provided with five columns; and the two rows of coding primitives are positioned inside the rectangular frame of the positioning primitive, and the two rows of coding primitives are respectively arranged at the top and the bottom of the positioning primitive.
A hidden coding identification network composed of directional primitives comprises a trunk convolution network, a fusion network and a prediction network, wherein the trunk convolution network, the fusion network and the prediction network are connected in series from front to back;
the backbone convolutional network is used for extracting multi-scale features in the picture and outputting feature maps of multiple scales;
the fusion network is used for fusing a plurality of scale features, receives a plurality of scale feature graphs input by the backbone convolution network, and outputs a fusion feature graph fused with the plurality of scale features;
the prediction network is used for predicting the class confidence and the position information of the target to be detected, receiving the fusion characteristic diagram output by the fusion network and outputting a prediction result.
A training method of a hidden coding recognition network composed of directional primitives comprises the following steps:
and S01, generating a sample set: randomly generating a training set and a testing set in batches by using a python script;
s02, data enhancement: performing data enhancement on the sample to obtain an enhanced sample image and an enhanced sample label;
s03, training the model: training the recognition network by using a training set, and storing network parameters after multiple iterations until the model converges;
s04, test model: and loading the network parameters into the identification network, taking the test set as input, and comparing the difference between the predicted result and the real result so as to judge whether the model has robustness for the strange input sample.
Further, in step S01, the python script will correspondingly scale, rotate and arrange the primitives on a random background according to the randomly generated codes to generate sample images, where a single sample includes the sample images and the sample labels, and a huge number of samples constitute a sample set.
Further, in step S02, the data enhancement operation includes random cropping, random brightness adjustment, random color perturbation, random saturation adjustment, random sharpening, and random blurring, which are randomly combined.
Further, in step S03, the training process of identifying the network includes the following steps:
s031, for given input sample, input the sample picture into the network, finish the forward propagation computational process, the network outputs and obtains the label predicted finally;
s032, calculating an error according to the real label of the input sample and the prediction label obtained in the step S031;
s033, reversely propagating the error calculated in the step S032 from the output end to the input end of the network, and adjusting parameters of each layer of the network by using a gradient descent optimization strategy, thereby completing a round of iterative process;
and S034, dividing the training set into a plurality of small batches of samples, repeating the processes of S031, S032 and S033 aiming at each batch of samples, and performing loop iteration until the error obtained by calculation in the step S032 is basically unchanged, the model is converged and the training process is finished.
The invention has the following beneficial effects:
compared with two-dimensional codes and bar codes, the hidden pattern adopted by the invention realizes a more beautiful coding mode in commodity application, and retains the original artistic value; for scenes needing simple coding, the method has higher detection precision and more attractive expression form; after the recognition network is trained, the recognition network can detect and obtain codes within 3s, the accuracy of actually detecting the codes is more than 98%, and better use experience is achieved.
Drawings
FIG. 1 is a schematic flow chart of a hidden primitive recognition method according to the present invention;
FIG. 2 is a schematic decoding flow of the identification network of the present invention;
FIG. 3 is a schematic diagram of the identification network structure of the present invention;
FIG. 4 is a schematic diagram of a training process of the recognition network of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the specification, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the description of this patent, it is to be understood that the terms "center," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," and the like are used in the orientations and positional relationships indicated in the drawings for the convenience of describing the patent and for the simplicity of description, and are not intended to indicate or imply that the referenced devices or elements must have a particular orientation, be constructed and operated in a particular orientation, and are not to be considered limiting of the patent.
As shown in fig. 1, a method for recognizing a hidden code composed of directional primitives includes the following steps:
s1, randomly generating a primitive: randomly generating a group of primitives, arranging the primitives according to a corresponding sequence to form a hidden pattern, and laying the hidden pattern on a commodity page;
s2, code scanning identification: using app and calling a camera to scan a commodity page, and scanning the commodity page by the app and identifying a hidden pattern;
s3, pattern decoding: decoding the identified hidden pattern by using an identification algorithm built in the app to obtain an identifiable code corresponding to the hidden pattern, and calling a corresponding function in the app according to the identifiable code;
s4, outputting the code: and displaying the function corresponding to the hidden pattern on the display page of the app, and performing subsequent operation.
Further, in step S1, the hidden pattern includes coding primitives and positioning primitives, where the coding primitives perform a role of coding mapping, the coding primitives correspond to identifiable codes in a one-to-one manner, and the positioning primitives are used for positioning during code scanning identification; the color of the hidden pattern is similar to that of the commodity page.
In the first embodiment of the present invention, the coding primitive is a pattern with directivity, and different identifiable codes are corresponding to different directions of the pattern; the positioning graphic element is a rectangular pattern and comprises a rectangular solid line outer frame, an internal filling color, a preset pattern located in the center and a blank area reserved for the encoding graphic element.
Furthermore, the coding primitives are arranged into two rows, and each row is provided with five columns; and the two rows of coding primitives are positioned inside the rectangular frame of the positioning primitive, and the two rows of coding primitives are respectively arranged at the top and the bottom of the positioning primitive.
Preferably, the coding primitives set 8, the 8 coding primitives in different directions represent 8 codes, the upright coding primitive is taken as a reference, the corresponding code is 0, the subsequent coding primitives rotate by 45 degrees clockwise relative to the previous coding primitive in sequence, and the corresponding code is increased by one; 8 coding primitives in different directions realize the mapping of 0-7 in the octal counting method.
Preferably, the coding primitives are any pattern capable of identifying directionality, such as various individual patterns or combined patterns.
Preferably, the coding primitives are arranged in two rows, and each row is provided with five columns, which totally comprise 10 primitives; the positioning primitives are rectangular frames, and two lines of coding primitives are respectively arranged at the top and the bottom of the frame.
As shown in fig. 2, further, in step S3, the decoding process of the identified network is as follows:
s31, primitive identification and detection: the method comprises the steps that a recognition network recognizes a hidden pattern obtained by a camera, and detects the type, position, size, rotation angle and confidence coefficient of a graphic element in the hidden pattern;
s32, primitive confidence filtering: filtering the primitives according to the confidence coefficient, and deleting the primitives with the confidence coefficient smaller than 0.5; the smaller the confidence coefficient is, the more unreliable the detection result is, and the larger the confidence coefficient is, the more reliable the detection result is;
s33, primitive hierarchy filtering: filtering the primitive according to the category, the position and the size, and deleting the primitive detection result which does not meet the preset hierarchical structure limiting condition; the hierarchy constraints include: whether the primitives of each category exist or not, the number of the primitives of each category, and the relative position, relative size and inclusion relation among the primitives;
the specific way of performing the hierarchical structure filtering on the hidden pattern of the first embodiment is as follows: whether 10 coding primitives exist and are located in the range of one positioning primitive is detected, and the 10 coding primitives approximately meet the preset relative position relationship of two rows and five columns.
S34, encoding mapping: mapping the primitive to a final code according to a preset hierarchical structure and a mapping relation between the primitive and the code;
s35, outputting the recognizable code: and the identification network outputs the decoded identifiable code to a corresponding module of the app and calls a corresponding function.
Preferably, in step S31, the input picture is identified and detected by using an identification network, the category confidence and the location information obtained after the identification network detection are filtered by the following algorithms in steps S31 and S32, and the filtered primitives are mapped to obtain codes and output the codes.
As shown in fig. 3, a hidden coded recognition network composed of directional primitives includes a trunk convolutional network, a fusion network, and a prediction network, where the trunk convolutional network, the fusion network, and the prediction network are connected in series from front to back;
the backbone convolutional network is used for extracting a plurality of scale features in the picture and outputting a feature map of a plurality of scales;
the backbone convolution network is formed by connecting a plurality of basic convolution modules in series;
the fusion network is used for fusing a plurality of scale features, receives a plurality of scale feature graphs input by the backbone convolution network, and outputs a fusion feature graph fused with the plurality of scale features;
the prediction network is used for predicting the class confidence and the position information of the target to be detected, receiving the fusion characteristic diagram output by the fusion network and outputting a prediction result.
The preferred embodiment of the identification network of the present invention: and inputting a color image with the shape of 512 × 3, and outputting the color image as the category confidence coefficient and the position information of the target to be detected.
The main convolution network obtains a feature map with the size of 256 × 256 and the number of channels of 32 after convolution operation is carried out through a basic convolution module, and then the feature map is subjected to convolution operation successively through the basic convolution module; selecting feature maps which form a low scale, a medium scale and a high scale from the front part, the middle part and the rear part of the backbone convolution network respectively, wherein the low scale is 64 × 48, the medium scale is 32 × 120, and the high scale is 16 × 352;
inputting low, medium and high three-scale feature maps formed by a backbone convolution network into a fusion network, unifying the number of feature channels of each scale through the fusion network, outputting a top-layer feature map after channel reforming, performing bit-wise addition operation on the top-layer feature map and a feature map of an adjacent lower layer after the top-layer feature map is sampled, outputting the result, and repeating the same operation with the lower layer until the lowest layer is reached to obtain a high-scale fusion feature map of 16 × 128, a medium-high-scale fusion feature map of 32 × 158 and a medium-high-low-scale fusion feature map of 64 × 128;
inputting the three scales of fusion feature maps into a prediction network, further extracting features through multi-round convolution operation respectively, and predicting category confidence and position information of the target to be detected through convolution branches respectively; and filtering the information identified by the identified network through the finally obtained category confidence coefficient and position information through subsequent algorithms of the steps S31 and S32.
As shown in fig. 4, a training method for a hidden coded recognition network composed of directional primitives includes the following steps:
and S01, generating a sample set: randomly generating a training set and a testing set in batches by using a python script;
s02, data enhancement: performing data enhancement on the sample to obtain an enhanced sample image and an enhanced sample label;
s03, training the model: training the recognition network by using a training set, and storing network parameters after multiple iterations until the model converges;
s04, test model: and loading the network parameters into the identification network, taking the test set as input, and comparing the difference between the predicted result and the real result so as to judge whether the model has robustness for the strange input sample.
Further, in step S01, the python script will correspondingly scale, rotate and arrange the primitives on a random background according to the randomly generated codes to generate sample images, where a single sample includes the sample images and the sample labels, and a huge number of samples constitute a sample set.
Preferably, in step S01, the number of training set samples is 100000, and the number of test set samples is 10000
Further, in step S02, the data enhancement operation includes random cropping, random brightness adjustment, random color perturbation, random saturation adjustment, random sharpening, and random blurring, which are randomly combined.
Further, in step S03, the training process of identifying the network includes the following steps:
s031, for given input sample, input the sample picture into the network, finish the forward propagation computational process, the network outputs and obtains the label predicted finally;
s032, calculating an error according to the real label of the input sample and the prediction label obtained in the step S031;
s033, reversely propagating the error calculated in the step S032 from the output end to the input end of the network, and adjusting parameters of each layer of the network by using a gradient descent optimization strategy, thereby completing a round of iterative process;
and S034, dividing the training set into a plurality of small batches of samples, repeating the processes of S031, S032 and S033 for each batch of samples, and performing loop iteration until the error calculated in the step S032 is basically unchanged, wherein the model can be considered to be converged, and the training process is finished.
Further, the trained recognition network can realize a detection speed of more than 20 frames per second for 640 × 640 resolution image input; in the recognition accuracy, under the condition that the illumination and the shooting angle are normal, after the angle is manually adjusted, the code can be detected within 3s, and the accuracy of the actually detected code is more than 98%.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein, and any reference signs in the claims are not intended to be construed as limiting the claim concerned.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111027485.XA CN113936164A (en) | 2021-09-02 | 2021-09-02 | Recognition method, network and training method of hidden coding composed of directional primitives |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111027485.XA CN113936164A (en) | 2021-09-02 | 2021-09-02 | Recognition method, network and training method of hidden coding composed of directional primitives |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113936164A true CN113936164A (en) | 2022-01-14 |
Family
ID=79274948
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111027485.XA Pending CN113936164A (en) | 2021-09-02 | 2021-09-02 | Recognition method, network and training method of hidden coding composed of directional primitives |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113936164A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101366266A (en) * | 2005-12-01 | 2009-02-11 | 北大方正集团有限公司 | Method and device for embedding and detecting digital watermark in text document |
CN102456215A (en) * | 2010-10-14 | 2012-05-16 | 北京大学 | A Visible Watermark Embedding and Extraction Method and System Carrying Hidden Information |
CN105243409A (en) * | 2014-07-07 | 2016-01-13 | 顾泽苍 | Printed image information embedding and identifying method enabling public to read and identify code information easily through mobile phone |
CN110110599A (en) * | 2019-04-03 | 2019-08-09 | 天津大学 | A kind of Remote Sensing Target detection method based on multi-scale feature fusion |
CN111028308A (en) * | 2019-11-19 | 2020-04-17 | 珠海涵辰科技有限公司 | Steganography and reading method for information in image |
-
2021
- 2021-09-02 CN CN202111027485.XA patent/CN113936164A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101366266A (en) * | 2005-12-01 | 2009-02-11 | 北大方正集团有限公司 | Method and device for embedding and detecting digital watermark in text document |
CN102456215A (en) * | 2010-10-14 | 2012-05-16 | 北京大学 | A Visible Watermark Embedding and Extraction Method and System Carrying Hidden Information |
CN105243409A (en) * | 2014-07-07 | 2016-01-13 | 顾泽苍 | Printed image information embedding and identifying method enabling public to read and identify code information easily through mobile phone |
CN110110599A (en) * | 2019-04-03 | 2019-08-09 | 天津大学 | A kind of Remote Sensing Target detection method based on multi-scale feature fusion |
CN111028308A (en) * | 2019-11-19 | 2020-04-17 | 珠海涵辰科技有限公司 | Steganography and reading method for information in image |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112052839B (en) | Image data processing method, apparatus, device and medium | |
CN109815928B (en) | Face image synthesis method and device based on counterstudy | |
Xu et al. | Stylized aesthetic QR code | |
CN114155527A (en) | A scene text recognition method and device | |
KR102612808B1 (en) | lighting estimation | |
CN110276316A (en) | A human key point detection method based on deep learning | |
CN112836597B (en) | Multi-hand gesture key point estimation method based on cascade parallel convolution neural network | |
CN108764024A (en) | Generating means, method and the computer readable storage medium of human face recognition model | |
CN117409192B (en) | A data-enhanced infrared small target detection method and device | |
CN112183150B (en) | Image two-dimensional code and preparation method, analysis device and analysis method thereof | |
CN112633220B (en) | Human body posture estimation method based on bidirectional serialization modeling | |
CN106778995A (en) | A kind of art up two-dimensional code generation method and device with image co-registration | |
CN108108751A (en) | A kind of scene recognition method based on convolution multiple features and depth random forest | |
CN110263768A (en) | A kind of face identification method based on depth residual error network | |
CN109886153A (en) | A real-time face detection method based on deep convolutional neural network | |
CN108491836A (en) | Chinese text global recognition method in a kind of natural scene image | |
CN108229234A (en) | A kind of fusion is digitally coded can scan image generation method | |
CN114299184B (en) | Method and device for coloring line drawings of Tibetan architecture based on semantic matching | |
CN113850324A (en) | Multispectral target detection method based on Yolov4 | |
CN109409305A (en) | A kind of facial image clarity evaluation method and device | |
CN109977834B (en) | Method and device for segmenting human hand and interactive object from depth image | |
CN114821326A (en) | A method for detection and recognition of dense and weak targets in wide-scale remote sensing images | |
CN117671509A (en) | Remote sensing target detection method and device, electronic equipment and storage medium | |
CN113763498B (en) | Industrial manufacturing-oriented portrait simple drawing region self-adaptive color matching method and system | |
CN113936164A (en) | Recognition method, network and training method of hidden coding composed of directional primitives |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |