Method and apparatus for generating recognition model, electronic device, and storage medium

By training the recognition model through anchor-free box regression and multi-scale feature extraction, the incompatibility problem between recognition accuracy and computational efficiency in small target detection is solved, and efficient small target detection is achieved.

CN116091785BActive Publication Date: 2025-10-24BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310031651.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-10
Publication Date
2025-10-24
Estimated Expiration
2043-01-10

AI Technical Summary

Technical Problem

Existing small target detection models cannot balance recognition accuracy and computational efficiency, and are unable to effectively detect small targets with very few visual features in images.

Method used

Anchor-free frame regression is used to determine the target frame, image segmentation is performed based on the target frame's proportion distribution data, and the recognition model is trained through multi-scale feature extraction.

Benefits of technology

The accuracy and computational efficiency of small target detection are improved, achieving a balance between recognition accuracy and computational efficiency without increasing the computational consumption of the computer system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116091785B_ABST
    Figure CN116091785B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method and device for generating a recognition model, electronic equipment and a storage medium, relates to the field of artificial intelligence, in particular to the field of computer vision. The specific implementation scheme is: obtaining an image dataset, and performing anchor-free regression processing on the image dataset to determine target boxes of multiple images contained in the image dataset, wherein the target boxes are used to identify the regions of objects in the corresponding images; determining proportion distribution data corresponding to the image dataset based on the target boxes of the multiple images, wherein the proportion distribution data represents distribution information of the proportion of the regions of the target boxes in the corresponding images in the image dataset; performing cut image processing on the image dataset according to the proportion distribution data to obtain a cut image processed image dataset; and training an initial recognition model based on the cut image processed image dataset to obtain a target recognition model, wherein the initial recognition model is at least used for multi-scale feature extraction of objects in the cut image processed image dataset.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the field of artificial intelligence, in particular to the field of computer vision, and more particularly to a method and device for generating a recognition model, an electronic device and a storage medium. BACKGROUND

[0002] Target detection is an important research direction in the field of computer vision and is also the basis of other complex vision tasks. As a cornerstone of image understanding and computer vision, target detection is the basis for solving higher-level vision tasks such as segmentation, scene understanding, target tracking, image description, and event detection. Small target detection is a difficult point in target detection, which aims to accurately detect small targets with little visual features in images, such as targets below 32 pixels x 32 pixels. Due to the small pixel ratio of small targets, small targets have the characteristics of small coverage area and little information, so it is difficult to improve the accuracy of small target detection. However, in real-world scenarios, there are a large number of small targets that need to be detected, so small target detection has broad application prospects.

[0003] At present, existing small target detection models cannot balance the recognition accuracy and computational efficiency of small target detection. For example, some detection models have simple implementation processes, but the accuracy is generally low; or some detection models have improved accuracy, but the implementation process is complex. SUMMARY

[0004] The present disclosure provides a method and device for generating a recognition model, an electronic device and a storage medium.

[0005] According to an aspect of the present disclosure, a method for generating a recognition model is provided, comprising: obtaining an image data set and performing anchor-free regression processing on the image data set to determine target boxes of multiple images contained in the image data set, wherein the target boxes are used to identify the regions of objects in the corresponding images; determining the proportion distribution data corresponding to the image data set based on the target boxes of the multiple images, wherein the proportion distribution data represents the distribution information of the proportion of the target boxes in the corresponding images in the image data set; performing cut image processing on the image data set according to the proportion distribution data to obtain a cut image processed image data set; and training an initial recognition model based on the cut image processed image data set to obtain a target recognition model, wherein the initial recognition model is used at least for multi-scale feature extraction of objects in the cut image processed image data set.

[0006] According to another aspect of the present disclosure, a device for generating a recognition model is also provided, comprising: an acquisition module configured to acquire an image dataset and perform anchor-free bounding box regression processing on the image dataset to determine target bounding boxes of a plurality of images included in the image dataset, wherein the target bounding boxes are used to identify regions of objects in the corresponding images; a distribution determination module configured to determine proportion distribution data corresponding to the image dataset based on the target bounding boxes of the plurality of images, wherein the proportion distribution data represents distribution information of proportions of the target bounding boxes in the corresponding images in the image dataset; a cutout module configured to perform cutout processing on the image dataset according to the proportion distribution data to obtain a cutout-processed image dataset; and a model training module configured to train an initial recognition model based on the cutout-processed image dataset to obtain a target recognition model, wherein the initial recognition model is used at least for multi-scale feature extraction of objects in the cutout-processed image dataset.

