Illegal image detection method and device, equipment and storage medium

By using preset model-assisted annotation system and decoupling framework, combined with redundant removal algorithm, a violation image detection model is built, which solves the problems of high cost and insufficient accuracy of violation image detection in the existing technology, and achieves efficient and accurate violation image detection.

CN119649084APending Publication Date: 2025-03-18GUANGZHOU HUYA TECH CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411499229.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-25
Publication Date
2025-03-18

Smart Images

  • Figure CN119649084A_ABST
    Figure CN119649084A_ABST
Patent Text Reader

Abstract

The invention relates to the field of image processing, and discloses a violation image detection method and device, equipment and a storage medium. The violation image detection method comprises the following steps: acquiring pre-annotation data obtained by annotating a sample image based on a preset model auxiliary annotation system; training an image processing model of a preset decoupling framework based on the pre-annotated data to construct a violation image detection model; and performing violation detection on a target image based on the violation image detection model, the target image being obtained by preprocessing an original image based on a preset redundancy removal algorithm. By using the preset model auxiliary labeling system, the preset decoupling framework and the preset redundancy removal algorithm, the positioning and classification efficiency of labeling and the model training efficiency can be remarkably improved, the model deployment cost is reduced, the model processing efficiency is improved, efficient violation detection of the image is realized, and the detection accuracy is improved. The risk control scene of the vertical screen picture of the mobile phone can be effectively compatible.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a method, device, equipment and storage medium for detecting illegal images. Background Art

[0002] With the rapid development of the Internet and mobile terminals, as well as the rise of the live broadcast and short video industries, more and more image content is spread on the Internet. In order to maintain a healthy and orderly network environment, it is necessary to detect bad information and non-compliant content in images.

[0003] Existing violation detection methods are mainly based on supervised deep learning algorithms driven by big data. This method can identify illegal images to a certain extent by training models with massive data. However, this method requires a large amount of labeled data to train the model, which is time-consuming and labor-intensive, and the trained model has weak generalization ability and cannot adapt to new types and variants of illegal images. It is complex and the effect is uncontrollable. At the same time, with the increase in vertical screen images, the illegal target area of ​​the image is smaller, the image recognition is reduced, and the processing accuracy of the traditional model is insufficient. Summary of the invention

[0004] The main purpose of the present invention is to provide a method, device, equipment and storage medium for detecting illegal images, aiming to solve the technical problem of high cost of illegal image detection.

[0005] A first aspect of the present invention provides a method for detecting illegal images, the method comprising:

[0006] Acquire pre-annotated data obtained by annotating the sample image based on a preset model-assisted annotation system;

[0007] Based on the pre-labeled data, an image processing model of a preset decoupling framework is trained to construct an illegal image detection model;

[0008] Violation detection is performed on a target image based on the violation image detection model, wherein the target image is obtained by preprocessing an original image based on a preset redundancy removal algorithm.

[0009] Optionally, in a first implementation of the first aspect of the present invention, the preset model-assisted annotation system includes a position annotation auxiliary model, a category annotator interface, a category prediction model, and an annotation information integration module;

[0010] The obtaining of pre-annotated data obtained by annotating the sample image based on the preset model auxiliary annotation system includes:

[0011] Determine an object sub-atlas in the sample image based on the position annotation auxiliary model;

[0012] Manually annotating a preset proportion of object subgraphs in the object subgraph set based on the category annotator interface to divide the object subgraph set into a manually annotated data set and an unannotated data set;

[0013] Fine-tuning the target prediction model based on the manually annotated data set to obtain the initial category prediction model;

[0014] Iteratively optimizing the category prediction model based on the unlabeled data set to obtain the category prediction model whose prediction confidences all meet preset confidence conditions, and updating the manually labeled data set and the unlabeled data set;

[0015] Determine a model labeled data set obtained by performing category prediction on the unlabeled data set by the category prediction model;

[0016] The manually annotated data set and the model annotated data set are aggregated based on the annotation information integration module to obtain the pre-annotated data.

[0017] Optionally, in a second implementation of the first aspect of the present invention, the iterative optimization of the category prediction model based on the unlabeled dataset to obtain the category prediction model whose prediction confidence satisfies a preset confidence condition, and updating the manually labeled dataset and the unlabeled dataset includes:

[0018] Performing category prediction on the object subgraphs in the unlabeled data set based on the category prediction model to obtain the prediction confidence corresponding to each object subgraph;

[0019] In response to determining that the prediction confidence of the object subgraph does not satisfy the preset confidence condition, manually annotating a preset proportion of the object subgraphs that do not satisfy the preset confidence condition based on the category annotator interface to update the manually annotated data set and the unannotated data set;

[0020] The category prediction model is fine-tuned based on the iteratively updated manually labeled dataset to iteratively update the category prediction model until the prediction confidence of the category prediction model for the object subgraph in the corresponding unlabeled dataset reaches the preset confidence condition.

[0021] Optionally, in a third implementation of the first aspect of the present invention, the image processing model of the preset decoupling framework includes a cascaded target detection model and a target classification model;

[0022] The step of training the image processing model of the preset decoupling framework based on the pre-labeled data to construct an illegal image detection model includes:

[0023] The target detection model is trained based on the pre-labeled data to obtain a lightweight high-risk detection model, wherein the lightweight high-risk detection model is used to screen out high-risk target images in the target images;

[0024] Training the target classification model based on the pre-annotated data corresponding to the high-risk target image to obtain a large object subgraph classification model, wherein the large object subgraph classification model is used to classify and identify the object subgraph in the high-risk target image;

[0025] The cascaded lightweight high-risk detection model and the large object subgraph classification model are coupled to obtain the illegal image detection model.

[0026] Optionally, in a fourth implementation of the first aspect of the present invention, the target detection model is constructed based on a backbone expansion of a lightweight version of the YOLO series.

[0027] Optionally, in a fifth implementation manner of the first aspect of the present invention, preprocessing the original image based on a preset redundancy removal algorithm to obtain the target image includes:

[0028] Performing grayscale conversion on the original image to obtain a grayscale image;

[0029] Performing a mean filter within a preset range on each pixel in the grayscale image to obtain a filtered image and a filter value of each pixel in the filtered image;

[0030] Binarizing the filtered image based on the mode of the filtered values ​​to obtain a binary image;

[0031] Performing dilation and corrosion processing on the binary image to obtain an image to be processed;

[0032] Acquire the maximum object contour in the image to be processed, and the minimum circumscribed rectangle corresponding to the maximum object contour;

[0033] The original image is cropped based on the area range of the minimum circumscribed rectangle to obtain the target image.

[0034] Optionally, in a sixth implementation manner of the first aspect of the present invention, binarizing the filtered image based on the mode of the filter values ​​to obtain a binary image includes:

[0035] The binarization threshold is adjusted based on the following formula:

[0036]

