Water mark detection method, system and equipment and storage medium

By using multiple water trace segmentation models to improve the accuracy of water trace detection, the problem of missed and missed water trace detection in the prior art is solved, and more efficient and accurate water trace detection is achieved.

CN119832320APending Publication Date: 2025-04-15SEVNCE ROBOTICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411904799.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

Existing water trace detection methods are prone to missed inspection and missed inspection in complex industrial backgrounds, and require the reproduction of data sets based on different factory backgrounds, which is time-consuming and labor-intensive.

Method used

Multiple water trace segmentation models (first water trace segmentation model, second water trace segmentation model and third water trace segmentation model) are used to extract the characteristics of the patrol image separately, and the accuracy of water trace detection is improved by fusing the features of different models.

Benefits of technology

By integrating the identification results of multiple models, the possibility of missed and missed water traces is reduced, the accuracy of water trace detection results is improved, and the cost of adaptation to different factory backgrounds is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119832320A_ABST
    Figure CN119832320A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, and relates to a water stain detection method, which comprises the following steps: acquiring an inspection image; inputting the inspection image into a first water mark segmentation model, extracting features of the inspection image by the first water mark segmentation model to obtain first image features, and outputting a first segmented image according to the first image features; inputting the inspection image into a second water mark segmentation model, extracting features of the inspection image by the second water mark segmentation model to obtain second image features, and outputting a second segmented image according to the second image features; inputting the inspection image into a third water mark segmentation model, fusing the first image feature and the second image feature by the third water mark segmentation model to obtain a third image feature, and obtaining a third segmented image according to the third image feature; and determining a water stain detection result of the inspection image according to the first segmented image, the second segmented image and the third segmented image. The invention further provides a water mark detection system and device and a storage medium. The accuracy of a water mark detection result can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method, system, device and storage medium for detecting watermarks. Background Technology

[0002] Liquid leak detection is a crucial aspect of enterprise safety management. Timely monitoring and handling of liquid leaks can prevent property damage, environmental pollution, and production interruptions. Currently, factories commonly use manual inspections, intelligent video surveillance systems, or inspection robots to detect water stains. However, manual inspections are costly due to the large size of factories. Intelligent video surveillance systems or inspection robots collect images from various locations within the factory and analyze them to determine the presence of water stains. While these methods are more labor-efficient, water stains come in various shapes, increasing the likelihood of missed or false detections in complex industrial environments. Furthermore, creating new datasets and training models for water stain recognition is time-consuming and labor-intensive for different factory environments. Summary of the Invention

[0003] To reduce the possibility of missed or false detections of watermarks and improve the accuracy of watermark detection results, a watermark detection method, system, device, and storage medium are provided.

[0004] To achieve the above-mentioned objectives of the present invention, the present invention provides a method for detecting watermarks.

[0005] The present invention provides a water stain detection method, comprising:

[0006] Acquire inspection images;

[0007] The inspection image is input into the first watermark segmentation model. The first watermark segmentation model extracts the features of the inspection image to obtain the first image features. The first segmented image is output based on the first image features.

[0008] The inspection image is input into the second watermark segmentation model, which extracts features from the inspection image to obtain second image features. The second segmented image is then output based on the second image features. The first watermark segmentation model and the second watermark segmentation model belong to different types.

[0009] The inspection image is input into the third watermark segmentation model. The third watermark segmentation model fuses the first image features and the second image features to obtain the third image features. The third segmented image is obtained based on the third image features.

[0010] The water stain detection results of the inspection image are determined based on the first segmented image, the second segmented image, and the third segmented image.

[0011] Optionally, determining the watermark detection result of the inspection image based on the first segmented image, the second segmented image, and the third segmented image includes:

[0012] The first segmented image, the second segmented image, and the third segmented image are analyzed separately to obtain the analysis results. The images in the first segmented image, the second segmented image, and the third segmented image where water traces are detected are recorded as water trace segmented images, and the images in the first segmented image, the second segmented image, and the third segmented image where water traces are not detected are recorded as water trace-free segmented images.

[0013] The water stain detection results were determined based on the analysis results:

[0014] If the third segmented image is a water-free segmented image, and at least one of the first and second segmented images is a water-free segmented image, then the water detection result is that the inspection image is water-free.

[0015] If the third segmentation image is a segmentation image with watermarks, and the first and second segmentation images are both segmentation images without watermarks, then the third segmentation image is input into the classification network, the classification network parses the third segmentation image, and outputs the watermark detection result;