[0007] According to another aspect of the present disclosure, an electronic device is also provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the above-mentioned method for generating a recognition model.

[0008] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is also provided, wherein the computer instructions are used to enable a computer to perform the above-mentioned method for generating a recognition model.

[0009] According to another aspect of the present disclosure, a computer program product is also provided, comprising a computer program which, when executed by a processor, implements the above-mentioned method for generating a recognition model.

[0010] As can be seen from the above, in the present disclosure, the image dataset is processed in an anchor-free bounding box regression manner, which can improve the accuracy of the target bounding boxes identifying the image regions and improve the accuracy of the recognition model in identifying targets. Moreover, the anchor-free bounding box regression manner does not require manual annotation of the regions in each image, thereby improving the recognition efficiency of the recognition model. In addition, the image dataset is cutout-processed according to the proportion distribution data of the target bounding boxes to improve the recognition accuracy of small targets. Furthermore, multi-scale feature extraction of the objects in the image dataset can be performed during the training of the recognition model, and the recognition precision of the recognition model can be improved according to the multi-scale features. In addition, the present disclosure provides a scheme for training a model based on a cutout-processed image dataset, and the targets included in the cutout-processed image dataset are small targets, i.e., the present disclosure can achieve recognition of small targets, and the recognition process does not increase the computational consumption of the computer system, thereby achieving a balance between recognition precision and computational efficiency.

[0011] Therefore, the scheme provided by the present disclosure achieves the purpose of identifying small targets, improves the detection accuracy and operation efficiency of small targets, and solves the problem that the recognition accuracy and operation efficiency cannot be compatible when identifying small targets in the related art.

[0012] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present disclosure, nor to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0013] The accompanying drawings are used to better understand the present scheme and do not constitute a limitation on the present disclosure. Among them:

[0014] Figure 1 is a flowchart of a method for generating an identification model according to an embodiment of the present disclosure;

[0015] Figure 2 is a training schematic diagram of a target identification model according to an embodiment of the present disclosure;

[0016] Figure 3 is a network schematic diagram of a target identification model according to an embodiment of the present disclosure;

[0017] Figure 4 is a schematic diagram of a device for generating an identification model according to an embodiment of the present disclosure;

[0018] Figure 5 is a schematic block diagram of an electronic device for implementing an embodiment of the present disclosure. DETAILED DESCRIPTION

[0019] Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, which include various details of the embodiments of the present disclosure to help understanding, and should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Also, in order to be clear and concise, the description below omits the description of well-known functions and structures.

[0020] It should be noted that in the technical scheme of the present disclosure, the acquisition, storage and application of user personal information involved comply with relevant laws and regulations and do not violate public order and good customs.

[0021] Example 1

[0022] According to an aspect of the present disclosure, a method for generating an identification model is provided, which can be executed in a server or a terminal device. In the present embodiment, the terminal device is taken as the execution subject for explanation and description. Wherein, Figure 1is a flowchart of a generation method of the identification model provided by the embodiment, as shown in Figure 1 The method comprises the following steps:

[0023] In step S102, an image dataset is obtained, and an anchor-free regression processing is performed on the image dataset to determine a target frame of multiple images contained in the image dataset, wherein the target frame is used to identify the region of an object in the corresponding image.

[0024] In step S102, the image dataset described above is composed of multiple images, and at least part of the multiple images includes a small target object, wherein the small target object is an object with a pixel number less than a preset pixel number in the image, for example, the small target object can be an object with a size of 32 pixels x 32 pixels or less.

[0025] In addition, in step S102, each object has a frame, and there can be only one object in an image, or there can be multiple objects. Compared with the way of determining the target frame of each image by using anchor frame in the related art, the way of determining the target frame corresponding to each image by using anchor-free regression processing in the present disclosure can eliminate the problems of artificial design of super parameters and complex calculation caused by anchor frame, not only can improve the recognition accuracy of the target identification model, but also can improve the recognition efficiency of the target identification model.

[0026] In step S104, the proportion distribution data corresponding to the image dataset is determined based on the target frames of the multiple images.

[0027] In step S104, the proportion distribution data represents the distribution information of the region proportion of the target frame in the corresponding image in the image dataset. Optionally, the proportion distribution data can include a first region proportion and a second region proportion, wherein the first region proportion represents a region proportion less than or equal to a target threshold, and the second region proportion represents a region proportion greater than the target threshold, that is, the first region proportion represents the region proportion of the small target object, and the second region proportion represents the region proportion of the non-small target object. The region proportion can be the area ratio of the region of the object to the entire image region, and the area of the region of the object can be determined by the area of the target frame corresponding to the object.