[0037] Wherein, τ is the binarization threshold, v0 is the original preset threshold, and v is the mode of the filter value;

[0038] The filtered image is binarized based on the following formula:

[0039]

[0040] Among them, B(x,y) is the filtered value of the pixel point with coordinates (x,y) in the filtered image, and T(x,y) is the binarized value of the pixel point with coordinates (x,y) in the binarized image.

[0041] A second aspect of the present invention further provides a violation image detection device, the violation image detection device comprising:

[0042] An acquisition module, used to acquire pre-annotated data obtained by annotating a sample image based on a preset model-assisted annotation system;

[0043] A construction module, used to train an image processing model of a preset decoupling framework based on the pre-labeled data to construct an illegal image detection model;

[0044] A detection module is used to perform violation detection on a target image based on the violation image detection model, wherein the target image is obtained by preprocessing an original image based on a preset redundancy removal algorithm.

[0045] The third aspect of the present invention also provides a computer device, which includes: a memory and at least one processor, wherein the memory stores instructions; the at least one processor calls the instructions in the memory so that the computer device executes the illegal image detection method as described above.

[0046] A fourth aspect of the present invention further provides a computer-readable storage medium, on which instructions are stored, and when the instructions are executed by a processor, the method for detecting illegal images as described above is implemented.

[0047] The embodiments of the present invention provide a method, device, equipment and storage medium for detecting illegal images. The method first obtains pre-annotated data obtained by annotating sample images based on a preset model auxiliary annotation system, then trains an image processing model of a preset decoupling framework based on the pre-annotated data to construct an illegal image detection model, and finally detects illegal images on target images based on the illegal image detection model. The present invention completely replaces the positioning annotation in manual annotation and replaces most of the classification annotation workload through annotation based on the preset model annotation system, thereby reducing the cost of manual annotation, significantly improving the annotation efficiency, and ensuring the quality of the annotation data. At the same time, the present invention also decomposes complex image processing tasks into simpler subtasks through a decoupling framework, and trains the image processing model of a preset decoupling framework through pre-annotated data, thereby reducing the amount of data required for model processing, improving the utilization rate of computing resources, reducing the cost of deploying computing power, and improving the processing efficiency and generalization ability of the obtained illegal image detection model. In addition, the present invention also introduces a redundant removal algorithm to obtain a target image that is more focused on the target content, so that the model can be adapted to illegal detection in the vertical screen wind control scenario, improve the model processing efficiency and processing accuracy, and has strong practicality and high accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 This is a flow chart of a first embodiment of a method for detecting illegal images according to an embodiment of the present invention;

[0049] Figure 2 for Figure 1 A schematic flow chart of an embodiment of step 101 in the embodiment;

[0050] Figure 3 for Figure 1 A flow chart of an embodiment of step 102 in the embodiment;

[0051] Figure 4 for Figure 1 A schematic flow chart of an embodiment of step 103 in the embodiment;

[0052] Figure 5 This is a schematic diagram of functional modules of an embodiment of an illegal image detection device according to an embodiment of the present invention;

[0053] Figure 6 Schematic diagram of functional modules of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0054] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0055] For ease of understanding, the specific process of the illegal image detection method in the embodiment of the present invention is described below. Figure 1 , Figure 1 This is a schematic diagram of a first embodiment of a method for detecting illegal images in an embodiment of the present invention. In this embodiment, the method for detecting illegal images includes:

[0056] 101. Obtain pre-annotated data obtained by annotating a sample image based on a preset model-assisted annotation system;

[0057] In this embodiment, the sample image is image data that is subsequently used to train a violation image detection model, which may specifically be an image data set including one or more violation types, wherein a single image data in the image data set may include multiple object sub-images, each sub-image having a corresponding violation type, and specific violation types may include normal and violation, and the violation may be specifically subdivided, or a neutral violation type may be set.

[0058] The traditional method manually annotates sample images. After obtaining the sample images, they need to be manually positioned and classified. The positioning and labeling work aims to locate the illegal areas in the image and mark the illegal areas with specific identification boxes. The classification model assigns corresponding specific categories and labels to the located and marked illegal areas. In the process of manual labeling, the positioning and labeling work requires the labelers to spend a lot of time and energy to carefully analyze each image to determine the illegal areas. After determining the illegal areas, the classification and labeling work is relatively simple. It only requires the naked eye to scan the illegal content and click the preset label to label it. However, as the types of violations become more complex and diverse, and the amount of image data increases, the cost of traditional manual labeling is also getting higher and higher, and the labeling efficiency is difficult to improve.

[0059] In this embodiment, in order to improve the efficiency of annotation and reduce the cost of annotation, the corresponding positioning annotation work and classification annotation work are specifically performed through the preset model assisted annotation system. Among them, the preset model assisted annotation system is a pre-configured processing system based on model-assisted annotation (Model-Assisted Data Annotation, MADA), which can automatically or semi-automatically perform annotation tasks, realize the annotation of sample images, and obtain annotated pre-annotated data. The preset model assisted annotation system can be based on deep learning, for example, using a neural network structure such as a convolutional neural network or a recurrent neural network to establish, or it can be realized by presetting a large model tool, for example, by configuring a prompt word (prompt) for a multimodal large model, so that the large model tool can perform corresponding image analysis and annotation, and it can also be realized by transfer learning and fine-tuning, for example, by transfer learning and fine-tuning an existing pre-trained model, accelerating the development process of the preset model assisted annotation system and improving its performance on new tasks. By obtaining the preset model-assisted annotation to annotate the sample image, not only the workload of manual annotation is significantly reduced, but also the accuracy and efficiency of annotation are improved. The obtained pre-annotated data can accurately distinguish the types of violations and provide reliable data support for the training of subsequent violation image detection models.

[0060] Optionally, in one embodiment, the preset model-assisted annotation system includes a position annotation auxiliary model, a category annotator interface, a category prediction model and an annotation information integration module.

[0061] In this optional embodiment, a preset model assisted annotation system is formed by a location labeling assistant model (Location Labeling Assistant Model, LLAM), a classification annotator (Classification Annotator, CA) interface, a classification prediction model (Classification Prediction Model, CPM) and an annotation information integration module (Annotation Aggregation Module, AAM).

[0062] In this optional embodiment, the position annotation auxiliary model is responsible for automatically locating the illegal areas in the sample image and preliminarily annotating these areas to achieve full automation of positioning and annotation. Specifically, the position annotation auxiliary model needs to automatically obtain the coordinate information of various objects in the image data, thereby avoiding the cumbersome steps of manually annotating the coordinate frame. To this end, the position annotation auxiliary model needs to effectively locate the positions of various object elements in the image, which can be specifically constructed based on Faster R-CNN (Faster Regions with Convolutional Neural Networks, a faster regional method based on convolutional neural networks), YOLO (You Are Only Looking Once) and other target detection algorithms. The present invention preferably uses a SAM (Segment Anything Model) series of model tools, such as a SAM model, a FastSAM model or a MobileSAM model to construct an offline position annotation auxiliary model. The SAM model is trained from more than 11 million images and corresponding to more than 100 million annotation information, and can effectively segment various objects in the image and obtain their position information. By expanding the SAM model to construct the position annotation auxiliary model, it is possible to achieve efficient positioning of illegal areas in the image and ensure the accuracy of positioning.

