An image recognition detection method and system based on weakly supervised learning

By generating pseudo-labels through point annotation, edge detection, and adaptive flood filling algorithms, and combining them with a visual converter for two rounds of training to optimize the saliency map, the problem of invalid objects that cannot be ignored in existing methods is solved, and efficient image recognition and detection is achieved.

CN117058515BActive Publication Date: 2026-01-02GUANGDONG TOBACCO SHANWEI CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310845346.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-10
Publication Date
2026-01-02
Estimated Expiration
2043-07-10

AI Technical Summary

Technical Problem

Existing weakly supervised learning-based image recognition and detection methods can only cover a portion of the image and cannot ignore invalid objects, resulting in low efficiency.

Method used

Initial pseudo-labels are generated by point annotation, edge detectors, and an adaptive flood filling algorithm. A point-supervised salient object detection model based on a visual converter is constructed and trained in two rounds to optimize the final salient map and suppress non-salient objects.

Benefits of technology

It achieves efficient image recognition and detection, can ignore invalid objects, and has strong supervision capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117058515B_ABST
    Figure CN117058515B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of object recognition, and discloses an image recognition detection method and system based on weak supervision learning, which comprises the following steps: S1, generating initial pseudo labels of a to-be-detected image through point annotation, an edge detector and a self-adaptive flood filling algorithm; S2, constructing a point supervision salient object detection model based on a visual converter; S3, performing the first round of training on the point supervision salient object detection model to obtain a final salient map; and S4, suppressing non-salient objects of the final salient map, performing the second round of training on the point supervision salient object detection model, and completing the recognition of the image. The application solves the problem that the existing image recognition detection technology can only cover part of an image, cannot ignore invalid objects, leads to low efficiency, and has the characteristics of strong supervision capability.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of object recognition, and more particularly, to an image recognition detection method and system based on weakly supervised learning. BACKGROUND

[0002] The environment and equipment of the tobacco manufacturing site are complex, and modern tobacco machine equipment is also upgraded with the progress of the times. Therefore, it is difficult to accurately determine the specific tobacco machine in the tobacco manufacturing site, so we need to identify the object recognition. Salient object detection (SOD) is a common means of object recognition, which aims to detect the most attractive regions in images or videos to mimic the human attention mechanism. It has received more and more attention in the field of image processing and can be further applied to various computer vision fields, such as object recognition, image captioning, and person re-identification. Fully supervised salient object detection models achieve excellent performance by relying on effectively designed modules. However, these methods heavily rely on large datasets with precise pixel-by-pixel annotations, which is a tedious and inefficient process.

[0003] A sparse labeling method has attracted increasing attention, which aims to achieve a balance between time consumption and performance. Some methods attempt to detect salient objects using image-level labels. Some methods train the network using noisy labels, which are usually generated by other SOD methods. The scribble annotation is proposed by reducing the labeling time consumption. In addition, it can provide local ground truth labels compared with previous methods.

[0004] With the development of weakly supervised learning in dense prediction tasks, some works attempt to use sparse annotations to obtain salient objects. Supervision by fusion: Towards unsupervised learning of deep salient object detector utilizes the fusion saliency maps provided by several unsupervised heuristic SOD methods as pseudo labels to train the final self-verification model, by merging a dense Conditional Random Field (CRF) as a post-processing step. Recently, Weakly-supervised salient object detection via scribble annotations proposed scribble annotations for saliency detection, which is a more user-friendly annotation method, where the edge map generated by an edge detector is used to provide structural information. In addition, Structure-consistent weakly-supervised salient object detection with local saliency coherence enhances the structural consistency of saliency maps by introducing salient structure consistency loss and gated CRF loss to improve the performance of the model on the writable dataset.