[0028] It should be noted that the proportion distribution data represents the proportion of the number of small target objects in the current image. By analyzing the proportion distribution data to determine whether to perform cut image processing on the current image, and then training the initial identification model based on the image dataset after the cut image processing, the recognition accuracy of the target identification model in recognizing small target objects can be improved. Moreover, the identification process is simple, and the recognition efficiency of small target objects is improved.

[0029] In step S106, the image dataset is cut according to the proportion distribution data to obtain a cut image dataset.

[0030] In step S106, after the proportion distribution data of each image is determined, the terminal device can cut the images whose proportion distribution data meet certain conditions, for example, the terminal device cuts the images containing a large number of small target objects, and does not cut the images containing a small number of small target objects. On the one hand, the disclosure cuts the images containing a large number of small target objects, and trains the initial recognition model based on the cut image dataset, which can improve the recognition accuracy of the target recognition model for small target objects. On the other hand, the disclosure does not cut the images containing a small number of small target objects, which can avoid the problem of low recognition accuracy of large target objects caused by cutting the images containing large target objects, and can further improve the accuracy of the target recognition model for target objects.

[0031] Optionally, in the process of cutting the image dataset according to the proportion distribution data, the terminal device can cut the current image according to the target frame in the current image. The image corresponding to the target frame is in one complete sub-image in the multiple sub-images obtained by cutting the current image, that is, the integrity of the target frame is maintained in the cutting process, thereby ensuring the integrity of the small target object. In addition, one sub-image can include only one target frame, and one sub-image can include multiple target frames.

[0032] In step S108, the initial recognition model is trained based on the cut image dataset to obtain a target recognition model, wherein the initial recognition model is used at least for multi-scale feature extraction of the objects in the cut image dataset.

[0033] In step S108, the initial recognition model at least includes a P2 feature layer and a transmission layer. By increasing these two layers, multi-scale feature extraction of the objects in the cut image dataset can be realized, and the recognition accuracy of the target recognition model can be improved according to the multi-scale features.

[0034] It should be noted that the target recognition model obtained by training can be applied to the fields of autonomous driving, intelligent medical treatment, defect detection, aerial image analysis, etc. For example, the target recognition model can be used to recognize small target objects in the images of industrial devices to detect whether the industrial devices produced are qualified.

[0035] Based on the scheme defined in steps S102 to S108, it can be known that, in the present disclosure, the image dataset is processed by cutting, after the image dataset is obtained, anchor-free regression is performed on the image dataset to determine the target frame of each image contained in the image dataset, and the proportion distribution data corresponding to the image dataset is determined based on the target frame of each image; then, the image dataset is processed by cutting according to the proportion distribution data, to obtain the image dataset processed by cutting; finally, the initial recognition model is trained based on the image dataset processed by cutting, to obtain the target recognition model, wherein the initial recognition model is used at least for multi-scale feature extraction of the object in the image dataset processed by cutting.

[0036] It is easy to note that, in the present disclosure, the image dataset is processed by anchor-free regression, which can improve the accuracy of the target frame of the identified image region, and improve the accuracy of the target recognition model; moreover, the anchor-free regression does not require manual annotation of the region in each image, thereby improving the recognition efficiency of the target recognition model. In addition, the image dataset is processed by cutting according to the proportion distribution data of the target frame, to improve the recognition accuracy of the small target; and in the process of training the recognition model, multi-scale feature extraction can also be performed on the object in the image dataset, and the recognition accuracy of the target recognition model can be improved according to the multi-scale features. Furthermore, the scheme provided by the present disclosure is based on the model training of the image dataset processed by cutting, and the target contained in the image dataset processed by cutting is a small target, i.e., the present disclosure can realize the recognition of the small target, and the recognition process does not increase the operation consumption of the computer system, and the recognition accuracy and operation efficiency are balanced.

[0037] Therefore, the scheme provided by the present disclosure achieves the purpose of recognizing the small target, improves the detection accuracy and operation efficiency of the small target, and solves the problem that the recognition accuracy and operation efficiency cannot be compatible when the small target is recognized in the related art.

[0038] Example 2

[0039] According to an aspect of the present disclosure, a method for generating a recognition model is also provided. In the present embodiment, the method for generating a recognition model provided in Embodiment 1 is combined with Figure 1 The flowchart of the method for generating a recognition model provided in the present embodiment is used to explain and describe each step mentioned in Embodiment 1 in detail.