[0063] In this optional embodiment, the category annotator interface is responsible for accessing the annotator's operating instructions, which are used to further confirm and locate the partial illegal areas initially marked by the position annotation model. The interface can be connected to the operating interface platform of the specific integrated annotation tool, through which the annotator can intuitively interact with the sample image, and establish a connection with the preset model auxiliary annotation system through the category annotator interface, and send corresponding operating instructions to meet the manual annotation requirements of the annotation work. Among them, there are many ways to trigger the manual annotation operation instructions, for example, it can be triggered by clicking, dragging, batch clicking or batch dragging, etc., to meet different annotation requirements. In addition, the category annotator interface should also have a real-time feedback function, so that the annotator can view the annotation results in real time during the annotation process and adjust the annotation strategy in time.

[0064] In this optional embodiment, the category prediction model is responsible for predicting the category label of the illegal area and realizing the automation of category label prediction. Specifically, the category prediction model can learn and identify the characteristics of different violation types based on the labeled sample image data, and then automatically classify and label the illegal area in the new sample image. In order to achieve this goal, the category prediction model can be constructed based on a variety of advanced deep learning algorithms, such as convolutional neural networks (CNN), residual networks (Residual Network, ResNet) or more complex Transformer networks. The present invention preferably uses ResNet50 pre-trained on the open source data set ImageNet to carry out subsequent fine-tuning and training verification. By training these models with a large amount of labeled data, it is possible to learn the subtle differences and common features of the illegal content, so that when faced with new image data, the category label of the illegal area can be accurately predicted.

[0065] In this optional embodiment, the annotation information integration module is responsible for integrating the annotation information generated by the position annotation auxiliary model, the category annotator interface, and the category prediction model to form a complete and accurate annotation data set. Specifically, the annotation information integration module can traverse the object sub-graphs and corresponding annotation labels in all sample images. If the category is a business target category, it is retained, otherwise it is discarded. Finally, the obtained object sub-graphs and category labels are used as training samples for the subsequent training and construction of the detection model to ensure the consistency and accuracy of the annotation information. In addition, the annotation information integration module can also use a variety of data processing and integration technologies, such as data cleaning, deduplication, merging, etc., to improve the effectiveness and reliability of the pre-annotated data obtained after integration.

[0066] Optional, see Figure 2 In one embodiment, obtaining pre-annotated data obtained by annotating a sample image based on a preset model-assisted annotation system specifically includes:

[0067] 1011. Determine an object sub-atlas in the sample image based on a position annotation auxiliary model;

[0068] 1012. Manually annotate a preset proportion of object subgraphs in the object subgraph set based on a category annotator interface to divide the object subgraph set into a manually annotated data set and an unannotated data set;

[0069] 1013. Fine-tune the target prediction model based on the manually annotated data set to obtain an initial category prediction model;

[0070] 1014. Iteratively optimize the category prediction model based on the unlabeled data set to obtain a category prediction model whose prediction confidence satisfies a preset confidence condition, and update the manually labeled data set and the unlabeled data set;

[0071] 1015. Determine a model labeled data set obtained by performing category prediction on the unlabeled data set by the category prediction model;

[0072] 1016. Aggregate the manually annotated data set and the model annotated data set based on the annotation information integration module to obtain pre-annotated data.

[0073] In this optional embodiment, the object subgraph set is a set of object images that are automatically extracted and preliminarily annotated from the sample image by the position annotation auxiliary model. These object subgraphs usually contain various object elements in the sample image, and are image regions that are automatically segmented from the sample image. For example, a screenshot of the emoticon package interface of a chat software may include multiple emoticons, where the entire screenshot is the sample image, and each emoticon corresponds to an object subgraph. In the object subgraph set, each object subgraph corresponds to a specific area in the sample image and carries corresponding location information and possible preliminary category information.

[0074] In this optional embodiment, in order to further improve the accuracy and reliability of the labeled data, the present invention adopts a semi-supervised learning method to manually calibrate and confirm some object subgraphs. Through the category annotator interface, the annotator can access the preset model auxiliary annotation system to manually annotate the object subgraphs of a preset proportion, wherein the preset proportion can be based on the accuracy requirements of the model, the number of iterations, the computing power cost and the manual annotation cost, and can usually be set to 10%. Through manual annotation, the object subgraph set can be divided into a relatively accurate and reliable manually annotated data set that has been manually annotated and an unlabeled data set that has not yet been annotated and confirmed, and the subsequent category prediction model can be fine-tuned and trained and verified iteratively through the two data sets.

[0075] In this optional embodiment, the target prediction model is the original prediction model that has not been trained with a data set, that is, the predecessor of the category prediction model. The specific framework of the target prediction model is consistent with the category prediction model, and can be a convolutional neural network, a residual network, or a Transformer network, etc. Fine-tuning the target prediction model based on the manually annotated data set is to adjust the parameters and weights within the model by learning from the annotated sample data, so that it can better adapt to the characteristics of the annotated data, thereby improving the prediction accuracy and robustness of the model. At the same time, since the fine-tuning is performed on a small amount of data, it can greatly save training time and computing resources. During the fine-tuning process, the model will be trained according to the manually annotated data set, continuously correcting its own prediction deviations, and gradually approaching the actual annotation results, thereby obtaining an initial category prediction model, which can be used to predict the violation category of the object subgraph.

[0076] In this optional embodiment, although the initial category prediction model can complete the corresponding classification and labeling work, due to the diversity and heterogeneity of the data, there will still be certain errors and uncertainties. Moreover, since the initial category prediction model is a fully supervised learning model, it is also highly dependent on the data, prone to overfitting, and has weak generalization ability. Therefore, in order to improve the generalization ability of the model and ensure the prediction accuracy of the model, the present invention also iteratively optimizes the category prediction model based on the unlabeled data set. Specifically, in each iteration, the model will predict the unlabeled data set and update its own parameters and weights based on the prediction results. The unlabeled data set will also be updated during the iteration process to maintain the unknown nature of the data set to the category prediction model and ensure generalization ability.