[0005] Regarding point annotation in weakly supervised segmentation, there are several works and instance segmentation. Semantic segmentation focuses on class-specific classes, but saliency detection does not focus on class properties, and often one object is important in one case and not important in another. That is, saliency detection is specifically used for contrast between objects and the current scene. Point-based instance segmentation methods are mainly used for interactive pipelines. The transformer for visual processing introduced from the transformer in natural language processing (NLP) has attracted widespread attention in multiple fields of computer vision. Vision Transformer (ViT) introduces a pure transformer model in computer vision tasks and achieves the state-of-the-art performance in image classification tasks. By using ViT as the backbone, Segmentation Transformer (SETR) adds a decoding head to generate the final segmentation result with minimal modification. Detection Transformer utilizes an encoder-decoder transformer and a standard convolutional network for object detection. Considering the scale difference between natural language and images, Weakly-Supervised Salient Object Detection With Saliency Bounding Boxes designs a shift window scheme to improve efficiency and accuracy.

[0006] Considering that the existing weakly supervised self-checker can only cover part of the image and cannot ignore invalid objects, resulting in low efficiency, how to invent an image recognition detection method and system based on weakly supervised learning is a technical problem that needs to be solved in the technical field. SUMMARY

[0007] In order to solve the problem that the existing image recognition detection technology can only cover part of the image and cannot ignore invalid objects, resulting in low efficiency, the present application provides an image recognition detection method and system based on weakly supervised learning, which has the characteristics of strong supervision ability.

[0008] In order to achieve the above-mentioned purpose of the present application, the technical solutions adopted are as follows:

[0009] An image recognition detection method based on weakly supervised learning, comprising the following steps:

[0010] S1, collecting images to be detected; generating initial pseudo labels of the images to be detected through point annotation, edge detector and adaptive flood fill algorithm;

[0011] S2, constructing a point supervision salient object detection model based on the above;

[0012] S3, inputting the image to be detected into the point supervision salient object detection model, combining the initial pseudo label of the image to be detected to perform the first round of training on the point supervision salient object detection model, and obtaining a final salient map;

[0013] S4, suppressing non-salient objects of the final salient map, performing the second round of training on the point supervision salient object detection model, optimizing the final salient map, and completing the recognition of the image.

[0014] Preferably, the initial pseudo label of the image to be detected is generated by point annotation, edge detector and adaptive flood fill algorithm, specifically:

[0015] S201, manually marking the image to be detected, and performing point annotation on different objects or objects in the image;

[0016] S202, using an edge detector to detect the edge map of the image to be detected: e = E(I), wherein E(·) represents the edge detector, I represents the image, and e represents the detected edge map;

[0017] S203, the labeled ground truth of I is represented as: Wherein S b And respectively represent the position coordinates of the background pixels and the Ith labeled salient object; the adaptive mask with a radius generated by the edge decoder is designed to change according to the size of the image;

[0018] The set of masks is defined as Wherein r(I) is the mask radius corresponding to the image I, C represents a circle with the above angle as the center and the above angle as the radius;

[0019] S204, the union of e and The union is According to the union, the image I is divided into a plurality of connected regions; the adaptive flood fill algorithm is used on the divided image I to obtain the initial pseudo label of the image to be detected:

[0020]

[0021] Wherein g represents the obtained initial pseudo label, and F(·) represents the adaptive flood fill algorithm.

[0022] Further, the radius r(I) of the adaptive mask is:

[0023]

[0024] Wherein h I And ω I respectively represent the length and width of the input image, and γ is a hyperparameter.

[0025] Further, in the step S204, the adaptive flood filling algorithm is used to obtain the initial pseudo label of the image to be detected, specifically:

[0026] S2101, set the starting annotation point as (x, y);

[0027] S2102, generate the pseudo label of the image I according to the adaptive flood filling algorithm starting from a starting annotation point of the image I: F((x, y), I, a), if the conditions x≥0 and x<width and y≥0 and y<height are met, and the conditions a<I(x, y)-old<b and I(x, y)=a are met, then update M(x, y) by ;

[0028] S2103, search the neighborhood of the starting annotation point and extract the nearby annotation points connected to it until the pseudo labels of all annotation points in multiple connected regions are filled: flood filling((x+1, y), I, a); flood filling((x-1, y), I, a); flood filling((x, y+1), I, a); flood filling((x, y-1), I, a);

[0029] S2104, fill the adaptive mask to obtain the initial pseudo label of the image to be detected.

[0030] Further, the point supervision salient object detection model comprises a visual converter and an edge preserving decoder.

