A method, system, medium and device for detecting sensitive marks
By processing the images sequentially through the two models and integrating the results, the problem of unused results of small models is solved, the accuracy and efficiency of sensitive mark detection are improved, and more accurate category identification is achieved.
Patent Information
- Application Number
- CN202310703245.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-14
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2043-06-14
AI Technical Summary
When the existing technology detects whether images sent by users contain sensitive marks, the small model is only responsible for data screening, and the results are not fully utilized, resulting in insufficient detection efficiency and accuracy.
Two models are used to process the image in sequence. The first model is a coarse sensitive mark detection model, and the second model is a fine sensitive mark detection model. The fused sensitive mark category set is used to integrate the image to be detected to generate the final detection result.
The accuracy and processing efficiency of sensitive mark detection are improved, the final detection result is more accurate, and the category identification is made more precise through the fusion processing of sensitive mark category sets.
Smart Images

Figure CN117558000B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of image processing, and in particular relates to a method, system, medium and equipment for detecting sensitive marks. Background Art
[0002] In social scenarios, when detecting whether images sent by users contain sensitive signs, in most cases large and small models are used jointly for detection. The small model is responsible for the initial screening of data, and the large model is responsible for processing the riskier results after screening by the small model, taking into account both speed and accuracy. However, in this case, the small model is only responsible for data screening, and its own results are not well utilized. Summary of the invention
[0003] The technical problem to be solved by the present invention is to provide a method, system, medium and equipment for detecting sensitive marks.
[0004] The technical solution of the present invention to solve the above technical problem is as follows: A method for detecting a sensitive mark comprises:
[0005] Determine the sensitive mark category set after fusion processing;
[0006] Processing the image to be detected by the first model to obtain a first processing result, and when the first processing result is not empty, inputting the image to be detected into the second model to obtain a second processing result, wherein the first model is a coarse sensitive mark detection model, and the second model is a fine sensitive mark detection model;
[0007] When the second processing result is not empty, the first processing result is searched in the sensitive flag category set, and based on the search result, it is determined whether the first processing result is integrated with the second processing result to generate a judgment result. If the judgment result is yes, the integrated result is the detection result of the image to be detected; if the judgment result is no, the second processing result is the detection result of the image to be detected.
[0008] The beneficial effects of the present invention are as follows: by fusing the sensitive mark category set, the category identification of the category set can be made more accurate. In addition, by using the two models in sequence, the processing efficiency can be greatly improved. In the process of determining the final detection result, the processing result of the first model is combined, which also makes the final detection result more accurate.
[0009] Based on the above technical solution, the present invention can also be improved as follows.
[0010] Furthermore, the process of determining the sensitive sign category set after fusion processing is as follows:
[0011] Constructing a sensitive mark category set, wherein the sensitive mark category set includes n categories, and each category corresponds to multiple image data;
[0012] Processing each image data in the sensitive mark category set by using the first model and the second model respectively, to obtain a third processing result of each image data processed by the first model and a fourth processing result of each image data processed by the second model;
[0013] Determine, based on a comparison result between the confidence level in each third processing result and the first preset confidence level, a first correct interception number of all image data in any category in the sensitive mark category set after being processed by the first model;
[0014] Determine, based on a comparison result between the confidence in each fourth processing result and the second preset confidence, a second correct interception number of all image data in any category in the sensitive mark category set after being processed by the second model;
[0015] Calculate whether the difference between the first correct interception number and the second correct interception number is greater than the preset difference in any category, determine the category greater than the preset difference as the fusion category, generate a fusion category list, and determine the set of the fusion category and the category less than the preset difference as the sensitive flag category set after fusion processing.
[0016] Further, the process of searching the first processing result in the sensitive flag category set and determining whether the first processing result is to be integrated with the second processing result based on the search result is:
[0017] Obtain the category corresponding to each sub-result in the first processing result, traverse the category corresponding to each sub-result in the fused category list, and when the category corresponding to any sub-result is in the fused category list and the confidence corresponding to the sub-result is greater than a third preset confidence, judge the first processing result corresponding to the sub-result as needing to be integrated with the second processing result corresponding to the first processing result.
[0018] Further, when the first processing result is empty, the detection result of the image to be detected is no result.
[0019] Further, when the second processing result is empty, the detection result of the image to be detected is no result.
[0020] Another technical solution of the present invention to solve the above technical problem is as follows: A sensitive mark detection system, comprising:
[0021] The determination module is used to: determine the sensitive sign category set after fusion processing;
[0022] The processing module is used to: process the image to be detected by a first model to obtain a first processing result, and when the first processing result is not empty, input the image to be detected into a second model to obtain a second processing result, wherein the first model is a coarse sensitive mark detection model, and the second model is a fine sensitive mark detection model;
[0023] The detection module is used to: when the second processing result is not empty, search the first processing result in the sensitive mark category set, and judge whether the first processing result is integrated with the second processing result based on the search result, and generate a judgment result. If the judgment result is yes, the integration result is the detection result of the image to be detected; if the judgment result is no, the second processing result is the detection result of the image to be detected.
[0024] The beneficial effects of the present invention are as follows: by fusing the sensitive mark category set, the category identification of the category set can be made more accurate. In addition, by using the two models in sequence, the processing efficiency can be greatly improved. In the process of determining the final detection result, the processing result of the first model is combined, which also makes the final detection result more accurate.
[0025] Furthermore, the process of determining the sensitive sign category set after fusion processing is as follows:
[0026] Constructing a sensitive mark category set, wherein the sensitive mark category set includes n categories, and each category corresponds to multiple image data;
[0027] Processing each image data in the sensitive mark category set by using the first model and the second model respectively, to obtain a third processing result of each image data processed by the first model and a fourth processing result of each image data processed by the second model;
[0028] Determine, based on a comparison result between the confidence level in each third processing result and the first preset confidence level, a first correct interception number of all image data in any category in the sensitive mark category set after being processed by the first model;
[0029] Determine, based on a comparison result between the confidence in each fourth processing result and the second preset confidence, a second correct interception number of all image data in any category in the sensitive mark category set after being processed by the second model;
[0030] Calculate whether the difference between the first correct interception number and the second correct interception number is greater than the preset difference in any category, determine the category greater than the preset difference as the fusion category, generate a fusion category list, and determine the set of the fusion category and the category less than the preset difference as the sensitive flag category set after fusion processing.
[0031] Further, the process of searching the first processing result in the sensitive flag category set and determining whether the first processing result is to be integrated with the second processing result based on the search result is:
[0032] Obtain the category corresponding to each sub-result in the first processing result, traverse the category corresponding to each sub-result in the fused category list, and when the category corresponding to any sub-result is in the fused category list and the confidence corresponding to the sub-result is greater than a third preset confidence, judge the first processing result corresponding to the sub-result as needing to be integrated with the second processing result corresponding to the first processing result.
[0033] Further, when the first processing result is empty, the detection result of the image to be detected is no result.
[0034] Further, when the second processing result is empty, the detection result of the image to be detected is no result.
[0035] Another technical solution of the present invention to solve the above technical problem is as follows: a storage medium, in which instructions are stored, and when a computer reads the instructions, the computer executes any of the methods described above.
[0036] The beneficial effects of the present invention are as follows: by fusing the sensitive mark category set, the category identification of the category set can be made more accurate. In addition, by using the two models in sequence, the processing efficiency can be greatly improved. In the process of determining the final detection result, the processing result of the first model is combined, which also makes the final detection result more accurate.
[0037] Another technical solution of the present invention to solve the above technical problem is as follows: an electronic device comprises the above storage medium and a processor for executing instructions in the above storage medium. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A schematic diagram of a process for detecting a sensitive mark according to an embodiment of the present invention;
[0039] Figure 2 A structural framework diagram provided for an embodiment of a sensitive mark detection system of the present invention;
[0040] Figure 3 A schematic diagram of a model processing flow provided for an embodiment of a method for detecting a sensitive mark of the present invention;
[0041] Figure 4 A schematic diagram of a process for determining a sensitive sign category set after fusion processing provided in an embodiment of a sensitive sign detection method of the present invention;
[0042] Figure 5 A schematic flow chart of obtaining a final result by dual-model fusion processing provided in an embodiment of a sensitive marker detection method of the present invention. DETAILED DESCRIPTION
[0043] The principles and features of the present invention are described below. The examples given are only used to explain the present invention and are not used to limit the scope of the present invention.
[0044] like Figure 1 As shown, a method for detecting a sensitive mark includes:
[0045] Determine the sensitive mark category set after fusion processing;
[0046] Processing the image to be detected by the first model to obtain a first processing result, and when the first processing result is not empty, inputting the image to be detected into the second model to obtain a second processing result, wherein the first model is a coarse sensitive mark detection model, and the second model is a fine sensitive mark detection model;
[0047] When the second processing result is not empty, the first processing result is searched in the sensitive flag category set, and based on the search result, it is determined whether the first processing result is integrated with the second processing result to generate a judgment result. If the judgment result is yes, the integrated result is the detection result of the image to be detected; if the judgment result is no, the second processing result is the detection result of the image to be detected.
[0048] In some possible implementations, the fusion processing of the sensitive mark category set can make the category identification of the category set more accurate. In addition, the processing efficiency can be greatly improved by using the two models in sequence. In the process of determining the final detection result, the processing result of the first model is combined to make the final detection result more accurate.
[0049] It should be noted that in the subsequent examples of this solution, the first model is uniformly referred to as the small model, and the second model is uniformly referred to as the large model. Both the large and small models are landmark detection models, but they differ in the amount of model parameters, so they are called large and small models. Both the large and small models are based on the yo l ov5 detection model, which includes a backbone module, a head module and a final output layer. The input of the backbone is the original image, that is, the image to be detected. After the features are extracted by the backbone layer, three feature maps with different resolutions and depths are obtained. The scales are H*W*C and are: 52*52*128, 26*26*256, and 13*13*512 respectively. The feature maps of three different scales are input into the head layer for post-processing, and the final detection result is obtained through the final output layer. The result contains six values: confidence score, category cls, target upper left corner coordinates x1, y1, target upper left corner coordinates x2, y2. The processing flow of the large and small models is the same. The flow chart is as follows Figure 3 shown.
[0050] The process of determining the sensitive flag category set after fusion processing can be:
[0051] like Figure 4 As shown, first, a sensitive sign category set is constructed. The category set can be obtained by retrieving historical records or crawling images containing fixed categories from online user data. The categories in the category set can be category A or category B, etc., and each category contains at least two image data;
[0052] Secondly, each image data in each category of the constructed sensitive mark category set is processed using the large and small models respectively, that is, any image data needs to be processed by two models to obtain two processing results, namely, the first processing result and the second processing result;
[0053] Finally, the correct interception amount of all image data in each category after being processed by different models is counted respectively, and the categories with the difference of correct interception amount corresponding to different models under the same category exceeding 3% (preset difference) are determined as fusion categories. A fusion category list is generated for all fusion categories, and the fusion categories and categories that do not need to be fused are integrated to generate a sensitive mark category set after fusion processing.
[0054] It should be noted that the fusion category can be determined as follows: For example, if it is necessary to determine whether the national emblem category is a fusion category, each of the image data (for example, 100 images) under the national emblem category needs to be processed by the large model and the small model respectively to generate two processing results. The processing result includes the confidence of the image data. By determining whether the confidence exceeds 0.8 (the first preset confidence or the second preset confidence), it is determined whether the image data corresponding to the processing result is correctly intercepted. If it is greater than 0.8, it can be determined to be correctly intercepted. Count how many image data are correctly intercepted after being processed by the large model, and how many image data are correctly intercepted after being processed by the small model. The difference between the two correct interception amounts is calculated to determine whether the national emblem category is a category that needs to be fused.
[0055] The image to be detected is processed by the first model to obtain a first processing result. When the first processing result is not empty, the image to be detected is input into the second model to obtain a second processing result, the first model is a coarse sensitive mark detection model, and the second model is a fine sensitive mark detection model; when the second processing result is not empty, the first processing result is searched in the sensitive mark category set, and based on the search result, it is judged whether the first processing result is integrated with the second processing result to generate a judgment result. If the judgment result is yes, the integration result is the detection result of the image to be detected. If the judgment result is no, the second processing result is the detection result of the image to be detected. The processing process is:
[0056] like Figure 5 As shown, the image to be detected is input into the small model to obtain the small model result (the first processing result), and it is determined whether the small model result is empty, that is, whether the small model has not detected any result. If it is empty, it is directly determined that the detection result of the image to be detected is no result. If it is not empty, the image to be detected is continued to be input into the large model to obtain the large model result (the second processing result), and it is determined whether the large model result is empty, that is, whether the large model has not detected any result. If it is empty, it is directly determined that the detection result of the image to be detected is no result. If it is not empty, it is necessary to retrieve the small model result, and in the fusion category list, find the category corresponding to each sub-result in the small model result, and determine whether the category corresponding to each sub-result is in the fusion category list. If so, and the confidence corresponding to the sub-result is greater than 0.8, the sub-result can be added to the large model result. If the corresponding category is not found in the fusion category list, the large model result is output as the final detection result.
[0057] Preferably, in any of the above embodiments, the process of determining the sensitive flag category set after fusion processing is:
[0058] Constructing a sensitive mark category set, wherein the sensitive mark category set includes n categories, and each category corresponds to multiple image data;
[0059] Processing each image data in the sensitive mark category set by using the first model and the second model respectively, to obtain a third processing result of each image data processed by the first model and a fourth processing result of each image data processed by the second model;
[0060] Determine, based on a comparison result between the confidence level in each third processing result and the first preset confidence level, a first correct interception number of all image data in any category in the sensitive mark category set after being processed by the first model;
[0061] Determine, based on a comparison result between the confidence in each fourth processing result and the second preset confidence, a second correct interception number of all image data in any category in the sensitive mark category set after being processed by the second model;
[0062] Calculate whether the difference between the first correct interception number and the second correct interception number is greater than the preset difference in any category, determine the category greater than the preset difference as the fusion category, generate a fusion category list, and determine the set of the fusion category and the category less than the preset difference as the sensitive flag category set after fusion processing.
[0063] Preferably, in any of the above embodiments, the process of searching the first processing result in the sensitive flag category set and determining whether to integrate the first processing result with the second processing result based on the search result is:
[0064] Obtain the category corresponding to each sub-result in the first processing result, traverse the category corresponding to each sub-result in the fused category list, and when the category corresponding to any sub-result is in the fused category list and the confidence corresponding to the sub-result is greater than a third preset confidence, judge the first processing result corresponding to the sub-result as needing to be integrated with the second processing result corresponding to the first processing result.
[0065] Preferably, in any of the above embodiments, when the first processing result is empty, the detection result of the image to be detected is no result.
[0066] Preferably, in any of the above embodiments, when the second processing result is empty, the detection result of the image to be detected is no result.
[0067] like Figure 2 As shown, a sensitive mark detection system includes:
[0068] The determination module 100 is used to: determine a sensitive sign category set after fusion processing;
[0069] The processing module 200 is used to: process the image to be detected by a first model to obtain a first processing result, and when the first processing result is not empty, input the image to be detected into a second model to obtain a second processing result, wherein the first model is a coarse sensitive mark detection model, and the second model is a fine sensitive mark detection model;
[0070] The detection module 300 is used to: when the second processing result is not empty, search the first processing result in the sensitive mark category set, and judge whether the first processing result is integrated with the second processing result based on the search result, and generate a judgment result. If the judgment result is yes, the integration result is the detection result of the image to be detected; if the judgment result is no, the second processing result is the detection result of the image to be detected.
[0071] In some possible implementations, the fusion processing of the sensitive mark category set can make the category identification of the category set more accurate. In addition, the processing efficiency can be greatly improved by using the two models in sequence. In the process of determining the final detection result, the processing result of the first model is combined to make the final detection result more accurate.
[0072] Preferably, in any of the above embodiments, the process of determining the sensitive flag category set after fusion processing is:
[0073] Constructing a sensitive mark category set, wherein the sensitive mark category set includes n categories, and each category corresponds to multiple image data;
[0074] Processing each image data in the sensitive mark category set by using the first model and the second model respectively, to obtain a third processing result of each image data processed by the first model and a fourth processing result of each image data processed by the second model;
[0075] Determine, based on a comparison result between the confidence level in each third processing result and the first preset confidence level, a first correct interception number of all image data in any category in the sensitive mark category set after being processed by the first model;
[0076] Determine, based on a comparison result between the confidence in each fourth processing result and the second preset confidence, a second correct interception number of all image data in any category in the sensitive mark category set after being processed by the second model;
[0077] Calculate whether the difference between the first correct interception number and the second correct interception number is greater than the preset difference in any category, determine the category greater than the preset difference as the fusion category, generate a fusion category list, and determine the set of the fusion category and the category less than the preset difference as the sensitive flag category set after fusion processing.
[0078] Preferably, in any of the above embodiments, the process of searching the first processing result in the sensitive flag category set and determining whether to integrate the first processing result with the second processing result based on the search result is:
[0079] Obtain the category corresponding to each sub-result in the first processing result, traverse the category corresponding to each sub-result in the fused category list, and when the category corresponding to any sub-result is in the fused category list and the confidence corresponding to the sub-result is greater than a third preset confidence, judge the first processing result corresponding to the sub-result as needing to be integrated with the second processing result corresponding to the first processing result.
[0080] Preferably, in any of the above embodiments, when the first processing result is empty, the detection result of the image to be detected is no result.
[0081] Preferably, in any of the above embodiments, when the second processing result is empty, the detection result of the image to be detected is no result.
[0082] The reader should understand that in the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples without contradiction.
[0083] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the method embodiments described above are only illustrative, for example, the division of steps is only a logical function division, and there may be other division methods in actual implementation, such as multiple steps can be combined or integrated into another step, or some features can be ignored or not executed.
[0084] If the above method is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0085] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for detecting a sensitive mark, It is characterized in that include: Determine the sensitive mark category set after fusion processing; Processing the image to be detected by the first model to obtain a first processing result, and when the first processing result is not empty, inputting the image to be detected into the second model to obtain a second processing result, wherein the first model is a coarse sensitive mark detection model, and the second model is a fine sensitive mark detection model; When the second processing result is not empty, the first processing result is searched in the sensitive flag category set after the fusion processing, and it is judged whether the first processing result is integrated with the second processing result based on the search result to generate a judgment result. If the judgment result is yes, the result of the integration processing is the detection result of the image to be detected; if the judgment result is no, the second processing result is the detection result of the image to be detected. The process of determining the sensitive flag category set after the fusion processing is: Constructing a sensitive mark category set, wherein the sensitive mark category set includes n categories, and each category corresponds to multiple image data; Processing each image data in the sensitive mark category set by using the first model and the second model respectively, to obtain a third processing result of each image data processed by the first model and a fourth processing result of each image data processed by the second model; Determine, based on a comparison result between the confidence level in each third processing result and the first preset confidence level, a first correct interception number of all image data in any category in the sensitive mark category set after being processed by the first model; Determine, based on a comparison result between the confidence in each fourth processing result and the second preset confidence, a second correct interception number of all image data in any category in the sensitive mark category set after being processed by the second model; Calculate whether the difference between the first correct interception number and the second correct interception number is greater than the preset difference in any category, determine the category greater than the preset difference as the fusion category, generate a fusion category list, and determine the set of the fusion category and the category less than the preset difference as the sensitive flag category set after fusion processing.
2. A method for detecting a sensitive mark according to claim 1, It is characterized in that The process of searching the first processing result in the sensitive flag category set after the fusion processing and judging whether the first processing result is to be integrated with the second processing result based on the search result is as follows: Obtain the category corresponding to each sub-result in the first processing result, traverse the category corresponding to each sub-result in the fused category list, and when the category corresponding to any sub-result is in the fused category list and the confidence corresponding to the sub-result is greater than a third preset confidence, judge the first processing result corresponding to the sub-result as needing to be integrated with the second processing result corresponding to the first processing result.
3. A method for detecting a sensitive mark according to claim 1, It is characterized in that When the first processing result is empty, the detection result of the image to be detected is no result.
4. A method for detecting a sensitive mark according to claim 1, It is characterized in that When the second processing result is empty, the detection result of the image to be detected is no result.
5. A system for detecting sensitive signs, It is characterized in that include: The determination module is used to: determine the sensitive sign category set after fusion processing; The processing module is used to: process the image to be detected by a first model to obtain a first processing result, and when the first processing result is not empty, input the image to be detected into a second model to obtain a second processing result, wherein the first model is a coarse sensitive mark detection model, and the second model is a fine sensitive mark detection model; The detection module is used for: when the second processing result is not empty, searching the first processing result in the sensitive mark category set after the fusion processing, and judging whether the first processing result is integrated with the second processing result based on the search result, and generating a judgment result; if the judgment result is yes, the result of the integration processing is the detection result of the image to be detected; if the judgment result is no, the second processing result is the detection result of the image to be detected; the process of determining the sensitive mark category set after the fusion processing is: Constructing a sensitive mark category set, wherein the sensitive mark category set includes n categories, and each category corresponds to multiple image data; Processing each image data in the sensitive mark category set by using the first model and the second model respectively, to obtain a third processing result of each image data processed by the first model and a fourth processing result of each image data processed by the second model; Determine, based on a comparison result between the confidence level in each third processing result and the first preset confidence level, a first correct interception number of all image data in any category in the sensitive mark category set after being processed by the first model; Determine, based on a comparison result between the confidence in each fourth processing result and the second preset confidence, a second correct interception number of all image data in any category in the sensitive mark category set after being processed by the second model; Calculate whether the difference between the first correct interception number and the second correct interception number is greater than the preset difference in any category, determine the category greater than the preset difference as the fusion category, generate a fusion category list, and determine the set of the fusion category and the category less than the preset difference as the sensitive flag category set after fusion processing.
6. A sensitive mark detection system according to claim 5, It is characterized in that The process of searching the first processing result in the sensitive flag category set after the fusion processing and judging whether the first processing result is to be integrated with the second processing result based on the search result is as follows: Obtain the category corresponding to each sub-result in the first processing result, traverse the category corresponding to each sub-result in the fused category list, and when the category corresponding to any sub-result is in the fused category list and the confidence corresponding to the sub-result is greater than a third preset confidence, judge the first processing result corresponding to the sub-result as needing to be integrated with the second processing result corresponding to the first processing result.
7. A storage medium, It is characterized in that The medium stores instructions, and when a computer reads the instructions, the computer executes the method according to any one of claims 1 to 4.
8. An electronic device, It is characterized in that The invention comprises the storage medium as claimed in claim 7 and a processor for executing instructions in the storage medium.
