Target detection method, device and electronic system

By extracting image features and performing feature enhancement on relevant areas, the problem of background information interference in the existing technology is solved, and the accuracy of target detection is improved. It is especially suitable for targets with changeable shapes or large differences in contours.

CN112766272BInactive Publication Date: 2024-10-15MEGVII (BEIJING) TECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110059475.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-15
Publication Date
2024-10-15
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When existing target detection methods deal with targets with variable shapes or large differences in contours, it is easy to introduce a large amount of background information, resulting in a decrease in detection accuracy.

Method used

By extracting image features, the polygonal area related to the edge shape of the target object is determined, and the features of this area are enhanced to reduce background information interference and improve detection accuracy.

Benefits of technology

It effectively reduces the interference of background information in the detection process and improves the accuracy of target detection, especially in the detection of targets with variable shapes or large contour differences.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112766272B_ABST
    Figure CN112766272B_ABST
Patent Text Reader

Abstract

The present invention provides a target detection method, device and electronic system, which extracts the image features of an image to be processed; based on the image features, determines the image region containing the target object in the image to be processed; the edge shape of the image region is related to the edge shape of the target object, and the area occupied by the target object is smaller than the image region; performs feature enhancement processing on the regional features corresponding to the image region in the image features to obtain the processed image features; based on the processed image features, detects the target object. This method can be understood as pre-segmenting the target object roughly to obtain the image region containing the target object; then performing feature enhancement processing on the regional features corresponding to the image region in the image features; this method can strengthen the object features of the target object, and then weaken the features of the background region in the image, reduce the interference of background information in the process of detecting the target, and improve the accuracy of target detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a target detection method, device and electronic system. Background Art

[0002] In related technologies, target detection tasks usually use a rectangular frame to locate the target, and then identify the category of the target within the rectangular frame. For targets with standard shapes or standard contours, such as faces, cars, and pedestrians, the target detection results of this method are relatively accurate; however, for targets with variable shapes or large contour differences, such as piles of debris and piles of various objects, a large amount of background information will be introduced when detecting the target through a rectangular frame. This background information will interfere with target detection and affect the accuracy of target detection. Summary of the invention

[0003] In view of this, an object of the present invention is to provide a target detection method, device and electronic system to improve the accuracy of target object detection.

[0004] In a first aspect, an embodiment of the present invention provides a target detection method, the method comprising: extracting image features of an image to be processed; based on the image features, determining an image area in the image to be processed that contains a target object; wherein an edge shape of the image area is related to an edge shape of the target object, and an area occupied by the target object is smaller than the image area; performing feature enhancement processing on regional features corresponding to the image area in the image features to obtain processed image features; and detecting the target object based on the processed image features.

[0005] Furthermore, based on the image features, the step of determining the image region containing the target object in the image to be processed includes: inputting the image features into a pre-trained region segmentation network, and outputting a region mask image; wherein, in the region mask image, the pixel values ​​of the pixel positions within the image region are first pixel values; and the pixel values ​​of the pixel positions outside the image region are second pixel values; based on the region mask image, determining the image region containing the target object.

[0006] Furthermore, the image region includes: a polygonal region related to the edge shape of the target object.

[0007] Furthermore, the training samples used for training the region segmentation network include sample images and annotation information of the sample images; the annotation information includes: polygon identification of the image region containing the target object in the sample image.

[0008] Furthermore, the step of performing feature enhancement processing on the regional features corresponding to the image area in the image features to obtain the processed image features includes: obtaining a regional mask image indicating the image area; wherein, in the regional mask image, the pixel values ​​of the pixel positions within the image area are first pixel values; and the pixel values ​​of the pixel positions outside the image area are second pixel values; and for each pixel position, multiplying the feature value at the pixel position in the image features by the pixel value at the pixel position in the regional mask image to obtain the processed image features.

[0009] Furthermore, after the step of obtaining a regional mask image indicating an image region, the method further includes: if the scale of the regional mask image is different from the scale of the image feature, adjusting the scale of the regional mask image so that the scale of the regional mask image is the same as the scale of the image feature.

