Training data generation method, image data processing method, device and equipment
By enhancing processing of the target QR code and fusing it with background images, training data with adversarial characteristics is generated, which solves the problem of insufficient recognition ability of malicious QR codes in the existing technology, and improves the detection ability of the QR code detection model and accuracy.
Patent Information
- Application Number
- CN202411480724.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-02-11
AI Technical Summary
The existing QR code scanning identification program has weak ability to identify malicious QR codes and cannot accurately identify malicious QR codes containing malicious information, resulting in user losses.
A training data generation method is proposed, by obtaining the target QR code, performing enhancement processing and fusing with the background image, and generating training data with adversarial characteristics, which is used to train the QR code detection model.
The detection capability and accuracy of the QR code detection model are improved, the recognition ability of malicious QR codes is enhanced, and the reliability and accuracy of training data generation are improved.
Smart Images

Figure CN119416805A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, in particular to the field of artificial intelligence technology such as deep learning, computer vision, and image processing, and specifically to a training data generation method, an image data processing method, a device, and an apparatus. Background Art
[0002] Due to the convenience of QR code technology, QR codes are currently being rapidly and widely used in various fields. However, when users scan and identify QR codes, existing scanning and recognition programs have weak security recognition capabilities for QR codes and may not accurately identify malicious QR codes containing malicious information, thus causing user losses. How to improve the recognition capability of malicious QR codes is a problem that needs to be solved urgently. Summary of the invention
[0003] The present disclosure aims to solve one of the technical problems in the related art at least to some extent.
[0004] The first embodiment of the present disclosure provides a method for generating training data, including:
[0005] Get the target QR code;
[0006] Performing enhancement processing on the target two-dimensional code image to obtain a first two-dimensional code, wherein the first two-dimensional code and the target two-dimensional code respectively correspond to at least one of the following different items: encoding information, visual presentation;
[0007] Merging the first two-dimensional code with a randomly acquired background image to obtain an input image;
[0008] The input image and the target two-dimensional code are determined as a set of training data, wherein the training data is used to train and generate a two-dimensional code detection model.
[0009] A second aspect of the present disclosure provides a method for processing image data, including:
[0010] Inputting the acquired image into the generated two-dimensional code detection model to obtain the two-dimensional code to be identified, wherein the two-dimensional code detection model is generated based on the training data described in the first aspect of the present disclosure;
[0011] Identify the two-dimensional code image to be identified to obtain a second text corresponding to the two-dimensional code image;
[0012] In the case where the domain name in the second text contains Chinese characters, determining a multi-dimensional feature of the domain name, wherein the multi-dimensional feature includes at least one of the following: a probability value of containing an uncommon word, network assets, and associated domain name information;
[0013] The acquired image is processed according to the multi-dimensional features of the domain name.
[0014] The third aspect of the present disclosure provides a training data generating device, including:
[0015] An acquisition module is used to acquire a target QR code;
[0016] An enhancement module, configured to enhance the target two-dimensional code image to obtain a first two-dimensional code, wherein the first two-dimensional code and the target two-dimensional code respectively correspond to at least one of the following different items: encoding information, visual presentation;
[0017] A fusion module, used for fusing the first two-dimensional code with a randomly acquired background image to obtain an input image;
[0018] The first determination module is used to determine the input image and the target two-dimensional code as a set of training data, wherein the training data is used to train and generate a two-dimensional code detection model.
[0019] A fourth aspect of the present disclosure provides an image data processing device, including:
[0020] An input module, used to input the acquired image into a generated two-dimensional code detection model to obtain a two-dimensional code to be identified, wherein the two-dimensional code detection model is generated based on the training data described in the first aspect of the present disclosure;
[0021] A recognition module, used for recognizing the two-dimensional code image to be recognized, and obtaining a second text corresponding to the two-dimensional code image;
[0022] A second determination module is used to determine the multi-dimensional features of the domain name in the case where the domain name in the second text contains Chinese characters, wherein the multi-dimensional features include at least one of the following: a probability value of containing uncommon words, network assets, and associated domain name information;
[0023] A processing module is used to process the acquired image according to the multi-dimensional features of the domain name.
[0024] The fifth aspect embodiment of the present disclosure proposes a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the training data generation method proposed in the first aspect embodiment and the image data processing method proposed in the second aspect embodiment of the present disclosure are implemented.
[0025] The sixth aspect embodiment of the present disclosure proposes a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the training data generation method proposed in the first aspect embodiment of the present disclosure and the image data processing method proposed in the second aspect embodiment.
[0026] The seventh aspect embodiment of the present disclosure proposes a computer program product, including a computer program. When the computer program is executed by a processor, it implements the training data generation method proposed in the first aspect embodiment of the present disclosure and the image data processing method proposed in the second aspect embodiment.
[0027] The training data generation method, image data processing method, device and equipment provided by the present disclosure have the following beneficial effects:
[0028] In the disclosed embodiment, the target two-dimensional code is first acquired, and then the target two-dimensional code image is enhanced to obtain a first two-dimensional code, and then the first two-dimensional code is fused with a randomly acquired background image to obtain an input image, and finally the input image and the target two-dimensional code are determined as a set of training data. Thus, by enhancing the target two-dimensional code to obtain the first two-dimensional code, fusing the first two-dimensional code with the background image to obtain the input image, and using the input image and the target two-dimensional code as training data, training data with adversarial characteristics is obtained, which provides conditions for improving the detection capability of the two-dimensional code detection model generated based on the training data, and improves the reliability and accuracy of the training data generation.
[0029] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0031] Figure 1 A flowchart of a training data generation method provided by an embodiment of the present disclosure;
[0032] Figure 2 A schematic diagram of an input image provided for the present disclosure;
[0033] Figure 3 A flowchart of a training data generation method provided by an embodiment of the present disclosure;
[0034] Figure 4 A flowchart of a method for processing image data provided by an embodiment of the present disclosure;
[0035] Figure 5 A schematic diagram of the process of optimizing a two-dimensional code image provided by the present disclosure;
[0036] Figure 6 A schematic diagram of a two-dimensional code locator provided by the present disclosure;
[0037] Figure 7 A flowchart of a method for processing image data provided by an embodiment of the present disclosure;
[0038] Figure 8 A flowchart of a method for processing image data provided by an embodiment of the present disclosure;
[0039] Fig. 9 A flowchart of a method for processing image data provided by an embodiment of the present disclosure;
[0040] Fig.10 A schematic diagram of the structure of a training data generating device provided in an embodiment of the present disclosure;
[0041] Fig.11 A schematic diagram of the structure of an image data processing device provided by an embodiment of the present disclosure;
[0042] Fig.12 A block diagram of an exemplary computer device suitable for implementing embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0043] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0044] The present disclosure relates to the fields of artificial intelligence technologies such as deep learning, computer vision, and image processing.
[0045] Artificial Intelligence (AI) is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence.
[0046] Deep Learning (DL) is the process of learning the inherent laws and representation levels of sample data. The information obtained in the learning process is very helpful for interpreting data such as text, images, and sounds. The ultimate goal of deep learning is to enable machines to have analytical learning capabilities like humans and to recognize data such as text, images, and sounds.
[0047] Computer vision refers to the use of cameras and computers to replace the human eye to identify, track and measure targets, and further perform graphic processing so that the computer processing becomes an image that is more suitable for human eye observation or transmission to instrument detection.
[0048] Image processing refers to the technology of analyzing, processing, and manipulating images to meet visual, psychological or other requirements.
[0049] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0050] The following describes the training data generation method, image data processing method, device and equipment of the embodiments of the present disclosure with reference to the accompanying drawings.
[0051] Figure 1 A flowchart of a training data generation method provided in an embodiment of the present disclosure.
[0052] like Figure 1 As shown, the training data generation method may include the following steps:
[0053] Step 101, obtaining a target QR code.
[0054] The target two-dimensional code may be a two-dimensional code used to form training data.
[0055] In the present disclosure, in order to obtain a two-dimensional code detection model, a target two-dimensional code used to constitute training data may be first obtained.
[0056] Optionally, the present disclosure may generate a target QR code based on a randomly generated first text, thereby improving the content diversity of the generated target QR code.
[0057] The first text may be a text of any content, which is not limited in the present disclosure.
[0058] Step 102, enhancing the target two-dimensional code image to obtain a first two-dimensional code, wherein the first two-dimensional code and the target two-dimensional code respectively correspond to at least one of the following different items: encoding information, visual presentation.
[0059] Optionally, when the target two-dimensional code image is enhanced, the present disclosure may perform at least one of the following enhancement processing operations: reducing the contrast of the two-dimensional code, flipping the two-dimensional code black and white, adding noise, and artistic stylization, etc. For example, if the contrast of the target two-dimensional code is reduced, or the two-dimensional code is flipped black and white, or artistic stylization is performed, a first two-dimensional code different from the visual presentation of the target two-dimensional code can be obtained; if the target two-dimensional code is subjected to noise processing, a first two-dimensional code different from the encoding information of the target two-dimensional code can be obtained, etc., and the present disclosure does not limit this.
[0060] In the present disclosure, after obtaining the target QR code, by performing at least one of the enhancement processing such as reducing the contrast of the QR code, flipping the QR code black and white, adding noise and artistic stylization processing on the target QR code, a first QR code different in at least one of the coding information and visual presentation corresponding to the target QR code can be obtained, thereby obtaining a first QR code that is adversarial to the target QR code, providing conditions for generating training data with adversarial features.
[0061] Step 103: Merge the first two-dimensional code with the randomly acquired background image to obtain an input image.
[0062] The input image may be an image used to train a QR code detection model.
[0063] In the present disclosure, after obtaining the first two-dimensional code, the first two-dimensional code is fused with a randomly obtained background image to obtain an input image containing the first two-dimensional code. Figure 2 For example, Figure 2 A schematic diagram of an input image provided by the present disclosure, Figure 2 The input image shown is obtained by artistically stylizing the target two-dimensional code to obtain a first two-dimensional code, and fusing the first two-dimensional code with a randomly obtained background image, which is not limited in the present disclosure.
[0064] Step 104: determine the input image and the target two-dimensional code as a set of training data, wherein the training data is used to train and generate a two-dimensional code detection model.
[0065] The two-dimensional code detection model may be a detection model of any type and structure generated by training. For example, the two-dimensional code detection model may be a detection model of a CNN type and structure, etc., which is not limited in the present disclosure.
[0066] Among them, CNN is the abbreviation of Convolutional Neural Network (CNN).
[0067] In the present disclosure, after obtaining the input image, the input image and the target QR code can be determined as a set of training data. Since the input image is obtained by enhancing the target QR code and fusing it with the background image, the QR code contained therein differs from the target QR code in visual presentation and encoding information. Therefore, the training data composed of the input image and the target QR code is data with adversarial characteristics. Therefore, the QR code detection model generated by training based on the training data can detect and identify the QR code in the adversarial scenario, and the detection capability and accuracy of the QR code detection model can be improved.
[0068] In the disclosed embodiment, the target two-dimensional code is first acquired, and then the target two-dimensional code image is enhanced to obtain a first two-dimensional code, and then the first two-dimensional code is fused with a randomly acquired background image to obtain an input image, and finally the input image and the target two-dimensional code are determined as a set of training data. Thus, by enhancing the target two-dimensional code to obtain the first two-dimensional code, fusing the first two-dimensional code with the background image to obtain the input image, and using the input image and the target two-dimensional code as training data, training data with adversarial characteristics is obtained, which provides conditions for improving the detection capability of the two-dimensional code detection model generated based on the training data, and improves the reliability and accuracy of the training data generation.
[0069] Figure 3 A flowchart of a training data generation method provided by an embodiment of the present disclosure.
[0070] like Figure 3 As shown, the training data generation method may include the following steps:
[0071] Step 301, obtaining a target QR code.
[0072] Step 302: Enhance the target two-dimensional code image to obtain a first two-dimensional code, wherein the first two-dimensional code and the target two-dimensional code respectively correspond to at least one of the following different items: encoding information, visual presentation.
[0073] The specific implementation forms of step 301 to step 302 can refer to the detailed descriptions in other embodiments of the present disclosure, and will not be described in detail here.
[0074] Step 303: scaling and / or angularly rotating the first two-dimensional code to obtain a second two-dimensional code.
[0075] In the present disclosure, after obtaining the first QR code, in order to expand the difference between the input image and the target QR code, thereby improving the detection capability of the QR code detection model, before merging the first QR code with the background image, the first QR code can be scaled and / or rotated to obtain a second QR code.
[0076] Step 304, randomly generate a placement position for the second QR code.
[0077] The placement position may be the position of the second QR code on the background image when the second QR code is integrated with the background image. For example, the placement position may be any position such as the upper left corner, the middle, or the lower right corner of the background image, and the present disclosure does not limit this.
[0078] In the present disclosure, after obtaining the second two-dimensional code, the placement position of the second two-dimensional code can be randomly generated, thereby providing conditions for improving the randomness and diversity of the obtained input image.
[0079] Step 305: Based on the placement position, the second two-dimensional code is merged with the randomly acquired background image to obtain an input image.
[0080] In the present disclosure, after randomly generating the placement position of the second QR code, the second QR code can be fused with a randomly acquired background image based on the placement position to obtain an input image for training a QR code detection model, thereby improving the randomness and diversity of the obtained input image.
[0081] Step 306: determine the input image and the target two-dimensional code as a set of training data, wherein the training data is used to train and generate a two-dimensional code detection model.
[0082] The specific implementation of step 306 can refer to the detailed description in other embodiments of the present disclosure, and will not be described in detail here.
[0083] In the disclosed embodiment, the target two-dimensional code is first obtained, and then the target two-dimensional code image is enhanced to obtain a first two-dimensional code, and the first two-dimensional code is scaled and / or angle-rotated to obtain a second two-dimensional code, and then the placement position of the second two-dimensional code is randomly generated, and based on the placement position, the second two-dimensional code is fused with the randomly obtained background image to obtain an input image, and finally the input image and the target two-dimensional code are determined as a set of training data. Thus, after the target two-dimensional code is enhanced and scaled and / or angle-rotated, the second two-dimensional code is obtained, and based on the randomly generated placement position, the second two-dimensional code is fused with the randomly obtained background image to obtain the input image, and the input image and the target two-dimensional code are used as a set of training data, thereby improving the randomness and reliability of the generated training data, and providing conditions for improving the detection capability of the two-dimensional code detection model.
[0084] Figure 4 A flowchart of a method for processing image data provided by an embodiment of the present disclosure is provided.
[0085] like Figure 4 As shown, the method for processing the image data may include the following steps:
[0086] Step 401, input the acquired image into the generated two-dimensional code detection model to obtain the two-dimensional code to be identified.
[0087] Among them, the two-dimensional code detection model can be generated by the training data obtained by the method in the above embodiment.
[0088] The acquired image may be any image containing a QR code. For example, the acquired image may be Figure 2 The present disclosure is not limited to the images shown, etc.
[0089] In the present disclosure, after obtaining an image containing a two-dimensional code to be identified, the obtained image can be input into a generated two-dimensional code detection model to obtain the two-dimensional code to be identified.
[0090] Step 402: recognize the two-dimensional code image to be recognized, and obtain a second text corresponding to the two-dimensional code image.
[0091] The second text may be text information of a website address corresponding to the QR code image.
[0092] In the present disclosure, after obtaining the QR code to be identified, the QR code image to be identified can be identified to obtain the second text corresponding to the QR code image, so that it can be determined based on the second text whether the QR code image to be identified is a malicious image.
[0093] Optionally, before recognizing the QR code image to be recognized, since the resolution and / or contrast of the QR code image to be recognized may be low, in order to improve the accuracy of QR code recognition, the resolution of the QR code image may be firstly improved by using a preset super-resolution model, and then the QR code image may be converted into a black and white image by binarization, thereby obtaining a high-resolution and high-contrast QR code image. Figure 5 As shown, Figure 5 A schematic diagram of the process of optimizing the QR code image provided by the present disclosure, Figure 5 In the embodiment, the low-resolution two-dimensional code image is processed by the super-resolution model and the binarization method in sequence to obtain the corresponding high-resolution two-dimensional code image, which is not limited in the present disclosure.
[0094] Optionally, when the two-dimensional code image to be identified is identified, the identification can be performed through two stages: positioning and parsing. First, in the positioning stage, the locator of the two-dimensional code can be detected and located by image processing technology, and the boundary and direction of the two-dimensional code can be determined, such as Figure 6 As shown, Figure 6 A schematic diagram of a two-dimensional code locator provided by the present disclosure, Figure 6The square patterns in the upper left corner, upper right corner, and lower left corner are the locators of the QR code. Figure 6 As an example only, in the parsing stage, the QR code area is corrected to a standard square through perspective transformation and other methods, and the data area of the QR code is scanned and parsed to extract the second text corresponding to the QR code. This disclosure does not limit this.
[0095] Step 403, when there are Chinese characters in the domain name in the second text, determine the multi-dimensional features of the domain name, wherein the multi-dimensional features include at least one of the following: a probability value of containing uncommon words, network assets, and associated domain name information.
[0096] Among them, uncommon words can be words generated by counterfeiting legitimate website domain names and randomly combining Chinese characters. They can also be words generated by randomly combining legitimate Chinese website domain names with other characters (such as numbers or English, etc.), and the present disclosure does not limit this.
[0097] The network assets may include any asset information, such as website icons, page fingerprint information, etc., which are not limited in the present disclosure.
[0098] In the present disclosure, after obtaining the second text corresponding to the QR code image to be identified, when there are Chinese characters in the domain name in the second text, in order to determine whether the domain name in the second text is a high-risk domain name, the multi-dimensional features of the domain name can be determined first.
[0099] Optionally, the present disclosure may first determine the second-level domain (SLD) in the second text, and then decode the second-level domain encoded based on the Puny Code to determine whether there are Chinese characters in the domain name in the second text, which is not limited by the present disclosure.
[0100] Step 404: Process the acquired image according to the multi-dimensional features of the domain name.
[0101] It should be noted that each feature included in the multi-dimensional features of the domain name is different, and the way of processing the acquired image based on each feature may be different, which is not limited in the present disclosure.
[0102] Optionally, when the probability value of the domain name containing uncommon words is greater than a first threshold value in the multidimensional features of the domain name, it can be determined that the domain name is likely to be a high-risk domain name. At this time, the image can be marked as a malicious image.
[0103] The first threshold value may be a probability critical value of a domain name containing an uncommon word when judging whether the acquired image is a malicious image, which may be preset. For example, the first threshold value may be 0.9, which is not limited in the present disclosure.
[0104] Optionally, when network assets are included in the multidimensional features of the domain name, and when the first similarity between the network assets and any asset in the preset asset library is greater than a second threshold, it can be determined that there is a high probability that the network assets of the domain name are high-risk network assets. In this case, the image can be marked as a malicious image.
[0105] Among them, the preset asset library can be a database containing website icons and page fingerprint information of high-risk Chinese domain names.
[0106] The first similarity may be the similarity between the network asset of the domain name in the second text and any asset in the asset library.
[0107] The second threshold may be a critical value of similarity used to determine whether the acquired image is a malicious image, which may be preset and is not limited in the present disclosure.
[0108] Optionally, when the multidimensional features of the domain name include associated domain name information, and when the associated domain name information includes an unregistered domain name, it can be determined that there is a high probability that the domain name is an illegal domain name with high risk. In this case, the image can be marked as a malicious image.
[0109] Among them, the unregistered domain name may be a domain name that has not been registered with ICP.
[0110] Among them, ICP is the abbreviation of Internet Content Provider (ICP).
[0111] Optionally, when the multidimensional features of the domain name include associated domain name information, and when the associated domain name information includes a domain name in a blacklist library, the domain name can be determined to be a high-risk domain name. In this case, the image can be marked as a malicious image.
[0112] The blacklist database may be a database containing risky domain names, which may be pre-set, and the present disclosure does not limit this.
[0113] In the present disclosure, whether the acquired image is a malicious image is determined by at least one feature in the multidimensional features based on the domain name. If the image is determined to be a malicious image, the image is marked as a malicious image, thereby improving the ability to recognize malicious QR codes and improving the accuracy and reliability of image data processing.
[0114] It should be noted that the present disclosure can also determine whether the domain name is a high-risk domain name by determining the geographical location of the IP of the domain name in the second text. For example, a domain name whose IP geographical location is outside a preset range (such as abroad, etc.) can be determined to be a high-risk domain name, and the present disclosure does not limit this.
[0115] It should be noted that the present disclosure can also determine whether a domain name is a high-risk domain name based on risk behavior. For example, whether the domain name has an off-site jump, and whether the target domain name of the jump is a registered domain name. If there is an off-site jump and the target domain name is not a registered domain name, then the domain name can be determined to be a high-risk domain name, and the present disclosure does not limit this.
[0116] In the disclosed embodiment, the acquired image is first input into the generated two-dimensional code detection model to obtain the two-dimensional code to be identified, and then the two-dimensional code image to be identified is identified to obtain the second text corresponding to the two-dimensional code image. When there are Chinese characters in the domain name in the second text, the multi-dimensional features of the domain name are determined. Finally, the acquired image is processed according to the multi-dimensional features of the domain name. Thus, by identifying the acquired image based on the two-dimensional code detection model, the two-dimensional code image to be identified is obtained, the text of the two-dimensional code image is determined, and when there are Chinese characters in the domain name in the text, the multi-dimensional features of the domain name are determined, and the acquired image is processed based on the multi-dimensional features, thereby improving the accuracy and reliability of image data processing.
[0117] Figure 7 A flowchart of a method for processing image data provided by an embodiment of the present disclosure is provided.
[0118] like Figure 7 As shown, the method for processing the image data may include the following steps:
[0119] Step 701: input the acquired image into the generated two-dimensional code detection model to obtain the two-dimensional code to be identified.
[0120] Among them, the two-dimensional code detection model can be generated by the training data obtained by the method of the above embodiment.
[0121] Step 702: recognize the two-dimensional code image to be recognized, and obtain a second text corresponding to the two-dimensional code image.
[0122] The specific implementation forms of step 701 to step 702 can refer to the detailed descriptions in other embodiments of the present disclosure, and will not be described in detail here.
[0123] Step 703: If there are Chinese characters in the domain name in the second text, determine the Chinese character set contained in the domain name.
[0124] Among them, the Chinese character set can be the set of Chinese characters included in the domain name in the second text.
[0125] In the present disclosure, after obtaining the second text corresponding to the QR code pattern, when there are Chinese characters in the domain name in the second text, in order to determine whether the domain name in the second text is a high-risk domain name, the Chinese character set included in the domain name can be determined first.
[0126] Step 704, when at least one character in the Chinese character set is a character in the reference character library, search based on each other character in the Chinese character set to obtain the search result corresponding to each other character.
[0127] Among them, the reference character library can be a preset Chinese character database, which contains Chinese characters that may correspond to high-risk domain names. For example, the reference character library may contain Chinese characters such as "hao", "you", and "pai", etc., and the present disclosure does not limit this.
[0128] In the present disclosure, after determining the Chinese character set included in the domain name in the second text, when at least one character in the Chinese character set is a character in the reference character set, in order to accurately determine whether the domain name in the second text is a high-risk domain name, search can be performed based on each other character in the Chinese character set to obtain the search result corresponding to each other character.
[0129] Step 705, determine the probability value that the domain name contains rare words according to the number of times each other character appears in the title of the search result and the total number of search results.
[0130] In the present disclosure, after obtaining the search result corresponding to each other character, the probability value that the domain name contains rare words can be determined based on the number of times each other character appears in the title of the search result and the total number of search results, so as to improve the accuracy of the determined probability value that the domain name contains rare words. For example, let the number of times each other character appears in the title of the search result be n, and the total number of search results be N, and it can be determined according to to determine the probability that each other character appears in the search result. After determining the probability that each other character appears in the domain name, the probability value that the domain name contains rare words is the sum of the occurrence probabilities corresponding to all other characters, and the present disclosure does not limit this.
[0131] It should be noted that The smaller it is, it indicates that the corresponding other character appears fewer times, and the probability that this other character is a rare word is greater, and the present disclosure does not limit this.
[0132] Optionally, when determining the probability value that the domain name contains an uncommon word based on the number of times each other character appears in the title of the search results and the total number of search results, you can first determine the weight value corresponding to each other character based on the total number of other characters contained in the domain name, and then determine the probability value that the domain name contains an uncommon word based on the weight value corresponding to each other character, the number of times the other character appears in the title of the search results and the total number of search results, thereby further improving the accuracy of the determined probability value that the domain name contains an uncommon word.
[0133] It should be noted that the more other characters a domain name contains, the lower the weight value corresponding to each character, and this disclosure does not limit this.
[0134] Step 706: When the probability value of the domain name containing an uncommon word is greater than a first threshold, the image is marked as a malicious image.
[0135] The specific implementation form of step 706 can refer to the detailed description in other embodiments of the present disclosure, and will not be described in detail here.
[0136] In the disclosed embodiment, the acquired image is first input into the generated QR code detection model to obtain the QR code to be identified, and the QR code image to be identified is identified to obtain a second text corresponding to the QR code image. When there are Chinese characters in the domain name in the second text, the Chinese character set contained in the domain name is determined. When at least one character in the Chinese character set is a character in the reference character library, a search is performed based on each other character in the Chinese character set to obtain the search result corresponding to each other character. Then, based on the number of times each other character appears in the title of the search result and the total number of search results, the probability value of the domain name containing an uncommon word is determined. When the probability value of the domain name containing an uncommon word is greater than a first threshold, the image is marked as a malicious image. Therefore, after obtaining the text of the QR code image to be identified, when there are Chinese characters in the domain name in the text, and when at least one character in the Chinese character set contained in the domain name is a character in the reference character library, each other character in the Chinese character set is searched, and based on the number of times each other character appears in the title of the search result and the total number of search results, the probability value of the domain name containing uncommon words is determined, and when the probability value is greater than a threshold, the obtained image is marked as a malicious image, thereby improving the ability to recognize malicious QR codes and improving the accuracy and reliability of image data processing.
[0137] Figure 8 A flowchart of a method for processing image data provided by an embodiment of the present disclosure is provided.
[0138] like Figure 8 As shown, the method for processing the image data may include the following steps:
[0139] Step 801, determining a first vector corresponding to an acquired image.
[0140] The first vector may be a feature vector corresponding to the acquired image.
[0141] In the present disclosure, after obtaining an image, the first vector corresponding to the obtained image can be determined by any method. For example, the first vector can be determined by using CNN to learn the feature representation of the image, which is not limited in the present disclosure.
[0142] Step 802: Match the first vector with each second vector in the malicious image library to determine the matching degree between the first vector and each second vector.
[0143] The malicious image library may be a database containing malicious images and their corresponding second vectors, which may be pre-set and is not limited in the present disclosure.
[0144] It should be noted that the malicious image contained in the malicious image and its corresponding second vector can be manually annotated malicious image samples, and then the second vector corresponding to the malicious image is obtained through CNN calculation, and the present disclosure does not limit this.
[0145] The second vector may be a feature vector corresponding to the malicious image.
[0146] In the present disclosure, after determining the first vector corresponding to the acquired image, the first vector can be matched with each second vector in the malicious image, and the matching degree between the first vector and each second vector can be determined by a pre-set matching degree calculation method. For example, the matching degree between the first vector and each second vector can be determined by methods such as Euclidean distance or cosine similarity, which is not limited in the present disclosure.
[0147] Step 803: When each matching degree is less than the third threshold, the acquired image is input into the generated two-dimensional code detection model to obtain the two-dimensional code to be identified.
[0148] Among them, the third threshold value may be a critical value of matching degree used to determine whether the acquired image is a malicious image, which may be preset and is not limited in the present disclosure.
[0149] In the present disclosure, when the first vector corresponding to the acquired image has a matching degree with each second vector in the malicious image library that is less than a third threshold, it can be determined that the acquired image is not a malicious image in the malicious image library. At this time, in order to further determine whether the acquired image is a malicious image, the acquired image can be input into the generated QR code detection model to obtain the QR code to be identified, thereby improving the reliability of image data processing.
[0150] Step 804: recognize the two-dimensional code image to be recognized, and obtain a second text corresponding to the two-dimensional code image.
[0151] Step 805, when there are Chinese characters in the domain name in the second text, determine the multi-dimensional features of the domain name, wherein the multi-dimensional features include at least one of the following: a probability value of containing uncommon words, network assets, and associated domain name information.
[0152] Step 806: Process the acquired image according to the multi-dimensional features of the domain name.
[0153] The specific implementation forms of steps 804 to 806 can refer to the detailed descriptions in other embodiments of the present disclosure and will not be described in detail here.
[0154] In the disclosed embodiment, the first vector corresponding to the acquired image is first determined, and the first vector is matched with each second vector in the malicious image library to determine the matching degree between the first vector and each second vector. When each matching degree is less than a third threshold, the acquired image is input into the generated two-dimensional code detection model to obtain the two-dimensional code to be identified, and then the two-dimensional code image to be identified is identified to obtain the second text corresponding to the two-dimensional code image. When there are Chinese characters in the domain name in the second text, the multi-dimensional features of the domain name are determined, and finally the acquired image is processed according to the multi-dimensional features of the domain name. Thus, by matching the vector corresponding to the acquired image with each vector in the malicious image library and obtaining the corresponding matching degree, when each matching degree is less than a threshold, the two-dimensional code image to be identified contained in the acquired image, and when the domain name in the text of the two-dimensional code image contains Chinese characters, the multi-dimensional features of the domain name are determined, and the acquired image is processed according to the multi-dimensional features of the domain name, thereby improving the efficiency and accuracy of image data processing.
[0155] Fig. 9 A flowchart of a method for processing image data provided by an embodiment of the present disclosure is provided.
[0156] like Fig. 9 As shown, the method for processing the image data may include the following steps:
[0157] Step 901: input the acquired image into the generated two-dimensional code detection model to obtain the two-dimensional code to be identified.
[0158] Among them, the two-dimensional code detection model can be generated by the training data obtained by the method of the above embodiment.
[0159] Step 902: recognize the two-dimensional code image to be recognized, and obtain a second text corresponding to the two-dimensional code image.
[0160] The specific implementation forms of step 901 to step 902 can refer to the detailed descriptions in other embodiments of the present disclosure and will not be described in detail here.
[0161] Step 903: based on the second text, search a preset malicious text library, and if the second similarity between the second text and any malicious text in the malicious text library is greater than a fourth threshold, mark the image as a malicious image.
[0162] The malicious text library may be a database containing malicious texts of any content, and the present disclosure does not limit this.
[0163] The second similarity may be a similarity between the second text and any malicious text in the malicious text library.
[0164] Among them, the fourth threshold value may be a similarity critical value used to determine whether the second text is a malicious text, which may be preset and is not limited in the present disclosure.
[0165] In the present disclosure, after obtaining the second text corresponding to the QR code image, a preset malicious text library can be retrieved based on the second text. When the second similarity between the second text and any malicious text in the malicious text library is greater than a fourth threshold, the second text can be determined to be a malicious text. At this time, the obtained image can be marked as a malicious image, thereby effectively avoiding losses caused by users identifying malicious QR codes and improving the reliability of image data processing.
[0166] Optionally, after marking the acquired image as a malicious image, the third vector corresponding to the second text may be determined, and the second text and the third vector may be associated and stored in a malicious text library, thereby improving the real-time and comprehensiveness of the content in the malicious text library.
[0167] The third vector may be a feature vector corresponding to the second text.
[0168] In the disclosed embodiment, the acquired image is first input into the generated QR code detection model to obtain the QR code to be identified, and then the QR code image to be identified is identified to obtain the second text corresponding to the QR code image, and finally based on the second text, the preset malicious text library is retrieved, and when the second similarity between the second text and any malicious text in the malicious text library is greater than a fourth threshold, the image is marked as a malicious image. Thus, by retrieving the malicious text library based on the text of the QR code image in the acquired image, and when the similarity between the text of the QR code image and any malicious text in the malicious text library is greater than a threshold, the image is marked as a malicious image, thereby improving the efficiency and accuracy of image data processing.
[0169] In order to implement the above embodiment, the present disclosure also proposes a training data generating device.
[0170] Fig.10 A schematic diagram of the structure of a training data generating device provided in an embodiment of the present disclosure.
[0171] like Fig.10 As shown, the training data generating device 1000 includes: an acquisition module 1001, an enhancement module 1002, a fusion module 1003, and a first determination module 1004.
[0172] An acquisition module 1001 is used to acquire a target QR code;
[0173] The enhancement module 1002 is used to enhance the target two-dimensional code image to obtain a first two-dimensional code, wherein the first two-dimensional code and the target two-dimensional code respectively correspond to at least one of the following different items: encoding information, visual presentation;
[0174] A fusion module 1003 is used to fuse the first two-dimensional code with a randomly acquired background image to obtain an input image;
[0175] The first determination module 1004 is used to determine the input image and the target two-dimensional code as a set of training data, wherein the training data is used to train and generate a two-dimensional code detection model.
[0176] In a possible implementation of the present disclosure, the fusion module 1003 is specifically configured to:
[0177] Scaling and / or angularly rotating the first two-dimensional code to obtain a second two-dimensional code;
[0178] Randomly generate the placement position of the second QR code;
[0179] Based on the placement position, the second QR code is fused with the randomly acquired background image to obtain an input image.
[0180] In a possible implementation of the present disclosure, the acquisition module 1001 is specifically used to:
[0181] A target QR code is generated based on the randomly generated first text.
[0182] The functions and specific implementation principles of the above modules in the embodiments of the present disclosure can be referred to the above method embodiments, and will not be repeated here.
[0183] In the disclosed embodiment, the target two-dimensional code is first acquired, and then the target two-dimensional code image is enhanced to obtain a first two-dimensional code, and then the first two-dimensional code is fused with a randomly acquired background image to obtain an input image, and finally the input image and the target two-dimensional code are determined as a set of training data. Thus, by enhancing the target two-dimensional code to obtain the first two-dimensional code, fusing the first two-dimensional code with the background image to obtain the input image, and using the input image and the target two-dimensional code as training data, training data with adversarial characteristics is obtained, which provides conditions for improving the detection capability of the two-dimensional code detection model generated based on the training data, and improves the reliability and accuracy of the training data generation.
[0184] In order to implement the above embodiment, the present disclosure also proposes a device for processing image data.
[0185] Fig.11 A schematic diagram of the structure of an image data processing device provided in an embodiment of the present disclosure.
[0186] like Fig.11 As shown, the image data processing device 1100 includes: an input module 1101 , a recognition module 1102 , a second determination module 1103 , and a processing module 1104 .
[0187] An input module 1101 is used to input the acquired image into a generated two-dimensional code detection model to obtain a two-dimensional code to be recognized, wherein the two-dimensional code detection model is generated by the training data obtained in the above embodiment of the present disclosure;
[0188] The recognition module 1102 is used to recognize the two-dimensional code image to be recognized and obtain a second text corresponding to the two-dimensional code image;
[0189] The second determination module 1103 is used to determine the multi-dimensional features of the domain name when there are Chinese characters in the domain name in the second text, wherein the multi-dimensional features include at least one of the following: a probability value of containing uncommon words, network assets, and associated domain name information;
[0190] The processing module 1104 is used to process the acquired image according to the multi-dimensional features of the domain name.
[0191] In a possible implementation of the present disclosure, the second determining module 1103 is specifically configured to:
[0192] Determine the Chinese character set contained in the domain name;
[0193] When at least one character in the Chinese character set is a character in the reference character library, searching based on each other character in the Chinese character set to obtain search results corresponding to each other character;
[0194] According to the number of times each other character appears in the title of the search result and the total number of search results, the probability value of the domain name containing an uncommon word is determined.
[0195] In a possible implementation of the present disclosure, the second determining module 1103 is further configured to:
[0196] According to the total number of other characters contained in the domain name, determine the weight value corresponding to each other character;
[0197] Based on the weight value corresponding to each other character, the number of times the other character appears in the title of the search result and the total number of search results, the probability value that the domain name contains an uncommon word is determined.
[0198] In a possible implementation of the present disclosure, the processing module 1104 is specifically used for at least one of the following:
[0199] When the probability value of the domain name containing an uncommon word is greater than a first threshold, marking the image as a malicious image;
[0200] When a first similarity between the network asset and any asset in the preset asset library is greater than a second threshold, marking the image as a malicious image;
[0201] If the associated domain name information contains an unregistered domain name, the image is marked as a malicious image;
[0202] When the associated domain name information contains a domain name in the blacklist library, the image is marked as a malicious image.
[0203] In a possible implementation of the present disclosure, the processing module 1104 is further configured to:
[0204] Determine a first vector corresponding to the acquired image;
[0205] Matching the first vector with each second vector in the malicious image library to determine a matching degree between the first vector and each second vector;
[0206] When each matching degree is less than the third threshold, the acquired image is input into the generated two-dimensional code detection model to obtain the two-dimensional code to be identified.
[0207] In a possible implementation of the present disclosure, the identification module 1102 is further configured to:
[0208] Based on the second text, a preset malicious text library is retrieved, and when a second similarity between the second text and any malicious text in the malicious text library is greater than a fourth threshold, the image is marked as a malicious image.
[0209] In a possible implementation of the present disclosure, the identification module 1102 is further configured to:
[0210] Determine a third vector corresponding to the second text;
[0211] The second text and the third vector are associated and stored in a malicious text library.
[0212] The functions and specific implementation principles of the above modules in the embodiments of the present disclosure can be referred to the above method embodiments, and will not be repeated here.
[0213] In the disclosed embodiment, the acquired image is first input into the generated two-dimensional code detection model to obtain the two-dimensional code to be identified, and then the two-dimensional code image to be identified is identified to obtain the second text corresponding to the two-dimensional code image. When there are Chinese characters in the domain name in the second text, the multi-dimensional features of the domain name are determined. Finally, the acquired image is processed according to the multi-dimensional features of the domain name. Thus, by identifying the acquired image based on the two-dimensional code detection model, the two-dimensional code image to be identified is obtained, the text of the two-dimensional code image is determined, and when there are Chinese characters in the domain name in the text, the multi-dimensional features of the domain name are determined, and the acquired image is processed based on the multi-dimensional features, thereby improving the accuracy and reliability of image data processing.
[0214] Fig.12 A schematic block diagram of an example electronic device 1200 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0215] like Fig.12 As shown, the device 1200 includes a computing unit 1201, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1202 or a computer program loaded from a storage unit 1208 into a random access memory (RAM) 1203. In the RAM 1203, various programs and data required for the operation of the device 1200 can also be stored. The computing unit 1201, the ROM 1202, and the RAM 1203 are connected to each other via a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.
[0216] A number of components in the device 1200 are connected to the I / O interface 1205, including: an input unit 1206, such as a keyboard, a mouse, etc.; an output unit 1207, such as various types of displays, speakers, etc.; a storage unit 1208, such as a disk, an optical disk, etc.; and a communication unit 1209, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1209 allows the device 1200 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0217] The computing unit 1201 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1201 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1201 performs the various methods and processes described above, such as the training data generation method. For example, in some embodiments, the training data generation method may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 1208. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 1200 via ROM 1202 and / or the communication unit 1209. When the computer program is loaded into RAM 1203 and executed by the computing unit 1201, one or more steps of the training data generation method described above may be performed. Alternatively, in other embodiments, the computing unit 1201 may be configured to execute the training data generating method in any other appropriate manner (eg, by means of firmware).
[0218] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0219] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a general-purpose computer, a special-purpose computer, or other programmable processor or controller, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.
[0220] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0221] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0222] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.
[0223] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.
[0224] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0225] In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, the meaning of "multiple" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. In the description of the present disclosure, the words "if" and "if" used can be interpreted as "at the time of" or "when" or "in response to determination" or "under the circumstances of".
[0226] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for generating training data, comprising: Get the target QR code; Performing enhancement processing on the target two-dimensional code image to obtain a first two-dimensional code, wherein the first two-dimensional code and the target two-dimensional code respectively correspond to at least one of the following different items: encoding information, visual presentation; Merging the first two-dimensional code with a randomly acquired background image to obtain an input image; The input image and the target two-dimensional code are determined as a set of training data, wherein the training data is used to train and generate a two-dimensional code detection model.
2. The method of claim 1, wherein: The step of fusing the first two-dimensional code with a randomly acquired background image to obtain an input image includes: Scaling and / or rotating the first two-dimensional code to obtain a second two-dimensional code; Randomly generate a placement position for the second QR code; Based on the placement position, the second two-dimensional code is fused with the randomly acquired background image to obtain the input image.
3. The method according to any one of claims 1 to 2, wherein: The step of obtaining the target QR code comprises: The target two-dimensional code is generated based on the randomly generated first text.
4. A method for processing image data, comprising: Inputting the acquired image into a generated two-dimensional code detection model to obtain a two-dimensional code to be identified, wherein the two-dimensional code detection model is generated based on the training data according to any one of claims 1 to 4; Identify the two-dimensional code image to be identified to obtain a second text corresponding to the two-dimensional code image; In the case where the domain name in the second text contains Chinese characters, determining a multi-dimensional feature of the domain name, wherein the multi-dimensional feature includes at least one of the following: a probability value of containing an uncommon word, network assets, and associated domain name information; The acquired image is processed according to the multi-dimensional features of the domain name.
5. The method of claim 4, wherein: The determining of the multi-dimensional features of the domain name includes: Determining the Chinese character set contained in the domain name; In a case where at least one character in the Chinese character set is a character in the reference character library, searching based on each other character in the Chinese character set to obtain a search result corresponding to each other character; The probability value of the domain name containing an uncommon word is determined according to the number of times each of the other characters appears in the title of the search result and the total number of search results.
6. The method of claim 5, wherein: Determining the probability that the domain name contains an uncommon word according to the number of times each of the other characters appears in the title of the search result and the total number of search results includes: Determining a weight value corresponding to each of the other characters according to the total number of other characters included in the domain name; Based on the weight value corresponding to each of the other characters, the number of times the other characters appear in the title of the search result and the total number of search results, the probability value that the domain name contains an uncommon word is determined.
7. The method of claim 4, wherein: The processing of the acquired image according to the multi-dimensional features of the domain name includes at least one of the following: When the probability value of the domain name containing an uncommon word is greater than a first threshold, marking the image as a malicious image; When a first similarity between the network asset and any asset in a preset asset library is greater than a second threshold, marking the image as a malicious image; If the associated domain name information includes an unregistered domain name, marking the image as a malicious image; In the case that the associated domain name information includes a domain name in the blacklist library, the image is marked as a malicious image.
8. The method of claim 7, wherein: The step of inputting the acquired image into the generated two-dimensional code detection model to obtain the two-dimensional code to be identified includes: Determining a first vector corresponding to the acquired image; Matching the first vector with each second vector in the malicious image library to determine a matching degree between the first vector and each second vector; In the case where each of the matching degrees is less than a third threshold, the acquired image is input into the generated two-dimensional code detection model to obtain the two-dimensional code to be identified.
9. The method according to any one of claims 4 to 8, wherein: After obtaining the second text corresponding to the two-dimensional code image, the method further includes: Based on the second text, a preset malicious text library is retrieved, and when a second similarity between the second text and any malicious text in the malicious text library is greater than a fourth threshold, the image is marked as a malicious image.
10. The method of claim 9, wherein: After marking the image as a malicious image, the method further includes: Determine a third vector corresponding to the second text; The second text and the third vector are associated and stored in the malicious text library.
11. A training data generating device, wherein: The device comprises: An acquisition module is used to acquire a target QR code; An enhancement module, configured to enhance the target two-dimensional code image to obtain a first two-dimensional code, wherein the first two-dimensional code and the target two-dimensional code respectively correspond to at least one of the following different items: encoding information, visual presentation; A fusion module, used for fusing the first two-dimensional code with a randomly acquired background image to obtain an input image; The first determination module is used to determine the input image and the target two-dimensional code as a set of training data, wherein the training data is used to train and generate a two-dimensional code detection model.
12. The device of claim 11, wherein: The fusion module is specifically used for: Scaling and / or rotating the first two-dimensional code to obtain a second two-dimensional code; Randomly generate a placement position for the second QR code; Based on the placement position, the second two-dimensional code is fused with the randomly acquired background image to obtain the input image.
13. The device according to any one of claims 11 to 12, wherein: The acquisition module is specifically used for: The target two-dimensional code is generated based on the randomly generated first text.
14. A device for processing image data, wherein: The device comprises: An input module, used for inputting the acquired image into a generated two-dimensional code detection model to obtain a two-dimensional code to be identified, wherein the two-dimensional code detection model is generated based on the training data according to any one of claims 1 to 4; A recognition module, used for recognizing the two-dimensional code image to be recognized, and obtaining a second text corresponding to the two-dimensional code image; A second determination module is used to determine the multi-dimensional features of the domain name in the case where the domain name in the second text contains Chinese characters, wherein the multi-dimensional features include at least one of the following: a probability value of containing uncommon words, network assets, and associated domain name information; A processing module is used to process the acquired image according to the multi-dimensional features of the domain name.
15. The device of claim 14, wherein: The second determining module is specifically used to: Determining the Chinese character set contained in the domain name; In a case where at least one character in the Chinese character set is a character in the reference character library, searching based on each other character in the Chinese character set to obtain a search result corresponding to each other character; The probability value of the domain name containing an uncommon word is determined according to the number of times each of the other characters appears in the title of the search result and the total number of search results.
16. The device of claim 15, wherein: The second determining module is further used for: Determining a weight value corresponding to each of the other characters according to the total number of other characters included in the domain name; Based on the weight value corresponding to each of the other characters, the number of times the other characters appear in the title of the search result and the total number of search results, the probability value that the domain name contains an uncommon word is determined.
17. The device of claim 14, wherein: The processing module is specifically used for at least one of the following: When the probability value of the domain name containing an uncommon word is greater than a first threshold, marking the image as a malicious image; When a first similarity between the network asset and any asset in a preset asset library is greater than a second threshold, marking the image as a malicious image; If the associated domain name information includes an unregistered domain name, marking the image as a malicious image; In a case where the associated domain name information includes a domain name in a blacklist library, the image is marked as a malicious image.
18. The device of claim 17, wherein: The processing module is further used for: Determining a first vector corresponding to the acquired image; Matching the first vector with each second vector in the malicious image library to determine a matching degree between the first vector and each second vector; In the case where each of the matching degrees is less than a third threshold, the acquired image is input into the generated two-dimensional code detection model to obtain the two-dimensional code to be identified.
19. The device according to any one of claims 14 to 18, wherein: The identification module is further used for: Based on the second text, a preset malicious text library is retrieved, and when a second similarity between the second text and any malicious text in the malicious text library is greater than a fourth threshold, the image is marked as a malicious image.
20. The device of claim 19, wherein: The identification module is further used for: Determine a third vector corresponding to the second text; The second text and the third vector are associated and stored in the malicious text library.
21. An electronic device, characterized in that: include: at least one processor; and, a memory communicatively coupled to the at least one processor; Wherein, the memory stores instructions that may be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the training data generation method described in any one of claims 1-3, or the image data processing method described in any one of claims 4-10.
22. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to enable the computer to execute the training data generating method according to any one of claims 1-3, or the image data processing method according to any one of claims 4-10.
23. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the training data generation method according to any one of claims 1 to 3, or the image data processing method according to any one of claims 4 to 10.