[0016] If the third segmented image is a water-marked segmented image, and at least one of the first and second segmented images is a water-marked segmented image, then it is determined whether the water-marked regions in the first and / or second segmented images are consistent with the water-marked regions in the third segmented image. If they are consistent, the water-marked detection result is that the inspection image has water marks. If they are inconsistent, the water-marked segment is input into the classification network, the classification network parses the water-marked segmented image, and outputs the water-marked detection result.

[0017] Optionally, the classification network includes a first classification model and a second classification model, and the watermark segmentation image is a first segmentation image, a second segmentation image, or a third segmentation image. The processing steps of the classification network for the watermark segmentation image are as follows:

[0018] The watermark segmentation map is input into the first classification model. The first classification model parses the watermark segmentation map and outputs the first target category prediction result.

[0019] The watermark segmentation map is input into the second classification model, which then parses the watermark segmentation map and outputs the prediction result of the second target category.

[0020] The final target classification prediction result is obtained by voting on the prediction results of the first target category and the prediction results of the second target category through a decision forest.

[0021] The watermark detection result is determined based on the final target classification prediction result.

[0022] Optionally, before inputting the watermark segmentation map into the classification network, the method further includes:

[0023] Obtain the confidence score of the segmentation map with watermarks. The confidence score is used to characterize the probability that watermarks exist in the segmentation map with watermarks.

[0024] Compare the confidence score with a preset score threshold:

[0025] If the confidence score is greater than or equal to the preset score threshold, it is determined that there is water in the image corresponding to the water stain segmentation map, and the water stain segmentation map is input into the classification network.

[0026] If the confidence score is less than a preset score threshold, the segmentation result of the watermark segmentation image is determined to be inaccurate, and the watermark segmentation image is discarded.

[0027] Optionally, the method further includes: preprocessing the watermark segmentation map, and then inputting the preprocessed watermark segmentation map into a classification network;

[0028] The preprocessing steps for the watermark segmentation image include:

[0029] Identify the location of watermarks in the watermark segmentation image, and use a rectangle to extract the image range corresponding to the location of the watermarks from the watermark segmentation image to obtain the preprocessed watermark segmentation image.

[0030] Optionally, both the first image feature and the second image feature are multi-level image features. The first image feature includes first spatial detail information and first semantic information, and the second image feature includes second spatial detail information and second semantic information.

[0031] Optionally, the first image features and the second image features have the same number of levels. The third watermark segmentation model fuses the first image features and the second image features to obtain the third image features. The step of obtaining the third segmented image based on the third image features includes:

[0032] By splicing the first and second image features at the same level, the spliced ​​features at the corresponding level are obtained;

[0033] The third image feature is obtained by fusing splicing features from multiple levels;

[0034] The third segmentation image is obtained based on the features of the third image.

[0035] To address the above problems, the present invention also provides a water stain detection system, the system comprising:

[0036] The acquisition module is used to acquire inspection images;

[0037] The first processing module is used to input the inspection image into the first watermark segmentation model, the first watermark segmentation model extracts the features of the inspection image to obtain the first image features, and outputs the first segmented image based on the first image features.

[0038] The second processing module is used to input the inspection image into the second watermark segmentation model, the second watermark segmentation model extracts the features of the inspection image to obtain the second image features, and outputs the second segmented image based on the second image features.

[0039] The third processing module is used to input the inspection image into the third watermark segmentation model. The third watermark segmentation model fuses the first image features and the second image features to obtain the third image features, and obtains the third segmented image based on the third image features.

[0040] The generation module is used to determine the water stain detection results of the inspection image based on the first segmented image, the second segmented image, and the third segmented image.

[0041] To address the above problems, the present invention also provides an electronic device, the electronic device comprising:

[0042] At least one processor; and,

[0043] A memory communicatively connected to the at least one processor; wherein,

[0044] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the watermark detection method described above.

[0045] To address the aforementioned problems, the present invention also provides a computer-readable storage medium storing at least one computer program, which is executed by a processor in an electronic device to implement the watermark detection method described above.

[0046] In summary, this application includes the following beneficial technical effects:

[0047] This application utilizes a first watermark segmentation model and a second watermark segmentation model with different frameworks to extract features from the inspection images: the first image segmentation result is obtained by analyzing the first image features, and the second image segmentation result is obtained by analyzing the second image features; the third image features integrate the first image features and the second image features, and utilize the advantages of the first and second watermark segmentation models to obtain a more accurate third image segmentation result; the final watermark detection result integrates the image features and detection results identified by multiple image segmentation models, reducing the possibility of missed or false watermark detections and improving the accuracy of watermark detection results. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 This is a schematic flowchart of a water stain detection method provided in an embodiment of the present invention;