[0077] In this optional embodiment, in order to evaluate the confidence of the model prediction, the present invention introduces a preset confidence condition, which can be a preset threshold. For example, when the confidence reaches a certain preset value, such as 0.8, it is considered that the condition is met, otherwise it is considered that the condition is not met. The preset confidence condition can also be a comprehensive evaluation method of multiple factors, and the value obtained by a specific algorithm is compared with the set threshold to determine whether the condition is met. In addition, the preset confidence condition can also comprehensively consider the relevant factors between the data, such as the uniformity of data distribution, the similarity between samples, and the performance differences of the model in different categories, etc., to more accurately evaluate the prediction ability of the model and avoid the deviation and misleading that may be caused by a single indicator. Only when the confidence of the prediction result meets the preset confidence condition, the corresponding prediction result will be adopted, and the unadopted part needs to be selected again for manual labeling to update the manually labeled data set and the unlabeled data set, and to conduct a new round of training and verification of the category prediction model. This process will continue until the prediction confidence of the category prediction model for the unlabeled data set meets the preset confidence condition. At this time, the model obtained is the optimized category prediction model, and its labeling ability is more powerful and reliable. The category prediction model obtained through iterative updating is a semi-supervised learning model. Based on this category prediction model, the object sub-images in the sample image can be classified and labeled more accurately and comprehensively.

[0078] In this embodiment, after completing the training and iterative update of the category prediction model, the category prediction results of the corresponding object subgraphs whose final prediction confidences all meet the preset confidence conditions can be determined, that is, the category prediction results of the unlabeled data set obtained by the last iterative update, and the object subgraphs after category annotation are used as the model annotation data set, so that the final manual annotation data set contains the annotated data obtained by manual annotation, and the model annotation data set contains the annotated data obtained by the category prediction model. The model annotation data set obtained by the category prediction model performing category prediction on the unlabeled data set can be determined in the training iteration process, and the annotated data obtained by performing category prediction on the updated unlabeled data set in the last verification process can be added to the model annotation data set, or it can be obtained by predicting the unlabeled data set after the corresponding category prediction model is determined.

[0079] In this embodiment, after determining the final manually annotated data set and the model annotated data set, the two data sets can be aggregated through the annotation information integration module to generate the final pre-annotated data. In this process, the annotation information integration module will comprehensively consider the results of manual annotation and model prediction to ensure the consistency and accuracy of the annotation information. At the same time, the annotation information integration module can also use a variety of data processing and integration technologies, such as data cleaning, deduplication, merging, etc., to improve the effectiveness and reliability of the pre-annotated data. At the same time, the annotation information integration can aggregate the data set according to actual business needs. For example, the annotation information integration module can first traverse the two data sets to determine each object subgraph and the corresponding annotation information. If the business requirement is to find the object subgraph of the vulgar picture category, the object subgraph marked with the label of "vulgar picture category" can be retained, and the object subgraphs of other non-vulgar picture categories can be discarded. Finally, the obtained object subgraphs and category labels are used as pre-annotated data for subsequent training and construction of the detection model.

[0080] Optionally, in one embodiment, iteratively optimizing the category prediction model based on the unlabeled data set to obtain a category prediction model whose prediction confidences all meet preset confidence conditions, and updating the manually labeled data set and the unlabeled data set specifically include:

[0081] (1) Based on the category prediction model, the category of the object subgraphs in the unlabeled dataset is predicted to obtain the prediction confidence corresponding to each object subgraph;

[0082] (2) in response to determining that the prediction confidence of the object subgraph does not meet the preset confidence condition, manually annotating a preset proportion of the object subgraphs that do not meet the preset confidence condition based on the category annotator interface to update the manually annotated dataset and the unannotated dataset;

[0083] (3) Fine-tune the category prediction model based on the iteratively updated manually annotated dataset to iteratively update the category prediction model until the prediction confidence of the category prediction model for the object subgraphs in the corresponding unlabeled dataset reaches a preset confidence condition.

[0084] In this optional embodiment, the category prediction model is used to make preliminary classification predictions for the object subgraphs in the unlabeled data set, and the category predictions are made for the object subgraphs in the unlabeled data set based on the category prediction model, and the prediction confidence corresponding to each object subgraph is obtained, which can effectively evaluate the prediction ability of the model in the current state and determine whether the data is reliable, wherein the prediction confidence is a measure of the reliability of the model's prediction results, and a high confidence indicates that the model has a high confidence in its predictions, and vice versa, it indicates that the prediction results may have large errors. The way to obtain the prediction confidence can be based on the evaluation of the model output probability or similarity, the evaluation based on the confidence interval, or the cross-validation evaluation, etc., and the present invention does not make specific limitations on this.

[0085] In this optional embodiment, when it is found that there is an object subgraph whose prediction confidence does not meet the preset confidence condition, the preset model-assisted annotation system will trigger a manual intervention mechanism. Specifically, the present invention will randomly or sequentially select a portion of the object subgraphs that do not meet the conditions for manual annotation based on a preset ratio, such as 10%. Thereby, new and reliable annotation data can be introduced for fine-tuning the training of the model to correct the deviation of the model in the prediction process and enrich the diversity of the training data set. At the same time, by updating the manually annotated data set and the unlabeled data set, a new starting point is also provided for subsequent iterative optimization.

[0086] In this optional embodiment, after obtaining the updated manually annotated data set, the preset model-assisted annotation system will use this data again to fine-tune the category prediction model. Fine-tuning is an iterative process that continuously adjusts the parameters and weights of the model to enable it to better adapt to new training data and improve the accuracy and robustness of the prediction. This step is repeated to iteratively update the category prediction model, and to update the manually annotated data set and unlabeled data set related to model training until the prediction confidence of the category prediction model for all object subgraphs in the unlabeled data set reaches the preset confidence condition. At this point, it can be considered that the category prediction model has been fully optimized and has high prediction and generalization capabilities.

[0087] This embodiment significantly improves the accuracy and reliability of the category prediction model through the iterative optimization method. By continuously introducing new and reliable annotation data, the model can gradually correct the deviation in the prediction process and adapt to more complex and changeable sample images. This self-improvement ability enables the model to make more accurate and reliable predictions when facing unknown or complex scenes. At the same time, this method effectively improves the annotation efficiency and quality. By combining manual annotation and model prediction, the preset model-assisted annotation system can automatically process most of the object subgraphs that are easy to classify, and only manually annotate a few object subgraphs that are difficult to predict or have low prediction confidence. In this way, not only the burden of manual annotation is reduced, but also the quality and consistency of the annotation data are ensured. In addition, the iterative optimization method also has good scalability and flexibility. In practical applications, parameters such as preset ratios and preset confidence conditions can be adjusted according to specific needs to adapt to different annotation scenarios and task requirements, which is conducive to further improving the effectiveness and reliability of pre-annotated data.

[0088] Optionally, in one embodiment, the image processing model of the preset decoupling framework includes a cascaded target detection model and a target classification model.