[0031] The visual converter comprises an encoder, a convolutional neural network and a ResNet-50 network.

[0032] The edge map preserving decoder comprises a saliency decoder and an approximate edge detector; the saliency decoder is four cascaded convolutional layers.

[0033] The approximate edge detector is used to generate weakly labeled edges lacking structure and details.

[0034] Further, in the step S3, the image to be detected is input into the point supervision salient object detection model, and the pseudo label of the image to be detected is used for the first round of training to obtain a final salient map, specifically:

[0035] S301, input the image to be detected into the visual converter of the point supervision salient object detection model, extract the image features of the image to be detected through the convolutional neural network, record the image features through the ResNet-50 network, and input the position embedding and flattened features of the image features into the encoder to obtain the encoded features.

[0036] S302, input the encoding feature into the edge preserving decoder to obtain the explicit feature;

[0037] S303, combine the encoding feature and the explicit feature through the preserving encoder, the approximate edge detector generates edge structure according to the encoding feature and the explicit feature for the weak label lacking structure and details in the explicit feature, combine the edge structure with e to obtain the saliency map, and train the point supervised salient object detection model for the first round according to the saliency map and the initial pseudo label to obtain the final saliency map.

[0038] Further, in step S303, the edge structure is combined with the edge map generated by the real edge detector to obtain the final saliency map, specifically:

[0039] S3101, the output f of the approximate edge detector e = σ (cat (R, D)), where R is the encoding feature, D is the explicit feature, and σ represents a convolutional layer of the edge preserving decoder, and cat represents a merging operation;

[0040] S3102, merge f e with D, combine e, and pass through another two convolutional layers of the edge preserving decoder to obtain the saliency map.

[0041] Further, in step S4, the non-salient object of the final saliency map is suppressed, specifically:

[0042] S401, the salient object region P obtained by the adaptive flood fill algorithm f :

[0043] P f = F (S-S b , P 1st )

[0044] Where F () represents the adaptive flood fill algorithm, S represents the saliency map, and P 1st represents the final saliency map;

[0045] S402, perform an unfolding operation on P f to obtain an expanded region, assign the expanded region as an uncertain region, and assign the remaining region as a background region; record the uncertain region as P 2st , and use P 2st as the pseudo label for the second round of training.

[0046] Further, when performing the first round and the second round of training, a binary cross-entropy loss is used to constrain e:

[0047]

[0048] Where Lbce represents binary cross-entropy loss, y represents the ground truth, and r and c represent row and column coordinates; for the saliency decoder, partial cross-entropy loss and gated CRF loss are adopted; the partial binary cross-entropy loss focuses on the determined region and ignores the uncertain region:

[0049]

[0050] wherein L pbce represents partial cross-entropy loss, J is a marked region, g is a set ground truth, and s is a predicted saliency map;

[0051] The gated CRF is used in the loss function to obtain better object structure and edges:

[0052]

[0053] wherein L gcrf represents gated CRF loss, K i is an area covered by a k x k kernel around pixel i, and d(i,j) is defined as:

[0054] d(i,j) = |s i -s j |,

[0055] wherein s i , s j are saliency values of s at i and j positions, and || is L1 distance; f(i,j) is a Gaussian kernel bandwidth filter:

[0056]

[0057] wherein is a set normalization weight, IR() and PT() are RGB values and positions of image pixels, and σ PT and σ IR are set hyperparameters for controlling the scale of the Gaussian kernel;

[0058] The total loss function used in the first and second rounds of training is:

[0059] L = α1L bce + α2L pbce + α3L gcrf

[0060] wherein α1, α2, and α3 are weights.

[0061] An image recognition and detection system based on weakly supervised learning includes a pseudo-label generation module, a model construction module, a weakly supervised learning module, a non-salient object suppression module, and a detection and recognition module.

[0062] ​The pseudo label generation module is used for collecting an image to be detected; and initial pseudo labels of the image to be detected are generated through point annotation, edge detection, and a self-adaptive flood filling algorithm.

[0063] The model construction module is used for constructing a point supervision salient object detection model based on a visual transformer.