[0049] Figure 2 This is a system architecture diagram of a water stain detection method provided in an embodiment of the present invention;

[0050] Figure 3 This is a schematic diagram of the structure of a third watermark segmentation model provided in an embodiment of the present invention;

[0051] Figure 4 This is a schematic diagram of water trace segmentation obtained after processing an inspection image using the first water trace segmentation model, the second water trace segmentation model, and the third water trace segmentation model in one embodiment of the present invention.

[0052] Figure 5 This is a schematic diagram of the structure of an electronic device for implementing the water stain detection method according to an embodiment of the present invention.

[0053] Reference numerals: 10, processor; 11, memory; 12, communication bus; 13, communication interface.

[0054] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0055] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0056] In the description of this invention, it should be understood that the terms "longitudinal", "lateral", "up", "down", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0057] In the description of this invention, unless otherwise specified and limited, it should be noted that the terms "installation", "connection" and "linking" should be interpreted broadly. For example, they can refer to mechanical or electrical connections, or internal connections between two components. They can be direct connections or indirect connections through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms according to the specific circumstances.

[0058] Reference Figure 1 The diagram shown is a schematic flowchart of a water stain detection method according to an embodiment of the present invention. In this embodiment, the water stain detection method includes:

[0059] S1. Obtain inspection images.

[0060] Specifically, inspection images can be obtained using intelligent video surveillance systems or inspection robots. The intelligent video surveillance system or inspection robot can be controlled to capture inspection images at a time period of T. Alternatively, the intelligent video surveillance system or inspection robot can capture monitoring videos and perform frame extraction processing on the monitoring videos to obtain several inspection images.

[0061] Inspection images can be imported via external devices (such as USB flash drives, portable hard drives, etc.) or read from storage devices or databases. This application does not restrict the method of acquiring inspection images.

[0062] S2. Input the inspection image into the first watermark segmentation model. The first watermark segmentation model extracts the features of the inspection image to obtain the first image features. Output the first segmented image based on the first image features.

[0063] S3. Input the inspection image into the second watermark segmentation model. The second watermark segmentation model extracts the features of the inspection image to obtain the second image features. Output the second segmented image based on the second image features.

[0064] In this embodiment, the first watermark segmentation model uses MASK-RCNN, and the second watermark segmentation model uses OpenSeeD. The MASK-RCNN network is used to extract features from the inspection image to obtain the first image features and the first segmented image; the OpenSeeD network is used to extract features from the inspection image to obtain the second image features and the second segmented image.

[0065] Mask-RCNN, short for Mask Region-based Convolutional Neural Network, is a deep learning model for object detection and instance segmentation. Mask-RCNN can generate binary masks of objects in an image while simultaneously detecting them, thus achieving accurate instance segmentation. The backbone of Mask-RCNN typically uses networks like ResNet to extract image features, and a Region Proposal Network (RPN) generates candidate regions for object detection. Classification and regression determine the location and category of each object. Based on object detection, it generates precise binary masks for each detected object, achieving pixel-level segmentation, such as segmenting watermarks in an inspection image.

[0066] OpenSeeD, short for Open Set of Diverse Domains for Scene Parsing, is a multi-task network based on the Twint Transformer that can simultaneously learn image features and language representations. This framework not only provides support for object recognition within standard categories but also enables semantic segmentation and object detection for unseen objects, achieving the identification and segmentation of watermark regions in inspection images.

[0067] S4. Input the inspection image into the third watermark segmentation model. The third watermark segmentation model fuses the first image features and the second image features to obtain the third image features. Based on the third image features, the third segmented image is obtained.

[0068] In this embodiment, the first image features and the second image features are fused using a third watermark segmentation model, and a third segmented image is obtained based on the third image features. Figure 2 The third watermark segmentation model includes a feature stitching module and a segmentation module. The feature stitching module is used to stitch together the first image features and the second image features according to preset rules to obtain the third image features. The segmentation module is used to segment the inspection image according to the third image features using a segmentation head (Seg-Head) to obtain the third segmented image.

[0069] The architecture of this application fully leverages the advantages of two advanced models, MASK-RCNN and OpenSeeD. OpenSeeD is capable of semantic segmentation and object detection for unseen objects and is suitable for watermark detection with uncertain shapes. Meanwhile, the features extracted by MASK-RCNN are more sensitive in distinguishing watermarks from the background and the internal details of watermarks. Therefore, the third watermark segmentation model integrates the advantages of the first and second watermark segmentation models, resulting in a more refined and robust segmentation effect.