[0040] In an optional embodiment, after the terminal device obtains the image dataset, step S102 can be executed, i.e., anchor-free regression is performed on the image dataset to determine the target frame of each image contained in the image dataset, and then it is determined whether to perform cutting on each image based on the target frame of each image.

[0041] Specifically, the terminal device predicts an initial anchor box range corresponding to each image in the image dataset based on the positions of the objects in the multiple images in the image dataset in the corresponding images, then counts the initial anchor box range to obtain anchor box size distribution information corresponding to the image dataset, adjusts the initial anchor box range based on the anchor box size distribution information to obtain a target anchor box range, and finally determines a target box corresponding to each image based on the target anchor box range.

[0042] Optionally, the terminal device first identifies the objects in each image and identifies the positions of the objects in the images, then predicts an object anchor box corresponding to each object with the position of the object in the image as the center, and further determines an initial anchor box range corresponding to a current image according to the object anchor box of each object, where the current image is any image in the image dataset, and the initial anchor box range represents that most (for example, 98%) of the objects in the current image can be covered by an anchor box in the initial anchor box range. After obtaining the initial anchor box range of each image, the terminal device counts anchor box size distribution information of the initial anchor box range in the entire image dataset, adjusts the initial anchor box range according to the anchor box size distribution information, adds a negative coefficient weight value (for example, -2, -1, etc.) at the same time, calculates an expected value corresponding to a target anchor box range through the negative coefficient weight value, and determines a target box of each image based on the expected value.

[0043] It should be noted that the anchor-free regression processing is performed on the image dataset to determine the target box of each image, that is, the size of the target box can be dynamically adjusted, so that small target objects can be accurately detected, and the recognition accuracy of the small target objects is effectively improved.

[0044] In an optional embodiment, as shown in FIG. 1, Figure 1 After the target box of each image is determined, the terminal device performs steps S104 and S106, that is, determines the proportion distribution data based on the target box of each image, and performs cutout processing on the image dataset according to the proportion distribution data to obtain the image dataset after the cutout processing.

[0045] Specifically, the terminal device counts the number corresponding to the proportion of the first type of region and the number corresponding to the proportion of the second type of region according to the proportion distribution data; determines a first type of image from the image dataset, and performs cutout processing on the first type of image to obtain a first type of image after the cutout processing; determines a second type of image from the image dataset, and does not perform cutout processing on the second type of image, and generates the image dataset after the cutout processing based on the first type of image after the cutout processing and the second type of image.

[0046] The first type of area ratio represents an area ratio less than or equal to a target threshold, and the second type of area ratio represents an area ratio greater than the target threshold. The first type of image is an image in which the number of small target objects corresponding to the first type of area ratio is greater than or equal to the number of small target objects corresponding to the second type of area ratio, that is, the first type of image is an image in which the number of small target objects is relatively large, and the second type of image is an image in which the number of small target objects is relatively small.

[0047] Optionally, Figure 2 An optional training schematic diagram of a target recognition model is shown, in which Figure 2 In the method, the terminal device first detects proportion distribution data of target frame sizes in the image data set, determines the number of small target objects contained in each image according to the proportion distribution data, and then determines whether to perform cutout processing on the current image according to the number of small target objects contained in each image. When the current image contains a large number of small target objects, the current image is subjected to cutout processing, and the cutout sub-image is used for training of the target recognition model. When the current image contains a small number of small target objects, the current image is not subjected to cutout processing, and the current image can be directly used for training of the target recognition model.

[0048] It should be noted that the image data set is subjected to cutout processing according to the proportion distribution data of the target frame to improve the recognition accuracy of small targets, and the model is trained based on the cutout image data set, and the targets contained in the cutout image data set are small targets, so that the recognition of small targets is realized. The recognition process does not increase the operation consumption of the computer system, and the recognition accuracy and operation efficiency are balanced.

[0049] Further, in the process of performing cutout processing on the first type of image, the terminal device divides each image in the first type of image into a plurality of sub-images based on the target anchor frame range, and generates the first type of image subjected to cutout processing based on the plurality of sub-images corresponding to each image.

[0050] Optionally, the terminal device can perform cutout processing on the current image according to the target anchor frame range, so that each target frame can be completely presented on a sub-image, that is, the integrity of the target frame is maintained in the cutout process, and the integrity of the small target object is further ensured.