[0010] Furthermore, the above method also includes: if the image feature includes multiple channels, for each channel, executing the step of multiplying the feature value at the pixel position in the image feature with the pixel value at the pixel position in the regional mask image for each pixel position to obtain the processed image feature.

[0011] Furthermore, based on the processed image features, the step of detecting the target object includes: inputting the processed image features into a pre-trained target detection network, and outputting the target detection result; the target detection result includes: a rectangular frame mark indicating the location of the target object, and the category of the target object.

[0012] In a second aspect, an embodiment of the present invention provides a target detection device, which includes: an extraction module for extracting image features of an image to be processed; a determination module for determining, based on the image features, an image area in the image to be processed that contains a target object; wherein an edge shape of the image area is related to an edge shape of the target object, and an area occupied by the target object is smaller than the image area; a detection module for performing feature enhancement processing on area features corresponding to the image area in the image features to obtain processed image features; and detecting the target object based on the processed image features.

[0013] In a third aspect, an embodiment of the present invention provides an electronic system, the electronic system comprising: a processing device and a storage device; a computer program is stored on the storage device, and the computer program executes a target detection method as any one of the first aspects when the processed device is running.

[0014] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processing device, the steps of the target detection method as described in any one of the items in the first aspect are executed.

[0015] The embodiments of the present invention bring the following beneficial effects:

[0016] The embodiment of the present invention provides a target detection method, device and electronic system, which extracts the image features of the image to be processed; based on the image features, determines the image area containing the target object in the image to be processed; the edge shape of the image area is related to the edge shape of the target object, and the area occupied by the target object is smaller than the image area; performs feature enhancement processing on the regional features corresponding to the image area in the image features to obtain the processed image features; based on the processed image features, detects the target object. In this method, the edge shape of the image area containing the target object is related to the edge shape of the target object, and the area occupied by the target object is smaller than the image area; this method can be understood as pre-segmenting the target object based on the edge of the target object to obtain the image area containing the target object; and then performs feature enhancement processing on the regional features corresponding to the image area in the image features; this method can strengthen the object features of the target object, and then weaken the features of the background area in the image, reduce the interference of background information in the process of detecting the target, and improve the accuracy of target detection.

[0017] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.

[0018] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.

[0020] Figure 1 A schematic diagram of the structure of an electronic system provided by an embodiment of the present invention;

[0021] Figure 2 A flow chart of a target detection method provided by an embodiment of the present invention;

[0022] Figure 3 A flowchart of another target detection method provided by an embodiment of the present invention;

[0023] Figure 4A schematic diagram of a regional mask image provided by an embodiment of the present invention;

[0024] Figure 5 A schematic diagram of an image of a training sample provided by an embodiment of the present invention;

[0025] Figure 6 A flowchart of another target detection method provided by an embodiment of the present invention;

[0026] Figure 7 A flowchart of a network training method provided by an embodiment of the present invention;

[0027] Figure 8 A schematic diagram of the structure of a target detection device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0029] In the related art, the target detection method usually uses a rectangular frame parallel to the x-axis and the y-axis to locate the target. In addition, the same method is used to annotate the target when annotating the data. This method has good detection results for targets with standard shapes or standard contours such as faces, cars, pedestrians, etc., because the features of these targets are relatively uniform and the morphological performance of the entire target will not differ too much; however, when this method is migrated to more general target detection, such as piles of debris and accumulations of various objects in urban management applications; since the shapes of debris piles vary greatly, a large amount of background information will be introduced when detecting targets through rectangular frames, and this background information will interfere with target detection and affect the accuracy of target detection.

[0030] Based on this, an embodiment of the present invention provides a target detection method, device and electronic system. This technology can be applied to application scenarios in which target objects are detected or identified from original images, such as detecting the categories of main objects and foreground objects in original images; for example, in satellite image analysis application scenarios, buildings, roads, and forests are identified in satellite images; in medical image analysis application scenarios, lesions are located in medical images, areas are measured, etc.; in intelligent transportation application scenarios, road information is identified, including lane markings, traffic signs, etc.

[0031] Embodiment 1:

[0032] First, refer to Figure 1An exemplary electronic system 100 for implementing the target detection method, apparatus, and electronic system according to the embodiments of the present invention is described.