[0070] In this embodiment, both the first image feature and the second image feature are multi-level image features. The first image feature includes first spatial detail information and first semantic information, and the second image feature includes second spatial detail information and second semantic information.

[0071] The backbone of Mask-RCNN has the same number of layers as the backbone of OpenSeeD. In neural network models, the backbone's role is to extract features.

[0072] Reference Figure 2 and Figure 3The first image feature and the second image feature have the same number of levels. The first image feature and the second image feature are fused to obtain the third image feature. The third segmented image is obtained based on the third image feature, including:

[0073] S41. By splicing the first image features and the second image features at the same level, the spliced ​​features at the corresponding level are obtained;

[0074] S42. The third image feature is obtained by fusing the splicing features of multiple levels;

[0075] S43. Obtain the third segmented image based on the features of the third image.

[0076] In short, refer to Figure 3 First, feature maps from each layer of the MASK-RCNN backbone network are extracted. These feature maps contain information ranging from low-level spatial details to high-level semantic information. Simultaneously, feature maps from the corresponding layers are extracted from the OpenSeeD backbone network. Before concatenating the first and second image features, the feature dimensions of each layer in either the MASK-RCNN or OpenSeeD backbone network are adjusted to ensure consistency in the feature dimensions of each set of first and second image features. Then, the two features are concatenated. In this embodiment, both the MASK-RCNN and OpenSeeD backbone networks have four layers. Therefore, in this embodiment, the feature maps from the four layers are concatenated separately to obtain four concatenated features. These four concatenated features are then fed into an enhanced feature pyramid network for feature fusion to obtain the third image feature. The third image feature combines the advantages of the first and second watermark segmentation models, thereby improving the accuracy of the segmentation results for the third segmented image.

[0077] The first, second, and third watermark segmentation models can employ pre-trained neural network models. These models can be trained using a training dataset, which includes various sample images taken at the factory with or without watermarks, along with corresponding labels. First, the first and second watermark segmentation models are trained using the training dataset. Then, the backbone network portions of the first and second watermark segmentation models are frozen, and finally, the third watermark segmentation model is trained using the training dataset.

[0078] In a preferred embodiment of this example, when training the third watermark segmentation model using the first and second image features, different weights can be set for the first and second image features, enabling the neural network model to better learn features meaningful for image segmentation. Furthermore, a dynamic weighting mechanism is employed for the first and second image features, allowing the weights of these features to be adaptively adjusted during training. This enables the neural network model to select feature maps that better reflect the information of the sample images based on their actual conditions, further improving the accuracy of the image segmentation results of the third watermark segmentation model. The selection of the weight parameters for the first and second image features is related to the color and shape of the target object in the sample image and the ambient light when the sample was captured. Users can formulate their own weight adjustment rules according to actual needs; this embodiment does not impose any restrictions.

[0079] It should be noted that, besides the combination of MASK-RCNN and OpenSeeD, other combinations can be used for the first and second watermark segmentation models. For example, MASK-RCNN and GroundingDINO can be used as the first and second watermark segmentation models, respectively. GroundingDINO is a zero-shot detection model that can generate object boxes and labels from text descriptions. It achieves object detection and segmentation in images by combining with the SAM (Segment Anything Model) model.

[0080] The preferred choice for selecting the first watermark segmentation model and the second watermark segmentation model is two neural models with different frameworks for image segmentation. Secondly, the feature extraction networks of the first watermark segmentation model and the second watermark segmentation model must have the same level and be compatible in size. Users can also choose other neural network models according to the above requirements, and this embodiment does not impose any restrictions.

[0081] S5. Determine the water stain detection results of the inspection image based on the first segmented image, the second segmented image, and the third segmented image.

[0082] Figure 4 This diagram illustrates the watermark segmentation obtained after processing the inspection image using the first, second, and third watermark segmentation models. Figure 4 Image (a) is the first segmented image obtained after processing by the first watermark segmentation model. Figure 4 Image (b) is the second segmented image obtained after processing by the second watermark segmentation model. Figure 4(c) is the third segmented image obtained by the third water stain segmentation model; the presence of water stains in the inspection image is determined based on the target objects identified by the first, second and third segmented images.

[0083] The water stain detection results include whether water stains are present in the inspection image or not. When the water stain detection result indicates that water stains are present in the inspection image, the information corresponding to the water stain detection result also includes the shooting location coordinates of the inspection image and the mask image of the water stain location in the inspection image, so that managers can locate the area where water stains appear in a timely manner.

