Illegal detection method and device, electronic equipment and storage medium

By obtaining the mask characteristics of the information to be detected and using a pre-trained violation detection model for detection, the inefficiency problem of multiple detection models in the prior art is solved, and more efficient and accurate violation detection is achieved.

CN119961801APending Publication Date: 2025-05-09BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411919242.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-05-09

AI Technical Summary

Technical Problem

In the prior art, each violation detection model can only realize a separate detection of one violation type, resulting in the same information to be detected by multiple types of violation detection models before it can be determined whether the violation is violated, and the detection effect is very low.

Method used

Provide a violation detection method, by obtaining the mask characteristics of the information to be detected and conducting violation detection based on the pre-trained violation detection model, the detection results are obtained, including whether the violation and the categories of violations.

Benefits of technology

This method can effectively improve the accuracy and detection efficiency of violation detection, avoid complex processes that require multiple detection models, and can detect combined information of text and pictures at the same time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119961801A_ABST
    Figure CN119961801A_ABST
Patent Text Reader

Abstract

The invention provides a violation detection method and device, electronic equipment and a storage medium, and relates to the technical field of artificial intelligence such as risk control detection, machine learning and natural language processing. According to the specific implementation scheme, to-be-detected information is acquired; acquiring mask features of to-be-detected information; based on the mask feature of the to-be-detected information and the to-be-detected information, adopting a pre-trained violation detection model to perform violation detection on the to-be-detected information to obtain a detection result; the detection result comprises whether the to-be-detected information is illegal or not and an illegal type when the to-be-detected information is illegal. According to the technology disclosed by the invention, the accuracy and the detection efficiency of violation detection can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, specifically to the field of artificial intelligence technology such as risk control detection, machine learning and natural language processing, and more particularly to a violation detection method, device, electronic device and storage medium. Background Art

[0002] With the development of deep learning technology and the application of neural network models, it has brought more and more convenience to people's work and life.

[0003] For example, in traditional technology, people can only manually detect whether information violates regulations. With the maturity of model application technology, violation detection models for various separate tasks can be constructed to detect whether there are corresponding types of violations in the information to be detected. Summary of the invention

[0004] The present disclosure provides a violation detection method, device, electronic device and storage medium.

[0005] According to one aspect of the present disclosure, a violation detection method is provided, comprising:

[0006] Obtain the information to be tested;

[0007] Obtaining mask features of the information to be detected;

[0008] Based on the mask features of the information to be detected and the information to be detected, a pre-trained violation detection model is used to perform violation detection on the information to be detected to obtain a detection result; the detection result includes whether the information to be detected violates the regulations and the violation category if it violates the regulations.

[0009] According to another aspect of the present disclosure, a method for training a violation detection model is provided, comprising:

[0010] Acquire training data, wherein the training data includes training information to be detected and annotated detection results of the training information to be detected, wherein the annotated detection results include whether the training information to be detected violates a rule and a violation category if the rule violates a rule;

[0011] Obtaining training mask features of the training information to be detected;

[0012] The violation detection model is trained based on the training mask features of the training information to be detected and the training information to be detected.

[0013] According to another aspect of the present disclosure, there is provided a violation detection device, comprising:

[0014] An information acquisition module, used to acquire information to be detected;

[0015] A mask feature acquisition module, used to acquire mask features of information to be detected;

[0016] The violation detection module is used to perform violation detection on the information to be detected based on the mask features of the information to be detected and the information to be detected, using a pre-trained violation detection model to obtain a detection result; the detection result includes whether the information to be detected violates the regulations and the violation category if it violates the regulations.

[0017] According to another aspect of the present disclosure, a training device for a violation detection model is provided, comprising:

[0018] A training data acquisition module, used to acquire training data, wherein the training data includes training information to be detected and a labeled detection result of the training information to be detected, wherein the labeled detection result includes whether the training information to be detected violates a rule and the violation category if a rule is violated;

[0019] A mask feature acquisition module, used to acquire the training mask features of the training information to be detected;

[0020] A training module is used to train a violation detection model based on the training mask features of the training information to be detected and the training information to be detected.

[0021] According to yet another aspect of the present disclosure, there is provided an electronic device, including:

[0022] at least one processor; and

[0023] a memory communicatively connected to the at least one processor; wherein,

[0024] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any possible implementation manner and the aspects described above.

[0025] According to yet another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method of the above-mentioned aspect and any possible implementation manner.

[0026] According to yet another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the computer program implements the above-mentioned aspects and the method of any possible implementation manner.

[0027] According to the technology disclosed in the present invention, the accuracy and efficiency of violation detection can be effectively improved.

[0028] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0030] Figure 1 is a schematic diagram according to a first embodiment of the present disclosure;