[0033] like Figure 1 The electronic system 100 includes one or more processing devices 102, one or more storage devices 104, an input device 106, an output device 108, and may also include one or more image acquisition devices 110. These components are interconnected through a bus system 112 and / or other forms of connection mechanisms (not shown). It should be noted that Figure 1 The components and structure of the electronic system 100 shown are merely exemplary and non-limiting. The electronic system may also have other components and structures as required.

[0034] The processing device 102 can be a gateway, or a smart terminal, or a device including a central processing unit (CPU) or other forms of processing units with data processing capabilities and / or instruction execution capabilities. It can process data of other components in the electronic system 100 and control other components in the electronic system 100 to perform desired functions.

[0035] The storage device 104 may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processing device 102 may run the program instructions to implement the client functions and / or other desired functions in the embodiments of the present invention (implemented by the processing device) described below. Various applications and various data, such as various data used and / or generated by the application, may also be stored in the computer-readable storage medium.

[0036] The input device 106 may be a device used by a user to input instructions, and may include one or more of a keyboard, a mouse, a microphone, a touch screen, and the like.

[0037] The output device 108 may output various information (eg, images, data, or sounds) to the outside (eg, a user), and may include one or more of a display, a speaker, and the like.

[0038] The image acquisition device 110 can acquire preview video frames or picture data (such as images to be processed or target video frames), and store the acquired preview video frames or image data in the storage device 104 for use by other components.

[0039] Exemplarily, the components in the example electronic system for implementing the target detection method, device and electronic system according to the embodiment of the present invention can be integrated or dispersed, such as integrating the processing device 102, the storage device 104, the input device 106 and the output device 108 into one, and setting the image acquisition device 110 at a specified position where the image can be acquired. When the components in the above electronic system are integrated, the electronic system can be implemented as a smart terminal such as a camera, a smart phone, a tablet computer, a computer, a vehicle-mounted terminal, a camera, etc.

[0040] Embodiment 2:

[0041] The embodiment of the present invention provides a target detection method, such as Figure 2 As shown, the method comprises the following steps:

[0042] Step S202, extracting image features of the image to be processed;

[0043] The above-mentioned image to be processed usually refers to an image to be detected, which may be an image containing targets with variable shapes, large contour differences or irregular shapes, such as images containing targets such as piles of debris (garbage piles, express piles, etc.), piles of various objects (pile of scattered toys, books, etc.), irregularly placed objects (disorderly bicycles, etc.). The above-mentioned image features may refer to high-dimensional feature data of the image to be processed, which usually include detailed features of the image to be processed; specifically, the image to be processed (also referred to as the original image) may be input into a feature extraction network, and the image features of the image to be processed may be output; the feature extraction network may be a backbone network (Backbone), such as a backbone network such as ResNet-50 (deep residual network), or a backbone network based on a convolutional neural network (CNN Backbone, Convolutional Neural Networks Backbone). Image features are usually feature data of higher dimensions, such as 64 channels or 128 channels; the dimensions of image features may be set according to actual needs, or automatically set according to the features of the original image.

[0044] Step S204, based on the image features, determining an image region containing the target object in the image to be processed; wherein the edge shape of the image region is related to the edge shape of the target object, and the region occupied by the target object is smaller than the image region;

[0045] The above-mentioned image area can be an area containing the target object. Specifically, in order to prevent the image area from containing too much background information, the edge shape of the image area is similar to the edge shape of the target object. For example, if the target object is an ellipse, then the edge shape of the image area is an ellipse. In addition, in order to enable the image area to completely contain the target object without losing any information about the target object, the area occupied by the target object is smaller than the image area. It can be understood that the edge characteristics of the image area are not required to completely fit the contour of the target object, but only need to roughly contain the main information of the target object. The above-mentioned image area can be a single-channel image.

[0046] Specifically, based on the preset polygon detection rules, the region of the target object in the extracted image features can be detected to obtain the image region containing the target object; the image features can also be input into the image segmentation network, and based on the image segmentation method (such as a threshold-based segmentation method, a region-based segmentation method, an edge-based segmentation method, etc.), the image features are divided into multiple regions, and the region containing the target object is the image region. The image segmentation network is a pre-trained network.