[0084] Specifically, the steps for determining the watermark detection results of the inspection image based on the first segmented image, the second segmented image, and the third segmented image include:

[0085] S51. Analyze the first segmented image, the second segmented image, and the third segmented image respectively to obtain the analysis results.

[0086] Images in the first, second, and third segmented images where water traces are detected are denoted as water-trace segmented images, and images in the first, second, and third segmented images where water traces are not detected are denoted as water-free segmented images.

[0087] S52. Determine the water stain detection result based on the analysis results:

[0088] If the third segmented image is a water-free segmented image, and at least one of the first and second segmented images is a water-free segmented image, then the water detection result is that the inspection image is water-free.

[0089] If the third segmentation image is a segmentation image with watermarks, and the first and second segmentation images are both segmentation images without watermarks, then confidence filtering is performed first, and then the third segmentation image is input into the classification network. The classification network parses the third segmentation image and outputs the watermark detection result.

[0090] If the third segmented image is a water-marked segmented image, and at least one of the first and second segmented images is a water-marked segmented image, then it is determined whether the water-marked regions in the first and / or second segmented images are consistent with the water-marked regions in the third segmented image. If they are consistent, the water-marked detection result is that the inspection image has water marks. If they are inconsistent, confidence filtering is first performed, and the water-marked segment is input into the classification network. The classification network parses the water-marked segmented image and outputs the water-marked detection result.

[0091] To facilitate understanding by those skilled in the art, the method for determining whether the watermark region in the first segmented image and / or the second segmented image is consistent with the watermark region in the third segmented image is described below with specific examples.

[0092] The third segmented image is a segmented image with watermarks, and at least one of the first and second segmented images is a segmented image with watermarks. There are three possibilities:

[0093] The first scenario involves detecting watermarks in the first segmented image, the second segmented image, and the third segmented image.

[0094] The second scenario is that watermarks are detected in the first and third segmented images, but not in the second segmented image;

[0095] The third scenario is that watermarks are detected in the second and third segmented images, but not in the first segmented image;

[0096] The following example, using the first scenario, illustrates the method for determining whether the watermark regions in the first and / or second segmented images are identical to the watermark regions in the third segmented image:

[0097] S521. Confidence filtering is performed on the first segmented image, the second segmented image, and the third segmented image. The confidence filtering steps include:

[0098] Confidence scores are obtained for the first segmented image, the second segmented image, and the third segmented image, respectively.

[0099] The confidence score is used to characterize the probability of watermarks in an image. The first watermark segmentation model (or the second / third watermark segmentation model) outputs the recognition result of the segmented image, and also outputs the probability value corresponding to the recognition result. Based on the probability value of the recognition result, the confidence score of the segmented image with watermarks or without watermarks is obtained. By analyzing the value of the confidence score, it is determined whether the prediction result of the first watermark segmentation model (or the second / third watermark segmentation model) for watermarks in the inspection image is accurate.

[0100] The confidence score is compared with a preset score threshold: if the confidence score is greater than or equal to the preset score threshold, it is determined that there is water in the image; if the confidence score is less than the preset score threshold, it is determined that the segmentation result of the water-marked segmentation image is inaccurate and the image with low confidence is discarded.

[0101] S522. After the confidence filtering of the first, second, and third segmented images passes, non-maximum suppression is performed using the watermark coordinates of the first, second, and third segmented images to determine the boundary of the watermark region in the first segmented image (second segmented image / third segmented image), thereby obtaining the accurate watermark location region in the first segmented image (second segmented image / third segmented image). By comparing the boundary values ​​of the corresponding watermark location regions in the first, second, and third segmented images, it is determined whether the watermarks in the first, second, and third segmented images are in the same region, and the watermark detection result is obtained.

[0102] In a preferred embodiment of this example, before inputting the watermark segmentation map into the classification network, the watermark detection method further includes:

[0103] S501. Obtain the confidence score of the watermark segmentation map.

[0104] The confidence score is used to characterize the probability of watermarks being present in the watermark segmentation image. The first watermark segmentation model (or the second / third watermark segmentation model) outputs the recognition result of the segmented image, and also the probability value corresponding to the recognition result. Based on the probability value of the recognition result, the confidence score of the watermark segmented image or the watermark-free segmented image is obtained. By analyzing the value of the confidence score, it is determined whether the first watermark segmentation model (or the second / third watermark segmentation model) is accurate in predicting watermarks in the inspection image.

[0105] S502. Compare the confidence score with the preset score threshold:

