A risk image interception method and device, a storage medium and an electronic device
By segmenting and identifying risks in images and using pre-trained models to generate fine-grained risk identification results, the problem of poor identification of small target risk elements in existing technologies is solved, thereby improving the accuracy of risk image identification and interception.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD
- Filing Date
- 2024-03-05
- Publication Date
- 2026-06-23
AI Technical Summary
In existing technologies, when performing risk identification on the entire image, it is difficult to effectively identify risk elements of small targets in the image, resulting in poor identification performance of risky images.
By segmenting the image, a pre-trained risk identification model is used to divide the image into multiple sub-images. Risk identification is performed on each sub-image according to the risk label set to generate risk identification results. Finally, the image is intercepted based on the risk interception strategy.
It improves the recognition of small target risk elements in images, enhances the interception accuracy of risky images, avoids over-interception or missed interception, and is suitable for application scenarios with different security levels.
Smart Images

Figure CN118154947B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to computer technology, and more particularly to a method, apparatus, storage medium, and electronic device for intercepting risky images. Background Technology
[0002] Internet content security is of paramount importance to ensuring the continued healthy development of the internet. To protect internet data security and prevent the leakage of personal privacy, it is essential to identify the risks of content uploaded by users to the internet.
[0003] Related technologies use pre-trained neural network models to identify risks in the entire image, determining whether an image poses a risk and whether to intercept it based on the identification results. However, this approach of identifying risks in the entire image lacks effectiveness in identifying risky elements such as small targets within the image. Summary of the Invention
[0004] This specification provides a risk image interception method. This method segments the image while simultaneously identifying risks, which helps identify risk elements of small targets within the image, improving the identification effect of risky images and thus enhancing the interception accuracy. The method includes:
[0005] Obtain the image to be identified and a set of preset risk labels;
[0006] The image to be identified and each risk label in the risk label set are input into a pre-trained risk identification model to obtain the segmented sub-image corresponding to the image to be identified and the risk label corresponding to the segmented sub-image;
[0007] Based on each of the segmented sub-images and the risk labels corresponding to each of the segmented sub-images, a risk identification result corresponding to the image to be identified is generated;
[0008] Obtain a risk interception strategy, and intercept the image to be identified based on the risk interception strategy and the risk identification result.
[0009] Furthermore, in some embodiments, the risk identification model includes an image representation extraction network and a segmentation risk identification network;
[0010] The step of inputting the image to be identified and each risk label in the risk label set into a pre-trained risk identification model to obtain the segmented sub-image corresponding to the image to be identified and the risk label corresponding to the segmented sub-image includes:
[0011] The image to be identified is input into the image representation extraction network, and feature extraction processing is performed on the image to be identified based on the image representation extraction network to obtain the first image feature corresponding to the image to be identified;
[0012] Based on each risk label in the risk label set, the first image features are segmented by the segmentation risk recognition network to obtain the segmented sub-images corresponding to the image to be identified and the risk labels corresponding to the segmented sub-images.
[0013] Furthermore, in some embodiments, the segmented risk identification network includes a risk coding subnetwork and a risk segmentation subnetwork;
[0014] The step of segmenting the first image features based on each risk label in the risk label set, using the segmentation risk recognition network, to obtain the segmented sub-images corresponding to the image to be identified and the risk labels corresponding to the segmented sub-images, includes:
[0015] Each risk label is input into the risk coding sub-network to obtain the risk label features corresponding to each risk label;
[0016] The risk label features and the first image features are input into the segmentation sub-network to obtain the segmented sub-image corresponding to the image to be identified and the risk label corresponding to the segmented sub-image.
[0017] Furthermore, in some embodiments, the segmentation risk identification network includes an image segmentation subnetwork and a risk identification subnetwork;
[0018] The step of segmenting the first image features based on each risk label in the risk label set, using the segmentation risk recognition network, to obtain the segmented sub-images corresponding to the image to be identified and the risk labels corresponding to the segmented sub-images, includes:
[0019] The first image features are input into the image segmentation sub-network to obtain the segmented sub-image corresponding to the image to be identified;
[0020] Risk identification is performed on the segmented sub-image based on the risk identification sub-network to obtain the risk label corresponding to the segmented sub-image.
[0021] Furthermore, in some embodiments, the risk interception strategy includes risk labels that need to be intercepted;
[0022] The interception of the image to be identified based on the risk interception strategy and the risk identification result includes:
[0023] If the risk identification result contains a risk label that needs to be intercepted, then the image to be identified is intercepted.
[0024] Furthermore, in some embodiments, the risk interception strategy includes a combination of risk labels that need to be intercepted, the combination of risk labels including at least two risk labels;
[0025] The interception of the image to be identified based on the risk interception strategy and the risk identification result includes:
[0026] If the risk identification result contains the risk label combination that needs to be intercepted, then the image to be identified is intercepted.
[0027] Furthermore, in some embodiments, the risk identification model further includes a global risk identification network;
[0028] After inputting the image to be identified into the image representation extraction network, and performing feature extraction processing on the image to be identified based on the image representation extraction network to obtain the first image feature corresponding to the image to be identified, the method further includes:
[0029] The first image feature is input into the global risk identification network to obtain the risk category corresponding to the image to be identified.
[0030] Furthermore, in some embodiments, generating the risk identification result corresponding to the image to be identified based on each of the segmented sub-images and the risk labels corresponding to each of the segmented sub-images includes:
[0031] Based on each of the segmented sub-images, the risk labels corresponding to each of the segmented sub-images, and the risk categories, a risk identification result corresponding to the image to be identified is generated.
[0032] Furthermore, in some embodiments, the risk interception strategy includes risk labels that need to be intercepted and risk categories that need to be intercepted;
[0033] The interception of the image to be identified based on the risk interception strategy and the risk identification result includes:
[0034] If the risk identification result contains both the risk label that needs to be intercepted and the risk category that needs to be intercepted, then the image to be identified is intercepted.
[0035] This specification also proposes a risk image interception device, comprising:
[0036] The image acquisition module is used to acquire the image to be identified and a preset set of risk labels;
[0037] The risk identification module is used to input the image to be identified and each risk label in the risk label set into a pre-trained risk identification model to obtain the segmented sub-image corresponding to the image to be identified and the risk label corresponding to the segmented sub-image;
[0038] The result generation module is used to generate a risk identification result for the image to be identified based on each of the segmented sub-images and the risk labels corresponding to each of the segmented sub-images;
[0039] The image interception module is used to acquire a risk interception strategy and intercept the image to be identified based on the risk interception strategy and the risk identification result.
[0040] This specification also provides a computer program product that stores at least one instruction adapted to be loaded by a processor and executed in accordance with the above-described method steps.
[0041] This specification also provides a storage medium storing a computer program adapted to be loaded by a processor and to execute the steps of the method described above.
[0042] This specification also provides an electronic device, including a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to execute the steps of the method described above.
[0043] This specification proposes a risk image interception method. It involves acquiring an image to be identified and a preset set of risk labels, then inputting each risk label from the image to be identified and the risk label set into a pre-trained risk identification model to obtain segmented sub-images corresponding to the image to be identified and their corresponding risk labels. Based on each segmented sub-image and its corresponding risk label, a risk identification result for the image to be identified is generated. Finally, a risk interception strategy is obtained, and the image to be identified is intercepted based on the risk interception strategy and the risk identification result. Using the method proposed in this specification, image segmentation is performed simultaneously with risk identification, which helps identify risk elements of small targets in the image, improving the identification effect of risk images and thus enhancing the interception accuracy of risk images. Attached Figure Description
[0044] Figure 1 This specification provides a flowchart illustrating a method for intercepting risky images.
[0045] Figure 2 This is a schematic diagram illustrating an example of risk identification provided in an embodiment of this specification.
[0046] Figure 3This is a schematic diagram illustrating an example of risk identification provided in an embodiment of this specification.
[0047] Figure 4 A flowchart illustrating a risk image interception method provided in an embodiment of this specification;
[0048] Figure 5 This is a schematic diagram illustrating an example of risk identification provided in an embodiment of this specification.
[0049] Figure 6 This is a schematic diagram of the structure of a risk image interception device provided in the embodiments of this specification;
[0050] Figure 7 This is a schematic diagram of the structure of a risk identification module provided in an embodiment of this specification;
[0051] Figure 8 This is a schematic diagram of the structure of a risk image interception device provided in the embodiments of this specification;
[0052] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this specification. Detailed Implementation
[0053] To make the objectives, technical solutions, and advantages of this specification clearer, the technical solutions of this specification will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of them. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this specification.
[0054] Please see Figure 1 This document provides a flowchart illustrating a risk image interception method as described in an embodiment of this specification. In this embodiment, the risk image interception method is applied to a risk image interception device or an electronic device equipped with a risk image interception device. The following will focus on... Figure 1 The process shown will be described in detail. The risk image interception method may specifically include the following steps:
[0055] S102, Obtain the image to be identified and a preset set of risk labels;
[0056] The image to be identified refers to an image that needs to be risk-identified, such as an image newly uploaded to the Internet by a user.
[0057] The risk label set consists of pre-defined risk labels used for risk identification, such as pornography labels, gambling labels, and terrorism labels. During risk identification, each risk label directly corresponds to a single risk element in the image to be identified.
[0058] S104, Input the image to be identified and each risk label in the risk label set into the pre-trained risk identification model to obtain the segmented sub-image corresponding to the image to be identified and the risk label corresponding to the segmented sub-image;
[0059] In one or more embodiments of this specification, the risk identification model refers to a deep learning model that identifies risks in an image to be identified based on a preset set of risk labels. The risk identification model can be pre-trained using a pre-created training dataset. The purpose of training is to enable the trained risk identification model to accurately identify risks present in the image to be identified based on the set of risk labels.
[0060] After obtaining the image to be identified and the set of risk labels, each risk label in the image to be identified and the set of risk labels is input into the pre-trained risk identification model. The risk identification model outputs the segmented sub-images corresponding to the image to be identified and the risk labels corresponding to the segmented sub-images.
[0061] Here, a segmented sub-image refers to an image obtained by segmenting different elements in an image to be identified. For example, if the image to be identified includes elements such as people, trees, roads, and cars, then segmenting the image can yield segmented sub-images containing only people, only trees, only roads, and only cars. In one or more embodiments of this specification, the segmented sub-images output by the risk identification model can be images associated with at least one risk label in the risk label set.
[0062] In one feasible implementation, the image to be identified and each risk label in the risk label set are input into a pre-trained risk identification model. The risk identification model outputs the segmented sub-image corresponding to the image to be identified and the risk label corresponding to the segmented sub-image. This can be achieved by the risk identification model performing image segmentation on the image to be identified based on each risk label in the risk label set, and segmenting out the segmented sub-image corresponding to the risk label.
[0063] In another feasible implementation, the image to be identified and each risk label in the risk label set are input into a pre-trained risk identification model. The risk identification model first performs image segmentation on the image to be identified to obtain all the segmented sub-images corresponding to the image to be identified. Then, based on each risk label in the risk label set, risk identification is performed on each segmented sub-image corresponding to the image to be identified to obtain the segmented sub-image corresponding to the risk label.
[0064] S106, Generate the risk identification result corresponding to the image to be identified based on each segmented sub-image and the risk label corresponding to each segmented sub-image;
[0065] After obtaining each segmented sub-image and its corresponding risk label, a risk identification result for the image to be identified is generated based on the combination of each segmented sub-image and its corresponding risk label. Specifically, generating the risk identification result for the image to be identified based on each segmented sub-image and its corresponding risk label can be achieved by: determining the risk location of each segmented sub-image based on its position within the image to be identified; determining the association between the risk label and the risk location based on the risk label and the risk location of each segmented sub-image; and generating a risk identification result that includes the risk label, risk location, and association.
[0066] S108, Obtain the risk interception strategy, and intercept the image to be identified based on the risk interception strategy and the risk identification result.
[0067] Among them, the risk interception strategy can be a risk content interception strategy set for content risks. This risk interception strategy can determine whether to intercept the image to be identified based on the risk tags identified from the image to be identified.
[0068] It should be noted that, in one or more embodiments of this specification, the risk label refers to a pre-set, finer-grained label corresponding to a single element segmented from the image to be identified. Compared to the prior art, based on this set of risk labels, finer-grained risks corresponding to single elements in the image to be identified can be identified. Based on the identification results, a more detailed risk interception strategy can be set, improving the identification effect and interception accuracy of risky images.
[0069] In one or more embodiments of this specification, a set of risk labels corresponding to minor risk elements is pre-created. A pre-trained risk identification model is then used to identify risks in the image to be identified based on this set of risk labels. The risk identification model segments the image to be identified and associates the resulting sub-images with the risk labels, thereby identifying the sub-images corresponding to the risk labels. Image segmentation improves the identification of minor target risk elements, thus enhancing the identification and interception accuracy of risky images. After obtaining the risk identification result corresponding to the image to be identified by the risk identification model, a preset risk interception strategy is acquired. The image to be identified is then intercepted based on the risk interception strategy and the risk identification result. The risk interception strategy can be adaptively set and adjusted according to actual conditions to improve the interception effect of risky images, avoiding over-interception or missed interception, and adapting to application scenarios with different security levels.
[0070] The document tampering detection method proposed in this manual will be further explained below.
[0071] In one example embodiment of this specification, the risk identification model may include an image representation extraction network and a segmentation risk identification network. In step S104, inputting the image to be identified and each risk label from the risk label set into the pre-trained risk identification model to obtain the segmented sub-images corresponding to the image to be identified and the risk labels corresponding to the segmented sub-images can be: inputting the image to be identified into the image representation extraction network, performing feature extraction processing on the image to be identified based on the image representation extraction network to obtain the first image features corresponding to the image to be identified; and performing risk segmentation on the first image features based on each risk label from the risk label set through the segmentation risk identification network to obtain the segmented sub-images corresponding to the image to be identified and the risk labels corresponding to the segmented sub-images.
[0072] It should be noted that the risk identification model includes an image representation extraction network and a segmentation risk identification network. The image representation extraction network is used for feature extraction of the image to be identified, obtaining the first image features corresponding to the image to be identified. The segmentation risk identification network is used to perform image segmentation and risk identification on the image to be identified based on the first image features and each risk label in the risk label set, obtaining the segmented sub-images corresponding to the image to be identified and the risk labels corresponding to the segmented sub-images.
[0073] In the embodiments of this specification, the risk identification model can be a machine learning model based on an Encoder-Decoder framework. The image representation extraction network acts as the Encoder in the risk identification model, and it can consist of multiple convolutional layers or fully connected layers, primarily used for feature encoding of the image. The segmentation risk identification network acts as the Decoder in the risk identification model, primarily used to decode the first image features extracted by the risk identification model according to a preset set of risk labels, generating segmented sub-images corresponding to the image to be identified and corresponding risk labels for the segmented sub-images. This segmentation risk identification network has both image segmentation capabilities for the image to be identified and risk identification capabilities for the segmented sub-images. By combining image segmentation and risk identification, this segmentation risk identification network can achieve a more prominent identification effect for small target risk elements, thereby improving the identification effect and interception accuracy of risky images.
[0074] In one feasible implementation, after inputting each risk label in the risk label set and the first image features corresponding to the image to be identified into the segmentation risk identification network, the segmentation risk identification network first encodes the features of each risk label to obtain the risk label features of each risk label, and then segments the first image features based on the risk label features as prompt information to obtain segmented sub-images corresponding to the risk labels.
[0075] In one example embodiment of this specification, the risk identification segmentation network may include a risk coding subnetwork and a risk segmentation subnetwork. See also... Figure 2 This is a schematic diagram illustrating an example of risk identification provided in an embodiment of this specification. Figure 2 As shown, the risk identification model includes an image representation extraction network, a risk coding sub-network, and a segmentation sub-network. The image to be identified is input into the image representation extraction network, which extracts features from the image and outputs the first image features corresponding to the image to be identified. Each risk label is input into the risk coding sub-network, which outputs the risk label features corresponding to each risk label. Then, the label features and the first image features are input into the segmentation sub-network, which uses the label features as prompts to segment the first image features, obtaining the segmented sub-images and risk labels corresponding to the segmented sub-images of the image to be identified.
[0076] It should be noted that when the label features and the first image features are input into the segmentation sub-network, and the segmentation sub-network segments the first image features using the label features as prompts, the segmentation sub-network will only output segmented sub-images associated with the risk labels. All segmented sub-images output by the segmentation sub-network are segmented images that are at risk.
[0077] In this embodiment, the image to be identified is segmented based on the preset risk label as the prompt information. The image region of the image to be identified that has risks is segmented and output as a segmented sub-image. Combining image segmentation and risk identification can improve the identification effect of small target risk elements, thereby improving the identification effect and interception accuracy of risky images.
[0078] In another feasible implementation, after inputting each risk label in the risk label set and the first image feature corresponding to the image to be identified into the segmentation risk identification network, the segmentation risk identification network first performs image segmentation based on the first image feature to obtain all segmented sub-images corresponding to the image to be identified. Then, it labels each segmented sub-image corresponding to the image to be identified with a risk label based on the risk label set, thereby identifying the segmented sub-image with risk and its corresponding risk label in each segmented sub-image.
[0079] In one example embodiment of this specification, the segmentation risk identification network includes an image segmentation sub-network and a risk identification sub-network. After inputting each risk label in the risk label set and the first image features corresponding to the image to be identified into the segmentation risk identification network, the first image features are first input into the image segmentation sub-network. The segmentation sub-network segments the image based on the first image features to obtain all segmented sub-images corresponding to the image to be identified. These all segmented sub-images may include both risky and non-risky segmented sub-images. Then, the segmented sub-images are input into the risk identification sub-network. The risk identification sub-network can identify the risks in the segmented sub-images based on each risk label in the risk label set, adding corresponding risk labels to the risky segmented sub-images. Please refer to [link to relevant documentation]. Figure 3 This is a schematic diagram illustrating an example of risk identification provided in an embodiment of this specification. Figure 3 As shown, the risk identification model includes an image representation extraction network, an image segmentation sub-network, and a risk identification sub-network. The image to be identified is input into the image representation extraction network, which extracts features from the image and outputs the first image features corresponding to the image to be identified. These first image features are then input into the image segmentation sub-network, which segments the image to be identified based on these features, obtaining the corresponding segmented sub-images. Finally, the risk identification sub-network performs risk identification on each segmented sub-image, determining the segmented sub-images with risks and their corresponding risk labels.
[0080] Optionally, after obtaining all the segmented sub-images corresponding to the image to be identified, for each segmented sub-image, the local image features corresponding to the segmented sub-image are obtained, and risk identification is performed on the local image features based on the risk identification sub-network to obtain the risk label corresponding to the segmented sub-image.
[0081] The risk identification sub-network is a classifier network trained based on the risk labels in the risk label set. It is obtained through supervised training using training data constructed from sample training images and the risk label set. It can classify and identify the segmented sub-images input into it according to each risk label and determine the risk label corresponding to the segmented sub-image.
[0082] In this embodiment, during the risk identification process of the image to be identified, the image to be identified is first segmented to obtain fine-grained segmented sub-images. Then, risk identification is performed on the segmented sub-images, which can improve the identification effect of small target risk elements in the image to be identified, thereby improving the overall identification effect and interception accuracy of the risk image.
[0083] The following is a further explanation of step S108.
[0084] In one example embodiment, the risk interception strategy includes risk labels that need to be intercepted. Then, in step S108, after obtaining the risk interception strategy, the image to be identified is intercepted based on the risk interception strategy and the risk identification result. This can be achieved by: based on the risk interception strategy, if the risk identification result contains a risk label that needs to be intercepted, then the image to be identified corresponding to that risk identification result is intercepted; if the risk identification result does not contain a risk label that needs to be intercepted, then the image to be identified corresponding to that risk identification result is not intercepted.
[0085] Understandably, the risk identification result includes risk labels corresponding to all risky segmented sub-images in the image to be identified, and the risk interception strategy is a preset strategy that includes risk labels that need to be intercepted. When the risk identification result contains risk labels that need to be intercepted as preset in the risk interception strategy, the corresponding image to be identified is intercepted.
[0086] It should be noted that the risk interception strategy can be adjusted according to the different interception accuracy and interception content, so that the risk image interception method proposed in the embodiments of this specification can adapt to different risk image interception scenarios.
[0087] In one example embodiment, the risk interception strategy includes risk label combinations that need to be intercepted, and the risk label combination includes at least two risk labels. Then, in step S108, after obtaining the risk interception strategy, the image to be identified is intercepted based on the risk interception strategy and the risk identification result. This can be achieved by: based on the risk interception strategy, if the risk identification result contains a risk label combination that needs to be intercepted, then the corresponding image to be identified is intercepted; if the risk identification result does not contain a risk label combination that needs to be intercepted, then it is not intercepted.
[0088] By incorporating a multi-label interception strategy with risk label combinations into the risk interception strategy, the interception criteria can be made more accurate and objective, resulting in more precise interception of risky images. For example, in the process of identifying and intercepting gambling-related risky images, playing cards and chips are preset risk labels. However, if only the risk label of playing cards is identified in the image to be identified, it cannot be determined whether the image is gambling-related (it may just be a card game). Intercepting the image based solely on the identification of the playing card risk label may lead to false interceptions. By setting a risk label combination of playing cards and chips in the risk interception strategy, the image to be identified is only determined to be gambling-related when both risk labels of playing cards and chips are present, and thus intercepted. In other words, risk label combinations can improve the accuracy of risky image interception.
[0089] Please see Figure 4This is a flowchart illustrating a risk image interception method provided in an embodiment of this specification. Figure 4 As shown, the risk image interception method includes the following steps:
[0090] S202, Obtain the image to be identified and a set of preset risk labels;
[0091] For step S202, please refer to the detailed description of step S102 in another embodiment of this specification, which will not be repeated here.
[0092] S204, The image to be identified is input into the image representation extraction network, and the image to be identified is processed by feature extraction based on the image representation extraction network to obtain the first image feature corresponding to the image to be identified;
[0093] S206, Based on each risk label in the risk label set, the first image features are segmented by a risk identification network to obtain the segmented sub-images corresponding to the image to be identified and the risk labels corresponding to the segmented sub-images.
[0094] It should be noted that the risk identification model includes an image representation extraction network and a segmentation risk identification network. The image representation extraction network is used for feature extraction of the image to be identified, obtaining the first image features corresponding to the image to be identified. The segmentation risk identification network is used to perform image segmentation and risk identification on the image to be identified based on the first image features and each risk label in the risk label set, obtaining the segmented sub-images corresponding to the image to be identified and the risk labels corresponding to the segmented sub-images.
[0095] In the embodiments of this specification, the risk identification model can be a machine learning model based on an Encoder-Decoder framework. The image representation extraction network acts as the Encoder in the risk identification model, and it can consist of multiple convolutional layers or fully connected layers, primarily used for feature encoding of the image. The segmentation risk identification network acts as the Decoder in the risk identification model, primarily used to decode the first image features extracted by the risk identification model according to a preset set of risk labels, generating segmented sub-images corresponding to the image to be identified and corresponding risk labels for the segmented sub-images. This segmentation risk identification network has both image segmentation capabilities for the image to be identified and risk identification capabilities for the segmented sub-images. By combining image segmentation and risk identification, this segmentation risk identification network can achieve a more prominent identification effect for small target risk elements, thereby improving the identification effect and interception accuracy of risky images.
[0096] S208, Input the first image features into the global risk recognition network to obtain the risk category corresponding to the image to be recognized;
[0097] The first image feature is the global image feature corresponding to the image to be identified. The global risk identification network is used to identify risks based on the global image feature corresponding to the image to be identified, and obtain the risk category corresponding to the image to be identified.
[0098] The risk category can be a preset risk image category. For example, it can be pornography, terrorism, gambling, etc. The pornography category can include categories such as comic book pornography, art pornography, and exhibitionism.
[0099] S210, Generate the risk identification result corresponding to the image to be identified based on each segmented sub-image, the risk label corresponding to each segmented sub-image, and the risk category;
[0100] The risk identification results include fine-grained risk labels corresponding to each segmented sub-image, as well as risk categories obtained by combining global image features.
[0101] S212, Obtain the risk interception strategy, and intercept the image to be identified based on the risk interception strategy and the risk identification result.
[0102] In one example embodiment, the risk interception strategy includes risk labels and risk categories that need to be intercepted. Then, in step S212, after obtaining the risk interception strategy, the image to be identified is intercepted based on the risk interception strategy and the risk identification result. This can be achieved by: if the risk identification result contains both a risk label and a risk category that needs to be intercepted, then the image to be identified is intercepted.
[0103] Please see Figure 5 This is a schematic diagram illustrating an example of risk identification provided in an embodiment of this specification. Figure 5 As shown, the risk identification model includes an image representation extraction network, a global risk identification network, and a segmentation risk identification network. The image to be identified is input into the image representation extraction network, which extracts features from the image and outputs the first image feature corresponding to the image to be identified. Then, the first image feature is input into the global risk identification network, which performs risk identification based on the global image feature corresponding to the image to be identified, and obtains the risk category corresponding to the image to be identified. Finally, the first image feature is input into the segmentation risk identification network, which performs risk segmentation on the first image feature, and obtains the segmented sub-image corresponding to the image to be identified and the risk label corresponding to the segmented sub-image.
[0104] In this embodiment, the risk identification result includes both fine-grained risk labels corresponding to each segmented sub-image and risk categories identified by combining global image features. By setting a risk interception strategy, risk interception is only performed on the image to be identified when both the risk labels and risk categories preset in the risk interception strategy are present in the risk identification result. Compared to a risk interception strategy based solely on risk labels, this embodiment combines risk categories identified from the global image features of the image to be identified, further improving the risk identification effect and thus enhancing the interception accuracy.
[0105] It should be noted that the risk interception strategy can be adjusted according to the different interception accuracy and interception content, so that the risk image interception method proposed in the embodiments of this specification can adapt to different risk image interception scenarios.
[0106] Please see Figure 6 This is a schematic diagram of a risk image interception device provided in an embodiment of this specification. Figure 6 As shown, the risk image interception device 1 can be implemented as all or part of an electronic device through software, hardware, or a combination of both. According to some embodiments, the risk image interception device 1 includes an image acquisition module 11, a risk identification module 12, a result generation module 13, and an image interception module 14, specifically including:
[0107] Image acquisition module 11 is used to acquire the image to be identified and a preset set of risk labels;
[0108] Risk identification module 12 is used to input the image to be identified and each risk label in the risk label set into a pre-trained risk identification model to obtain the segmented sub-image corresponding to the image to be identified and the risk label corresponding to the segmented sub-image;
[0109] Result generation module 13 is used to generate risk identification results for the image to be identified based on each of the segmented sub-images and the risk labels corresponding to each of the segmented sub-images;
[0110] The image interception module 14 is used to obtain a risk interception strategy and intercept the image to be identified based on the risk interception strategy and the risk identification result.
[0111] Optionally, the risk identification model includes an image representation extraction network and a segmentation risk identification network; please refer to [link to relevant documentation]. Figure 7 The risk identification module 12 includes a feature extraction unit 121 and a risk identification unit 122, wherein:
[0112] Feature extraction unit 121 is used to input the image to be identified into the image representation extraction network, and perform feature extraction processing on the image to be identified based on the image representation extraction network to obtain the first image feature corresponding to the image to be identified;
[0113] The risk identification unit 122 is used to perform risk segmentation on the first image features based on each risk label in the risk label set through the segmentation risk identification network, so as to obtain the segmented sub-image corresponding to the image to be identified and the risk label corresponding to the segmented sub-image.
[0114] Optionally, the risk segmentation identification network includes a risk coding subnetwork and a risk segmentation subnetwork; the risk identification unit 122 is specifically used for:
[0115] Each risk label is input into the risk coding sub-network to obtain the risk label features corresponding to each risk label;
[0116] The risk label features and the first image features are input into the segmentation sub-network to obtain the segmented sub-image corresponding to the image to be identified and the risk label corresponding to the segmented sub-image.
[0117] Optionally, the segmentation risk identification network includes an image segmentation subnetwork and a risk identification subnetwork; the risk identification unit 122 is specifically used for:
[0118] The first image features are input into the image segmentation sub-network to obtain the segmented sub-image corresponding to the image to be identified;
[0119] Risk identification is performed on the segmented sub-image based on the risk identification sub-network to obtain the risk label corresponding to the segmented sub-image.
[0120] Optionally, the risk interception strategy includes risk labels that need to be intercepted; when the image interception module 14 executes the interception of the image to be identified based on the risk interception strategy and the risk identification result, it is specifically used for:
[0121] If the risk identification result contains a risk label that needs to be intercepted, then the image to be identified is intercepted.
[0122] Optionally, the risk interception strategy includes a combination of risk tags to be intercepted, the risk tag combination including at least two risk tags; when the image interception module 14 executes the interception of the image to be identified based on the risk interception strategy and the risk identification result, it is specifically used for:
[0123] If the risk identification result contains the risk label combination that needs to be intercepted, then the image to be identified is intercepted.
[0124] Optionally, the risk identification model also includes a global risk identification network; please refer to [link to relevant documentation]. Figure 8 The device further includes a category recognition module 15, specifically used for:
[0125] The first image feature is input into the global risk identification network to obtain the risk category corresponding to the image to be identified.
[0126] Optionally, the result generation module 13 is specifically used for:
[0127] Based on each of the segmented sub-images, the risk labels corresponding to each of the segmented sub-images, and the risk categories, a risk identification result corresponding to the image to be identified is generated.
[0128] Optionally, the risk interception strategy includes risk labels to be intercepted and risk categories to be intercepted; when the image interception module 14 executes the interception of the image to be identified based on the risk interception strategy and the risk identification result, it is specifically used for:
[0129] If the risk identification result contains both the risk label that needs to be intercepted and the risk category that needs to be intercepted, then the image to be identified is intercepted.
[0130] The above-described apparatus embodiments correspond to the method embodiments, and detailed descriptions can be found in the description of the method embodiments section, which will not be repeated here. The apparatus embodiments are derived based on the corresponding method embodiments and have the same technical effects as the corresponding method embodiments; detailed descriptions can be found in the corresponding method embodiments.
[0131] This specification also provides a storage medium that can store multiple instructions adapted to be loaded and executed by a processor as described above. Figures 1-5 The method described in the illustrated embodiment can be found in the following documentation for a detailed execution process. Figures 1-5 The specific details of the illustrated embodiments will not be elaborated here.
[0132] This specification also provides a computer program product that stores at least one instruction, said at least one instruction being loaded and executed by the processor as described above. Figures 1-5 The method described in the illustrated embodiment can be found in the following documentation for a detailed execution process. Figures 1-5 The specific details of the illustrated embodiments will not be elaborated here.
[0133] The embodiments in this specification also provide Figure 9 The diagram shows the structure of the electronic device. Figure 9 At the hardware level, the electronic device includes a processor, internal bus, network interface, memory, and non-volatile storage, and may also include other hardware required for the task. The processor reads the corresponding computer program from the non-volatile storage into memory and then runs it to implement the aforementioned risk image interception method.
[0134] Of course, in addition to software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of hardware and software. In other words, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0135] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many methodological improvements today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that a methodological improvement cannot be implemented using hardware physical modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program and "integrate" a digital system onto a PLD themselves, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should understand that by simply performing some logic programming on the method flow using one of these hardware description languages and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.
[0136] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.
[0137] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.
[0138] For ease of description, the above devices are described in terms of function, divided into various units. Of course, in implementing this specification, the functions of each unit can be implemented in one or more software and / or hardware components.
[0139] Those skilled in the art will understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this specification may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0140] This specification is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this specification. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0141] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0142] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0143] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0144] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0145] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0146] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0147] This specification can be described in the general context of computer-executable instructions that are executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This specification can also be practiced in distributed computing environments, where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0148] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0149] The above description is merely an embodiment of this specification and is not intended to limit this specification. Various modifications and variations can be made to this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of the claims of this specification.
Claims
1. A risk image interception method, comprising: obtaining a to-be-recognized image and a preset risk label set; inputting the to-be-recognized image and each risk label in the risk label set into a pre-trained risk identification model to obtain a segmented sub-image corresponding to the to-be-recognized image and a risk label corresponding to the segmented sub-image; generating a risk identification result corresponding to the to-be-recognized image based on each segmented sub-image and the risk label corresponding to each segmented sub-image; obtaining a risk interception strategy and intercepting the to-be-recognized image based on the risk interception strategy and the risk identification result.
2. The method of claim 1, wherein the risk identification model comprises an image feature extraction network and a segmented risk identification network. The inputting the to-be-recognized image and each risk label in the risk label set into a pre-trained risk identification model to obtain a segmented sub-image corresponding to the to-be-recognized image and a risk label corresponding to the segmented sub-image comprises: inputting the to-be-recognized image into the image feature extraction network, performing feature extraction processing on the to-be-recognized image based on the image feature extraction network, and obtaining a first image feature corresponding to the to-be-recognized image; based on each risk label in the risk label set, performing risk segmentation on the first image feature through the segmented risk identification network to obtain a segmented sub-image corresponding to the to-be-recognized image and a risk label corresponding to the segmented sub-image.
3. The method of claim 2, wherein the segmented risk identification network comprises a risk encoding sub-network and a risk segmentation sub-network. The inputting the to-be-recognized image and each risk label in the risk label set into a pre-trained risk identification model to obtain a segmented sub-image corresponding to the to-be-recognized image and a risk label corresponding to the segmented sub-image comprises: inputting each risk label into the risk encoding sub-network to obtain a risk label feature corresponding to each risk label; inputting each risk label feature and the first image feature into the segmentation sub-network to obtain a segmented sub-image corresponding to the to-be-recognized image and a risk label corresponding to the segmented sub-image.
4. The method of claim 2, wherein the segmented risk identification network comprises an image segmentation sub-network and a risk identification sub-network. The inputting the to-be-recognized image and each risk label in the risk label set into a pre-trained risk identification model to obtain a segmented sub-image corresponding to the to-be-recognized image and a risk label corresponding to the segmented sub-image comprises: inputting the first image feature into the image segmentation sub-network to obtain a segmented sub-image corresponding to the to-be-recognized image; performing risk identification on the segmented sub-image based on the risk identification sub-network to obtain a risk label corresponding to the segmented sub-image.
5. The method of claim 1, wherein the risk interception strategy comprises a risk label that needs to be intercepted. The intercepting the to-be-recognized image based on the risk interception strategy and the risk identification result comprises: If the risk identification result contains a risk label that needs to be intercepted, then the image to be identified is intercepted.
6. The method according to claim 1, wherein the risk interception strategy includes a combination of risk labels to be intercepted, and the combination of risk labels includes at least two risk labels; The interception of the image to be identified based on the risk interception strategy and the risk identification result includes: If the risk identification result contains the risk label combination that needs to be intercepted, then the image to be identified is intercepted.
7. The method according to claim 2, wherein the risk identification model further includes a global risk identification network; After inputting the image to be identified into the image representation extraction network, and performing feature extraction processing on the image to be identified based on the image representation extraction network to obtain the first image feature corresponding to the image to be identified, the method further includes: The first image feature is input into the global risk identification network to obtain the risk category corresponding to the image to be identified.
8. The method according to claim 7, wherein generating a risk identification result corresponding to the image to be identified based on each of the segmented sub-images and the risk labels corresponding to each of the segmented sub-images includes: Based on each of the segmented sub-images, the risk labels corresponding to each of the segmented sub-images, and the risk categories, a risk identification result corresponding to the image to be identified is generated.
9. The method according to claim 7, wherein the risk interception strategy includes risk labels to be intercepted and risk categories to be intercepted; The interception of the image to be identified based on the risk interception strategy and the risk identification result includes: If the risk identification result contains both the risk label that needs to be intercepted and the risk category that needs to be intercepted, then the image to be identified is intercepted.
10. A risky image interception device, comprising: The image acquisition module is used to acquire the image to be identified and a preset set of risk labels; The risk identification module is used to input the image to be identified and each risk label in the risk label set into a pre-trained risk identification model to obtain the segmented sub-image corresponding to the image to be identified and the risk label corresponding to the segmented sub-image; The result generation module is used to generate a risk identification result for the image to be identified based on each of the segmented sub-images and the risk labels corresponding to each of the segmented sub-images; The image interception module is used to acquire a risk interception strategy and intercept the image to be identified based on the risk interception strategy and the risk identification result.
11. A storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method according to any one of claims 1 to 9.
12. An electronic device comprising: A processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to execute the steps of the method as claimed in any one of claims 1 to 9.
13. A computer program product having at least one instruction stored thereon, wherein the at least one instruction, when executed by a processor, implements the steps of the method according to any one of claims 1 to 9.