[0051] It should be noted that in actual application, it can also be determined according to the distribution information of the target frame whether to divide a plurality of target frames in one sub-image or to contain one target frame in each sub-image. For example, when the target frame distribution is relatively dense, a plurality of target frames can be divided in one sub-image, and when the target frame distribution is relatively sparse, each target frame can be divided in a separate sub-image.

[0052] Further, the image containing a large number of small target objects is subjected to the cutting processing, and the initial recognition model is trained based on the image data set subjected to the cutting processing, so as to improve the recognition accuracy of the target recognition model in recognizing the small target objects; the image containing a small number of small target objects is not subjected to the cutting processing, so as to avoid the problem that the large target objects are subjected to the cutting processing and the recognition accuracy of the large target objects is low, and the accuracy of the target recognition model in recognizing the target objects is further improved.

[0053] Further, as shown in Figure 1 After the image data set is subjected to the cutting processing, the terminal device trains the initial recognition model based on the image data set subjected to the cutting processing, to obtain the target recognition model. After the target recognition model is obtained, the terminal device can further adjust the target recognition model, so as to improve the recognition accuracy of the target recognition model.

[0054] Specifically, after the first recognition result of the first type of image subjected to the cutting processing by the target recognition model and the second recognition result of the second type of image subjected to the cutting processing by the target recognition model are obtained, the terminal device determines the recognition accuracy of the first type of image subjected to the cutting processing by the target recognition model based on the first recognition result, to obtain a first recognition accuracy; and determines the recognition accuracy of the second type of image subjected to the cutting processing by the target recognition model based on the second recognition result, to obtain a second recognition accuracy; and then adjusts the parameters of the target recognition model based on the first recognition accuracy and / or the second recognition accuracy.

[0055] Optionally, as shown in Figure 2 The terminal device adopts different recognition manners for different types of images, and adjusts the parameters of the target recognition model in combination with the recognition results corresponding to the different types of images, so that the target recognition model can accurately recognize different types of images.

[0056] Further, as shown in Figure 2 For the image containing a large number of small target objects, the terminal device needs to perform the cutting processing when detecting the accuracy of the target recognition model. Specifically, the terminal device performs the cutting processing on the first recognition result corresponding to a plurality of sub-images, to obtain a spliced image, and adjusts the parameters of the target recognition model based on the similarity between the spliced image and an original image, wherein the original image is the image before the cutting of the spliced image in the first type of image.

[0057] Optionally, as shown in Figure 2As shown, for an image containing a large number of small target objects, the terminal device performs splicing processing on the sub-image after the target recognition model is identified, obtains a spliced image, and compares the similarity between the spliced image and the original image to determine the recognition accuracy of the target recognition model in identifying small target objects. If the similarity between the spliced image and the original image is greater than a preset similarity, it indicates that the recognition accuracy of the target recognition model in identifying small target objects is high, and there is no need to further adjust the parameters of the target recognition model. Otherwise, it indicates that the recognition accuracy of the target recognition model in identifying small target objects is low, and the parameters of the target recognition model need to be adjusted.

[0058] In addition, for an image containing a small number of small target objects, the terminal device directly determines whether to adjust the parameters of the target recognition model according to the recognition accuracy of the target recognition model on the image.

[0059] In addition, the terminal device can also adjust the parameters of the target recognition model in combination with the recognition accuracies of the two types of images. For example, the terminal device can set a weight value for each of the two types of images, and perform weighted summation on the recognition accuracies of the two types of images, and determine whether to adjust the parameters of the target recognition model according to the weighted summation result.

[0060] It should be noted that by adjusting the parameters of the target recognition model, the recognition accuracy of the target recognition model is improved.

[0061] From the above, it can be seen that the scheme provided by the present disclosure can improve the recognition accuracy of the target recognition model in identifying small target objects and improve the recognition efficiency by performing cut image processing on the image data set containing a large number of small target objects, using the cut sub-image for training of the target recognition model, and adjusting the parameters of the target recognition model in the form of a puzzle. In addition, the scheme provided by the present disclosure can realize extraction of multi-scale features, greatly improving the precision of small target object detection. In addition, the present disclosure optimizes the regression detection box, proposes a determination method of the regression range, and introduces a center prior box (predicts the initial anchor box range), which greatly improves the precision of small target object matching.

[0062] Moreover, the scheme provided by the present disclosure can achieve 38.29 mAP on the visdrone standard data set through Matlab testing, which improves the detection accuracy by 1.16 compared with PP-YOLOE, and improves the detection accuracy by 2.09 compared with tph-yolov5. On the Coco data set, compared with ppyoloe_plus mAP, AP50, and AP-small, the detection accuracy is improved by 0.1, 0.3, and 1.9, respectively.