[0089] In this optional embodiment, the image processing model of the preset decoupling framework is a framework model that splits a complex image processing task into multiple subtasks for processing, and can realize a data processing magnitude-aware model decoupling design method (Throughput-Aware Decoupled Models) TADM. In the present invention, the image processing model of the preset decoupling framework specifically includes a cascaded target detection model and a target classification model, wherein the target detection model can be a deep learning model based on a convolutional neural network, such as Faster R-CNN or YOLO series, etc., through subsequent training, it can realize the learning and recognition of key features in the image, and then realize the precise positioning of the target object, and the target classification model can also be a deep learning model based on a convolutional neural network, such as ResNet or Transformer, etc., which can realize the category judgment of the target object. The image processing model of the preset decoupling framework realizes the efficient decomposition and collaborative processing of complex image processing tasks through the cascaded target detection model and target classification model, reduces the computing power requirements for a single processing, and is conducive to improving the accuracy and efficiency of subsequent illegal image detection.

[0090] 102. Train the image processing model of the preset decoupling framework based on the pre-labeled data to build a violation image detection model;

[0091] In this optional embodiment, after obtaining the pre-annotated data, the image processing model of the preset decoupling framework can be trained through the pre-annotated data, wherein, since the pre-annotated data is obtained by annotating the sample image with the preset model auxiliary annotation system, it has strong quality and accuracy, and can provide reliable guidance for the training of the model. During the training process, the model will continuously learn and update its internal parameters to better adapt to and identify illegal content in the image. After the training is completed, the obtained illegal image detection model will be able to automatically detect and classify illegal content in the input image. Through this process, the model can quickly and accurately complete the detection task of illegal images and build an efficient and accurate illegal image detection model. When the model receives a new image later, it will first use the target detection model to locate and identify the target objects in the image, and then use the target classification model to classify these target objects to determine whether they contain illegal content.

[0092] Optional, see Figure 3 In one embodiment, an image processing model of a preset decoupling framework is trained based on pre-labeled data to construct an illegal image detection model, specifically including:

[0093] 1021. Training the target detection model based on the pre-labeled data to obtain a lightweight high-risk detection model, wherein the lightweight high-risk detection model is used to screen out high-risk target images in the target images;

[0094] 1022. Training a target classification model based on pre-labeled data corresponding to the high-risk target image to obtain a large object sub-graph classification model, wherein the large object sub-graph classification model is used to classify and identify object sub-graphs in the high-risk target image;

[0095] 1023. The cascaded lightweight high-risk detection model and the large object subgraph classification model are coupled to obtain a violation image detection model.

[0096] In this optional embodiment, by training with pre-labeled data, the target detection model and the target classification model can be trained as a lightweight high-risk detection model (Lightweight High-Risk Detection Model, LHRDM) and a large-scale object sub-graph classification model (Large-Scale High-Risk Classification Model, LSHRCM), respectively, wherein tasks with high data processing volume are only applied to the high-risk detection model, and the high-risk detection model only needs to screen out high-risk target images in the target images. Therefore, only a lightweight target detection model is needed to be trained, and the amount of data required to be processed in the subsequent large-scale object sub-graph classification model can be greatly reduced.

[0097] In this optional embodiment, specifically, the target detection model can be constructed based on the backbone expansion of the YOLO series lightweight version, wherein YOLO is a target detection algorithm model with high efficiency and high real-time performance, and the YOLO series algorithm has developed to multiple versions, such as YOLOv2, YOLOv3, YOLOv4 and YOLOv5, etc., and the YOLO series lightweight version is a YOLO model with fewer parameters, lower calculation amount and memory occupancy obtained by pruning, quantization, knowledge distillation, backbone network design, etc., and the target detection model is constructed based on the backbone expansion of the YOLO series lightweight version, and through subsequent training of pre-labeled data, the lightweight model characteristics can be effectively utilized, the consumption of computing resources can be reduced, the detection speed can be improved, and the model parameters can be flexibly adjusted, which is particularly suitable for scenes with high real-time requirements. At the same time, since the high-risk risk detection model mainly focuses on the potential high-risk areas of violations in the image, its design pays more attention to quickly and accurately locating these areas without the need to conduct a detailed analysis of every detail in the image, which not only improves the detection efficiency, but also can reduce the false alarm rate to a certain extent.

[0098] In this optional embodiment, the training of the large object subgraph classification model focuses more on the refined classification and identification of object subgraphs in high-risk target images. By utilizing the detailed annotation information for high-risk target images in the pre-annotated data, the large object subgraph classification model can learn the characteristic representations of various types of illegal objects, thereby achieving accurate classification of these object subgraphs. During the training process, classification algorithms in deep learning, such as ResNet or Transformer, can be used. According to actual needs, the model with more parameters and better fitting ability can be constructed, and through continuous iterative optimization, the model can gradually improve its classification and identification capabilities for illegal objects.

[0099] In this optional embodiment, after obtaining the lightweight high-risk detection model and the large object subgraph classification model, the two can be cascade-coupled to form a complete illegal image detection model. This coupling process ensures the consistency and efficiency of the model during the detection process. When the model receives a new image, it will first use the lightweight high-risk detection model to quickly screen the image to find potential high-risk target images; then, the large object subgraph classification model is used to perform detailed classification and identification of the object subgraphs in these high-risk target images to determine whether they contain illegal content. Through the decoupling and coupling design of the model, the speed and efficiency of detection are guaranteed, and the accuracy and reliability of detection are improved, so that the illegal image detection model can achieve efficient and accurate detection of illegal content in the image.

[0100] 103. Perform violation detection on the target image based on the violation image detection model, wherein the target image is obtained by preprocessing the original image based on a preset redundancy removal algorithm.

[0101] In this embodiment, after the training data is constructed and the training and construction of the illegal image detection model is completed, the target image can be detected for illegal activities through the illegal image detection model. In order to further improve the efficiency and accuracy of the detection, the image can be subjected to a series of preprocessing steps before being sent to the model, especially a preset redundancy removal algorithm is used to remove redundant information in the image. The main purpose of this algorithm is to remove irrelevant information or noise that may exist in the original image, so as to reduce the computational burden of the model and improve the detection effect. By removing redundant data in the image, such as repeated background information, irrelevant textures, etc., the model can focus more on the key content in the image, obtain the target image, and thus more accurately identify illegal content. Among them, the original image can be obtained by uploading by the receiving user, crawling by a web crawler, and provided by a picture library, etc., and the present invention does not make specific limitations on this.

[0102] In this embodiment, the preset redundancy removal algorithm can be specifically based on a variety of image processing techniques, such as image compression, filtering, morphological operations, etc. These techniques can effectively reduce redundant information in an image while maintaining the main features and details of the image. For example, an image compression algorithm can reduce the size of an image file by removing redundant pixels and color information in an image while maintaining the visual quality of the image. Filtering technology can remove noise and unnecessary details by smoothing the image, making the image clearer and easier to analyze. Morphological operations can highlight specific shapes and structures in an image through transformations such as expansion and corrosion, thereby helping the model to better identify target objects in the image.