[0106] If the confidence score is greater than or equal to the preset score threshold, it is determined that there is water in the image corresponding to the water stain segmentation map, and the water stain segmentation map is input into the classification network.

[0107] If the confidence score is less than the preset score threshold, the segmentation result of the watermark segmentation map is determined to be inaccurate, and the watermark segmentation map is discarded.

[0108] In a preferred embodiment of this application, the water stain segmentation image needs to be preprocessed before being input into the classification network, and then the preprocessed water stain segmentation image is input into the classification network.

[0109] The preprocessing steps for the watermark segmentation image include:

[0110] Identify the location of watermarks in the watermark segmentation image, and use a rectangle to extract the image range corresponding to the location of the watermarks from the watermark segmentation image to obtain the preprocessed watermark segmentation image.

[0111] In this embodiment, the method of cropping can be to determine the watermark region of the inspection image based on the mask image of the watermark segmentation map, take the smallest bounding rectangle of the watermark region corresponding to the inspection image, determine the range of the rectangle, and crop the watermark segmentation map; or the corresponding part of the watermark region in the watermark segmentation map can be determined by first binarizing the image and then extracting the largest connected region. This embodiment does not impose any restrictions.

[0112] In a preferred embodiment of this application, the classification network includes a first classification model and a second classification model. The processing steps of the classification network for watermark segmentation images are as follows:

[0113] S61. Input the watermark segmentation map into the first classification model. The first classification model parses the watermark segmentation map and outputs the prediction result of the first target category.

[0114] Specifically, the watermark segmentation image is either the first segmentation image, the second segmentation image, or the third segmentation image.

[0115] S62. Input the watermark segmentation map into the second classification model. The second classification model parses the watermark segmentation map and outputs the prediction result of the second target category.

[0116] S63. By voting on the prediction results of the first target category and the prediction results of the second target category through a decision forest, the final target classification prediction result is obtained;

[0117] Decision forest is an ensemble learning algorithm based on multiple decision trees. It improves the accuracy and robustness of classification or regression by combining the predictions of multiple decision trees. A decision forest consists of multiple decision trees, each of which is an independent classifier or regressor. In classification problems, decision forests use a voting mechanism to determine the final classification result; each decision tree provides a classification result for the input data, and the decision forest selects the category with the most votes as the final classification result. In regression problems, decision forests typically obtain the final prediction result by averaging the predictions of all decision trees, resulting in a high accuracy for the final target classification prediction.

[0118] S64. Determine the watermark detection result based on the final target classification prediction result.

[0119] The final watermark detection result integrates the detection results of multiple image segmentation models and target recognition models. Through different decision-making methods, it effectively solves the problems of missed detection and false detection in traditional watermark detection methods.

[0120] In some examples of this embodiment, the first classification model can be the YOLO model. YOLO stands for You Only Look Once, a deep learning model used for object detection and image segmentation. The YOLO model is renowned for its fast and accurate object detection performance and is widely used in real-time applications. In this embodiment, the YOLO model can be YOLOv8. The YOLO model can quickly identify the category of the target object in the pre-processed watermark segmentation model, improving the accuracy of the watermark detection results. The second classification model can use a traditional method—using the OpenCV library for object recognition, extracting the color and contour of the target object (watermark) in the image to determine whether watermarks exist. OpenCV stands for Open Source Computer Vision Library, an open-source computer vision library that provides a large number of image processing and computer vision algorithms. OpenCV object recognition refers to the process of using the OpenCV library for image processing to detect and identify specific target objects in images or videos.

[0121] In other examples of this embodiment, other target detection models can also be used to detect watermarks in the image; this embodiment does not impose any restrictions.

[0122] Based on the same inventive concept, an embodiment of the present invention provides a water stain detection system.

[0123] The water stain detection system of this invention can be installed in an electronic device. Depending on its function, the water stain detection system includes an acquisition module, a first processing module, a second processing module, a third processing module, and a generation module.

[0124] The acquisition module can acquire inspection images;

[0125] The first processing module can input the inspection image into the first water mark segmentation model, the first water mark segmentation model extracts the features of the inspection image to obtain the first image features, and outputs the first segmented image based on the first image features;

[0126] The second processing module can input the inspection image into the second watermark segmentation model, the second watermark segmentation model extracts the features of the inspection image to obtain the second image features, and outputs the second segmented image based on the second image features.

[0127] The third processing module can input the inspection image into the third watermark segmentation model. The third watermark segmentation model fuses the first image features and the second image features to obtain the third image features, and obtains the third segmented image based on the third image features.