[0031] Figure 2 is a schematic diagram according to a second embodiment of the present disclosure;

[0032] Figure 3 is a schematic diagram according to a third embodiment of the present disclosure;

[0033] Figure 4 is a schematic diagram according to a fourth embodiment of the present disclosure;

[0034] Figure 5 is a schematic diagram according to a fifth embodiment of the present disclosure;

[0035] Figure 6 is a schematic diagram according to a sixth embodiment of the present disclosure;

[0036] Figure 7 is a schematic diagram according to a seventh embodiment of the present disclosure;

[0037] Figure 8 is a schematic diagram according to an eighth embodiment of the present disclosure;

[0038] Fig. 9 The block diagram is a block diagram of an electronic device for implementing the method of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0039] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0040] Obviously, the described embodiments are only part of the embodiments of the present disclosure, but not all of them. Based on the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present disclosure.

[0041] It should be noted that the terminal devices involved in the embodiments of the present disclosure may include but are not limited to mobile phones, personal digital assistants (PDAs), wireless handheld devices, tablet computers and other smart devices; display devices may include but are not limited to personal computers, televisions and other devices with display functions.

[0042] In addition, the term "and / or" in this article is only a description of the association relationship between the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0043] In the prior art, each violation detection model can only realize the separate detection of one violation type, resulting in the same information to be detected having to be detected by multiple types of violation detection models to determine whether it is a violation, and the detection effect is very low.

[0044] Figure 1 is a schematic diagram according to the first embodiment of the present disclosure; Figure 1 As shown, this embodiment provides a violation detection method, which may specifically include the following steps:

[0045] S101, obtaining information to be detected;

[0046] S102, obtaining mask features of the information to be detected;

[0047] S103 , based on the mask features of the information to be detected and the information to be detected, using a pre-trained violation detection model, perform violation detection on the information to be detected to obtain a detection result.

[0048] The execution subject of the violation detection method of this embodiment may be a violation detection device, which may be an electronic entity, or an application integrated by software, or an intelligent entity, etc.

[0049] The information to be detected in this embodiment may be selected or input by a user from a document during violation detection. The information to be detected may include at least one of text and a picture.

[0050] That is to say, the violation detection model of this embodiment can detect whether only the text is in violation, or only the image is in violation, or the combination of text and image is in violation. For example, in some scenarios, detecting text alone or detecting image alone cannot detect whether it is in violation, but based on both text and image, it can be determined that it is in violation. Therefore, the detection scheme of this embodiment can detect violation information more accurately and effectively.

[0051] The technical solution of this embodiment can be applied in risk control scenarios to detect various violation information. In this embodiment, the pre-trained violation detection model can realize violation detection of multiple tasks.

[0052] In this embodiment, before using the pre-trained violation detection model for detection, it is necessary to obtain the mask features of the information to be detected, and then input the information to be detected and the mask features of the information to be detected into the violation detection model together. The violation detection model can perform violation detection on the information to be detected based on the input information to obtain a detection result. For example, the detection result may include whether the information to be detected violates the rules, and if so, the violation category. The violation categories that the violation detection model in this embodiment is suitable for detecting may include multiple pre-defined categories, which are not limited here.

[0053] The violation detection method of this embodiment, by adopting a violation detection model, can perform violation detection on the information to be detected based on the mask features of the information to be detected and the information to be detected, and determine whether the information to be detected violates the rules, and the violation category if it violates the rules, without adopting multiple different violation detection models to detect the information to be detected separately, which can effectively improve the accuracy and detection efficiency of violation detection.

[0054] Figure 2 is a schematic diagram according to the second embodiment of the present disclosure; the violation detection method of this embodiment, in the above Figure 1 Based on the technical solutions of the embodiments shown in the figure, the technical solutions of the present disclosure are further described in more detail. Figure 2 As shown, the violation detection method of this embodiment may specifically include the following steps:

[0055] S201, obtaining information to be detected;

[0056] S202, obtaining a picture to be detected based on the information to be detected;

[0057] When this embodiment is applied, the information to be detected determined by the user may include at least one of text and pictures. In other words, the information to be detected determined by the user may not include pictures. However, when training the violation detection model of this embodiment, in order to enable the deep fusion of text and pictures and increase the accuracy of violation detection, the input of picture information of the information to be detected is required. Therefore, when this step is specifically implemented, it can include the following two methods:

[0058] First, if the information to be detected includes the picture to be detected, the picture to be detected is obtained from the information to be detected;

[0059] Second, if the information to be detected does not include the picture to be detected, a preset picture is obtained as the picture to be detected; the preset picture is a blank picture.

