Image containing detection method and apparatus
By fusing and analyzing the features of large and small images, the problem of low detection accuracy in traditional image detection methods is solved, and efficient detection of specified classified images is achieved.
Patent Information
- Application Number
- CN202210266449.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-17
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2042-03-17
AI Technical Summary
Traditional image detection methods rely on the parameters of convolutional and fully connected layers for accurate detection of specific classified images, resulting in poor detection performance.
By reading the features of large and small images, feature maps of preset sizes are extracted and analyzed separately. After fusion analysis, it is determined whether the large image contains the small image. Finally, convolutional and fully connected layers are used to generate the final result.
It enables efficient detection of designated classified images and improves the accuracy of detection.
Smart Images

Figure CN114596450B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image detection, and more particularly to an image inclusion detection method and apparatus. Background Technology
[0002] In many scenarios, it's necessary to identify whether an image contains classified information. Classification is defined as either content-related or designated-related. Content-related classification refers to the information conveyed within the image being classified. Designated-related classification refers to images that are subjectively deemed to be classified. Traditional detection methods analyze image content, making them ineffective for detecting images with designated-related classification. They rely on feature extractors and discriminators, which consist of convolutional and fully connected layers. The extracted feature maps and outputs depend on the parameters of these convolutional and fully connected layers. Therefore, the extractor and discriminator directly impact the accuracy of the entire detection algorithm. Summary of the Invention
[0003] The purpose of this invention is to design an image inclusion detection method and apparatus to solve the above-mentioned problems.
[0004] The present invention achieves the above objectives through the following technical solutions:
[0005] Image inclusion detection methods include:
[0006] S1. Read the large and small images to be processed;
[0007] S2. Extract the large-image features of the large image and the small-image features of the small image respectively;
[0008] S3. Analyze the features of the large image to obtain a large feature map of a preset size, and analyze the features of the small image to obtain a small feature map of a preset size.
[0009] S4. Merge and analyze large and small feature maps to obtain new feature maps;
[0010] S5. Determine whether the large image contains the small image based on the new feature map.
[0011] The beneficial effect of this invention is that it enables the detection of specified classified images. Attached Figure Description
[0012] Figure 1 This is a schematic flowchart of the image inclusion detection method of the present invention;
[0013] Figure 2 This is a schematic diagram of large and small feature maps in the image inclusion detection method of the present invention;
[0014] Figure 3 This is a schematic diagram of the image inclusion detection method of the present invention taking the maximum value in step S3;
[0015] Figure 4 This is a schematic diagram of the image inclusion detection method of the present invention, which takes the average value in step S3;
[0016] Figure 5 This is a schematic diagram of the fusion analysis in the image inclusion detection method of the present invention;
[0017] Figure 6 This is a schematic diagram of step S5 in the image inclusion detection method of the present invention. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0019] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0020] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0021] In the description of this invention, it should be understood that the terms "upper," "lower," "inner," "outer," "left," "right," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship commonly used when the product of this invention is in use, or the orientation or positional relationship commonly understood by those skilled in the art. They are only used to facilitate the description of this invention and to simplify the description, and are not intended to 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.
[0022] Furthermore, the terms "first," "second," etc., are used only to distinguish descriptions and should not be interpreted as indicating or implying relative importance.
[0023] In the description of this invention, it should also be noted that, unless otherwise explicitly specified and limited, terms such as "set" and "connection" should be interpreted broadly. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium; it can be a connection within two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0024] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0025] Image inclusion detection methods include:
[0026] S1. Read the large and small images to be processed.
[0027] S6. Preprocess the large and small images to be processed, specifically including:
[0028] S61. Determine if the data can be read normally. If it can, proceed to S62; otherwise, output the error message.
[0029] S62. Read the specific pixel values of the image. If it is a grayscale image, expand it into a 3-channel color image.
[0030] S63. Normalize and center the pixel values of the image, normalizing them to... Centralized , where x is the original pixel value.
[0031] S2. Extract the large image features of the large image and the small image features of the small image respectively. The extracted large image features include 64 feature maps, which are divided into 2 groups of 32 feature maps each. The extracted small image features include 2 feature maps, which are divided into 2 groups of 1 feature map each.
[0032] S3. Analyze the large image features to obtain a large feature map of a preset size, and analyze the small image features to obtain a small feature map of a preset size. Specifically, this includes: filtering and analyzing the large image features and small image features respectively, expressed as s=ceil((index+1.0)*in_size / out_size)-floor(index*in_size / out_size), where in_size is the input size of the large or small image features, out_size is the size of the large or small feature map, and index is the output feature index; the first set of feature maps selects the maximum value of each sliding window as the feature value of the current window, x'=max(x1,x2,x3,x4); the second set of feature maps selects the average value of each sliding window as the feature value of the current window, x'=mean(x1,x2,x3,x4).
[0033] S4. Merge and analyze large and small feature maps to obtain new feature maps. Specifically, this includes: subtracting the first set of feature maps of the small feature map from the first set of feature maps of the large feature map to obtain the first feature map, and subtracting the second set of feature maps of the small feature map from the second set of feature maps of the large feature map to obtain the second feature map. The new feature map includes the first feature map set and the second feature map set.
[0034] S5. Determine whether a larger image contains a smaller image based on the new feature map. Specifically, this includes calculating the distance between the larger and smaller feature maps based on the new feature map to determine whether the larger image contains the smaller image, and outputting a floating-point number between 0 and 1, where the floating-point number represents the probability of inclusion. Figure 6 As shown, a new 64-layer fused feature map is generated by performing multiple convolutions on the new feature map using convolutional groups. Global max pooling is used to extract one feature from each layer. After obtaining 64 feature values, they are input into the fully connected layer. Finally, one feature value is output and the result is converted to 0-1 using sigmoid activation.
[0035] The image inclusion detection device includes a storage unit and a processor. The storage unit stores a program, and the processor executes the program to implement the steps of the image inclusion detection method described above.
[0036] The technical solutions of the present invention are not limited to the specific embodiments described above. Any technical modifications made in accordance with the technical solutions of the present invention fall within the protection scope of the present invention.
Claims
1. A method of inclusion detection of an image, characterized in that, Comprise: S1, read the large image and small image to be processed; S2, respectively extract the large image features and small image features of the large image; Specifically, the extracted large image features include 64 layer feature maps, the large image features are divided into 2 groups, each group has 32 layer feature maps, the extracted small image features include 2 layer feature maps, and the small image features are divided into 2 groups, each group has 1 layer feature map; S3, analyze the large image features to obtain a large feature map of a preset size, and analyze the small image features to obtain a small feature map of a preset size; Specifically, the sliding window s of the large image features and the small image features is analyzed and selected, which is represented as s = ceil((index+1.0)*in_size / out_size)-floor(index*in_size / out_size), wherein in_size is the input size of the large image features or the small image features, out_size is the size of the large feature map or the small feature map, and index is the output feature index; The maximum value of each sliding window is selected as the feature value of the current window for the first group of feature maps; The average value of each sliding window is selected as the feature value of the current window for the second group of feature maps; S4, fuse and analyze the large feature map and the small feature map to obtain a new feature map; Specifically, the first group of feature maps of the large feature map is subtracted from the first group of feature maps of the small feature map to obtain a first feature map, and the second group of feature maps of the large feature map is subtracted from the second group of feature maps of the small feature map to obtain a second feature map, and the new feature map includes the first feature map group and the second feature map group; S5, determine whether the large image contains the small image according to the new feature map; Specifically, the distance between the large feature map and the small feature map is calculated according to the new feature map to determine whether the large image contains the small image, and a floating point number of 0-1 is output, which represents the possibility of containing.
2. The method of claim 1, wherein, Between S1 and S2, S6 is further included, which is pre-processing the large image and the small image to be processed, specifically including: S61, determine whether it can be normally read, if yes, go to S62; Otherwise, output an exception message; S62, read the specific pixel value of the picture, if it is a gray image, expand it into a 3-channel color image; S63, normalizing and centering the pixel values of the image, normalizing to , and centering to , where x is the original pixel value.
3. Image containing detection device, characterized in that The storage and the processor, the storage is used for storing programs, the processor executes the programs to realize the steps of the image containing detection method of any one of claims 1-2.
Citation Information
Patent Citations
Sea surface remote sensing image ship detection method based on a feature pyramid
CN109800716A
Target detection method, computer equipment and storage medium
CN111881996A