[0128] The generation module can determine the water stain detection results of the inspection image based on the first segmented image, the second segmented image, and the third segmented image.

[0129] The module described in this invention can also be called a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can perform a fixed function, and are stored in the memory of the electronic device.

[0130] The various variations and specific examples of the water stain detection method provided in the above embodiments are also applicable to the water stain detection system of this embodiment. Through the foregoing detailed description of the water stain detection method, those skilled in the art can clearly understand the implementation method of the water stain detection system in this embodiment. For the sake of brevity, it will not be described in detail here.

[0131] This application also discloses an electronic device, such as Figure 5 The diagram shown is a structural schematic of an electronic device for a water stain detection method according to an embodiment of the present invention. The electronic device may include at least one processor 10, a memory 11 communicatively connected to the at least one processor, a communication bus 12, and a communication interface 13. It may also include a computer program, such as a water stain detection method program, stored in the memory 11 and executable on the processor 10.

[0132] In some embodiments, the processor 10 may be composed of integrated circuits, such as a single packaged integrated circuit or multiple integrated circuits with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 10 is the control unit of the electronic device, connecting various components of the entire electronic device through various interfaces and lines. It executes programs or modules stored in the memory 11 (e.g., methods for detecting watermarks) and calls data stored in the memory 11 to perform various functions and process data within the electronic device.

[0133] The memory 11 includes at least one type of readable storage medium, including flash memory, portable hard drive, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of an electronic device, such as a portable hard drive. In other embodiments, the memory 11 can be an external storage device of the electronic device, such as a plug-in portable hard drive, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc. Furthermore, the memory 11 can include both internal and external storage units of the electronic device. The memory 11 can be used not only to store application software and various types of data installed on the electronic device, such as the code of a watermark detection method program, but also to temporarily store data that has been output or will be output.

[0134] The communication bus 12 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into an address bus, a data bus, a control bus, etc. The bus is configured to enable communication between the memory 11 and at least one processor 10, etc.

[0135] Communication interface 13 is used for communication between the aforementioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a Wi-Fi interface, Bluetooth interface, etc.), typically used to establish communication connections between the electronic device and other electronic devices. The user interface may be a display, an input unit (such as a keyboard), or, optionally, a standard wired or wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen, etc. The display may also be appropriately referred to as a screen or display unit, used to display information processed in the electronic device and to display a visual user interface.

[0136] Figure 5 Only electronic devices with components are shown; it will be understood by those skilled in the art that... Figure 5The structure shown does not constitute a limitation on the electronic device and may include fewer or more components than shown, or combine certain components, or have different component arrangements. For example, although not shown, the electronic device may also include a power supply (such as a battery) to power the various components. Preferably, the power supply can be logically connected to at least one processor 10 through a power management device, thereby enabling functions such as charging management, discharging management, and power consumption management. The power supply may also include one or more DC or AC power supplies, recharging devices, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be described in detail here.

[0137] It should be understood that the embodiments are for illustrative purposes only and are not limited to this structure in the scope of the patent application.

[0138] Furthermore, if the modules / units integrated into the electronic device are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile.

[0139] This application provides a computer-readable storage medium, including, for example, any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, or a read-only memory (ROM). The computer-readable storage medium stores a computer program that can be loaded by a processor and execute the watermark detection method of the above embodiments.

[0140] In the description of this specification, the references to terms such as "an embodiment," "some embodiments," "example," "specific example," "a implementation," "a preferred implementation," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0141] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

Claims

1. A water mark detection method, characterized in that: Acquire inspection images; The inspection image is input into a first water mark segmentation model, the first water mark segmentation model extracts features of the inspection image to obtain first image features, and outputs a first segmented image according to the first image features; The inspection image is input into the second water mark segmentation model, the second water mark segmentation model extracts the features of the inspection image to obtain the second image features, and outputs the second segmented image according to the second image features, and the first water mark segmentation model and the second water mark segmentation model belong to different types; The inspection image is input into a third water mark segmentation model, the third water mark segmentation model fuses the first image feature and the second image feature to obtain a third image feature, and a third segmented image is obtained according to the third image feature; The water mark detection result of the inspection image is determined according to the first segmented image, the second segmented image and the third segmented image.