[0060] That is to say, if the information to be detected does not include any pictures, a blank picture can be used as the picture to be detected. In this way, other picture content that may affect violation detection is not added, and the accuracy and efficiency of violation detection by the violation detection model can be effectively improved.

[0061] S203, using a pre-trained target recognition model to perform target recognition on the image to be detected to obtain a recognition result;

[0062] The target recognition model of this embodiment detects and recognizes the target in the image to be detected. It can be considered that the target recognition model can amplify and recognize local information of the image during the detection process, thereby helping to improve the detection accuracy and efficiency of subsequent violation detection.

[0063] S204, obtaining mask features based on the recognition result;

[0064] For example, if the target is identified in the recognition result, the pixel value of the pixel point of the target in the image to be detected can be set to the first preset pixel value; the pixel values ​​of other pixels in the image to be detected can be set to the second preset pixel value to obtain a mask feature; wherein the first preset pixel value is greater than the second preset pixel value. In this way, the mask feature obtained is a feature map consistent with the size of the image, and the mask feature map only includes the first preset pixel value and the second preset pixel value. For example, the first preset pixel value in the present embodiment can be 255, or 254, etc., and the second preset pixel value can be 0 or 1, etc. In short, the difference between the first preset pixel value and the second preset pixel value is maximized as much as possible. For example, the difference between the first preset pixel value and the second preset pixel value needs to be greater than the preset pixel threshold so that the target can be significantly identified relative to the background. The preset pixel threshold can be set to 250, 240, etc. according to actual needs or experience, and is not limited here. The mask feature obtained in this way can make the target detected in the image to be detected significant, which can be more convenient for reference during violation detection, and thus can effectively improve the accuracy of violation detection.

[0065] It should be noted that when a target is detected in the image to be detected, or when the image to be detected is a preset image, the pixel values ​​in the mask feature are all second preset pixel values.

[0066] Steps S202-S204 of this embodiment are as described above. Figure 1 A specific implementation of step S102 of the illustrated embodiment. By this method, the mask features of the information to be detected can be obtained very accurately and reasonably.

[0067] S205, obtaining the text to be detected based on the information to be detected;

[0068] This step can be implemented in the following two ways:

[0069] In the first method, if the information to be detected includes the text to be detected, the text to be detected is obtained from the information to be detected; or

[0070] The second method is to obtain a preset text as the text to be detected if the information to be detected does not include the text to be detected; the preset text is blank text.

[0071] Similarly, as described above, the information to be detected in this embodiment may include at least one of a picture and text. That is to say, in this embodiment, there is also a situation where the information to be detected does not include text. However, when predicting, the violation detection model of this embodiment needs the text to be detected of the information to be detected. At this time, a preset text with blank text content is obtained as the text to be detected. This does not increase other text content that affects violation detection, but can also effectively improve the accuracy and detection efficiency of violation detection by the violation detection model.

[0072] S206, based on the text to be detected, using the text encoding unit in the violation detection model to obtain text features of the text to be detected;

[0073] S207, based on the picture to be detected corresponding to the information to be detected, using the picture encoding unit in the violation detection model to obtain picture features of the picture to be detected;

[0074] S208. Based on the mask features, the image features, and the text features, a violation detection unit in the violation detection model is used to perform violation detection on the information to be detected to obtain a detection result.

[0075] The violation detection model in this embodiment may include three parts: a text encoding unit, a picture encoding unit, and a violation detection unit, wherein the text encoding unit is used to encode the text to be detected in the detection information to obtain text features, and the picture encoding unit is used to encode the picture to be detected in the detection information to obtain picture features. Finally, the violation detection unit performs violation detection based on the mask features, text features, and picture features. At this time, the violation detection model can deeply analyze the target corresponding to the mask in the picture, and fully analyze the deep association between the picture and the text, so as to perform violation detection more accurately.

[0076] The violation detection model of this embodiment can deeply analyze the association between images and texts, and can further improve the accuracy of violation detection. Because in many scenarios in the prior art, when a single image or a single text is detected for violation, it is not a violation, but in fact, the combination of the two is a violation, so there are certain detection loopholes when only text or image detection is used. The violation detection model of this embodiment can deeply analyze the association between images and texts, and then accurately detect violations in this situation.

[0077] At the same time, the violation detection model of this embodiment can also perform violation detection based on local detail features according to mask features, which can further improve the accuracy and efficiency of violation detection.

[0078] In addition, the violation detection model of this embodiment can not only detect whether the information to be detected violates the rules, but also detect the violation category when violating the rules. It can be understood that the violation detection model is a multi-classification model, and the specific categories can include non-violation and violations of various violation categories.