[0063] Example 3

[0064] According to an aspect of the present disclosure, an application scenario of a generation method of an identification model is also provided. Specifically, after an initial identification model is trained based on a cut image processed image data set to obtain a target identification model, a terminal device extracts features of a to-be-identified image through a feature layer in the target identification model to obtain first data features; and extracts multi-scale information of the first data features through a transmission layer in the target identification model to obtain second data features; and then identifies a to-be-identified object in the to-be-identified image based on the second data features to obtain a target identification result.

[0065] Optionally, Figure 3 The feature layer and the transmission layer in the target identification model are shown, and Figure 3 It can be known that the P2 feature layer is added in the feature layer, which can retain more features of small target objects, thereby ensuring the identification accuracy of the target identification model on the to-be-identified object. In addition, for the output of the last layer of the backbone network, the transmission layer is introduced to further process the features extracted by the P2 feature layer to extract more multi-scale information, thereby improving the overall identification effect of the target identification model.

[0066] Optionally, the to-be-identified object in the to-be-identified image can be a small target object, for example, an object with a pixel size less than 32 pixels x 32 pixels. For example, Figure 3 After the to-be-identified image is obtained, the terminal device inputs the to-be-identified image into the feature layer in the target identification model to extract more features of small target objects; and then extracts multi-scale information of the extracted features through the transmission layer to obtain multi-scale information (i.e., second data features). Finally, after pyramid processing, the output results of each layer of the pyramid are predicted to obtain an identification result.

[0067] Example 4

[0068] According to an aspect of the present disclosure, an identification model generation device is also provided, wherein, Figure 4 is a schematic diagram of the identification model generation device, as Figure 4 shown, the device comprises an acquisition module 401, a distribution determination module 403, a cut image module 405, and a model training module 407.

[0069] The obtaining module 401 is configured to obtain an image dataset and perform anchor-free regression processing on the image dataset to determine target boxes of multiple images contained in the image dataset, wherein the target boxes are used to identify the regions of objects in the corresponding images. The distribution determining module 403 is configured to determine proportion distribution data corresponding to the image dataset based on the target boxes of the multiple images, wherein the proportion distribution data represents distribution information of the proportion of the regions of the target boxes in the corresponding images in the image dataset. The cutting module 405 is configured to perform cutting processing on the image dataset according to the proportion distribution data to obtain a cutting-processed image dataset. The model training module 407 is configured to train an initial recognition model based on the cutting-processed image dataset to obtain a target recognition model, wherein the initial recognition model is used to perform multi-scale feature extraction on the objects in the cutting-processed image dataset.

[0070] It should be noted that the obtaining module 401, the distribution determining module 403, the cutting module 405, and the model training module 407 correspond to steps S102 to S108 of the above embodiment, and the four modules have the same instances and application scenarios as the corresponding steps, but are not limited to the content disclosed in the above embodiment.

[0071] Optionally, the obtaining module includes a prediction module, a statistical prediction module, an anchor box adjustment module, and a first determination module. The prediction module is configured to predict an initial anchor box range corresponding to each image based on the positions of the objects in the multiple images in the corresponding images in the image dataset. The statistical prediction module is configured to statistically analyze the initial anchor box range to obtain anchor box size distribution information corresponding to the image dataset. The anchor box adjustment module is configured to adjust the initial anchor box range based on the anchor box size distribution information to obtain a target anchor box range. The first determination module is configured to determine the target box corresponding to each image based on the target anchor box range.

[0072] Optionally, the cutting module includes a first statistical module, a first processing module, and a second processing module. The first statistical module is configured to count the number of regions corresponding to a first proportion and the number of regions corresponding to a second proportion according to the proportion distribution data, wherein the first proportion represents a region proportion less than or equal to a target threshold, and the second proportion represents a region proportion greater than the target threshold. The first processing module is configured to determine a first type of image from the image dataset and perform cutting processing on the first type of image to obtain a cutting-processed first type of image, wherein the first type of image is an image in which the number of regions corresponding to the first proportion is greater than or equal to the number of regions corresponding to the second proportion. The second processing module is configured to determine a second type of image from the image dataset and not perform cutting processing on the second type of image, and generate a cutting-processed image dataset based on the cutting-processed first type of image and the second type of image.

[0073] Optionally, the first processing module comprises a first cutting module and a generating module. The first cutting module is configured to cut each image in the first type of images into a plurality of sub-images based on the target anchor frame range. The generating module is configured to generate the first type of images processed by cutting based on the plurality of sub-images corresponding to each image.