[0103] Optional, see Figure 4 In one embodiment, preprocessing the original image based on a preset redundancy removal algorithm to obtain a target image includes:

[0104] 1031. Perform grayscale conversion on the original image to obtain a grayscale image;

[0105] 1032. Perform a mean filter within a preset range on each pixel in the grayscale image to obtain a filtered image and a filter value of each pixel in the filtered image;

[0106] 1033. Binarize the filtered image based on the mode of the filter values ​​to obtain a binary image;

[0107] 1034. Perform expansion and corrosion processing on the binary image to obtain an image to be processed;

[0108] 1035. Obtain the maximum target contour in the image to be processed and the minimum circumscribed rectangle corresponding to the maximum target contour;

[0109] 1036. Crop the original image based on the area range of the minimum circumscribed rectangle to obtain a target image.

[0110] In this optional embodiment, the color information in the image can be removed by grayscale conversion of the original image, wherein grayscale conversion is a commonly used image processing technology, which simplifies the color information of each pixel in the image into a grayscale value, which is usually an integer between 0 and 255, representing the brightness of the pixel. Through grayscale conversion, the color and texture information in the image is simplified into a single brightness information. Specifically, the grayscale conversion can be based on the formula G=0.299I R +0.587I G +0.114I B Calculation is realized, where G is the gray value of the pixel after gray conversion, I R ,I G ,I B are the red, green and blue channel values ​​of the corresponding pixels in the original image, 0.299, 0.587 and 0.114 are the weight coefficients of the red, green and blue channels, and their specific values ​​are determined by the relative sensitivity of the human eye to different colors of light. By converting the original image to a grayscale image, the complexity and amount of image processing can be reduced, which facilitates a series of subsequent image processing.

[0111] In this optional embodiment, mean filtering is a method of replacing the original value of a pixel by calculating the average pixel value of pixels within a certain range around the pixel. Taking the mean filtering of a 9×9 range as an example, the specific method can be based on the formula Calculate the filter value, where B is the filter value obtained after the pixel mean filter calculation, (x, y) is the point coordinate of the pixel, i and j are variables ranging from -4 to 4, which are used to traverse the grayscale values ​​of the pixels in the 9×9 range centered on (x, y). The preset range can be adjusted according to actual needs to make the transition of the filtered image smoother.

[0112] In this optional embodiment, each pixel has a corresponding filter value, and the mode of all filter values ​​in the image can reflect the most common brightness feature in the image. Based on this feature, the filtered image is binarized, and the pixels in the image can be divided into two categories: bright pixels and dark pixels, and then the image is converted into a binary image of black and white or other two preset high-contrast colors, thereby further simplifying the image information, highlighting the key content in the image, and facilitating subsequent processing. Specifically, the mode can be obtained by calculating the relevant calculation function of the model, or by traversing statistics. For example, if B in the above formula is a set of multiple filter values, then the mode of the filter value can be calculated based on the formula v=mode(B), where B is the obtained mode value, and mode() is a function used to obtain the mode in the existing program code or model framework. It can be specifically adjusted for different program languages ​​and model types, as long as it can be used to obtain the mode from multiple filter values.

[0113] Optionally, in one embodiment, binarizing the filtered image based on the mode of the filter values ​​to obtain a binarized image includes:

[0114] (1) Adjust the binarization threshold based on the following formula:

[0115]

[0116] Among them, τ is the binarization threshold, v0 is the original preset threshold, and v is the mode of the filtered value;

[0117] (2) Binarize the filtered image based on the following formula:

[0118]

[0119] Among them, B(x,y) is the filtered value of the pixel point with coordinates (x,y) in the filtered image, and T(x,y) is the binarized value of the pixel point with coordinates (x,y) in the binarized image.

[0120] In this optional embodiment, specifically through the formula The binarization threshold is dynamically adjusted, wherein the original preset threshold v0 can be a value determined by the binarization division experience, or a value preset according to the environmental conditions and the color characteristics of the target area. Taking the value of v0 as 30 as an example, when the mode is less than 30, it means that the filtered image is dark as a whole, and most areas may be occupied by dark information such as black edges and shadows. Therefore, the binarization threshold can be set to the value of the mode plus 1, so that the mode part can be displayed with one color value, and the other parts are displayed with another color value to highlight the content outside the black edges and shadows. When the mode is greater than 30, it means that the black edges and shadow areas are relatively small, and the determined binarization threshold is 1, so that more filtered image content can be used for subsequent image processing steps.

[0121] In this optional embodiment, based on the above, it can be specifically obtained by formula The binarization value is determined. The binarization calculation can clearly remove the redundant areas with low information content such as black edges and shadows, and retain the areas with more information for subsequent detection. The method of binarizing the filtered image based on the mode of the filter value can not only effectively improve the accuracy of image processing, but also enhance the flexibility of the image processing process. By dynamically adjusting the binarization threshold, it is ensured that the ideal binarization effect can be obtained in different scenarios, further improving the accuracy and reliability of subsequent processing.

[0122] In this optional embodiment, after obtaining the binary image, the accuracy of the binary division can be further optimized by dilating and corroding the binary image. Dilating and corroding can further refine the edge of the binary image and improve the precision of image processing. Specifically, dilating and corroding can be based on the formula and formula Calculated, where C is the image to be processed, represents the corrosion operation, represents the expansion operation, K is the structural element, It is a matrix of all 1s. By adjusting the size and shape of the structural element, the degree of expansion and corrosion can be controlled to achieve the best image processing effect. Expansion and corrosion processing are usually implemented through the structural element K. This structural element will slide on the image and decide how to process the image pixels according to its overlap with the image pixels. Through the expansion operation, the bright or dark areas in the image can be expanded outward, filling some small holes and gaps, and making the edges smoother, depending on the setting of binarization. The corrosion operation is the opposite. It will shrink the bright or dark areas in the image inward, remove some small noise points and burrs, and further highlight the main features of the image. These two operations can be used in combination, through the opening operation of corrosion first and then expansion or the closing operation of expansion first and then corrosion, to achieve the effects of smoothing image edges, removing noise, connecting adjacent objects, etc. The edges of the image to be processed after expansion and corrosion will be smoother, and noise and redundant information will be further removed, thereby providing clearer and more accurate image data for subsequent image steps.

[0123] In this optional embodiment, the maximum target contour in the image to be processed and the minimum bounding rectangle corresponding to the maximum target contour are obtained in order to further determine the minimum area range covering all key information in the image and obtain a rectangular area more suitable for image processing. Before obtaining the maximum target contour, all target contours need to be obtained first, and then the maximum target contour can be determined from all target contours. Specifically, it can be obtained by Get all the contours in the image to be processed, where contours is a dataset of all contours. findContours() has different representations in different programming languages ​​and model frameworks, as long as it can be used to find contours in an image. The maximum target contour among all contours can be determined, and finally the minimum circumscribed rectangle of the maximum target contour can be obtained by rect=minAreaRect(c).