[0079] In summary, compared with the violation detection models of various separate violation categories in the prior art, the violation detection method of this embodiment can not only integrate the detection of multiple violation categories, but also fully consider the mask information of the target in the image, as well as the deep fusion information of the image and text, which can further effectively improve the accuracy and efficiency of violation detection.

[0080] Figure 3 is a schematic diagram according to the third embodiment of the present disclosure; this embodiment provides a method for training a violation detection model, which may specifically include the following steps:

[0081] S301, obtaining training data, wherein the training data includes training information to be detected and annotated detection results of the training information to be detected, wherein the annotated detection results include whether the training information to be detected violates a rule and the violation category if a rule is violated;

[0082] S302, obtaining training mask features of the training information to be detected;

[0083] S303: Training a violation detection model based on the training mask features of the training information to be detected and the training information to be detected.

[0084] The execution subject of the training method of the violation detection model of this embodiment is a training device of the violation detection model, and the device may be an electronic entity, or may also be an application integrated by software, etc.

[0085] This embodiment is used to Figure 1 or Figure 2 The violation detection model of the illustrated embodiment is trained.

[0086] In this embodiment, the training information to be detected may include at least one of a picture and a text.

[0087] In this embodiment, the training mask features of the training information to be detected are the same as those mentioned above. Figure 1 The method for acquiring the mask features of the information to be detected in the illustrated embodiment is the same and will not be described again.

[0088] The training method of the violation detection model of this embodiment, by adopting the above technical solution, can accurately and effectively train the violation detection model, and can effectively improve the detection accuracy and detection efficiency of the trained violation detection model.

[0089] Figure 4 is a schematic diagram according to the fourth embodiment of the present disclosure; the training method of the violation detection model of this embodiment, in the above Figure 3 Based on the technical solutions of the embodiments shown in the figure, the technical solutions of the present disclosure are further described in more detail. Figure 4 As shown, the training method of the violation detection model of this embodiment may specifically include the following steps:

[0090] S401, obtaining training data, wherein the training data includes training information to be detected and annotated detection results of the training information to be detected, wherein the annotated detection results include whether the training information to be detected violates a rule and the violation category if a rule is violated;

[0091] S402, obtaining a training image to be detected based on the training information to be detected;

[0092] For example, in a specific implementation, if the training information to be detected includes the training picture to be detected, the training picture to be detected is obtained from the training information to be detected; if the training information to be detected does not include the training picture to be detected, a preset training picture is obtained as the training picture to be detected; the preset training picture is a blank picture.

[0093] S403, using a pre-trained target recognition model to perform target recognition on the training image to be detected, and obtaining a training recognition result;

[0094] S404, obtaining training mask features based on the training recognition results;

[0095] For example, if a target is identified in the training recognition result, the pixel value of the pixel point of the target in the training image to be detected is set to the first preset pixel value; the pixel values ​​of other pixel points in the training image to be detected are set to the second preset pixel value to obtain a training mask feature; the first preset pixel value is greater than the second preset pixel value.

[0096] The steps of this embodiment are the specific implementation of S402-S404. Figure 2 S202 - S204 of the illustrated embodiment are the same, and details may refer to the description of the above embodiment, which will not be repeated here.

[0097] S405, obtaining a training text to be detected based on the training information to be detected;

[0098] For example, if the training information to be detected includes the training text to be detected, the training text to be detected is obtained from the training information to be detected; if the training information to be detected does not include the training text to be detected, a preset training text is obtained as the training text to be detected; the preset training text is blank text.

[0099] S406, based on the training text to be detected, using the text encoding unit in the violation detection model to obtain the training text features of the training text to be detected;

[0100] S407, based on the to-be-detected training picture corresponding to the to-be-detected training information, using the picture encoding unit in the violation detection model to obtain the training picture features of the to-be-detected training information;

[0101] S408, based on the training mask features, the training image features and the training text features, using the violation detection unit in the violation detection model, to perform violation detection on the training information to be detected, and obtain a training detection result; the training detection result includes whether the training information to be detected is predicted to violate the rules and the violation category if it violates the rules;

[0102] Specifically, in this embodiment, the specific implementation of steps S405-S408 is the same as above. Figure 2 Steps S205-S208 in the embodiment shown are the same, and can be referred to above for details. Figure 2 The relevant records of the illustrated embodiment will not be repeated here.

[0103] S409 , with the goal of making the training detection result and the labeling detection result the same, adjusting parameters of the text encoding unit, the image encoding unit, and the violation detection unit.

[0104] Specifically, a loss function can be constructed based on the training detection results and the labeled detection results, and then parameters of the text encoding unit, the image encoding unit, and the violation detection unit can be adjusted with the goal of convergence of the loss function.