[0047] Step S206, performing feature enhancement processing on the regional features corresponding to the image region in the image features to obtain processed image features; and detecting the target object based on the processed image features.

[0048] The above-mentioned feature enhancement processing can be to perform mathematical operations on the regional feature data of the image area to enhance the features of the area occupied by the target object in the image to be processed, for example, multiplying the feature data of the edge feature with a preset value (such as 1, 1.2, etc.) to increase the pixel value of each pixel position in the image area, so that the target object in the image to be processed is more prominent; the edge features (usually background information) other than the regional features of the image area in the image features can also be subjected to feature weakening processing, for example, multiplying the feature data of the edge feature with 0 to reduce the pixel value of each pixel position in the image background, thereby highlighting the target object in the image to be processed.

[0049] Specifically, if the above-mentioned image features can be high-dimensional image features, for the image features of each channel, feature enhancement processing is performed on the regional features corresponding to the image region in the image features to obtain the processed image features of the channel, and the image features of each channel are added to finally obtain the processed image features. The processed image features have the same scale as the original image, and the processed image features only contain the regional features where the target object is located, and a small amount of background information is contained at the edge of the regional features where the target object is located.

[0050] The above-mentioned detection of the target object may specifically be to input the processed image features into the target identification and classification network, and detect and identify the category of the target object and other information for the enhanced image area in the image features; specifically, the result of detecting the target object includes the original image, the region identification frame of the target object in the original image (for example, including the target object rectangular frame, including the edge contour frame of the target object, etc.), and the category of the target object in the original image and other information. The target identification and classification network is a pre-trained network.

[0051] The embodiment of the present invention provides a target detection method, which extracts image features of an image to be processed; based on the image features, determines the image region containing the target object in the image to be processed; wherein the edge shape of the image region is related to the edge shape of the target object, and the region occupied by the target object is smaller than the image region; performs feature enhancement processing on the region features corresponding to the image region in the image features to obtain processed image features; and detects the target object based on the processed image features. In this method, the edge shape of the image region containing the target object is related to the edge shape of the target object, and the region occupied by the target object is smaller than the image region; this method can be understood as pre-segmenting the target object based on the edge of the target object to obtain the image region containing the target object; and then performs feature enhancement processing on the region features corresponding to the image region in the image features; this method can strengthen the object features of the target object, and then weaken the features of the background region in the image, reduce the interference of background information in the process of detecting the target, and improve the accuracy of target detection.

[0052] Embodiment three:

[0053] The embodiment of the present invention further provides another target detection method, which is implemented on the basis of the above embodiment; this embodiment focuses on describing the specific implementation method of the step of determining the image area containing the target object in the image to be processed based on the image features (implemented by steps S304-S306); Figure 3 As shown, the method comprises the following steps:

[0054] Step S302, extracting image features of the image to be processed;

[0055] Step S304, inputting the image features into a pre-trained region segmentation network, and outputting a region mask image; wherein, in the region mask image, the pixel values ​​of the pixel positions within the image region are the first pixel values; and the pixel values ​​of the pixel positions outside the image region are the second pixel values;

[0056] The above-mentioned pre-trained region segmentation network can identify the position information of the image region in the image features, as well as the edge shape of the image region and mark them; the above-mentioned regional mask image can also be called mask, including two areas, and the pixel values ​​of the pixels in each area are different; and the pixel values ​​of the pixels in the regional mask image usually include two types, namely the above-mentioned first pixel value and the second pixel value, wherein the pixel value of the pixel position within the image area is the first pixel value, and the first pixel value can be 1, and the pixel value of the pixel position outside the image area is the second pixel value, and the second pixel value can be 0; of course, the first pixel value and the second pixel value can also be other values, such as the first pixel value can be 2, the second pixel value can be 1, etc.; the values ​​of the first pixel value and the second pixel value are mainly used to distinguish between image areas and non-image areas.

[0057] Specifically, the image features can be input into a pre-trained region segmentation network, and based on the convolution layer and the convolution kernel in the region segmentation network, the edge contour of the target object in the image features is calculated, and the edge contour of the target object is marked (such as marking lines) to obtain the image area. At the same time, the pixel values ​​of the pixel positions in the image area are set to the first pixel values, and the pixel values ​​of the pixel positions outside the image area are set to the second pixel values. The image features with the set pixel values ​​are determined as the regional mask image to enhance the feature representation of the image area, and the regional mask image is output.