[0064] The weak supervision learning module is used for inputting the image to be detected into the point supervision salient object detection model, performing the first round of training on the point supervision salient object detection model in combination with the initial pseudo labels of the image to be detected, and obtaining a final salient map.

[0065] The non-salient object suppression module is used for suppressing non-salient objects of the final salient map, performing the second round of training on the point supervision salient object detection model, optimizing the final salient map, and completing the recognition of the image.

[0066] The present application has the following advantages:

[0067] The present application discloses an image recognition detection method based on weak supervision learning. The initial pseudo labels of the image to be detected are generated through point annotation, edge detection, and a self-adaptive flood filling algorithm. A point supervision salient object detection model based on a visual transformer is proposed. The image to be detected is input into the point supervision salient object detection model. The first round of training is performed on the point supervision salient object detection model in combination with the initial pseudo labels of the image to be detected. The final salient map is obtained. The non-salient objects of the final salient map are suppressed. The second round of training is performed on the point supervision salient object detection model. The final salient map is optimized. The recognition of the image is completed. The method proposed in the present application can ignore invalid objects, realize efficient image recognition detection, and has the characteristics of strong supervision ability. BRIEF DESCRIPTION OF DRAWINGS

[0068] Figure 1 is a flowchart of the image recognition detection method based on weak supervision learning of the present application.

[0069] Figure 2 is a network framework and learning strategy diagram of the image recognition detection method based on weak supervision learning of the present application in Example 2. The black flow lines represent the forward propagation of data in the model. The green flow lines represent the components used in only the first round of training. The blue flow lines are used in both the first round of training and the second round of training. The red flow lines are used only in the second round of training. The bidirectional arrow represents the weak supervision method. The purple box represents the self-adaptive flood filling. The red box represents the non-salient object suppression.

[0070] Figure 3is a schematic diagram of image processing of an image recognition detection method based on weakly supervised learning of the application in embodiment 2; wherein the lower left image is a saliency map after suppressing non-salient targets of the final saliency map, and the lower right image is an image output by an edge detector.

[0071] Figure 4 is a training effect diagram of an image recognition detection method based on weakly supervised learning of the application in embodiment 2; wherein the upper right image is a final saliency map obtained by the first round of training; the lower left image is a pseudo label obtained by the first round of training; and the lower right image is a final saliency map obtained by the second round of training. DETAILED DESCRIPTION

[0072] The application will be described in detail below in conjunction with the drawings and specific embodiments.

[0073] Embodiment 1

[0074] As shown in Figure 1 , an image recognition detection method based on weakly supervised learning comprises the following steps:

[0075] S1, collecting an image to be detected; generating an initial pseudo label of the image to be detected by point annotation, an edge detector and an adaptive flood fill algorithm;

[0076] S2, constructing a point supervision salient target detection model based on a visual transformer;

[0077] S3, inputting the image to be detected into the point supervision salient target detection model, and performing the first round of training on the point supervision salient target detection model in combination with the initial pseudo label of the image to be detected to obtain a final saliency map;

[0078] S4, suppressing non-salient targets of the final saliency map, performing the second round of training on the point supervision salient target detection model, optimizing the final saliency map, and completing the recognition of the image.

[0079] Embodiment 2

[0080] More specifically, as shown in Figure 2 , the image recognized in this embodiment is a cigarette machine image.

[0081] In one specific embodiment, the initial pseudo label of the image to be detected is generated by point annotation, an edge detector and an adaptive flood fill algorithm, specifically:

[0082] S201, manually marking the image to be detected, and performing point annotation on different objects or objects in the image;

[0083] S202, using an edge detector to detect the edge map of the image to be detected: e = E(I), wherein E(·) represents the edge detector, I represents the image, and e represents the detected edge map;

[0084] S203, the label of I is represented as: where S b and respectively represent the position coordinates of the background pixels and the Ith labeled salient object; an adaptive mask with a radius varying according to the image size is designed for the edge decoder to generate the adaptive mask;

[0085] A set of masks is defined as where r(I) is the mask radius corresponding to the image I, C represents a circle with the angle as the center and the angle as the radius;

[0086] S204, e and are obtained by According to the union, the image I is divided into multiple connected regions; an adaptive flood fill algorithm is used on the divided image I to obtain the initial pseudo label of the image to be detected:

[0087]

[0088] where g represents the obtained initial pseudo label, and F(·) represents the adaptive flood fill algorithm.

[0089] In one specific embodiment, the radius r(I) of the adaptive mask is:

[0090]

[0091] where h I and ω I are the length and width of the input image respectively, and γ is a hyperparameter.

[0092] In one specific embodiment, in the step S204, the adaptive flood fill algorithm is used on the divided image I to obtain the initial pseudo label of the image to be detected, specifically:

[0093] S2101, set the starting annotation point as (x, y);

[0094] S2102, according to the adaptive flood fill algorithm, the pseudo label of the image I is generated by filling from a starting annotation point of the image I: F((x, y), I, a), if the conditions x≥0 and x<width and y≥0 and y<height are met, and the conditions a<I(x, y)-old<b and I(x, y)=a are met, then M(x, y) is updated by

[0095] ​S2103, search the neighborhood of the starting annotation point, and extract the nearby annotation points connected to it until the pseudo labels of all annotation points in the multiple connected regions are filled: flood filling((x+1, y), I, a); flood filling((x-1, y), I, a); flood filling((x, y+1), I, a); flood filling((x, y-1), I, a);

[0096] S2104, fill the adaptive mask to obtain the initial pseudo label of the image to be detected.

[0097] In one specific embodiment, the point supervision salient object detection model comprises a visual transformer and an edge-preserving decoder.

[0098] The visual transformer comprises an encoder, a convolutional neural network, and a ResNet-50 network.

[0099] The edge map preserving decoder comprises a saliency decoder and an approximate edge detector; the saliency decoder is four cascaded convolutional layers.

[0100] The approximate edge detector is used to generate weakly labeled edges lacking structure and details.

[0101] In this embodiment, each convolutional layer is followed by a batch normalization (BN) layer, a ReLU activation layer, and an upsampling layer, which takes the features of the transformer encoder as input. The corresponding feature representation of each layer of the saliency decoder is denoted as D i | i = 1, 2, 3, 4}.

[0102] In this embodiment, the point supervision salient object detection model is implemented in the Pytorch package.

[0103] The visual transformer uses a super version transformer ("ResNet50+vvi-base") without any adjustment.

[0104] The embedding layer and the transformer encoder layer are initialized using the pre-trained weights provided by the visual transformer, which is pre-trained on ImageNet 21K. The maximum learning rate of the transformer part is 2.5x10 -4 , and the maximum learning rate of the other parts is 2.5x10 -3 . The learning rate is adjusted using a warm-up and linear decay strategy.

[0105] In one specific embodiment, in step S3, the image to be detected is input into the point supervision salient object detection model, and the first round of training is performed in combination with the pseudo label of the image to be detected to obtain the final saliency map, specifically:

[0106] S301. Input the image to be detected into a visual converter of a supervised salient target detection model, extract the image features of the image to be detected through a convolutional neural network; record the image features through a ResNet-50 network; embed the position of the image features into a flattened feature input encoder to obtain the encoded features;

[0107] In this embodiment, for an input image of size 3×H×W, the CNN embedding part generates... Feature maps. The multi-stage features of ResNet-50 are denoted as R = {R i |i=1,2,3,4,5}. Then, the converter encoder will Position embedding and The flattened features of the feature maps are summed as input. After 12 self-attention layers, the output characteristics of the converter encoder part are:

[0108] S302. Input the encoded features into the edge-preserving decoder to obtain the explicit features;

[0109] S303. By maintaining the encoder's combination of encoded features and explicit features, the approximate edge detector generates edge structures based on encoded features and explicit features for weak annotations lacking structure and detail in explicit features. The edge structures are combined with e to obtain a saliency map. The saliency map is combined with the initial pseudo-labels to perform the first round of training on the point-supervised salient target detection model to obtain the final saliency map.

[0110] In one specific embodiment, step S303 involves combining the edge structure with the edge map constraints generated by the real edge detector to obtain the final saliency map, specifically as follows:

[0111] S3101, Output f of the approximate edge detector e =σ(cat(R,D)), where R is the encoded feature, D is the explicit feature, σ represents one convolutional layer of the edge-preserving decoder, and cat represents the merging operation;