[0105] In this embodiment, one piece of training data is taken as an example. In actual applications, multiple pieces of training data can be used to continuously train the violation detection model in the above manner until the training is terminated, such as when the model converges or the training reaches a preset number of times. At this time, the training is terminated and the violation detection model is determined.

[0106] The training method of the violation detection model of this embodiment, by adopting the above method, can fully refer to the mask features, image features and text features during training, and can not only learn to recognize the local information of the image based on the mask features, but also learn the deep correlation between the image and the text, thereby further effectively improving the detection accuracy and efficiency of the learned violation detection model.

[0107] Figure 5 is a schematic diagram according to a fifth embodiment of the present disclosure; this embodiment provides a violation detection device 500, comprising:

[0108] The information acquisition module 501 is used to acquire the information to be detected;

[0109] The mask feature acquisition module 502 is used to acquire the mask feature of the information to be detected;

[0110] The violation detection module 503 is used to perform violation detection on the information to be detected based on the mask features of the information to be detected and the information to be detected, using a pre-trained violation detection model to obtain a detection result; the detection result includes whether the information to be detected violates the regulations and the violation category if it violates the regulations.

[0111] The violation detection device 500 of this embodiment realizes the violation detection by adopting the above modules, and the implementation principle and technical effect are the same as those of the above related method embodiments. For details, please refer to the records of the above related method embodiments, which will not be repeated here.

[0112] Figure 6 is a schematic diagram according to the sixth embodiment of the present disclosure; the violation detection device 600 of this embodiment, in the above Figure 5 Based on the technical solutions of the embodiments shown in the figure, the technical solutions of the present disclosure are further described in more detail. Figure 6 As shown, the violation detection device 600 of this embodiment includes the above Figure 5 The modules with the same name and function are shown as follows: information acquisition module 601 , mask feature acquisition module 602 , and violation detection module 603 .

[0113] In this embodiment, the mask feature acquisition module 602 is used to:

[0114] Based on the information to be detected, obtaining a picture to be detected;

[0115] Using a pre-trained target recognition model, performing target recognition on the image to be detected to obtain a recognition result;

[0116] Based on the recognition result, the mask feature is obtained.

[0117] Further optionally, in one embodiment of the present disclosure, the mask feature acquisition module 602 is used to:

[0118] If the information to be detected includes a picture to be detected, obtaining the picture to be detected from the information to be detected; or

[0119] If the information to be detected does not include the picture to be detected, a preset picture is obtained as the picture to be detected; the preset picture is a blank picture.

[0120] Further optionally, in one embodiment of the present disclosure, the mask feature acquisition module 602 is used to:

[0121] If a target is identified in the recognition result, the pixel value of the pixel point of the target in the image to be detected is set to a first preset pixel value; the pixel values ​​of other pixel points in the image to be detected are set to a second preset pixel value to obtain the mask feature; the first preset pixel value is greater than the second preset pixel value.

[0122] Further optionally, if Figure 6 As shown, in one embodiment of the present disclosure, the violation detection module 603 includes:

[0123] A text information acquisition unit 6031 is used to acquire a text to be detected based on the information to be detected;

[0124] The text feature acquisition unit 6032 is used to acquire the text features of the text to be detected based on the text to be detected and using the text encoding unit in the violation detection model.

[0125] The picture feature acquisition unit 6033 is used to acquire the picture features of the picture to be detected based on the picture to be detected corresponding to the information to be detected and using the picture encoding unit in the violation detection model.

[0126] The violation detection unit 6034 is used to perform violation detection on the information to be detected based on the mask feature, the image feature and the text feature, using the violation detection unit in the violation detection model to obtain the detection result.

[0127] Further optionally, in one embodiment of the present disclosure, the text information acquiring unit 6031 is used to:

[0128] If the information to be detected includes text to be detected, obtaining the text to be detected from the information to be detected; or

[0129] If the information to be detected does not include the text to be detected, a preset text is obtained as the text to be detected; the preset text is a blank text.

[0130] The violation detection device 600 of this embodiment realizes the violation detection by adopting the above modules, and the implementation principle and technical effect are the same as those of the above related method embodiments. For details, please refer to the records of the above related method embodiments, which will not be repeated here.

[0131] Figure 7 is a schematic diagram according to the seventh embodiment of the present disclosure; this embodiment provides a training device 700 for a violation detection model, comprising:

[0132] The training data acquisition module 701 is used to acquire training data, wherein the training data includes training information to be detected and a labeled detection result of the training information to be detected, wherein the labeled detection result includes whether the training information to be detected violates a rule and the violation category if a rule is violated;

[0133] The mask feature acquisition module 702 is used to acquire the training mask feature of the training information to be detected;

[0134] The training module 703 is used to train the violation detection model based on the training mask features of the training information to be detected and the training information to be detected.