[0058] The above-mentioned image regions include: polygonal regions related to the edge shape of the target object; for example Figure 4 The region mask image shown, Figure 4 (a) is the image to be processed, where the target object is irregularly stacked cartons. Figure 4 (b) is the output regional mask image, where the white area is the image area, the first pixel value is 1, the black area is the area outside the image area, and the second pixel value is 0; Figure 4 It can be seen that the image region includes a polygonal region associated with the edge shape of the target object.

[0059] In addition, the training samples used for training the region segmentation network include sample images and annotation information of the sample images; the annotation information includes: polygon identification of the image region containing the target object in the sample image.

[0060] For example Figure 5 The training sample shown in the figure, where the target object in the sample image is irregularly stacked cartons, and the annotation information of the sample image is the polygon shown by the black line in the figure, which is the polygon mark of the image area of ​​the above target object. Its main purpose is to use the training samples with polygon marks to train the region segmentation network to output the region mask image.

[0061] For details, see Figure 7 The training method shown in the figure is that the region segmentation network is a supervised learning network. The training samples input to the backbone network include sample images and annotation information of the sample images. The backbone network outputs image features. The image features are then input to the region segmentation network, and polygon annotation is used to obtain the image region in the region mask image (wherein the pixel value of the region mask image predicted at the end may be a decimal between 0 and 1). After a large number of training samples, the parameters in the region segmentation network are trained, and finally a trained region segmentation network is obtained. Finally, Figure 7 shown It means multiplying the image features with the regional mask image, and outputting the multiplication results to the classification branch and the regression branch respectively, so as to train the classification branch and the regression branch.

[0062] Step S306, determining the image region containing the target object based on the regional mask image;

[0063] The area at the position where the pixel in the regional mask image is the first pixel value and the area at the corresponding position in the image to be processed (or image feature) is the image area. Specifically, the scale of the regional mask image is the same as the scale of the image feature, so the area indicated by the pixel position where the pixel in the regional mask image is the first pixel value can be directly determined as the image area of ​​the target object.

[0064] Step S308, performing feature enhancement processing on the regional features corresponding to the image region in the image features to obtain processed image features; and detecting the target object based on the processed image features.

[0065] In the above method, the extracted image features are input into a pre-trained regional segmentation network to output a regional mask image; in the regional mask image, the pixel value of the pixel position within the image area is a first pixel value; the pixel value of the pixel position outside the image area is a second pixel value; based on the regional mask image, the image area containing the target object is determined; the edge shape of the image area is related to the edge shape of the target object, and the area occupied by the target object is smaller than the image area; the regional features corresponding to the image area in the image features are enhanced to obtain processed image features; based on the processed image features, the target object is detected. In this method, for an image to be processed containing a multi-morphological target, the regional segmentation network can be used to determine the image area whose edge shape is related to the edge shape of the target object, and at the same time, the features of the image area are enhanced, the features of the background area are weakened, the interference of background information when detecting the target is reduced, and the accuracy of target detection is improved.

[0066] Embodiment 4:

[0067] The embodiment of the present invention further provides another target detection method, which is implemented on the basis of the above embodiment; this embodiment focuses on describing the specific implementation method of the step of performing feature enhancement processing on the regional features corresponding to the image region in the image features to obtain the processed image features (implemented by steps S608-S610), and the specific implementation method of the step of detecting the target object based on the processed image features (implemented by step S612); Figure 6 As shown, the method comprises the following steps:

[0068] Step S602, extracting image features of the image to be processed;

[0069] Step S604, inputting the image features into a pre-trained region segmentation network, and outputting a region mask image;

[0070] Step S606, determining the image region containing the target object based on the regional mask image;

[0071] Step S608, obtaining a regional mask image indicating the image area; wherein, in the regional mask image, the pixel values ​​of the pixel positions within the image area are first pixel values; and the pixel values ​​of the pixel positions outside the image area are second pixel values;