[0112] In this embodiment, the output of the approximate edge detector can be expressed as f e =σ(cat(R) 3 D 2 The convolutional layer is a 3×3 convolutional layer, and after convolution, it passes through BN and ReLU layers in sequence;

[0113] S3102, f e Combined with D, and then with e, the result is passed through two more convolutional layers of the edge-preserving decoder to obtain a saliency map.

[0114] In this embodiment, e can supervise the training process, thereby indirectly supplementing the prior knowledge of the structure.

[0115] In one specific embodiment, in step S4, the non-significant objects in the final saliency map are suppressed, specifically:

[0116] S401, the salient object region P obtained by the adaptive flood fill algorithm f :

[0117] P f = F(S-S b , P 1st )

[0118] Where F() represents the adaptive flood fill algorithm, S represents the saliency map, and P 1st represents the final saliency map;

[0119] In this embodiment,

[0120] S402, the expansion operation is performed on P f to obtain an expanded region The expanded region is designated as an uncertain region, and the remaining region is designated as a background region; the uncertain region is denoted as P 2st , and P 2st is used as a pseudo-label for the second round of training for training.

[0121] In this embodiment, considering that only the internal local label of the salient object is provided in the first round of training, which may cause the model to be unable to accurately distinguish the edges, the P f with a kernel size of 10 is expanded. The expanded region is designated as an uncertain region, and the remaining region is designated as a background region. This is denoted as P 2st , by reusing the position clues from the supervised points, the present application can successfully suppress the least significant objects by non-significant suppression.

[0122] In one specific embodiment, when performing the first and second rounds of training, a binary cross-entropy loss is used to constrain e:

[0123]

[0124] Where L bce represents the binary cross-entropy loss, y represents the benchmark truth, and r and c represent the row and column coordinates; for the saliency decoder, a partial cross-entropy loss and a gated CRF loss are used; the partial binary cross-entropy loss focuses on the determined region, and ignores the uncertain region:

[0125]

[0126] Where L pbce represents the partial cross-entropy loss, J is the labeled region, g is the set benchmark value, and s is the predicted saliency map.

[0127] Using gated CRF in the loss function, better object structure and edge are obtained:

[0128]

[0129] where L gcrf is the gated CRF loss, K i is the area covered by the k x k kernel around pixel i, and d(i,j) is defined as:

[0130] d(i,j) = |s i -s j |, i,j

[0131] where s i , s j are the saliency values of s at i,j position, and || is the L1 distance; f(i,j) is a Gaussian kernel bandwidth filter:

[0132]

[0133] where is the set normalization weight, IR() and P T() are the RGB values and position of the image pixel, and σ PT and σ IR are the set hyperparameters to control the scale of the Gaussian kernel.

[0134] The total loss function used in the first and second round of training is:

[0135] L = a1L bce + a2L pbce + a3L gcrf

[0136] where a1, a2, a3 are the weights. In this embodiment, a1, a2, a3 are all 1.

[0137] In this embodiment, the network is trained using Stochastic gradient descent (SGD) with the following hyperparameters: momentum = 0.9, weight decay = 5 x 10 -4 -3. Horizontal flipping and random cropping are used as data augmentation. The batch size is set to 28, and the first training process requires 20 epochs. The hyperparameter y of equation 1 is set to 5. The second round of training uses the same parameters, but the mask is replaced by the improved mask. In the testing process, we resize each image to 352 x 352 and then input it into our network to predict the saliency map.

[0138] The application discloses an image recognition detection method based on weakly supervised learning. The application generates initial pseudo labels of a to-be-detected image through point annotation, an edge detector and a self-adaptive flood filling algorithm; the application proposes a point supervision salient object detection model based on a visual transformer, inputs the to-be-detected image into the point supervision salient object detection model, performs first round training on the point supervision salient object detection model in combination with the initial pseudo labels of the to-be-detected image, obtains a final saliency map, suppresses non-salient objects of the final saliency map, performs second round training on the point supervision salient object detection model, optimizes the final saliency map and completes image recognition.

[0139] As Figure 3 It can be known that, due to the sparsity of labels, the model tends to detect non-salient objects.

[0140] As Figure 4 It can be known that, by means of the non-salient suppression method, the application can accurately extract a cigarette making machine and suppress non-salient objects around the cigarette making machine.

[0141] Embodiment 3

[0142] An image recognition detection system based on weakly supervised learning, comprising a pseudo label generation module, a model construction module, a weakly supervised learning module, a non-salient object suppression module and a detection and recognition module.

[0143] The pseudo label generation module is used for collecting a to-be-detected image; initial pseudo labels of the to-be-detected image are generated through point annotation, an edge detector and a self-adaptive flood filling algorithm.

[0144] The model construction module is used for constructing a point supervision salient object detection model based on a visual transformer.

[0145] The weakly supervised learning module is used for inputting the to-be-detected image into the point supervision salient object detection model, performing first round training on the point supervision salient object detection model in combination with the initial pseudo labels of the to-be-detected image and obtaining a final saliency map.

[0146] The non-salient object suppression module is used for suppressing non-salient objects of the final saliency map, performing second round training on the point supervision salient object detection model, optimizing the final saliency map and completing image recognition.

[0147] Obviously, the above-mentioned embodiments of the present application are only examples for clearly illustrating the present application, and are not intended to limit the implementation modes of the present application. Any modification, equivalent replacement and improvement, etc. within the spirit and principle of the present application should be included in the protection scope of the claims of the present application.

Claims

1. An image recognition and detection method based on weakly supervised learning, characterized in that: Includes the following steps: S1. Collect the image to be detected; generate initial pseudo-labels for the image to be detected through point annotation, edge detector, and adaptive flood filling algorithm; S2. Construct a point-supervised salient object detection model based on a visual converter; the point-supervised salient object detection model includes a visual converter and an edge-preserving decoder; the visual converter includes an encoder, a convolutional neural network, and a ResNet-50 network; the edge-preserving decoder includes a saliency decoder and an approximate edge detector; the saliency decoder is four cascaded convolutional layers; the approximate edge detector is used to generate weakly labeled edges that lack structure and detail; S3. Input the image to be detected into the point-supervised salient target detection model, and combine the initial pseudo-label of the image to be detected to perform the first round of training on the point-supervised salient target detection model to obtain the final salient map; S4. Suppress non-salient targets in the final saliency map, perform a second round of training on the point-supervised salient target detection model, optimize the final saliency map, and complete image recognition; the suppression of non-salient targets in the final saliency map specifically includes: S401. The significant target area obtained by the adaptive flood filling algorithm : in, This represents the adaptive flood fill algorithm, where S represents the saliency map. This represents the final saliency map; S402, To The expanded region is then designated as the uncertain region, and the remaining regions are designated as the background region. The uncertain region is denoted as... and will The pseudo-labels were used for training in the second round.

2. The image recognition and detection method based on weakly supervised learning according to claim 1, characterized in that: Initial pseudo-labels for the image to be detected are generated through point annotation, edge detection, and adaptive flood filling algorithm, specifically as follows: S201. Manually mark the image to be detected and annotate different objects or objects in the image. S202. Use an edge detector to detect the edge map of the image to be detected: ,in This indicates an edge detector. Represents an image. Represents the detected edge map; S203. The truth value of the marked I is represented as: S = { , | I = 1,...,N}, where and Let represent the position coordinates of the background pixel and the I-th salient marker, respectively; design an adaptive mask whose radius varies according to the image size for the edge decoder generation. Define the set of masks as ,in Let C be the mask radius corresponding to image I, and let C represent a circle with the lower corner as the center and the upper corner as the radius. S204, will and Union, ; Based on the union of the images Divide the image into multiple connected regions; for well-distinguished images An adaptive flood filling algorithm is used to obtain the initial pseudo-labels for the image to be detected: Where g represents the initial pseudo-label obtained, and F(·) represents the adaptive flood filling algorithm.

3. The image recognition and detection method based on weakly supervised learning according to claim 2, characterized in that: Radius of the adaptive mask for: in, and These are the length and width of the input image, respectively. It's a hyperparameter.

4. The image recognition and detection method based on weakly supervised learning according to claim 2, characterized in that: In step S204, the distinguished images are... An adaptive flood filling algorithm is used to obtain the initial pseudo-labels for the image to be detected, specifically: S2101, Let the starting annotation point be... ; S2102. Based on the adaptive flood filling algorithm, generate pseudo-labels for image I by filling in a starting annotation point: F If the conditions are met This condition, and it is satisfied. So through Update ; S2103. Search the neighborhood of the starting annotation point and extract the nearby annotation points connected to it, until the pseudo-labels of all annotation points in multiple connected regions are filled: ; ; ; ); S2104. Fill the adaptive mask to obtain the initial pseudo-label of the image to be detected.

