CN113255857B - Risk detection method, device and equipment for graphic code - Google Patents

Risk detection method, device and equipment for graphic code Download PDF

Info

Publication number
CN113255857B
CN113255857B CN202110590351.2A CN202110590351A CN113255857B CN 113255857 B CN113255857 B CN 113255857B CN 202110590351 A CN202110590351 A CN 202110590351A CN 113255857 B CN113255857 B CN 113255857B
Authority
CN
China
Prior art keywords
risk
graphic code
target graphic
target
features
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.)
Active
Application number
CN202110590351.2A
Other languages
Chinese (zh)
Other versions
CN113255857A (en
Inventor
杨坤乾
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202110590351.2A priority Critical patent/CN113255857B/en
Publication of CN113255857A publication Critical patent/CN113255857A/en
Application granted granted Critical
Publication of CN113255857B publication Critical patent/CN113255857B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K17/00Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations
    • G06K17/0022Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations arrangements or provisious for transferring data to distant stations, e.g. from a sensing device
    • G06K17/0025Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations arrangements or provisious for transferring data to distant stations, e.g. from a sensing device the arrangement consisting of a wireless interrogation device in combination with a device for optically marking the record carrier
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • G06K7/14131D bar codes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • G06K7/14172D bar codes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/146Methods for optical code recognition the method including quality enhancement steps
    • G06K7/1482Methods for optical code recognition the method including quality enhancement steps using fuzzy logic or natural solvers, such as neural networks, genetic algorithms and simulated annealing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification
    • G06Q20/4016Transaction verification involving fraud or risk level assessment in transaction processing

Abstract

The embodiment of the specification discloses a method, a device and equipment for detecting risks of graphic codes, wherein the method comprises the following steps: acquiring a target graphic code to be detected; performing feature extraction on the target graphic code to obtain a risk feature corresponding to the target graphic code, wherein the risk feature comprises a first feature related to an image of the target graphic code or information contained in the image and a second feature related to a source of the target graphic code; respectively determining the risk score of each characteristic contained in the risk characteristics corresponding to the target graphic code based on the risk characteristics corresponding to the target graphic code; and determining whether the target graphic code has risks or not based on the risk score of each characteristic contained in the risk characteristics corresponding to the target graphic code and a preset graphic code risk identification strategy.

Description

Risk detection method, device and equipment for graphic code
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, and a device for detecting a risk of a graphic code.
Background
The graphic code (such as a two-dimensional code) is used as a common information storage and expression mode, network information is convenient to spread, and the graphic code is extremely easy to be used in illegal scenes such as fraud and the like after being transformed by black products, particularly in the financial field, massive transactions based on the graphic code occur every day, various risk graphic codes are enriched, resource loss of users is caused, and meanwhile, all platforms in the financial field bear great public opinion monitoring risks.
Generally, whether a risk exists in a graphic code can be determined by means of risk Character Recognition, specifically, characters in the graphic code can be recognized by an OCR (Optical Character Recognition) model, and then the recognized characters are compared with preset high-risk keywords, so that the graphic code with the risk can be recognized. However, the above method is affected by a text recognition error, and meanwhile, if the high-risk keywords are not updated timely, the risk coverage rate is also reduced, and in addition, the OCR model needs to consume a large amount of resources and a long delay time, so that the overall recognition efficiency is affected.
Disclosure of Invention
The technical scheme is used for identifying the graphic code with the risk, and the graphic code with the risk can be identified quickly, effectively and with higher risk coverage rate.
In order to implement the above technical solution, the embodiments of the present specification are implemented as follows:
the method for detecting the risk of the graphic code provided by the embodiment of the specification comprises the following steps: and acquiring a target graphic code to be detected. And extracting features of the target graphic code to obtain risk features corresponding to the target graphic code, wherein the risk features comprise first features related to the image of the target graphic code or information contained in the image and second features related to the source of the target graphic code. And respectively determining the risk score of each feature contained in the risk features corresponding to the target graphic code based on the risk features corresponding to the target graphic code. And determining whether the target graphic code has risks or not based on the risk score of each characteristic contained in the risk characteristics corresponding to the target graphic code and a preset graphic code risk identification strategy.
The embodiment of this specification provides a device for detecting risk of graphic code, the device includes: and the graphic code acquisition module acquires the target graphic code to be detected. And the characteristic extraction module is used for extracting the characteristics of the target graphic code to obtain risk characteristics corresponding to the target graphic code, wherein the risk characteristics comprise a first characteristic related to the image of the target graphic code or information contained in the image and a second characteristic related to the source of the target graphic code. And the scoring module is used for respectively determining the risk score of each characteristic contained in the risk characteristics corresponding to the target graphic code based on the risk characteristics corresponding to the target graphic code. And the risk identification module is used for determining whether the target graphic code has risks or not based on the risk score of each characteristic contained in the risk characteristics corresponding to the target graphic code and a preset graphic code risk identification strategy.
The risk detection device of a graphic code provided by the embodiment of the present specification includes: a processor; and a memory arranged to store computer executable instructions that, when executed, cause the processor to: and acquiring a target graphic code to be detected. And extracting features of the target graphic code to obtain risk features corresponding to the target graphic code, wherein the risk features comprise first features related to the image of the target graphic code or information contained in the image and second features related to the source of the target graphic code. And respectively determining the risk score of each feature contained in the risk features corresponding to the target graphic code based on the risk features corresponding to the target graphic code. And determining whether the target graphic code has risks or not based on the risk score of each characteristic contained in the risk characteristics corresponding to the target graphic code and a preset graphic code risk identification strategy.
Embodiments of the present specification also provide a storage medium, where the storage medium is used to store computer-executable instructions, and the executable instructions, when executed, implement the following processes: and acquiring a target graphic code to be detected. And extracting features of the target graphic code to obtain risk features corresponding to the target graphic code, wherein the risk features comprise first features related to the image of the target graphic code or information contained in the image and second features related to the source of the target graphic code. And respectively determining the risk score of each feature contained in the risk features corresponding to the target graphic code based on the risk features corresponding to the target graphic code. And determining whether the target graphic code has risks or not based on the risk score of each characteristic contained in the risk characteristics corresponding to the target graphic code and a preset graphic code risk identification strategy.
Drawings
In order to more clearly illustrate the embodiments of the present specification or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only some embodiments described in the present specification, and for those skilled in the art, other drawings can be obtained according to the drawings without any creative effort.
Fig. 1 is a schematic diagram illustrating an embodiment of a risk detection method for a graphic code;
FIG. 2 is another embodiment of a method for risk detection of a graphic code according to the present disclosure;
fig. 3 is an embodiment of a risk detection apparatus for a graphic code according to the present disclosure;
fig. 4 is an embodiment of a risk detection device of a graphic code according to the present disclosure.
Detailed Description
The embodiment of the specification provides a method, a device and equipment for detecting risks of graphic codes.
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only a part of the embodiments of the present specification, and not all of the embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments in the present specification without any inventive step should fall within the scope of protection of the present specification.
Example one
As shown in fig. 1, an execution subject of the method may be a server, where the server may be a specific service (such as a transaction service or a financial service), and may also be a payment service server, a financial service or an instant messaging service related service, or may also be a server that detects whether there is a risk in a graphical code. The method may specifically comprise the steps of:
in step S102, a target graphic code to be detected is acquired.
The target graphic code may be any graphic code, which may be a graphic code recording data information distributed in two-dimensional plane or three-dimensional space according to a certain rule through a certain specific geometric figure, and the graphic code may represent literal numerical information by means of several geometric figures corresponding to binary system and may be read automatically through image input equipment or photoelectronic scanning equipment to realize automatic information processing. The target graphic code may include multiple types, for example, the target graphic code may be a barcode, a two-dimensional code, or the like, which may be set specifically according to an actual situation, and this is not limited in this specification.
In implementation, the graphic code (such as a two-dimensional code) is used as a general information storage and expression mode, network information is convenient to propagate, and the graphic code is also extremely easy to be used in illegal scenes such as fraud and the like after being transformed by black products, particularly in the financial field, massive transactions based on the graphic code occur every day, and various risk graphic codes are filled, so that not only is the resource loss of a user caused, but also each platform in the financial field bears great monitoring public opinion risks. How to quickly and effectively identify the graphic code with risks becomes an important problem to be solved.
Generally, whether risks exist in a graphic code can be determined in a risk character recognition mode, specifically, characters in the graphic code can be recognized through an OCR model, and then recognized characters are compared with preset high-risk keywords, so that the graphic code with risks can be recognized. However, the above method is affected by a character recognition error, and meanwhile, if the high-risk keywords are not updated timely, the risk coverage rate is also reduced, and in addition, the OCR model needs to consume a large amount of resources and a long delay time, so that the overall recognition efficiency is affected.
In practical applications, the target graphic code to be detected may be obtained in a variety of different manners, for example, an application program for detecting the graphic code may be preset, and a detection entry of the graphic code (for example, a key or a hyperlink for detecting the graphic code, etc.) may be set in the application program. When a user needs to detect whether the risk exists in a certain graphic code wind, the application program can be started, and a detection inlet of the graphic code can be found. Target graphic codes to be detected can be uploaded through the detection entrance.
For another example, when a user uses a certain graphic code for the first time, the user may acquire an image of the graphic code through a camera assembly of the terminal device, and may send the image to the server, and the server may receive the image and may use the graphic code in the image as a target graphic code to be detected.
In practical application, the target pattern code to be detected may be obtained through other various methods besides the above method, and may be specifically set according to actual conditions, which is not limited in the embodiments of the present specification.
In step S104, feature extraction is performed on the target graphic code to obtain a risk feature corresponding to the target graphic code, where the risk feature includes a first feature related to the image of the target graphic code or information included in the image, and a second feature related to a source of the target graphic code.
In implementation, the feature extraction may be performed on the target graphic code in a variety of different manners, for example, an algorithm related to image recognition may be preset based on an image attribute of the graphic code, a feature related to an image of the target graphic code may be executed on the target graphic code through the algorithm, specifically, whether a specified image, such as a specified avatar or a specified fraud-type image, is included in the target graphic code may be determined through the algorithm, or a texture feature included in the target graphic code may be determined through the algorithm. Furthermore, features related to information contained in the image of the target image code may also be performed on the target image code by the algorithm, such as the number of colors of characters contained in the target image code, whether highlighted characters are included, or the like may be determined by the algorithm. The feature obtained in the above manner may be regarded as the first feature.
In addition, an algorithm related to classification may be preset based on the source of the graphic code, and a feature related to the source of the target graphic code may be executed on the target graphic code through the algorithm, specifically, whether the target graphic code includes an album originated from the terminal device may be determined through the algorithm, or whether the target graphic code includes an application program originated from a designated high risk, and the feature obtained through the above manner may be used as the second feature.
In addition, in addition to the first feature and the second feature for the target graphic code, the risk feature corresponding to the target graphic code may be obtained in a plurality of different manners, which may be specifically set according to actual situations, and this is not limited in the embodiments of the present specification.
It should be noted that, the method for extracting features of the target graphic code may include multiple methods, for example, the target graphic code may be extracted by a specified feature extraction algorithm, or the target graphic code may also be extracted by a pre-trained model for extracting features of the graphic code, and the like, which may be specifically set according to actual situations, and this is not limited in the embodiments of this specification.
In step S106, based on the risk features corresponding to the target graphic code, a risk score of each feature included in the risk features corresponding to the target graphic code is respectively determined.
In implementation, risk scoring mechanisms corresponding to different risk features may be preset according to actual conditions, for example, a risk scoring mechanism of a first feature in the risk features corresponding to the target graphic code, a risk scoring mechanism of a second feature in the risk features corresponding to the target graphic code, and the like may be set. And performing risk assessment on the obtained first characteristics through a risk scoring mechanism of the first characteristics to obtain a risk score corresponding to the first characteristics. In addition, risk assessment can be performed on the obtained second features through a risk scoring mechanism of the second features, and a risk score corresponding to the second features is obtained. In addition, risk assessment can be performed on corresponding features in the obtained risk features corresponding to the target image code through a preset risk scoring mechanism of other features, so that a risk score corresponding to the other features is obtained.
For example, different weights may be set for the types of the features included in the first feature, and different risk scores may be set for the different weights, for example, the largest weight may be set for the image in the target graphic code in the first feature, which includes the specified fraud class, and the highest risk score may be set for the image, the smallest weight may be set for the target graphic code in the first feature, which includes one character color, and the lowest risk score may be set for the image. In this way, the risk scores corresponding to the first features may be respectively determined based on the feature types included in the first features. Corresponding risk scores can be set for the contents contained in the second characteristic and other characteristics in the same manner, and finally the risk score of each characteristic contained in the risk characteristics corresponding to the target icon code can be obtained.
In step S108, it is determined whether the target graphical code has a risk based on the risk score of each feature included in the risk features corresponding to the target graphical code and a preset graphical code risk identification policy.
The pattern code risk identification policy may be a policy for determining whether a risk exists in the target pattern code based on a risk score of a risk feature corresponding to the target pattern code, and specifically, the pattern code risk identification policy may be used to set different weights for different risk features, and the like.
In implementation, corresponding weights can be set for different risk characteristics in advance according to actual conditions, and then a graphic code risk identification strategy is obtained. After the risk score of each feature included in the risk features corresponding to the target graphic code is obtained in the above manner, the weight corresponding to each feature included in the risk features may be determined based on a graphic code risk identification policy, then, the risk score of each feature included in the risk features may be multiplied by the corresponding weight and added, finally, a corresponding calculation result may be obtained, the calculation result may be compared with a preset threshold, if the calculation result is greater than the threshold, it may be determined that the target graphic code has a risk, and if the calculation result is less than the threshold, it may be determined that the target graphic code does not have a risk.
Specifically, the risk score of each feature included in the risk feature is 0.9, 0.2, 0.8, and 0.5, respectively, and the weight corresponding to each feature included in the risk feature may be determined based on the graph code risk identification policy, and may be 0.7, 0.1, 0.8, and 0.9, respectively, and the final calculation result may be (0.9x0.7+0.2x0.1+0.8x0.8+0.5x0.9) ═ 1.74, and if the preset threshold is 2, 1.74 may be compared with the threshold 2, so that it may be determined that the target graph code does not have a risk.
The embodiment of the present specification provides a method for detecting a risk of a graphic code, which obtains a risk feature corresponding to a target graphic code by performing feature extraction on an acquired target graphic code to be detected, where the risk feature includes a first feature related to an image of the target graphic code or information included in the image, and a second feature related to a source of the target graphic code, and then, based on the risk feature corresponding to the target graphic code, a risk score of each feature included in the risk feature corresponding to the target graphic code may be respectively determined, and finally, based on a risk score of each feature included in the risk feature corresponding to the target graphic code and a preset graphic code risk identification policy, it may be determined whether the target graphic code has a risk, so that, through a feature related to the image of the target graphic code or information included in the image in the target graphic code, and the target graphic code is subjected to risk identification at a plurality of angles such as the characteristics related to the source of the target graphic code, so that the coverage rate of the risk identification of the graphic code is improved, the generalization capability of the risk identification of the graphic code is enhanced, the resource loss in the risk identification process of the graphic code can be reduced, and the delay of the risk identification of the graphic code is reduced.
Example two
As shown in fig. 2, an execution subject of the method may be a server, where the server may be a specific service (such as a transaction service or a financial service), and may also be a payment service server, a financial service or an instant messaging service related service, or may also be a server that detects whether there is a risk in a graphical code. The method may specifically comprise the steps of:
in step S202, a model architecture of the image recognition model is constructed based on a preset image recognition algorithm.
The image recognition algorithm may include a plurality of algorithms, for example, the image recognition algorithm may include one or more of an active learning algorithm, a FixMatch semi-supervised learning algorithm, a multitask learning algorithm, and a DynamicNAS algorithm, where the active learning algorithm may query the most useful unlabeled sample through a certain algorithm and label the unlabeled sample with an expert, and then train the active learning model with the queried sample, and modify the active learning model with information accumulated continuously. The active learning model processing process requires a learner to start learning by a small number of initial labeled samples, select one or more effective samples through a certain query function, inquire a supervisor about corresponding labels, train the active learning model by using the obtained information and perform the next round of query, and is a cyclic process until a certain stopping criterion is reached. The most common strategy for designing the query function is an uncertainty criterion and a difference criterion, wherein the uncertainty criterion is to find sample data with high uncertainty, and the sample data is useful for training the model because of the abundant information content contained in the sample data. The FixMatch semi-supervised learning algorithm may generate artificial labels using consistency regularization and pseudo labels, and use separate weak and strong enhancements when performing consistency regularization. The multi-task learning algorithm can learn a plurality of related tasks simultaneously in parallel and reversely, the plurality of tasks can help learning each other through a shared representation (shared representation) at the bottom layer, namely, the multi-task learning algorithm can put the plurality of related tasks together to learn, and the learning process can share and mutually supplement the learned domain related information (domain information) through a shared representation (shared representation) at the shallow layer. In addition, in practical application, the method may specifically include an SURF algorithm, a BRIEF algorithm, a brisk (binary Robust Scalable keys) algorithm, a neural network algorithm, and the like, which may be specifically set according to practical situations, and this is not limited in this embodiment of the present specification.
In implementation, the pattern recognition model may be constructed by performing model training on a pattern code sample based on a preset image recognition algorithm, specifically, an appropriate image recognition algorithm may be selected according to an actual situation, and a model architecture of the image recognition model may be constructed by the selected image recognition algorithm, where the model architecture includes parameters to be determined, and the like. For example, a convolutional neural network algorithm may be selected to construct a model architecture of a convolutional neural network model, where the convolutional neural network model may include multiple network layers, and the multiple network layers may include one or more different parameters to be determined.
In step S204, a plurality of different graphic code samples are acquired.
In implementation, a plurality of different graphic code samples may be obtained in a plurality of different manners, for example, a graphic code may be purchased from different users in a purchasing manner and may be used as the graphic code sample, or a user may be invited to provide a graphic code in a testing manner and may be used as the graphic code sample, or a plurality of different graphic codes may be generated by a preset graphic code generation mechanism and may be used as the graphic code sample, and the like, which may specifically be set according to an actual situation, and this is not limited in this description embodiment. In addition, a corresponding feature label and a risk score and the like corresponding to each feature can be marked for each graphic code sample, so that the subsequent model training can be facilitated.
In step S206, feature extraction is performed on each image code sample to obtain an image feature of each image code sample, where the image feature includes one or more of a color feature, a layout feature, and an image feature.
The color feature may be a feature related to a color in the image code sample, and the layout feature may be a feature related to layout, and the like in the image code sample. The color characteristics may include one or more of the number of colors of characters contained in the image code sample, whether or not there is a highlighted color. The layout characteristics may include one or more of whether the image code samples are in a horizontal mode, whether the image code samples are in a vertical mode, and whether the image code samples are in a mixed mode. The image characteristics may include one or more of whether an avatar is included in the image code sample, whether an image of a specified risk type is included in the image code sample, and the like.
In step S208, model training is performed on the image recognition model based on the image features of each image code sample, so as to obtain a trained image recognition model.
In step S210, a target graphic code to be detected is acquired.
In step S212, feature extraction is performed on the target graphic code to obtain a risk feature corresponding to the target graphic code, where the risk feature includes a first feature related to the image of the target graphic code or information included in the image, and a second feature related to a source of the target graphic code.
Wherein the first feature may include one or more of a color feature, a layout feature, and an image feature. In addition, the first feature may include a texture feature. The color characteristics can comprise one or more of the number of the colors of the characters contained in the target graphic code, and whether the highlighted colors exist; the typesetting characteristics can comprise one or more of whether the target graphic code is in a horizontal mode, whether the target graphic code is in a vertical mode and whether the target graphic code is in a mixed mode; the image characteristics may include one or more of whether the target graphic code includes an avatar, whether the target graphic code includes an image of a specified risk type, or not. The second characteristic may include one or more of whether the target graphics code is from a specified image library, whether the target graphics code is pulled up in a scheme manner, whether the target graphics code is from a preset application program with a specified risk, where the scheme may be an intra-page jump protocol, and may conveniently jump each page in the application program by defining its own scheme protocol, and through the scheme manner, the server may customize an indication of which page the application program jumps to, and may jump to the page through the H5 page, and the like, and the scheme manner may implement jumping in a URL manner.
In step S214, based on the risk features corresponding to the target graphic code, a risk assessment model corresponding to each feature included in the risk features corresponding to the target graphic code is obtained.
The risk assessment model may be a model that scores multiple different risk characteristics included in the graphic code, and may respectively construct corresponding risk assessment models for the different risk characteristics, and in practical application, one type of risk characteristic may correspond to one risk assessment model, or multiple different types of risk characteristics may correspond to one risk assessment model, and the like, which may be specifically set according to actual conditions, and is not limited in this specification.
In implementation, according to actual conditions, for risk features possibly existing in the graphic code, a corresponding risk assessment model may be constructed in advance, for example, for the first feature, an image recognition model may be trained in advance, the trained image recognition model may be used as a risk assessment model, for the second feature, a classification model may be trained in advance, the trained classification model may be used as a risk assessment model, and the like. Then, a pre-constructed risk assessment model may be stored, and after determining the risk features corresponding to the target graphical code, the risk assessment model corresponding to each feature included in the risk features corresponding to the target graphical code may be obtained from the stored risk assessment model, for example, for a first feature, an image recognition model may be obtained, and for a second feature, a classification model may be obtained.
In step S216, the risk features corresponding to the target graphic code are respectively input into the corresponding risk assessment models, so as to obtain a risk score of each feature included in the risk features corresponding to the target graphic code.
In implementation, based on the relevant content in step S214, the risk assessment model corresponding to the first feature may be a pre-trained image recognition model, the risk assessment model corresponding to the second feature may be a pre-trained classification model, and the classification model may be constructed by performing model training on a graph code sample based on a preset classification algorithm, where the classification algorithm may include one or more of a Decision Tree algorithm, a GBDT (Gradient Boosting Decision Tree) algorithm, and an XGBoost (eXtreme Gradient Boosting) algorithm. In this embodiment, the classification model may be specifically a binary classification model, which may be constructed in a variety of different manners, for example, through a logistic regression algorithm, or through a convolutional neural network model, and the like, and may be specifically set according to an actual situation, which is not limited in this embodiment. Then, the color features in the first features may be input into the image recognition model to obtain a risk score of the color features corresponding to the target image code, the layout features in the first features may be input into the image recognition model to obtain a risk score of the layout features corresponding to the target image code, and the image features in the first features may be input into the image recognition model to obtain a risk score of the image features corresponding to the target image code. The second feature may be input into the classification model to obtain a risk score of the second feature corresponding to the target graph code.
In step S218, a scoring card model is constructed and trained based on a preset pattern code risk recognition strategy.
The scoring card model may be an application statistical model, which may evaluate various items of information of the object to be detected and give a scoring score, and the scoring score may quantitatively predict the object to be detected. The scorecard corresponding to the scorecard model may be composed of a series of feature items, each feature item may be a question with the above specific features (such as the number of character colors included in the target graphic code in the color features, whether there is a highlighted color, and the like), and each feature item has a series of possible attributes, that is, a series of possible answers to each question (for example, for the number question of character colors included in the target graphic code, the answer may be 1, 5, 7, and the like). When the scoring card model is constructed, the correlation between the attribute and the object to be detected can be determined, and then an appropriate weight is assigned to the attribute, wherein the assigned weight needs to reflect the correlation. The score for an object to be detected may be a simple sum of its attribute scores. If the score of the subject to be detected is greater than or equal to a predetermined limit score, the subject to be detected is at an acceptable risk level and will be approved, and if the score of the subject to be detected is below the limit score, the subject to be detected will be rejected for use or given an indication for further review.
In implementation, in order to improve processing efficiency, a model architecture of a scoring card model corresponding to a preset graph code risk identification policy may be constructed based on content included in the model architecture (where the model architecture may include parameters to be determined), then, a plurality of different graph code samples may be obtained, corresponding risk features may be obtained through feature extraction, risk scores corresponding to different risk features may be determined, model training may be performed on the scoring card model based on the risk scores corresponding to different risk features, and finally, the trained scoring card model is obtained.
In step S220, the risk score of each feature included in the risk features corresponding to the target graphic code is input into the scorecard model, so as to obtain the risk score of the target graphic code.
In step S222, it is determined whether the target graphic code is at risk based on the score of the target graphic code at risk.
In implementation, a risk threshold may be set in advance according to actual conditions, and whether a risk exists in the target graphical code may be determined based on the score of the risk existing in the target graphical code and the risk threshold, specifically, if the score of the risk existing in the target graphical code is smaller than the risk threshold, it may be determined that the risk does not exist in the target graphical code, and if the score of the risk existing in the target graphical code is larger than the risk threshold, it may be determined that the risk exists in the target graphical code.
The embodiment of the present specification provides a method for detecting a risk of a graphic code, which obtains a risk feature corresponding to a target graphic code by performing feature extraction on an acquired target graphic code to be detected, where the risk feature includes a first feature related to an image of the target graphic code or information included in the image, and a second feature related to a source of the target graphic code, and then, based on the risk feature corresponding to the target graphic code, a risk score of each feature included in the risk feature corresponding to the target graphic code may be respectively determined, and finally, based on a risk score of each feature included in the risk feature corresponding to the target graphic code and a preset graphic code risk identification policy, it may be determined whether the target graphic code has a risk, so that, through a feature related to the image of the target graphic code or information included in the image in the target graphic code, and the target graphic code is subjected to risk identification at a plurality of angles such as the characteristics related to the source of the target graphic code, so that the coverage rate of the risk identification of the graphic code is improved, the generalization capability of the risk identification of the graphic code is enhanced, the resource loss in the risk identification process of the graphic code can be reduced, and the delay of the risk identification of the graphic code is reduced.
EXAMPLE III
Based on the same idea, the method for detecting the risk of the graphic code provided in the embodiment of the present specification further provides a device for detecting the risk of the graphic code, as shown in fig. 3.
The risk detection device of the graphic code comprises: the system comprises a graphic code acquisition module 301, a feature extraction module 302, a scoring module 303 and a risk identification module 304, wherein:
the graphic code acquisition module 301 acquires a target graphic code to be detected;
the feature extraction module 302 is configured to perform feature extraction on the target graphical code to obtain a risk feature corresponding to the target graphical code, where the risk feature includes a first feature related to an image of the target graphical code or information included in the image, and a second feature related to a source of the target graphical code;
the scoring module 303 is configured to determine a risk score of each feature included in the risk features corresponding to the target graphical code, based on the risk features corresponding to the target graphical code;
the risk identification module 304 determines whether the target graph code has a risk or not based on a risk score of each feature included in the risk features corresponding to the target graph code and a preset graph code risk identification strategy.
In an embodiment of the present specification, the first feature includes one or more of a color feature, a layout feature, and an image feature.
In the embodiment of the specification, the color characteristics comprise one or more of the number of the colors of the characters contained in the target graphic code, and whether the highlighted color exists; the typesetting characteristics comprise one or more of whether the target graphic code is in a horizontal mode, whether the target graphic code is in a vertical mode and whether the target graphic code is in a mixed mode; the image characteristics comprise one or more of whether the target graphic code contains an avatar and whether the target graphic code contains an image with a specified risk type.
In this embodiment of the present specification, the second feature includes one or more of whether the target graphic code is from a specified image library, whether the target graphic code is pulled up by a scheme manner, and whether the target graphic code is from a preset application program with a specified risk.
In an embodiment of this specification, the scoring module 303 includes:
the evaluation model determining unit is used for acquiring a risk evaluation model corresponding to each feature contained in the risk features corresponding to the target graphic code based on the risk features corresponding to the target graphic code;
and the scoring unit is used for respectively inputting the risk characteristics corresponding to the target graph codes into the corresponding risk assessment models to obtain the risk score of each characteristic contained in the risk characteristics corresponding to the target graph codes.
In an embodiment of the present specification, the risk assessment model corresponding to the first feature is a pre-trained image recognition model, the image recognition model is constructed by performing model training on a pattern code sample based on a preset image recognition algorithm, the image recognition algorithm includes one or more of an active learning algorithm, a FixMatch semi-supervised learning algorithm, a multi-task learning algorithm, and a DynamicNAS algorithm, and the risk assessment model corresponding to the second feature is a pre-trained classification model.
In an embodiment of this specification, the apparatus further includes:
the model construction module is used for constructing a model architecture of the image recognition model based on a preset image recognition algorithm;
the sample acquisition module is used for acquiring a plurality of different graphic code samples;
the sample characteristic extraction module is used for extracting the characteristics of each image code sample to obtain the image characteristics of each image code sample, wherein the image characteristics comprise one or more of color characteristics, typesetting characteristics and image characteristics;
and the training module is used for carrying out model training on the image recognition model based on the image characteristics of each image code sample to obtain a trained image recognition model.
In this embodiment, the risk identification module 304 includes:
the scoring card construction unit is used for constructing and training a scoring card model based on a preset graphic code risk identification strategy;
the risk score determining unit is used for inputting the risk score of each characteristic contained in the risk characteristics corresponding to the target graphic code into the score card model to obtain the score of the risk of the target graphic code;
and the risk identification unit is used for determining whether the target graphic code has risks or not based on the value of the risks existing in the target graphic code.
The embodiment of the present specification provides a risk detection apparatus for a graphic code, which obtains a risk feature corresponding to a target graphic code by performing feature extraction on an acquired target graphic code to be detected, where the risk feature includes a first feature related to an image of the target graphic code or information included in the image, and a second feature related to a source of the target graphic code, and then, based on the risk feature corresponding to the target graphic code, a risk score of each feature included in the risk feature corresponding to the target graphic code may be respectively determined, and finally, based on a risk score of each feature included in the risk feature corresponding to the target graphic code and a preset graphic code risk identification policy, it may be determined whether the target graphic code has a risk, so that, through a feature related to the image of the target graphic code or information included in the image in the target graphic code, and the target graphic code is subjected to risk identification at a plurality of angles such as the characteristics related to the source of the target graphic code, so that the coverage rate of the risk identification of the graphic code is improved, the generalization capability of the risk identification of the graphic code is enhanced, the resource loss in the risk identification process of the graphic code can be reduced, and the delay of the risk identification of the graphic code is reduced.
Example four
Based on the same idea, the risk detection apparatus for a graphic code provided in the embodiments of the present specification further provides a risk detection device for a graphic code, as shown in fig. 4.
The risk detection device of the graphic code may be the server provided in the above embodiment.
The risk detection device of graphic code may have a large difference due to different configurations or performances, and may include one or more processors 401 and a memory 402, where the memory 402 may store one or more stored applications or data. Wherein memory 402 may be transient or persistent. The application program stored in memory 402 may include one or more modules (not shown), each of which may include a series of computer-executable instructions for a risk detection device in graphical code. Still further, the processor 401 may be configured to communicate with the memory 402 to execute a series of computer-executable instructions in the memory 402 on a risk detection device in graphical code. The risk detection apparatus of graphic codes may also include one or more power sources 403, one or more wired or wireless network interfaces 404, one or more input-output interfaces 405, one or more keyboards 406.
In particular, in this embodiment, the risk detection device for graphic codes includes a memory, and one or more programs, where the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer-executable instructions for the risk detection device for graphic codes, and the one or more programs configured to be executed by one or more processors include computer-executable instructions for:
acquiring a target graphic code to be detected;
performing feature extraction on the target graphic code to obtain a risk feature corresponding to the target graphic code, wherein the risk feature comprises a first feature related to an image of the target graphic code or information contained in the image and a second feature related to a source of the target graphic code;
respectively determining the risk score of each feature contained in the risk features corresponding to the target graphic code based on the risk features corresponding to the target graphic code;
and determining whether the target graphic code has risks or not based on the risk score of each characteristic contained in the risk characteristics corresponding to the target graphic code and a preset graphic code risk identification strategy.
In an embodiment of the present specification, the first feature includes one or more of a color feature, a layout feature, and an image feature.
In the embodiment of the specification, the color characteristics comprise one or more of the number of the colors of the characters contained in the target graphic code, and whether the highlighted color exists; the typesetting characteristics comprise one or more of whether the target graphic code is in a horizontal mode, whether the target graphic code is in a vertical mode and whether the target graphic code is in a mixed mode; the image characteristics comprise one or more of whether the target graphic code contains an avatar and whether the target graphic code contains an image with a specified risk type.
In this embodiment of the present specification, the second feature includes one or more of whether the target graphic code is from a specified image library, whether the target graphic code is pulled up by a scheme manner, and whether the target graphic code is from a preset application program with a specified risk.
In an embodiment of this specification, the determining, based on the risk feature corresponding to the target graphical code, a risk score of each feature included in the risk feature corresponding to the target graphical code includes:
acquiring a risk evaluation model corresponding to each feature contained in the risk features corresponding to the target graphic code based on the risk features corresponding to the target graphic code;
and respectively inputting the risk characteristics corresponding to the target graph code into corresponding risk assessment models to obtain the risk score of each characteristic contained in the risk characteristics corresponding to the target graph code.
In an embodiment of the present specification, the risk assessment model corresponding to the first feature is a pre-trained image recognition model, the image recognition model is constructed by performing model training on a pattern code sample based on a preset image recognition algorithm, the image recognition algorithm includes one or more of an active learning algorithm, a FixMatch semi-supervised learning algorithm, a multi-task learning algorithm, and a DynamicNAS algorithm, and the risk assessment model corresponding to the second feature is a pre-trained classification model.
In the embodiment of this specification, the method further includes:
constructing a model framework of the image recognition model based on a preset image recognition algorithm;
obtaining a plurality of different graphic code samples;
performing feature extraction on each image code sample to obtain image features of each image code sample, wherein the image features comprise one or more of color features, typesetting features and image features;
and performing model training on the image recognition model based on the image characteristics of each image code sample to obtain a trained image recognition model.
In this embodiment of the present specification, the determining whether the target graph code has a risk based on a risk score of each feature included in the risk features corresponding to the target graph code and a preset graph code risk identification policy includes:
constructing and training a scoring card model based on a preset pattern code risk identification strategy;
inputting the risk score of each feature contained in the risk features corresponding to the target graphic code into the score card model to obtain the score of the risk of the target graphic code;
and determining whether the target graphic code has risks or not based on the score of the risks of the target graphic code.
The embodiment of the present specification provides a risk detection device for a graphic code, which obtains a risk feature corresponding to a target graphic code by performing feature extraction on an acquired target graphic code to be detected, where the risk feature includes a first feature related to an image of the target graphic code or information included in the image, and a second feature related to a source of the target graphic code, and then, based on the risk feature corresponding to the target graphic code, a risk score of each feature included in the risk feature corresponding to the target graphic code may be respectively determined, and finally, based on a risk score of each feature included in the risk feature corresponding to the target graphic code and a preset graphic code risk identification policy, it may be determined whether the target graphic code has a risk, so that, through a feature related to the image of the target graphic code or information included in the image in the target graphic code, and the target graphic code is subjected to risk identification at a plurality of angles such as the characteristics related to the source of the target graphic code, so that the coverage rate of the risk identification of the graphic code is improved, the generalization capability of the risk identification of the graphic code is enhanced, the resource loss in the risk identification process of the graphic code can be reduced, and the delay of the risk identification of the graphic code is reduced.
EXAMPLE five
Further, based on the methods shown in fig. 1 and fig. 2, one or more embodiments of the present specification further provide a storage medium for storing computer-executable instruction information, in a specific embodiment, the storage medium may be a usb disk, an optical disk, a hard disk, or the like, and when the storage medium stores the computer-executable instruction information, the storage medium implements the following processes:
acquiring a target graphic code to be detected;
performing feature extraction on the target graphic code to obtain a risk feature corresponding to the target graphic code, wherein the risk feature comprises a first feature related to an image of the target graphic code or information contained in the image and a second feature related to a source of the target graphic code;
respectively determining the risk score of each feature contained in the risk features corresponding to the target graphic code based on the risk features corresponding to the target graphic code;
and determining whether the target graphic code has risks or not based on the risk score of each characteristic contained in the risk characteristics corresponding to the target graphic code and a preset graphic code risk identification strategy.
In an embodiment of the present specification, the first feature includes one or more of a color feature, a layout feature, and an image feature.
In the embodiment of the specification, the color characteristics comprise one or more of the number of the colors of the characters contained in the target graphic code, and whether the highlighted color exists; the typesetting characteristics comprise one or more of whether the target graphic code is in a horizontal mode, whether the target graphic code is in a vertical mode and whether the target graphic code is in a mixed mode; the image characteristics comprise one or more of whether the target graphic code contains an avatar and whether the target graphic code contains an image with a specified risk type.
In this embodiment of the present specification, the second feature includes one or more of whether the target graphic code is from a specified image library, whether the target graphic code is pulled up by a scheme manner, and whether the target graphic code is from a preset application program with a specified risk.
In this embodiment of the present specification, the determining a risk score of each feature included in the risk features corresponding to the target graphic code based on the risk features corresponding to the target graphic code respectively includes:
acquiring a risk assessment model corresponding to each feature contained in the risk features corresponding to the target graphic code based on the risk features corresponding to the target graphic code;
and respectively inputting the risk characteristics corresponding to the target graphic codes into corresponding risk assessment models to obtain the risk score of each characteristic contained in the risk characteristics corresponding to the target graphic codes.
In an embodiment of the present specification, the risk assessment model corresponding to the first feature is a pre-trained image recognition model, the image recognition model is constructed by performing model training on a pattern code sample based on a preset image recognition algorithm, the image recognition algorithm includes one or more of an active learning algorithm, a FixMatch semi-supervised learning algorithm, a multi-task learning algorithm, and a DynamicNAS algorithm, and the risk assessment model corresponding to the second feature is a pre-trained classification model.
In the embodiment of this specification, the method further includes:
constructing a model architecture of the image recognition model based on a preset image recognition algorithm;
obtaining a plurality of different graphic code samples;
performing feature extraction on each image code sample to obtain image features of each image code sample, wherein the image features comprise one or more of color features, layout features and image features;
and performing model training on the image recognition model based on the image characteristics of each image code sample to obtain a trained image recognition model.
In this embodiment of the present specification, the determining whether the target graph code has a risk based on a risk score of each feature included in the risk features corresponding to the target graph code and a preset graph code risk identification policy includes:
constructing and training a scoring card model based on a preset pattern code risk identification strategy;
inputting the risk score of each characteristic contained in the risk characteristics corresponding to the target graphic code into the grading card model to obtain the score of the risk of the target graphic code;
and determining whether the target graphic code has risks or not based on the score of the risks of the target graphic code.
The embodiment of the present specification provides a storage medium, which obtains risk features corresponding to a target graphic code by performing feature extraction on an acquired target graphic code to be detected, where the risk features include a first feature related to an image of the target graphic code or information included in the image, and a second feature related to a source of the target graphic code, and then, based on the risk features corresponding to the target graphic code, a risk score of each feature included in the risk features corresponding to the target graphic code may be respectively determined, and finally, based on the risk score of each feature included in the risk features corresponding to the target graphic code and a preset graphic code risk identification policy, it may be determined whether the target graphic code has a risk, so that, through the features related to the image of the target graphic code or information included in the image in the target graphic code, and the target graphic code is subjected to risk identification at a plurality of angles such as the characteristics related to the source of the target graphic code, so that the coverage rate of the risk identification of the graphic code is improved, the generalization capability of the risk identification of the graphic code is enhanced, the resource loss in the risk identification process of the graphic code can be reduced, and the delay of the risk identification of the graphic code is reduced.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
In the 90's of the 20 th century, improvements to a technology could clearly distinguish between improvements in hardware (e.g., improvements to circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements to process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical blocks. For example, a Programmable Logic Device (PLD) (e.g., a Field Programmable Gate Array (FPGA)) is an integrated circuit whose Logic functions are determined by a user programming the Device. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Hardware Description Language), traffic, pl (core universal Programming Language), HDCal (jhdware Description Language), lang, Lola, HDL, laspam, hardward Description Language (vhr Description Language), vhal (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: the ARC625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be regarded as a hardware component and the means for performing the various functions included therein may also be regarded as structures within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, apparatuses, modules or units described in the above embodiments may be specifically implemented by a computer chip or an entity, or implemented by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, respectively. Of course, the functionality of the various elements may be implemented in the same one or more software and/or hardware implementations in implementing one or more embodiments of the present description.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present description are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the description. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable fraud case serial-parallel apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable fraud case serial-parallel apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable fraud case to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable fraud case serial-parallel apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both permanent and non-permanent, removable and non-removable media, may implement the information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
One or more embodiments of the present description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. One or more embodiments of the specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present specification, and is not intended to limit the present specification. Various modifications and alterations to this description will become apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification should be included in the scope of the claims of the present specification.

Claims (11)

1. A method of risk detection for a graphical code, the method comprising:
acquiring a target graphic code to be detected;
performing feature extraction on the target graphic code to obtain risk features corresponding to the target graphic code, wherein the risk features comprise first features related to the image of the target graphic code or information contained in the image and second features related to the source of the target graphic code, and the first features comprise one or more of color features, typesetting features and image features;
respectively determining the risk score of each feature contained in the risk features corresponding to the target graphic code based on the risk features corresponding to the target graphic code;
determining whether the target graphic code has risks or not based on the risk score of each feature contained in the risk features corresponding to the target graphic code and a preset graphic code risk identification strategy;
the determining whether the target graphic code has a risk based on the risk score of each feature included in the risk features corresponding to the target graphic code and a preset graphic code risk identification strategy includes:
constructing and training a scoring card model based on a preset pattern code risk identification strategy;
inputting the risk score of each characteristic contained in the risk characteristics corresponding to the target graphic code into the grading card model to obtain the score of the risk of the target graphic code;
and determining whether the target graphic code has risks or not based on the score of the risks of the target graphic code.
2. The method of claim 1, the color characteristics comprising one or more of a number of character colors contained in the target graphical code, whether there is a highlighted color; the typesetting characteristics comprise one or more of whether the target graphic code is in a horizontal mode, whether the target graphic code is in a vertical mode and whether the target graphic code is in a mixed mode; the image characteristics comprise one or more of whether the target graphic code contains an avatar and whether the target graphic code contains an image with a specified risk type.
3. The method of claim 1, wherein the second characteristics comprise one or more of whether the object graphic code is from a designated image library, whether it is pulled up by scheme, and whether it is from a preset application with a designated risk.
4. The method of claim 1, wherein the determining a risk score for each of the risk features included in the risk features corresponding to the target graphical code based on the risk features corresponding to the target graphical code comprises:
acquiring a risk assessment model corresponding to each feature contained in the risk features corresponding to the target graphic code based on the risk features corresponding to the target graphic code;
and respectively inputting the risk characteristics corresponding to the target graphic codes into corresponding risk assessment models to obtain the risk score of each characteristic contained in the risk characteristics corresponding to the target graphic codes.
5. The method of claim 4, wherein the risk assessment model corresponding to the first feature is a pre-trained image recognition model, the pattern recognition model is constructed by performing model training on a pattern code sample based on a preset image recognition algorithm, the image recognition algorithm includes one or more of an active learning algorithm, a FixMatch semi-supervised learning algorithm, a multitask learning algorithm and a dynamic NAS algorithm, and the risk assessment model corresponding to the second feature is a pre-trained classification model.
6. The method of claim 5, further comprising:
constructing a model architecture of the image recognition model based on a preset image recognition algorithm;
obtaining a plurality of different graphic code samples;
performing feature extraction on each graphic code sample to obtain image features of each graphic code sample, wherein the image features comprise one or more of color features, typesetting features and image features;
and performing model training on the image recognition model based on the image characteristics of each graphic code sample to obtain the trained image recognition model.
7. A risk detection apparatus for a graphic code, the apparatus comprising:
the graphic code acquisition module is used for acquiring a target graphic code to be detected;
the characteristic extraction module is used for extracting characteristics of the target graphic code to obtain risk characteristics corresponding to the target graphic code, wherein the risk characteristics comprise first characteristics related to an image of the target graphic code or information contained in the image and second characteristics related to a source of the target graphic code, and the first characteristics comprise one or more of color characteristics, typesetting characteristics and image characteristics;
the scoring module is used for respectively determining the risk score of each characteristic contained in the risk characteristics corresponding to the target graphic code based on the risk characteristics corresponding to the target graphic code;
the risk identification module is used for determining whether the target graphic code has a risk or not based on a risk score of each characteristic contained in the risk characteristics corresponding to the target graphic code and a preset graphic code risk identification strategy;
the risk identification module includes:
the scoring card construction unit is used for constructing and training a scoring card model based on a preset graphic code risk identification strategy;
the risk score determining unit is used for inputting the risk score of each characteristic contained in the risk characteristics corresponding to the target graphic code into the grading card model to obtain the risk score of the target graphic code;
and the risk identification unit is used for determining whether the target graphic code has risks or not based on the value of the risks existing in the target graphic code.
8. The apparatus of claim 7, the color characteristics comprising one or more of a number of character colors contained in the target graphical code, whether there is a highlighted color; the typesetting characteristics comprise one or more of whether the target graphic code is in a horizontal mode, whether the target graphic code is in a vertical mode and whether the target graphic code is in a mixed mode; the image characteristics comprise one or more of whether the target graphic code contains an avatar and whether the target graphic code contains an image with a specified risk type.
9. The apparatus of claim 7, wherein the second characteristics comprise one or more of whether the object graphic code is from a designated image library, whether it is pulled up by scheme, and whether it is from a preset application with a designated risk.
10. A risk detection device of a graphic code, the risk detection device of the graphic code comprising:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
acquiring a target graphic code to be detected;
performing feature extraction on the target graphic code to obtain risk features corresponding to the target graphic code, wherein the risk features comprise first features related to the image of the target graphic code or information contained in the image and second features related to the source of the target graphic code, and the first features comprise one or more of color features, typesetting features and image features;
respectively determining the risk score of each feature contained in the risk features corresponding to the target graphic code based on the risk features corresponding to the target graphic code;
determining whether the target graphic code has risks or not based on the risk score of each characteristic contained in the risk characteristics corresponding to the target graphic code and a preset graphic code risk identification strategy;
the determining whether the target graphic code has a risk or not based on the risk score of each feature contained in the risk features corresponding to the target graphic code and a preset graphic code risk identification strategy comprises the following steps:
constructing and training a scoring card model based on a preset graphic code risk identification strategy;
inputting the risk score of each characteristic contained in the risk characteristics corresponding to the target graphic code into the grading card model to obtain the score of the risk of the target graphic code;
and determining whether the target graphic code has risks or not based on the score of the risks of the target graphic code.
11. A storage medium for storing computer-executable instructions, which when executed implement the following:
acquiring a target graphic code to be detected;
performing feature extraction on the target graphic code to obtain risk features corresponding to the target graphic code, wherein the risk features comprise first features related to the image of the target graphic code or information contained in the image and second features related to the source of the target graphic code, and the first features comprise one or more of color features, typesetting features and image features;
respectively determining the risk score of each feature contained in the risk features corresponding to the target graphic code based on the risk features corresponding to the target graphic code;
determining whether the target graphic code has risks or not based on the risk score of each characteristic contained in the risk characteristics corresponding to the target graphic code and a preset graphic code risk identification strategy;
the determining whether the target graphic code has a risk based on the risk score of each feature included in the risk features corresponding to the target graphic code and a preset graphic code risk identification strategy includes:
constructing and training a scoring card model based on a preset pattern code risk identification strategy;
inputting the risk score of each characteristic contained in the risk characteristics corresponding to the target graphic code into the grading card model to obtain the score of the risk of the target graphic code;
and determining whether the target graphic code has risks or not based on the score of the risks of the target graphic code.
CN202110590351.2A 2021-05-28 2021-05-28 Risk detection method, device and equipment for graphic code Active CN113255857B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110590351.2A CN113255857B (en) 2021-05-28 2021-05-28 Risk detection method, device and equipment for graphic code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110590351.2A CN113255857B (en) 2021-05-28 2021-05-28 Risk detection method, device and equipment for graphic code

Publications (2)

Publication Number Publication Date
CN113255857A CN113255857A (en) 2021-08-13
CN113255857B true CN113255857B (en) 2022-09-06

Family

ID=77185336

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110590351.2A Active CN113255857B (en) 2021-05-28 2021-05-28 Risk detection method, device and equipment for graphic code

Country Status (1)

Country Link
CN (1) CN113255857B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113688650B (en) * 2021-09-22 2022-06-17 支付宝(杭州)信息技术有限公司 Method and device for identifying picture

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109657088A (en) * 2018-09-30 2019-04-19 阿里巴巴集团控股有限公司 A kind of picture risk checking method, device, equipment and medium
CN111353488A (en) * 2020-02-25 2020-06-30 支付宝(杭州)信息技术有限公司 Method, device and equipment for identifying risks in code image
CN111445258A (en) * 2020-06-12 2020-07-24 支付宝(杭州)信息技术有限公司 Risk prevention and control information processing method, device and equipment
CN112509699A (en) * 2020-12-28 2021-03-16 医渡云(北京)技术有限公司 Health identification code generation method and device, storage medium and electronic equipment
EP3985588A1 (en) * 2020-10-19 2022-04-20 Coges S.p.A. A payment support

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107451501B (en) * 2017-07-03 2020-03-06 阿里巴巴集团控股有限公司 Method and device for realizing dynamic graphic coding

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109657088A (en) * 2018-09-30 2019-04-19 阿里巴巴集团控股有限公司 A kind of picture risk checking method, device, equipment and medium
CN111353488A (en) * 2020-02-25 2020-06-30 支付宝(杭州)信息技术有限公司 Method, device and equipment for identifying risks in code image
CN111445258A (en) * 2020-06-12 2020-07-24 支付宝(杭州)信息技术有限公司 Risk prevention and control information processing method, device and equipment
EP3985588A1 (en) * 2020-10-19 2022-04-20 Coges S.p.A. A payment support
CN112509699A (en) * 2020-12-28 2021-03-16 医渡云(北京)技术有限公司 Health identification code generation method and device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN113255857A (en) 2021-08-13

Similar Documents

Publication Publication Date Title
CN109063886B (en) Anomaly detection method, device and equipment
CN109033261B (en) Image processing method, image processing apparatus, image processing device, and storage medium
CN110737811B (en) Application classification method and device and related equipment
CN111782637A (en) Model construction method, device and equipment
CN113688313A (en) Training method of prediction model, information pushing method and device
CN113761359B (en) Data packet recommendation method, device, electronic equipment and storage medium
CN113032525A (en) False news detection method and device, electronic equipment and storage medium
CN110689164A (en) Prediction method and system for user reduction behavior
CN110263817B (en) Risk grade classification method and device based on user account
CN113255857B (en) Risk detection method, device and equipment for graphic code
CN115188067A (en) Video behavior identification method and device, electronic equipment and storage medium
WO2024021685A1 (en) Reply content processing method and media content interactive content interaction method
CN116843376A (en) Marketing effect prejudging method, marketing effect prejudging device, storage medium and marketing effect prejudging equipment
CN113821634A (en) Content classification method and device, electronic equipment and storage medium
CN113688232A (en) Method and device for classifying bidding texts, storage medium and terminal
CN113553063A (en) Method and device for determining contribution degree of open source of code, computer equipment and medium
CN112989182A (en) Information processing method, information processing apparatus, information processing device, and storage medium
Wróblewska et al. Spoiler in a Textstack: How Much Can Transformers Help?
CN113407727B (en) Qualitative measure and era recommendation method based on legal knowledge graph and related equipment
Chivers et al. ANTS: a framework for retrieval of text segments in unstructured documents
Sehgal et al. Ai driven identification of fake news propagation in twitter social media with geo-spatial analysis
CN111428994B (en) Service processing method and device and electronic equipment
CN116028617B (en) Information recommendation method, apparatus, device, readable storage medium and program product
CN113254635B (en) Data processing method, device and storage medium
CN114219084B (en) Sales visit display counterfeiting identification method and device in fast moving industry

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
GR01 Patent grant
GR01 Patent grant