[0074] Optionally, the generation apparatus of the recognition model further comprises a result obtaining module, a first recognition module, a second recognition module, and a first adjustment module. The result obtaining module is configured to, after obtaining the target recognition model by training the initial recognition model based on the image dataset processed by cutting, obtain a first recognition result of the target recognition model recognizing the first type of images processed by cutting and a second recognition result of the target recognition model recognizing the second type of images. The first recognition module is configured to determine a first recognition accuracy of the target recognition model recognizing the first type of images based on the first recognition result. The second recognition module is configured to determine a second recognition accuracy of the target recognition model recognizing the second type of images based on the second recognition result. The first adjustment module is configured to adjust parameters of the target recognition model based on the first recognition accuracy and / or the second recognition accuracy.

[0075] Optionally, the first adjustment module comprises a jigsaw module and a second adjustment module. The jigsaw module is configured to perform jigsaw processing on the first recognition result corresponding to the plurality of sub-images to obtain a spliced image. The second adjustment module is configured to adjust the parameters of the target recognition model based on a similarity between the spliced image and an original image, wherein the original image is an image before cutting corresponding to the spliced image in the first type of images.

[0076] Optionally, the generation apparatus of the recognition model further comprises a feature extraction module, an information extraction module, and a third recognition module. The feature extraction module is configured to, after obtaining the target recognition model by training the initial recognition model based on the image dataset processed by cutting, perform feature extraction on a to-be-recognized image through a feature layer in the target recognition model to obtain first data features. The information extraction module is configured to perform multi-scale information extraction on the first data features through a transmission layer in the target recognition model to obtain second data features. The third recognition module is configured to recognize a to-be-recognized object in the to-be-recognized image based on the second data features to obtain a target recognition result.

[0077] Example 5

[0078] According to embodiments of the present disclosure, the present disclosure further provides an electronic device, a readable storage medium, and a computer program product.

[0079] Figure 5A schematic block diagram of an example electronic device 500 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit the implementations of the present disclosure described and / or claimed in this document.

[0080] As shown, the device 500 includes a computing unit 501 that can perform various appropriate actions and processes in accordance with a computer program stored in a read-only memory (ROM) 502 or a computer program loaded into a random access memory (RAM) 503 from a storage unit 505. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504. Figure 5 Various components in the device 500 are connected to the I / O interface 505, including an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a magnetic disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.

[0081]

[0082] ​The computing unit 501 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 501 performs various methods and processes described above, such as the generation method of the identification model. For example, in some embodiments, the generation method of the identification model can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 508. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the generation method of the identification model described above can be performed. Alternatively, in other embodiments, the computing unit 501 can be configured to perform the generation method of the identification model by any other appropriate means, such as by means of firmware.

[0083] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a programmable logic device (PLD), a computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0084] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces the functions / operations specified in the flowcharts and / or the block diagrams. The program code can be entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine or server, or entirely on a remote machine or server.

[0085] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0086] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0087] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0088] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises from computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.

[0089] It should be understood that the various forms of flow shown above can be used to reorder, add, or remove steps. For example, the steps described in the present disclosure can be performed in parallel, in series, or in a different order, without limitation herein, so long as the desired results of the technology described in the present disclosure are achieved.

[0090] The specific implementation described above does not constitute a limitation on the protection scope of the present disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A method for generating a recognition model, comprising: obtaining an image dataset, and performing anchor-free regression processing on the image dataset to determine target bounding boxes of a plurality of images contained in the image dataset, wherein the target bounding boxes are used to identify regions of objects in the corresponding images; determining distribution data of the image dataset based on the target bounding boxes of the plurality of images, wherein the distribution data of the image dataset represents distribution information of region ratios of the target bounding boxes in the corresponding images; counting a first type region ratio corresponding quantity and a second type region ratio corresponding quantity according to the distribution data, wherein the first type region ratio represents a region ratio less than or equal to a target threshold, and the second type region ratio represents a region ratio greater than the target threshold; determining first type images from the image dataset, and performing cutout processing on the first type images to obtain cutout processed first type images, wherein the first type images are images with the first type region ratio corresponding quantity greater than or equal to the second type region ratio corresponding quantity; determining second type images from the image dataset, and not performing cutout processing on the second type images, and generating a cutout processed image dataset based on the cutout processed first type images and the second type images; training an initial recognition model based on the cutout processed image dataset to obtain a target recognition model, wherein the initial recognition model is used to at least perform multi-scale feature extraction on objects in the cutout processed image dataset; wherein the cutout processing on the first type images to obtain the cutout processed first type images comprises: dividing each image in the first type images into a plurality of sub-images based on a target anchor box range, wherein the target anchor box range is used to determine the target bounding box corresponding to the each image; and generating the cutout processed first type images based on the plurality of sub-images corresponding to the each image.