5. The image recognition and detection method based on weakly supervised learning according to claim 2, characterized in that: In step S3, the supervised salient target detection model for the input points of the image to be detected is trained in the first round, combined with the pseudo-labels of the image to be detected, to obtain the final salient map, specifically as follows: S301. Input the image to be detected into a visual converter of a supervised salient target detection model, extract the image features of the image to be detected through a convolutional neural network; record the image features through a ResNet-50 network; embed the position of the image features into a flattened feature input encoder to obtain the encoded features; S302. Input the encoded features into the edge-preserving decoder to obtain the explicit features; S303. By maintaining the encoder's combination of encoded features and explicit features; the approximate edge detector generates edge structures based on encoded features and explicit features for weak annotations lacking structure and detail in explicit features; the edge structures are then combined. The saliency map is obtained, and the saliency map is combined with the initial pseudo-label to conduct the first round of training on the point-supervised salient target detection model to obtain the final saliency map.

6. The image recognition and detection method based on weakly supervised learning according to claim 5, characterized in that: In step S303, the edge structure is combined with the edge map constraints generated by the real edge detector to obtain the final saliency map, specifically as follows: S3101, Output of the Approximate Edge Detector ,in It is a dominant trait. This represents one convolutional layer of the edge-preserving decoder. Indicates a merge operation; S3102, will and The saliency map is obtained by merging and combining e, passing it through two more convolutional layers of the edge-preserving decoder.