[0072] After obtaining the image features and the image area containing the target object, in order to enhance the features of the image area, it is necessary to obtain the regional mask image indicating the image area output by the regional segmentation network again; in most cases, in order to indicate the position of the image area containing the target object in the image to be processed, in the regional mask image, the pixel values ​​of the pixels within the image area are different from the pixel values ​​of the pixels outside the image area; based on this, in this embodiment, in the regional mask image, the pixel value of the pixel position within the image area is the first pixel value; the pixel value of the pixel position outside the image area is the second pixel value; the values ​​of the first pixel value and the second pixel value are usually different and have a large difference, so as to clearly distinguish the image area from other areas outside the image area.

[0073] In a specific implementation method, the regional mask image is used to enhance the image features within the above-mentioned image area. In order to achieve the purpose of enhancing the image features within the image area, the first pixel value in the above-mentioned regional mask image is greater than the second pixel value, so as to achieve the purpose of enhancing the image features within the image area and weakening the image features outside the image area in subsequent steps; for example, the first pixel value can be set to 1, and the second pixel value can be set to 0.

[0074] In addition, after the step of obtaining a regional mask image indicating an image region, if the scale of the regional mask image is different from the scale of the image feature, the scale of the regional mask image needs to be adjusted so that the scale of the regional mask image is the same as the scale of the image feature.

[0075] For example, if the scale of the regional mask image is 20*20 and the scale of the image feature is 60*60, it is necessary to use methods such as scale transformation to increase the scale of the regional mask image, and the final scale of the regional mask image is 60*60; for example, if the scale of the regional mask image is 70*70 and the scale of the image feature is 50*50, it is necessary to use methods such as scale transformation to reduce the scale of the regional mask image, and the final scale of the regional mask image is 50*50.

[0076] Step S610, for each pixel position, multiplying the feature value at the pixel position in the image feature with the pixel value at the pixel position in the regional mask image to obtain a processed image feature;

[0077] Since the scale of the regional mask image is the same as the scale of the image feature, in order to enhance the features of the image region, the feature value at each pixel position in the image feature can be directly multiplied by the pixel value at the pixel position in the regional mask image to obtain the processed image feature.

[0078] In addition, if the image feature includes multiple channels, for each channel, a step is performed to multiply the feature value at the pixel position in the image feature with the pixel value at the pixel position in the regional mask image for each pixel position to obtain the processed image feature.

[0079] For example, the image features extracted from the image to be processed are 128-dimensional image features (i.e., image features of 128 channels). It is necessary to multiply the feature value at the pixel position in the image feature of each dimension with the pixel value at the pixel position in the regional mask image for each pixel position in each dimension of the image feature, and finally obtain the processed 128-dimensional image features.

[0080] Step S612, input the processed image features into a pre-trained target detection network, and output the target detection result; the target detection result includes: a rectangular frame mark indicating the location of the target object, and the category of the target object.

[0081] The above-mentioned target detection network includes a classification network and a regression network. Specifically, the processed image features are input into the pre-trained target detection network. First, the target object in the processed image features is regressed into a rectangular box, which contains the target object; then the category of the target object in the image area in the processed image features is identified, and the category is output.

[0082] It should be noted that see Figure 7 As shown in the figure, the target detection network includes a classification branch and a return branch. When training the target detection network, the detection and classification method is to regress a rectangular box and the corresponding classification result for each pixel in the processed image features. The regression of the rectangular box is to regress the distance from the current pixel point to the four sides of the annotation information (ground truth) box. Only the pixel points that fall into the ground truth box are regressed, and the remaining points are used as negative samples to participate in the classification but not regressed.

[0083] In the above method, a regional mask image indicating an image area is obtained; for each pixel position, the feature value at the pixel position in the image feature is multiplied by the pixel value at the pixel position in the regional mask image to obtain a processed image feature, and the feature of the image area is enhanced; the processed image feature is input into a pre-trained target detection network, and the target detection result is output; the target detection result includes: a rectangular frame mark indicating the location of the target object, and the category of the target object. In this method, for an image to be processed containing multi-morphological targets, a regional mask image is obtained through a regional segmentation network; based on the regional mask image, the image area is determined, and the image area whose edge shape is related to the edge shape of the target object is obtained; the regional mask image is multiplied by the feature of each corresponding position in the image feature, the feature of the image area is enhanced, the feature of the background area is weakened, the interference of background information when detecting the target is reduced, and the accuracy of target detection is improved.