[0135] The training device 700 of the violation detection model of this embodiment realizes the implementation principle and technical effect of the training of the violation detection model by adopting the above-mentioned modules, which is the same as the implementation of the above-mentioned related method embodiments. For details, please refer to the records of the above-mentioned related method embodiments, which will not be repeated here.

[0136] Figure 8 is a schematic diagram according to the eighth embodiment of the present disclosure; the training device 800 of the violation detection model of this embodiment, in the above Figure 7 Based on the technical solutions of the embodiments shown in the figure, the technical solutions of the present disclosure are further described in more detail. Figure 8 As shown, the training device 800 of the violation detection model of this embodiment includes the above Figure 7 The modules with the same name and function shown are: training data acquisition module 801 , mask feature acquisition module 802 and training module 803 .

[0137] In this embodiment, the mask feature acquisition module 802 is used to:

[0138] Based on the training information to be detected, obtaining a training picture to be detected;

[0139] Using a pre-trained target recognition model, performing target recognition on the training image to be detected to obtain a training recognition result;

[0140] Based on the training recognition result, the training mask feature is obtained.

[0141] Further optionally, in one embodiment of the present disclosure, the mask feature acquisition module 802 is used to:

[0142] If the to-be-detected training information includes a to-be-detected training picture, obtaining the to-be-detected training picture from the to-be-detected training information; or

[0143] If the to-be-detected training information does not include the to-be-detected training picture, a preset training picture is obtained as the to-be-detected training picture; the preset training picture is a blank picture.

[0144] Further optionally, in one embodiment of the present disclosure, the mask feature acquisition module 802 is used to:

[0145] If a target is identified in the training recognition result, the pixel value of the pixel point of the target in the training image to be detected is set to a first preset pixel value; the pixel values ​​of other pixel points in the training image to be detected are set to a second preset pixel value to obtain the training mask feature; the first preset pixel value is greater than the second preset pixel value.

[0146] Further optionally, if Figure 8 As shown, in one embodiment of the present disclosure, the training module 803 includes:

[0147] The text information acquisition unit 8031 ​​is used to acquire the training text to be detected based on the training information to be detected;

[0148] The text feature acquisition unit 8032 is used to acquire the training text features of the training text to be detected based on the training text to be detected and using the text encoding unit in the violation detection model.

[0149] The picture feature acquisition unit 8033 is used to acquire the training picture features of the training information to be detected based on the training picture to be detected corresponding to the training information to be detected, using the picture encoding unit in the violation detection model.

[0150] The violation detection unit 8034 is used to perform violation detection on the training information to be detected based on the training mask feature, the training image feature and the training text feature, using the violation detection unit in the violation detection model to obtain a training detection result; the training detection result includes a prediction of whether the training information to be detected violates the rule and the violation category if it violates the rule;

[0151] The adjustment unit 8035 is used to adjust the parameters of the text encoding unit, the image encoding unit and the violation detection unit with the goal of making the training detection result and the labeling detection result the same.

[0152] Further optionally, in one embodiment of the present disclosure, the text information acquiring unit 8031 ​​is used to:

[0153] If the training information to be detected includes a training text to be detected, obtaining the training text to be detected from the training information to be detected; or

[0154] If the training information to be detected does not include the training text to be detected, a preset training text is obtained as the training text to be detected; the preset training text is a blank text.

[0155] The training device 800 of the violation detection model of this embodiment realizes the implementation principle and technical effect of the training of the violation detection model by adopting the above-mentioned modules, which is the same as the implementation of the above-mentioned related method embodiments. For details, please refer to the records of the above-mentioned related method embodiments, which will not be repeated here.

[0156] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0157] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0158] Fig. 9 A schematic block diagram of an example electronic device 900 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0159] like Fig. 9 As shown, the device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the device 900 can also be stored. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0160] A number of components in the device 900 are connected to the I / O interface 905, including: an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0161] The computing unit 901 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 901 performs the various methods and processes described above, such as the above-mentioned methods of the present disclosure. For example, in some embodiments, the above-mentioned methods of the present disclosure may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 900 via ROM 902 and / or communication unit 909. When the computer program is loaded into RAM 903 and executed by the computing unit 901, one or more steps of the above-mentioned methods of the present disclosure described above may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to perform the above-mentioned methods of the present disclosure in any other appropriate manner (e.g., by means of firmware).

[0162] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0163] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0164] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0165] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0166] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0167] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0168] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0169] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A violation detection method, comprising: Obtain the information to be tested; Obtaining mask features of the information to be detected; Based on the mask features of the information to be detected and the information to be detected, a pre-trained violation detection model is used to perform violation detection on the information to be detected to obtain a detection result; the detection result includes whether the information to be detected violates the regulations and the violation category if it violates the regulations.