7. The image recognition and detection method based on weakly supervised learning according to claim 2, characterized in that: In the first and second rounds of training, binary cross-entropy loss was used to constrain the training. : in, This represents the binary cross-entropy loss. Representing the benchmark truth, and Representing row and column coordinates; for the saliency decoder, partial cross-entropy loss and gated CRF loss are used; partial binary cross-loss focuses on the deterministic region while ignoring the uncertain region: in, This represents partial cross-entropy loss. The set baseline value, For predicting significance plots; Using gated CRF in the loss function yields better object structure and edges: in, Indicates the gated CRF loss. For pixels around The area covered by the kernel, d(i, j), is defined as: in , For s in , The significance value of the location, where || is the L1 distance; Gaussian kernel bandwidth filter: in For the set normalized weights, and For the RGB values ​​and positions of image pixels, and The hyperparameters used to control the Gaussian kernel scale; The total loss function used in the first and second rounds of training is: in It is the weight.

8. An image recognition and detection system based on weakly supervised learning, characterized in that: The method for implementing the method as described in any one of claims 1 to 7 includes a pseudo-label generation module, a model building module, a weakly supervised learning module, a non-saliency target suppression module, and a detection and recognition module; The pseudo-label generation module is used to collect images to be detected; and to generate initial pseudo-labels for the images to be detected through point annotation, edge detectors, and adaptive flood filling algorithms. The model building module is used to build a point-supervised salient object detection model based on a visual converter; The weakly supervised learning module is used to input the image to be detected into the point-supervised salient target detection model, and to perform the first round of training on the point-supervised salient target detection model in combination with the initial pseudo-label of the image to be detected, so as to obtain the final salient map. The non-saliency target suppression module is used to suppress non-saliency targets in the final saliency map, perform a second round of training on the point-supervised saliency target detection model, optimize the final saliency map, and complete image recognition.

Citation Information

Patent Citations

  • Method for realizing weak supervision image saliency detection by using detection frame

    CN111680702A

  • Weak supervision RGBD image saliency detection method and system based on image classification

    CN112861880A