[0084] Embodiment five:

[0085] Corresponding to the above method embodiment, see Figure 8 A schematic diagram of the structure of a target detection device is shown, the device comprising:

[0086] An extraction module 81, used to extract image features of the image to be processed;

[0087] A determination module 82, configured to determine, based on the image features, an image region in the image to be processed that contains the target object; wherein the edge shape of the image region is related to the edge shape of the target object, and the region occupied by the target object is smaller than the image region;

[0088] The detection module 83 is used to perform feature enhancement processing on the regional features corresponding to the image area in the image features to obtain processed image features; and detect the target object based on the processed image features.

[0089] The embodiment of the present invention provides a target detection device, which extracts image features of an image to be processed; based on the image features, determines the image region containing the target object in the image to be processed; wherein the edge shape of the image region is related to the edge shape of the target object, and the region occupied by the target object is smaller than the image region; performs feature enhancement processing on the region features corresponding to the image region in the image features to obtain processed image features; and detects the target object based on the processed image features. In this method, the edge shape of the image region containing the target object is related to the edge shape of the target object, and the region occupied by the target object is smaller than the image region; this method can be understood as pre-segmenting the target object based on the edge of the target object to obtain the image region containing the target object; and then performs feature enhancement processing on the region features corresponding to the image region in the image features; this method can strengthen the object features of the target object, and then weaken the features of the background region in the image, reduce the interference of background information in the process of detecting the target, and improve the accuracy of target detection.

[0090] Furthermore, the above-mentioned determination module is also used to: input image features into a pre-trained region segmentation network to output a region mask image; wherein, in the region mask image, the pixel values ​​of the pixel positions within the image area are first pixel values; the pixel values ​​of the pixel positions outside the image area are second pixel values; based on the region mask image, determine the image area containing the target object.

[0091] Furthermore, the above-mentioned image area includes: a polygonal area related to the edge shape of the target object.

[0092] Furthermore, the training samples used for training the region segmentation network include sample images and annotation information of the sample images; the annotation information includes: polygon identification of the image region containing the target object in the sample image.

[0093] Furthermore, the above-mentioned detection module is also used to: obtain a regional mask image indicating an image area; wherein, in the regional mask image, the pixel value of the pixel position within the image area is a first pixel value; the pixel value of the pixel position outside the image area is a second pixel value; for each pixel position, the feature value at the pixel position in the image feature is multiplied by the pixel value at the pixel position in the regional mask image to obtain a processed image feature.

[0094] Furthermore, the above device also includes a scale adjustment module, which is used to adjust the scale of the regional mask image if the scale of the regional mask image is different from the scale of the image feature, so that the scale of the regional mask image is the same as the scale of the image feature.

[0095] Furthermore, the above-mentioned device is also used for: if the image feature includes multiple channels, for each channel, executing the step of multiplying the feature value at the pixel position in the image feature with the pixel value at the pixel position in the regional mask image for each pixel position to obtain the processed image feature.

[0096] Furthermore, the above detection module also includes a result output unit, which is used to input the processed image features into a pre-trained target detection network and output the target detection result; the target detection result includes: a rectangular frame mark indicating the location of the target object, and the category of the target object.

[0097] The target detection device provided in the embodiment of the present invention has the same technical features as the target detection method provided in the above embodiment, so it can also solve the same technical problems and achieve the same technical effects.

[0098] Embodiment six:

[0099] An embodiment of the present invention provides an electronic system, which includes: an image acquisition device, a processing device and a storage device; the image acquisition device is used to obtain preview video frames or image data; a computer program is stored on the storage device, and the computer program executes the steps of the above-mentioned target detection method when the processed device is running.

[0100] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the electronic system described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0101] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processing device, the steps of the target detection method described above are executed.

[0102] The computer program products of the target detection methods, devices, and electronic systems provided in the embodiments of the present invention include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the previous method embodiments. The specific implementation can be found in the method embodiments, which will not be repeated here.