2. The method of claim 1, wherein, The anchor-free regression processing on the image dataset to determine the target bounding boxes of the plurality of images contained in the image dataset comprises: predicting an initial anchor box range corresponding to each image based on positions of objects in the plurality of images in the corresponding images; counting the initial anchor box range to obtain anchor box size distribution information corresponding to the image dataset; adjusting the initial anchor box range based on the anchor box size distribution information to obtain a target anchor box range; determining the target bounding box corresponding to the each image based on the target anchor box range.

3. The method of claim 1, wherein, After the training of the initial recognition model based on the cutout processed image dataset to obtain the target recognition model, the method further comprises: obtaining a first recognition result of the target recognition model on the cutout processed first type images, and a second recognition result of the target recognition model on the second type images; determining a recognition accuracy of the target recognition model on the first type images based on the first recognition result to obtain a first recognition accuracy; and determining a recognition accuracy of the target recognition model on the second type images based on the second recognition result to obtain a second recognition accuracy. determine, based on the second recognition result, a recognition accuracy of the target recognition model in recognizing the second type of image, to obtain a second recognition accuracy; adjust parameters of the target recognition model based on the first recognition accuracy and / or the second recognition accuracy.

4. The method of claim 3, wherein, adjusting the parameters of the target recognition model based on the first recognition accuracy includes: performing jigsaw processing on the first recognition results corresponding to the plurality of sub-images to obtain a spliced image; adjusting the parameters of the target recognition model based on the similarity between the spliced image and an original image, wherein the original image is an image before the image corresponding to the spliced image is cut in the first type of image.

5. The method of claim 1, wherein, After training the initial recognition model based on the cut image processed image dataset to obtain the target recognition model, the method further includes: extracting features of a to-be-recognized image through a feature layer in the target recognition model to obtain first data features; extracting multi-scale information of the first data features through a transmission layer in the target recognition model to obtain second data features; recognizing a to-be-recognized object in the to-be-recognized image based on the second data features to obtain a target recognition result.

6. A generation device of a recognition model, comprising: an acquisition module configured to acquire an image dataset and perform anchor-free regression processing on the image dataset to determine target frames of a plurality of images included in the image dataset, wherein the target frames are used to identify regions of objects in corresponding images; a distribution determination module configured to determine proportion distribution data corresponding to the image dataset based on the target frames of the plurality of images, wherein the proportion distribution data represents distribution information of region proportions of the target frames in corresponding images in the image dataset; a cutting module configured to determine a quantity corresponding to a first region proportion and a quantity corresponding to a second region proportion according to the proportion distribution data, wherein the first region proportion represents that the region proportion is less than or equal to a target threshold, the second region proportion represents that the region proportion is greater than the target threshold, determine a first type of image from the image dataset, and perform cutting processing on the first type of image to obtain a first type of image processed by cutting, wherein the first type of image is an image whose quantity corresponding to the first region proportion is greater than or equal to the quantity corresponding to the second region proportion; determine a second type of image from the image dataset, and do not perform cutting processing on the second type of image, and generate the image dataset processed by cutting based on the first type of image processed by cutting and the second type of image; a model training module configured to train an initial recognition model based on the image dataset processed by cutting to obtain a target recognition model, wherein the initial recognition model is used at least for multi-scale feature extraction of an object in the image dataset processed by cutting. The cutting module is further configured to: cut each image in the first type of images into a plurality of sub-images based on a target anchor frame range, wherein the target anchor frame range is used to determine a target frame corresponding to the each image; and generate the first type of images after the cutting processing based on the plurality of sub-images corresponding to the each image. 7.An electronic device, comprising: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of claim 1 to 5.

8. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are configured to enable the computer to perform the method of claim 1 to 5. 9.A computer program product comprising a computer program which, when executed by a processor, implements the method of claim 1 to 5. 9.A computer program product comprising a computer program which, when executed by a processor, implements the method of claim 1 to 5.

Citation Information

Patent Citations

  • Recognition model training method and device, recognition method and device, equipment and storage medium

    CN113221768A

  • Dense small target detection method based on improved YOLOV4

    CN113935412A