2. The water mark detection method according to claim 1, characterized in that: The method of determining the water mark detection result of the inspection image according to the first segmented image, the second segmented image and the third segmented image includes: The first segmented image, the second segmented image and the third segmented image are analyzed respectively to obtain analysis results, and images in which water marks are detected in the first segmented image, the second segmented image and the third segmented image are recorded as segmented images with water marks, and images in which water marks are not detected in the first segmented image, the second segmented image and the third segmented image are recorded as segmented images without water marks; Determine the water mark detection result based on the analysis result: If the third segmented image is a water-free segmented image, and at least one of the first segmented image and the second segmented image is a water-free segmented image, then the water-traces detection result is that the inspection image has no water-traces; If the third segmented image is a segmented image with water marks, and the first segmented image and the second segmented image are both segmented images without water marks, the third segmented image is input into the classification network, and the classification network analyzes the third segmented image and outputs the water mark detection result; If the third segmented image is a water mark segmentation map, and at least one of the first segmented image and the second segmented image is a water mark segmentation map, then determine whether the water mark area in the first segmented image and / or the second segmented image is consistent with the water mark area in the third segmented image. If they are consistent, the water mark detection result is that the inspection image has water marks. If they are inconsistent, the water mark segmentation map is input into the classification network, and the classification network parses the water mark segmentation map and outputs the water mark detection result.

3. The water mark detection method according to claim 2, characterized in that: The classification network includes a first classification model and a second classification model. The water mark segmentation image is the first segmentation image or the second segmentation image or the third segmentation image. The classification network processes the water mark segmentation image in the following steps: The water mark segmentation map is input into a first classification model, the first classification model analyzes the water mark segmentation map and outputs a first target category prediction result; The water mark segmentation map is input into a second classification model, and the second classification model analyzes the water mark segmentation map and outputs a second target category prediction result; The decision forest is used to vote on the prediction results of the first target category and the second target category to obtain the final target classification prediction result; The water mark detection result is determined based on the final target classification prediction result.

4. The water mark detection method according to claim 2, characterized in that: Before inputting the water mark segmentation map into the classification network, the method further includes: Obtain the confidence score of the water mark segmentation map, which is used to represent the probability of the existence of water marks in the water mark segmentation map; Compare the confidence score to a preset score threshold: If the confidence score is greater than or equal to the preset score threshold, it is determined that there are water marks in the image corresponding to the water mark segmentation map, and the water mark segmentation map is input into the classification network; If the confidence score is less than the preset score threshold, it is determined that the segmentation result of the water mark segmentation map is inaccurate, and the water mark segmentation map is discarded.

5. The water mark detection method according to claim 2, 3 or 4, characterized in that: The method further comprises: preprocessing the water mark segmentation map, and then inputting the preprocessed water mark segmentation map into a classification network; The steps for preprocessing the water mark segmentation map include: The water mark position in the water mark segmentation map is identified, and the image range corresponding to the water mark position is intercepted from the water mark segmentation map using a rectangular frame to obtain the preprocessed water mark segmentation map.

6. The water mark detection method according to any one of claims 1 to 4, characterized in that: The first image feature and the second image feature are both multi-level image features. The first image feature includes first spatial detail information and first semantic information, and the second image feature includes second spatial detail information and second semantic information.

7. The water mark detection method according to claim 6, characterized in that: The first image feature has the same number of layers as the second image feature, the third watermark segmentation model fuses the first image feature and the second image feature to obtain the third image feature, and the step of obtaining the third segmented image according to the third image feature includes: Splicing the first image feature and the second image feature at the same level to obtain a splicing feature at a corresponding level; The third image feature is obtained by fusing multiple levels of splicing features; A third segmented image is obtained according to the third image feature.

8. A water mark detection system, used to implement the water mark detection method according to any one of claims 1 to 7, characterized in that: include: An acquisition module, used for acquiring inspection images; A first processing module, used for inputting the inspection image into a first water mark segmentation model, the first water mark segmentation model extracts the features of the inspection image to obtain first image features, and outputs a first segmented image according to the first image features; A second processing module is used to input the inspection image into a second water mark segmentation model, the second water mark segmentation model extracts the features of the inspection image to obtain second image features, and outputs a second segmented image according to the second image features; A third processing module is used to input the inspection image into a third water mark segmentation model, the third water mark segmentation model fuses the first image feature and the second image feature to obtain a third image feature, and obtain a third segmented image according to the third image feature; The generating module is used to determine the water mark detection result of the inspection image according to the first segmented image, the second segmented image and the third segmented image.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor (10); and, a memory (11) communicatively connected to the at least one processor (10); The memory (11) stores a computer program executable by the at least one processor (10), and the computer program is executed by the at least one processor (10) so that the at least one processor (10) can execute the method for water mark detection as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer storage medium stores a computer program; when the computer program is executed by a processor, the water mark detection method according to any one of claims 1 to 7 is implemented.