[0124] In this optional embodiment, through the minimum enclosing rectangle, the four vertices of the minimum enclosing rectangle can be further determined to be (x1, y1), (x2, y2), (x3, y3) and (x4, y4), so that the minimum coordinate x value can be further determined to be x min , the maximum coordinate x value is x max , the minimum y value is y min , the maximum y value is y max , and then get the height value of the rectangle h = y max -y min , width value w = x max -x min , thereby determining the corresponding area of ​​the final target image, I'=I[y min :ymax ,x min :x max ], in some programs, in order to improve the accuracy of calculation, the calculation formula is usually expressed as I'=I[y min :y min +h,x min :x min +w]. Based on this area range, the original image can be cropped to obtain the corresponding target image.

[0125] In this optional embodiment, through the above series of preprocessing steps, redundant information and noise in the original image can be effectively removed, especially the black edge area in the image, thereby improving the quality and clarity of the image, effectively adapting to the risk control scenario of the vertical screen of the mobile phone, avoiding the influence of redundant information on the target image, and helping to reduce the computational burden and complexity of the model, improve the accuracy and efficiency of violation detection, and promote the improvement of model accuracy.

[0126] This embodiment first obtains the pre-annotated data obtained by annotating the sample image based on the preset model auxiliary annotation system, and then trains the image processing model of the preset decoupling framework based on the pre-annotated data to construct an illegal image detection model, and finally performs illegal detection on the target image based on the illegal image detection model. The present invention completely replaces the positioning annotation in the manual annotation by the annotation based on the preset model annotation system, and replaces most of the classification annotation workload, thereby reducing the manual annotation cost, significantly improving the annotation efficiency, and ensuring the quality of the annotation data. At the same time, this embodiment also decomposes the complex image processing task into simpler subtasks through the decoupling framework, and trains the image processing model of the preset decoupling framework through the pre-annotated data, which can reduce the amount of data required for model processing, improve the utilization rate of computing resources, reduce the deployment computing cost, and improve the processing efficiency and generalization ability of the obtained illegal image detection model. In addition, the present invention also obtains a target image that focuses more on the target content by introducing a redundant removal algorithm, so that the model can be adapted to the illegal detection in the vertical screen wind control scenario, improve the model processing efficiency and processing accuracy, and has strong practicality, and the accuracy of illegal detection and the recall rate of illegal content are high.

[0127] In order to execute the corresponding steps in the above method embodiment and each possible implementation method, the following provides an implementation method of a violation image detection device. Figure 5 , Figure 5 This is a functional module diagram of an embodiment of a violation image detection device in an embodiment of the present invention. In this embodiment, the violation image detection device is applied to an electronic device, and the violation image detection device includes:

[0128] The acquisition module 201 is used to obtain the pre-annotated data obtained by annotating the sample image based on the preset model auxiliary annotation system.

[0129] Construction module 202, used to train the image processing model of the preset decoupling framework based on the pre-labeled data to construct an illegal image detection model

[0130] The detection module 203 is used to perform violation detection on the target image based on the violation image detection model, wherein the target image is obtained by preprocessing the original image based on a preset redundancy removal algorithm.

[0131] Optionally, in one embodiment, the preset model-assisted annotation system includes a position annotation auxiliary model, a category annotator interface, a category prediction model and an annotation information integration module.

[0132] Optionally, in one embodiment, the acquisition module 201 is specifically used to: determine an object sub-atlas in a sample image based on a position annotation auxiliary model; manually annotate a preset proportion of object sub-atlases in the object sub-atlas based on a category annotator interface to divide the object sub-atlas into a manually annotated data set and an unlabeled data set; fine-tune the target prediction model based on the manually annotated data set to obtain an initial category prediction model; iteratively optimize the category prediction model based on the unlabeled data set to obtain a category prediction model whose prediction confidences meet preset confidence conditions, and update the manually annotated data set and the unlabeled data set; fine-tune the target prediction model based on the manually annotated data set to obtain an initial category prediction model; iteratively optimize the category prediction model based on the unlabeled data set to obtain a category prediction model whose prediction confidences meet preset confidence conditions, and update the manually annotated data set and the unlabeled data set.

[0133] Optionally, in one embodiment, the acquisition module 201 is specifically used to: perform category prediction on the object subgraphs in the unlabeled data set based on the category prediction model to obtain the prediction confidence corresponding to each object subgraph; in response to determining that the prediction confidence of the object subgraph does not meet the preset confidence condition, manually annotate a preset proportion of the object subgraphs that do not meet the preset confidence condition based on the category annotator interface to update the manually annotated data set and the unlabeled data set; fine-tune the category prediction model based on the iteratively updated manually annotated data set to iteratively update the category prediction model until the prediction confidence of the category prediction model for the object subgraphs in the corresponding unlabeled data set meets the preset confidence condition.

[0134] Optionally, in one embodiment, the image processing model of the preset decoupling framework includes a cascaded target detection model and a target classification model.

[0135] Optionally, in one embodiment, the construction module 202 is specifically used to: train the target detection model based on pre-labeled data to obtain a lightweight high-risk detection model, wherein the lightweight high-risk detection model is used to screen out high-risk target images in the target image; train the target classification model based on the pre-labeled data corresponding to the high-risk target image to obtain a large object subgraph classification model, wherein the large object subgraph classification model is used to classify and identify object subgraphs in the high-risk target image; couple the cascaded lightweight high-risk detection model and the large object subgraph classification model to obtain a violation image detection model.

[0136] Optionally, in one embodiment, the target detection model is constructed based on the backbone expansion of a lightweight version of the YOLO series.

[0137] Optionally, in one embodiment, the detection module 203 is specifically used to: perform grayscale conversion on the original image to obtain a grayscale image; perform mean filtering within a preset range on each pixel in the grayscale image to obtain a filtered image, and a filter value for each pixel in the filtered image; perform binarization processing on the filtered image based on the mode of the filter values ​​to obtain a binary image; perform dilation and erosion processing on the binary image to obtain an image to be processed; obtain the maximum target contour in the image to be processed, and the minimum bounding rectangle corresponding to the maximum target contour; and crop the original image based on the area range of the minimum bounding rectangle to obtain a target image.

[0138] Optionally, in one embodiment, the detection module 203 is further configured to: adjust the binarization threshold based on the following formula:

[0139]

[0140] Among them, τ is the binarization threshold, v0 is the original preset threshold, and v is the mode of the filtered value;

[0141] The filtered image is binarized based on the following formula:

[0142]

[0143] Among them, B(x,y) is the filtered value of the pixel point with coordinates (x,y) in the filtered image, and T(x,y) is the binarized value of the pixel point with coordinates (x,y) in the binarized image.