[0103] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0104] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it 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, and it can be the internal communication of two components. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0105] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.

[0106] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0107] Finally, it should be noted that the above embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above embodiments, those skilled in the art should understand that any person skilled in the art can still modify the technical solutions recorded in the above embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A target detection method, characterized in that: The method comprises: Extracting image features of the image to be processed; Based on the image features, determining an image region in the image to be processed that contains a target object; wherein an edge shape of the image region is related to an edge shape of the target object, and an area occupied by the target object is smaller than the image region; Performing feature enhancement processing on the regional features corresponding to the image area in the image features to obtain the processed image features; detecting the target object based on the processed image features; wherein the feature enhancement processing is used to perform mathematical operations on the regional feature data of the image area to enhance the features of the area occupied by the target object in the image to be processed; the mathematical operations include: multiplying the feature data of the edge feature by a preset value; The step of determining the image region containing the target object in the image to be processed based on the image features comprises: inputting the image features into a pre-trained region segmentation network to output a region mask image; wherein, in the region mask image, the pixel value of the pixel position within the image region is a first pixel value; the pixel value of the pixel position outside the image region is a second pixel value; based on the region mask image, determining the image region containing the target object; The image region includes: a polygonal region related to the edge shape of the target object; the training samples used to train the region segmentation network include a sample image and annotation information of the sample image; the annotation information includes: a polygon identifier of the image region containing the target object in the sample image.

2. The method according to claim 1, characterized in that The step of performing feature enhancement processing on the regional features corresponding to the image region in the image features to obtain the processed image features comprises: Acquire a regional mask image indicating the image area; wherein, in the regional mask image, pixel values ​​of pixel positions within the image area are first pixel values; and pixel values ​​of pixel positions outside the image area are second pixel values; For each pixel position, the feature value at the pixel position in the image feature is multiplied by the pixel value at the pixel position in the regional mask image to obtain the processed image feature.

3. The method according to claim 2, characterized in that After the step of acquiring a regional mask image indicating the image area, the method further comprises: If the scale of the regional mask image is different from the scale of the image feature, the scale of the regional mask image is adjusted so that the scale of the regional mask image is the same as the scale of the image feature.

4. The method according to claim 2, characterized in that: The method further comprises: If the image feature includes multiple channels, for each channel, a step is performed to multiply the feature value at the pixel position in the image feature with the pixel value at the pixel position in the regional mask image for each pixel position to obtain the processed image feature.

5. The method according to claim 1, characterized in that The step of detecting the target object based on the processed image features comprises: The processed image features are input into a pre-trained target detection network, and a target detection result is output; the target detection result includes: a rectangular frame mark indicating the location of the target object, and the category of the target object.

6. A target detection device, characterized in that: The device comprises: An extraction module, used for extracting image features of the image to be processed; A determination module, configured to determine, based on the image features, an image region in the image to be processed that contains a target object; wherein an edge shape of the image region is related to an edge shape of the target object, and an area occupied by the target object is smaller than the image region; A detection module, configured to perform feature enhancement processing on the regional features corresponding to the image region in the image features to obtain the processed image features; and detect the target object based on the processed image features; wherein the feature enhancement processing is configured to perform mathematical operations on the regional feature data of the image region to enhance the features of the region occupied by the target object in the image to be processed; and the mathematical operations include: multiplying the feature data of the edge feature by a preset value; The step of determining the image region containing the target object in the image to be processed based on the image features comprises: inputting the image features into a pre-trained region segmentation network to output a region mask image; wherein, in the region mask image, the pixel value of the pixel position within the image region is a first pixel value; the pixel value of the pixel position outside the image region is a second pixel value; based on the region mask image, determining the image region containing the target object; The image region includes: a polygonal region related to the edge shape of the target object; the training samples used to train the region segmentation network include a sample image and annotation information of the sample image; the annotation information includes: a polygon identifier of the image region containing the target object in the sample image.

7. An electronic system, characterized in that: The electronic system includes: a processing device and a storage device; The storage device stores a computer program, and when the computer program is executed by the processing device, the target detection method according to any one of claims 1 to 5 is executed.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processing device, the steps of the target detection method according to any one of claims 1 to 5 are executed.