2. The method according to claim 1, wherein: Obtain the mask features of the information to be detected, including: Based on the information to be detected, obtaining a picture to be detected; Using a pre-trained target recognition model, performing target recognition on the image to be detected to obtain a recognition result; Based on the recognition result, the mask feature is obtained.

3. The method according to claim 2, wherein: Based on the information to be detected, obtaining a picture to be detected includes: If the information to be detected includes a picture to be detected, obtaining the picture to be detected from the information to be detected; or If the information to be detected does not include the picture to be detected, a preset picture is obtained as the picture to be detected; the preset picture is a blank picture.

4. The method according to claim 2, wherein: Based on the recognition result, obtaining the mask feature includes: If a target is identified in the recognition result, the pixel value of the pixel point of the target in the image to be detected is set to a first preset pixel value; the pixel values ​​of other pixel points in the image to be detected are set to a second preset pixel value to obtain the mask feature; the first preset pixel value is greater than the second preset pixel value.

5. The method according to claim 2, wherein: Based on the mask features of the information to be detected and the information to be detected, a pre-trained violation detection model is used to perform violation detection on the information to be detected to obtain a detection result, including: Based on the information to be detected, obtaining the text to be detected; Based on the text to be detected, the text encoding unit in the violation detection model is used to obtain the text features of the text to be detected. Based on the picture to be detected corresponding to the information to be detected, a picture encoding unit in the violation detection model is used to obtain picture features of the picture to be detected. Based on the mask features, the image features and the text features, a violation detection unit in the violation detection model is used to perform violation detection on the information to be detected to obtain the detection result.

6. The method according to claim 5, wherein: Based on the information to be detected, obtaining the text to be detected includes: If the information to be detected includes text to be detected, obtaining the text to be detected from the information to be detected; or If the information to be detected does not include the text to be detected, a preset text is obtained as the text to be detected; the preset text is a blank text.

7. A method for training a violation detection model, comprising: Acquire training data, wherein the training data includes training information to be detected and annotated detection results of the training information to be detected, wherein the annotated detection results include whether the training information to be detected violates a rule and a violation category if the rule violates a rule; Obtaining training mask features of the training information to be detected; The violation detection model is trained based on the training mask features of the training information to be detected and the training information to be detected.

8. The method according to claim 7, wherein: Acquiring the training mask features of the training information to be detected includes: Based on the training information to be detected, obtaining a training picture to be detected; Using a pre-trained target recognition model, performing target recognition on the training image to be detected to obtain a training recognition result; Based on the training recognition result, the training mask feature is obtained.

9. The method according to claim 8, wherein: Based on the to-be-detected training information, obtaining a to-be-detected training image includes: If the to-be-detected training information includes a to-be-detected training picture, obtaining the to-be-detected training picture from the to-be-detected training information; or If the to-be-detected training information does not include the to-be-detected training picture, a preset training picture is obtained as the to-be-detected training picture; the preset training picture is a blank picture.

10. The method according to claim 8, wherein: Based on the training recognition result, obtaining the training mask feature includes: If a target is identified in the training recognition result, the pixel value of the pixel point of the target in the training image to be detected is set to a first preset pixel value; the pixel values ​​of other pixel points in the training image to be detected are set to a second preset pixel value to obtain the training mask feature; the first preset pixel value is greater than the second preset pixel value.

11. The method according to claim 8, wherein: Training a violation detection model based on the training mask features of the training information to be detected and the training information to be detected includes: Based on the training information to be detected, obtaining the training text to be detected; Based on the training text to be detected, using the text encoding unit in the violation detection model, obtaining the training text features of the training text to be detected; Based on the to-be-detected training picture corresponding to the to-be-detected training information, using the picture encoding unit in the violation detection model, acquiring the training picture features of the to-be-detected training information; Based on the training mask features, the training image features and the training text features, a violation detection unit in the violation detection model is used to perform violation detection on the training information to be detected to obtain a training detection result; the training detection result includes a prediction of whether the training information to be detected violates a violation and a violation category if a violation occurs; With the goal of making the training detection result and the labeling detection result the same, parameters of the text encoding unit, the picture encoding unit and the violation detection unit are adjusted.

12. The method according to claim 11, wherein: Based on the to-be-detected training information, obtaining the to-be-detected training text includes: If the training information to be detected includes a training text to be detected, obtaining the training text to be detected from the training information to be detected; or If the training information to be detected does not include the training text to be detected, a preset training text is obtained as the training text to be detected; the preset training text is a blank text.