[0144] Since the embodiments of the device part correspond to the embodiments of the above-mentioned method, please refer to the above-mentioned method embodiments for the introduction of the illegal image detection device provided in the embodiments of the present invention. The embodiments of the present invention will not be repeated here, and it has the same beneficial effects as the above-mentioned illegal image detection method.

[0145] The present invention also provides a computer device, which includes a memory and a processor. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor executes the above-mentioned illegal image detection method. Figure 6 3 is a functional module diagram of a computer device provided by an embodiment of the present invention. The computer device 300 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 310 (for example, one or more processors) and a memory 320, and one or more storage media 330 (for example, one or more mass storage devices) storing application programs 333 or data 332. Among them, the memory 320 and the storage medium 330 can be short-term storage or permanent storage. The program stored in the storage medium 330 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the computer device 300. Furthermore, the processor 310 can be configured to communicate with the storage medium 330 to execute a series of instruction operations in the storage medium 330 on the computer device 300.

[0146] The computer device 300 may also include one or more power supplies 340, one or more wired or wireless network interfaces 350, one or more input and output interfaces 360, and / or one or more operating systems 331, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. It will be appreciated by those skilled in the art that Figure 6 The illustrated computer device structure does not constitute a limitation on the computer device, and may include more or fewer components than illustrated, or combine certain components, or arrange the components differently.

[0147] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the above-mentioned illegal image detection method.

[0148] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. If the integrated module or unit 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 such an understanding, the technical solution of the present invention is essentially or part of the contribution 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 several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0149] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for detecting illegal images, characterized in that: The illegal image detection method comprises: Acquire pre-annotated data obtained by annotating the sample image based on a preset model-assisted annotation system; Based on the pre-labeled data, an image processing model of a preset decoupling framework is trained to construct an illegal image detection model; Violation detection is performed on a target image based on the violation image detection model, wherein the target image is obtained by preprocessing an original image based on a preset redundancy removal algorithm.

2. The illegal image detection method according to claim 1, characterized in that: The preset model-assisted annotation system includes a position annotation auxiliary model, a category annotator interface, a category prediction model and an annotation information integration module; The obtaining of pre-annotated data obtained by annotating the sample image based on the preset model auxiliary annotation system includes: Determine an object sub-atlas in the sample image based on the position annotation auxiliary model; Manually annotating a preset proportion of object subgraphs in the object subgraph set based on the category annotator interface to divide the object subgraph set into a manually annotated data set and an unannotated data set; Fine-tuning the target prediction model based on the manually annotated data set to obtain the initial category prediction model; Iteratively optimizing the category prediction model based on the unlabeled data set to obtain the category prediction model whose prediction confidences all meet preset confidence conditions, and updating the manually labeled data set and the unlabeled data set; Determine a model labeled data set obtained by performing category prediction on the unlabeled data set by the category prediction model; The manually annotated data set and the model annotated data set are aggregated based on the annotation information integration module to obtain the pre-annotated data.

3. The illegal image detection method according to claim 2, characterized in that: The iterative optimization of the category prediction model based on the unlabeled data set to obtain the category prediction model whose prediction confidence satisfies a preset confidence condition, and updating the manually labeled data set and the unlabeled data set includes: Performing category prediction on the object subgraphs in the unlabeled data set based on the category prediction model to obtain the prediction confidence corresponding to each object subgraph; In response to determining that the prediction confidence of the object subgraph does not satisfy the preset confidence condition, manually annotating a preset proportion of the object subgraphs that do not satisfy the preset confidence condition based on the category annotator interface to update the manually annotated data set and the unannotated data set; The category prediction model is fine-tuned based on the iteratively updated manually labeled dataset to iteratively update the category prediction model until the prediction confidence of the category prediction model for the object subgraph in the corresponding unlabeled dataset reaches the preset confidence condition.

4. The illegal image detection method according to claim 1, characterized in that: The image processing model of the preset decoupling framework includes a cascaded target detection model and a target classification model; The step of training the image processing model of the preset decoupling framework based on the pre-labeled data to construct an illegal image detection model includes: The target detection model is trained based on the pre-labeled data to obtain a lightweight high-risk detection model, wherein the lightweight high-risk detection model is used to screen out high-risk target images in the target images; Training the target classification model based on the pre-annotated data corresponding to the high-risk target image to obtain a large object subgraph classification model, wherein the large object subgraph classification model is used to classify and identify the object subgraph in the high-risk target image; The cascaded lightweight high-risk detection model and the large object subgraph classification model are coupled to obtain the illegal image detection model.

5. The illegal image detection method according to claim 4, characterized in that: The target detection model is built based on the backbone of a lightweight version of the YOLO series.

6. The illegal image detection method according to claim 1, characterized in that: The preprocessing of the original image based on a preset redundancy removal algorithm to obtain the target image includes: Performing grayscale conversion on the original image to obtain a grayscale image; Performing a mean filter within a preset range on each pixel in the grayscale image to obtain a filtered image and a filter value of each pixel in the filtered image; Binarizing the filtered image based on the mode of the filtered values ​​to obtain a binary image; Performing dilation and corrosion processing on the binary image to obtain an image to be processed; Acquire the maximum object contour in the image to be processed, and the minimum circumscribed rectangle corresponding to the maximum object contour; The original image is cropped based on the area range of the minimum circumscribed rectangle to obtain the target image.

7. The illegal image detection method according to claim 6, characterized in that: The binarization processing of the filtered image based on the mode of the filter values ​​to obtain a binarized image includes: The binarization threshold is adjusted based on the following formula: Wherein, τ is the binarization threshold, v0 is the original preset threshold, and v is the mode of the filter value; The filtered image is binarized based on the following formula: Among them, B(x,y) is the filtered value of the pixel point with coordinates (x,y) in the filtered image, and T(x,y) is the binarized value of the pixel point with coordinates (x,y) in the binarized image.

8. A device for detecting illegal images, characterized in that: The illegal image detection device comprises: An acquisition module, used to acquire pre-annotated data obtained by annotating a sample image based on a preset model-assisted annotation system; A construction module, used to train an image processing model of a preset decoupling framework based on the pre-labeled data to construct an illegal image detection model; A detection module is used to perform violation detection on a target image based on the violation image detection model, wherein the target image is obtained by preprocessing an original image based on a preset redundancy removal algorithm.

9. A computer device, characterized in that: The computer device comprises: a memory and at least one processor, wherein instructions are stored in the memory; The at least one processor calls the instructions in the memory to enable the computer device to execute the illegal image detection method according to any one of claims 1 to 7.

10. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by a processor, the illegal image detection method according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Engineering drawing automatic labeling method and device and medium

    CN120340032A

  • Satellite communication data processing system and method based on Internet of Things

    CN121071689A

  • Building fine identification method, system and device, and model training method

    CN121191021A