13. A violation detection device, comprising: An information acquisition module, used to acquire information to be detected; A mask feature acquisition module, used to acquire mask features of information to be detected; The violation detection module is used to perform violation detection on the information to be detected based on the mask features of the information to be detected and the information to be detected, using a pre-trained violation detection model to obtain a detection result; the detection result includes whether the information to be detected violates the regulations and the violation category if it violates the regulations.

14. The device according to claim 13, wherein: The mask feature acquisition module is used to: Based on the information to be detected, obtaining a picture to be detected; Using a pre-trained target recognition model, performing target recognition on the image to be detected to obtain a recognition result; Based on the recognition result, the mask feature is obtained.

15. The device according to claim 14, wherein: The mask feature acquisition module is used to: If the information to be detected includes a picture to be detected, obtaining the picture to be detected from the information to be detected; or If the information to be detected does not include the picture to be detected, a preset picture is obtained as the picture to be detected; the preset picture is a blank picture.

16. The device according to claim 14, wherein: The mask feature acquisition module is used to: If a target is identified in the recognition result, the pixel value of the pixel point of the target in the image to be detected is set to a first preset pixel value; the pixel values ​​of other pixel points in the image to be detected are set to a second preset pixel value to obtain the mask feature; The first preset pixel value is greater than the second preset pixel value.

17. The device according to claim 14, wherein: The violation detection module comprises: A text information acquisition unit, used for acquiring the text to be detected based on the information to be detected; The text feature acquisition unit is used to acquire the text features of the text to be detected based on the text to be detected and using the text encoding unit in the violation detection model. The picture feature acquisition unit is used to acquire the picture features of the picture to be detected based on the picture to be detected corresponding to the information to be detected and using the picture encoding unit in the violation detection model. A violation detection unit is used to perform violation detection on the information to be detected based on the mask feature, the image feature and the text feature, using the violation detection unit in the violation detection model to obtain the detection result.

18. The device according to claim 17, wherein: The text information acquisition unit is used to: If the information to be detected includes text to be detected, obtaining the text to be detected from the information to be detected; or If the information to be detected does not include the text to be detected, a preset text is obtained as the text to be detected; the preset text is a blank text.

19. A training device for a violation detection model, comprising: A training data acquisition module, used to acquire training data, wherein the training data includes training information to be detected and a labeled detection result of the training information to be detected, wherein the labeled detection result includes whether the training information to be detected violates a rule and the violation category if a rule is violated; A mask feature acquisition module, used to acquire the training mask features of the training information to be detected; A training module is used to train a violation detection model based on the training mask features of the training information to be detected and the training information to be detected.

20. The device according to claim 19, wherein The mask feature acquisition module is used to: Based on the training information to be detected, obtaining a training picture to be detected; Using a pre-trained target recognition model, performing target recognition on the training image to be detected to obtain a training recognition result; Based on the training recognition result, the training mask feature is obtained.

21. The device according to claim 20, wherein: The mask feature acquisition module is used to: If the to-be-detected training information includes a to-be-detected training picture, obtaining the to-be-detected training picture from the to-be-detected training information; or If the to-be-detected training information does not include the to-be-detected training picture, obtaining a preset training picture as the to-be-detected training picture; The preset training picture is a blank picture.

22. The device according to claim 20, wherein: The mask feature acquisition module is used to: If a target is identified in the training recognition result, the pixel value of the pixel point of the target in the training image to be detected is set to a first preset pixel value; The pixel values ​​of other pixels in the to-be-detected training image are set to second preset pixel values ​​to obtain the training mask feature; The first preset pixel value is greater than the second preset pixel value.

23. The device according to claim 20, wherein: The training module comprises: A text information acquisition unit, used for acquiring a training text to be detected based on the training information to be detected; A text feature acquisition unit, used to acquire the training text features of the training text to be detected based on the training text to be detected and using the text encoding unit in the violation detection model; A picture feature acquisition unit, configured to acquire, based on the training picture to be detected corresponding to the training information to be detected, the training picture feature of the training information to be detected by using the picture encoding unit in the violation detection model; A violation detection unit is used to perform violation detection on the training information to be detected based on the training mask feature, the training image feature and the training text feature, using the violation detection unit in the violation detection model to obtain a training detection result; the training detection result includes a prediction of whether the training information to be detected violates the rule and a violation category if it violates the rule; An adjustment unit is used to adjust parameters of the text encoding unit, the image encoding unit and the violation detection unit with the goal of making the training detection result and the labeling detection result the same.

24. The device according to claim 23, wherein: The text information acquisition unit is used to: If the training information to be detected includes a training text to be detected, obtaining the training text to be detected from the training information to be detected; or If the training information to be detected does not include the training text to be detected, obtaining a preset training text as the training text to be detected; The preset training text is blank text.

25. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 12.

26. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-12.

27. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 12.