Model training method, target detection method, electronic device and storage medium

By screening and supplementing the original data set and using the perspective transformation correction network model to train and generate a second target data set, the problem of low accuracy of the target detection network model in large-viewing angle scenes is solved, and efficient target recognition is achieved under different viewing angles.

CN116597246BActive Publication Date: 2025-09-12BEIJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310403529.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-14
Publication Date
2025-09-12
Estimated Expiration
2043-04-14

AI Technical Summary

Technical Problem

In the existing technology, due to the difficulty in obtaining new data or data missing, the trained target detection network model is not very accurate in identifying targets, especially in large-viewing angle scenarios, which is difficult to meet actual needs.

Method used

By screening and supplementing the original data set, the first target data set is determined, and the perspective transformation correction network model is used for training to generate the second target data set. Finally, the initial target detection network model is trained to form a preset target detection network model.

Benefits of technology

Without increasing the amount of data, the recognition accuracy and reliability of the target detection network model in large and small viewing angle images are improved, and the scope of application of the model is expanded.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116597246B_ABST
    Figure CN116597246B_ABST
Patent Text Reader

Abstract

The present invention provides a model training method, a target detection method, an electronic device, and a storage medium, wherein the method comprises: obtaining an original data set, wherein each original data in the original data set includes an original image captured at a corresponding viewing angle and type and location information of a target of interest in the original image; performing data screening and data supplementation on the original data set to determine a first target data set; training an initial perspective transformation correction network model based on the first target data set to determine a target perspective transformation correction network model; performing data supplementation on the original data set based on the target perspective transformation correction network model to determine a second target data set; and training an initial target detection network model based on the second target data set to determine a preset target detection network model. The present invention can accurately identify targets of interest in images with large or small viewing angles without acquiring new data to expand the original data set.
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 model training method, a target detection method, an electronic device, and a storage medium. Background Art

[0002] As object detection algorithms become increasingly mature, their applications are becoming increasingly widespread. For example, they can be applied to various fields, such as face detection, pedestrian detection, vehicle detection, road detection in satellite images, obstacle detection in vehicle-mounted camera images, and lesion detection in medical imaging. Therefore, improving the accuracy of object detection becomes particularly important.

[0003] In related technologies, a data set is usually obtained first, and then the data set is used to train a supervised learning target detection network model, so that the trained target detection network model can be used in subsequent target detection.

[0004] However, since supervised learning requires a large amount of data in the dataset, and new data is usually obtained to expand the dataset when the amount of data is small, the accuracy of the trained target detection network model in identifying targets is not high due to the difficulty in obtaining new data or data missing problems. Summary of the Invention

[0005] The present invention provides a model training method, a target detection method, an electronic device and a storage medium, which are used to solve the defect in the prior art that the trained target detection network model has low accuracy in identifying targets due to the difficulty in obtaining new data or data missing problems when obtaining new data to expand the data set of the training target detection network model. By determining a second target data set with a large data volume and rich data content without obtaining new data to expand the original data set, a preset target detection network model for identifying targets of interest in images taken at a perspective of interest can also be determined, thereby improving the accuracy and reliability of identifying targets of interest in images with a large or small perspective, and also greatly improving the scope of application of the trained preset target detection network model.

[0006] In a first aspect, the present invention provides a model training method, comprising:

[0007] Acquire an original data set, where each original data in the original data set includes an original image captured at a corresponding viewing angle and type information and position information of an object of interest in the original image;

[0008] Performing data screening and data supplementation on the original data set to determine a first target data set; wherein each first target data in the first target data set includes type information and position information of an object of interest in an image of interest captured at a preset viewing angle;

[0009] Based on the first target data set, an initial perspective transformation correction network model is trained to determine a target perspective transformation correction network model;

[0010] Based on the target perspective transformation correction network model, the original data set is supplemented to determine a second target data set;

[0011] Based on the second target data set, the initial target detection network model is trained to determine a preset target detection network model.

[0012] According to a model training method provided by the present invention, the data screening and data supplementation of the original data set to determine the first target data set includes:

[0013] Based on preset target of interest requirement information, the original data set is screened to determine a data set of interest, where each data of interest in the data set of interest includes an image of interest of the target of interest at a preset viewing angle and type information and location information of the target of interest;

[0014] Determining a plurality of first perspective transformation matrices based on a preset perspective transformation threshold, preset data distribution requirement information, and a first preset quantity threshold;

[0015] When it is determined that the correlation of the plurality of first perspective transformation matrices satisfies a uniform distribution condition, for each first perspective transformation matrix, randomly transforming an image of interest randomly selected from the data set of interest using the first perspective transformation matrix to determine a transformed image;

[0016] Based on the transformed image and the first perspective transformation matrix, data supplementation is performed on the dataset of interest to determine the first target dataset.

[0017] According to a model training method provided by the present invention, the method of performing data complement on the original data set based on the target perspective transformation correction network model to determine a second target data set includes:

[0018] For each original image in the original data set, using the target perspective transform correction network model to identify the perspective transform distribution of the target of interest in the original image, and determine a perspective transform distribution map;

[0019] determining a deviation of the center of gravity of the perspective transformation vector information in the perspective transformation distribution map from a uniform distribution center, a variance of the perspective transformation vector information, and a correlation coefficient of the perspective transformation vector information;

[0020] When the deviation is greater than a deviation threshold, the variance is less than a variance threshold, or the correlation coefficient is greater than a coefficient threshold, determining, based on a preset target of interest attention weight and the deviation, the variance, or the correlation coefficient, a plurality of target images generated for the data-missing position of the target of interest in the original image;

[0021] For each target image, the original data set is completed using the target image to determine the second target data set.

[0022] According to a model training method provided by the present invention, the method of determining, based on a preset attention weight of the target of interest, and the deviation, the variance, or the correlation coefficient, a plurality of target images generated for a data missing location of the target of interest in the original image, includes:

[0023] Determining a plurality of second perspective transformation matrices based on a preset target of interest attention weight and a second preset quantity threshold, and the deviation, the variance, or the correlation coefficient;

[0024] When it is determined that the correlation of the multiple second perspective transformation matrices meets the uniform distribution condition, for each second perspective transformation matrix, the data missing position of the target of interest in the original image is randomly transformed using the second perspective transformation matrix to determine the target image.

[0025] According to a model training method provided by the present invention, for each target image, using the target image to complete the original data set to determine the second target data set includes:

[0026] For each target image, if the target image is an image containing the object of interest, labeling the target image with position information and type information of the object of interest to determine labeling information;

[0027] When the target image is a background image that does not contain the target of interest, performing compensation and distortion processing on the target image to determine a negative sample image;

[0028] Based on the target image and the annotation information, or based on the negative sample image, data completion is performed on the original data set to determine the second target data set.

[0029] According to a model training method provided by the present invention, determining multiple first perspective transformation matrices based on a preset perspective transformation threshold, preset data distribution requirement information, and a first preset quantity threshold includes:

[0030] Determining a uniformly distributed and normalized first random number sequence based on the preset perspective transformation threshold, the preset data distribution requirement, and the first preset quantity threshold;

[0031] Based on preset matrix combination requirement information, matrix combination is performed on the first random number sequence to determine the multiple first perspective transformation matrices.

[0032] According to a model training method provided by the present invention, the initial perspective transformation correction network model is a network model containing a residual network and a U-net network.

[0033] In a second aspect, the present invention further provides a target detection method, comprising:

[0034] Obtain a set of images to be tested, and a preset target detection network model determined by training according to the model training method described in the first aspect, wherein the set of images to be tested includes images containing targets of interest taken from different perspectives;

[0035] The image set to be tested is input into the preset target detection network model, and the target type information and target position information of the target of interest output by the preset target detection network model under a preset viewing angle are determined, and the preset viewing angle belongs to the different viewing angles.

[0036] In a third aspect, the present invention also provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the processor implements any one of the above-mentioned model training methods or the above-mentioned target detection method.

[0037] In a fourth aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any one of the above-described model training methods or the above-described target detection method.

[0038] The present invention provides a model training method, a target detection method, an electronic device and a storage medium, wherein the model training method determines a target perspective transformation correction network model by training an initial perspective transformation correction network model with a first target data set determined after data screening and data supplementation based on an original data set, and then determines a preset target detection network model by training an initial target detection network model with a second target data set determined after data supplementation based on the original data set through the target perspective transformation correction network model. Since each original data in the original data set is the original image taken at the corresponding perspective and the type information and position information of the target of interest in the original image, each first target data in the first target data set includes the type information and position information of the target of interest in the image of interest taken at the preset perspective. Therefore, without deliberately acquiring a new data set, it is only necessary to simply mark the position information and type information of the target in the original image, screen and supplement the data, complete the data, and perform simple auxiliary network training to determine a second target data set with a large amount of data and rich data content, thereby also being able to determine a preset target detection network model for identifying the target of interest in the image taken at the perspective of interest. This can not only achieve the purpose of accurately identifying the target of interest in images with a large or small perspective, but also greatly improve the scope of application of the trained preset target detection network model. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0040] Figure 1 This is one of the flow charts of the model training method provided by the present invention;

[0041] Figure 2 is a schematic diagram of the annotation information corresponding to the original image provided by the present invention;

[0042] Figure 3 This is a schematic diagram of the effect of the original image provided by the present invention after perspective transformation correction;

[0043] Figure 4 This is the second flow chart of the model training method provided by the present invention;

[0044] Figure 5 Schematic diagram of the target detection method provided by the present invention;

[0045] Figure 6It is a structural diagram of the model training device provided by the present invention;

[0046] Figure 7 It is a structural schematic diagram of the target detection device provided by the present invention;

[0047] Figure 8 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0048] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0049] As object detection algorithms become increasingly mature, their applications are becoming increasingly widespread. For example, they can be applied to various fields, such as face detection, pedestrian detection, vehicle detection, road detection in satellite images, obstacle detection in vehicle-mounted camera images, and lesion detection in medical imaging. Therefore, improving the accuracy of object detection becomes particularly important.

[0050] In related technologies, a data set is usually obtained first, and then the data set is used to train a supervised learning target detection network model, so that the trained target detection network model can be used in subsequent target detection applications.

[0051] However, supervised learning requires a large dataset, and when the dataset is small, new data is often acquired to expand the dataset. This difficulty or lack of new data makes it difficult for the target detection algorithm to learn the characteristics of targets at different angles during the training of the target detection network model. This results in low target recognition accuracy for the trained target detection network model, which in turn directly results in target detection accuracy in scenes with wide viewing angles failing to meet actual requirements. Therefore, optimizing the accuracy of target detection in scenes with wide viewing angles has become a key challenge in the implementation of target detection methods.

[0052] In order to solve the above technical problems, the present invention provides a model training method, a target detection method, an electronic device and a storage medium. Figures 1-8The model training method, target detection method, electronic device and storage medium of the present invention are described, wherein the execution subject of the model training method can be a terminal device, and the terminal device can be other electronic devices such as a personal computer (PC), a portable device, a laptop computer, a smart phone, a tablet computer and a portable wearable device. It is understandable that the execution subject of the model training method can also be a server, and the server can refer to a single server, or a server cluster composed of multiple servers, a cloud computing center, and the like. The present invention does not limit the specific form of the terminal device or server. The following method embodiment is described by taking the execution subject as a terminal device as an example.

[0053] Figure 1 A flow chart of the model training method provided by the present invention is shown in FIG. Figure 1 As shown, the model training method includes the following steps:

[0054] Step 110 : Acquire an original data set, where each original data in the original data set is an original image captured at a corresponding viewing angle and type information and position information of an object of interest in the original image.

[0055] Among them, the type information of the target of interest may include but is not limited to human faces, animals, vehicles, trees, roads, vehicles, etc. The target of interest in each original image can be one or more, and the viewing angle for shooting each original image can be a large viewing angle, a small viewing angle, or an angle between a small viewing angle and a large viewing angle. The large viewing angle is an angle with a large deviation from the flat viewing angle, and the small viewing angle is an angle with a small deviation from the flat viewing angle.

[0056] Specifically, the terminal device obtains the original data set by first obtaining multiple original images, then instructing the user to manually annotate the type and location information of the target of interest in each original image, and then formatting each original image and its corresponding annotation information to obtain the original data set. It should be noted that the annotation information corresponding to each original image can be in other formats such as json, yaml or txt, and the annotation information corresponding to each original image can be as follows: Figure 2 As shown, in Figure 2 In the , the numbers in the first column are the different types of information numbers for different targets of interest, and the 2nd to 5th data in each row are the position information of the normalized target box in the corresponding original image. In addition, through manual and machine-assisted methods, the bbox box position of the target of interest is annotated on each original image and formatted and stored together with the corresponding image of interest as the original dataset

[0057] Step 120: Screen and supplement the original data set to determine a first target data set.

[0058] Each first target data in the first target data set includes type information and position information of the target of interest in the image of interest captured at a preset viewing angle.

[0059] Specifically, the terminal device performs data screening and data supplementation on the acquired original data set, and can select some original images that meet the actual target detection requirements from the original data set as images of interest, and determine each image of interest and the type information and position information of the target of interest under a preset perspective in each image of interest as the filtered data set; the actual target detection requirement here represents the specified target of interest under a preset perspective, and the preset perspective can be a specified angle; in this way, each image of interest can be filtered out. Furthermore, the terminal device performs data supplementation on each filtered image of interest, for example, by randomly transforming the filtered image of interest using a preset uniformly distributed perspective transformation matrix to generate a transformed image different from the image of interest, and then supplements the filtered data set based on the transformed image and the perspective transformation matrix, so that the filtered data set includes not only the type information and position information of the image of interest and the target of interest, but also the newly added transformed image and perspective transformation matrix; thereby determining the first target data set.

[0060] Step 130: Based on the first target data set, train the initial perspective transformation correction network model to determine the target perspective transformation correction network model.

[0061] Specifically, the terminal device first divides the first target data set into two data sets and uses one of the data sets as the first training sample set and the other data set as the first test sample set. The data size of the first training sample set and the first test sample set can be equal or different. For example, if the first target data set contains 100 first target data, the first training sample set can contain 50 first target data and the first test sample set can contain 50 first target data, or the first training sample set can contain 60 first target data and the first test sample set can contain 40 first target data. This is not specifically limited here.

[0062] Based on this, the terminal device uses the first training sample set to train the initial perspective transform correction network model, obtains the loss value of the intermediate perspective transform correction network model after the preset number of trainings, and stops training when it is determined that the loss value of the intermediate perspective transform correction network model after the preset number of trainings is less than or equal to the first loss threshold. At the same time, the intermediate perspective transform correction network model corresponding to the time of stopping training is determined as the target perspective transform correction network model; conversely, when it is determined that the loss value of the intermediate perspective transform correction network model after the preset number of trainings is greater than the first loss threshold, the first training sample set is used to continue training the intermediate perspective transform correction network model after the preset number of trainings. Until the target perspective transform correction network model is determined when the training is stopped. It should be noted that each time the intermediate perspective transform correction network model after the last training is trained, the model parameters of the intermediate perspective transform correction network model after the last training must be automatically updated before the current training is carried out.

[0063] It should be noted that the initial perspective transformation correction network model is a network model containing a residual network and a U-net network, with the residual network serving as the backbone of the initial perspective transformation correction network model. The input of the initial perspective transformation correction network model is an image from the first target dataset, and the output is information about the type of the specified target and a six-dimensional vector. The six-dimensional vector corresponds to the six coefficients in the perspective transformation matrix. Furthermore, the initial perspective transformation correction network model can be any existing supervised learning-based prediction algorithm, model, or neural network.

[0064] Step 140: Based on the target perspective transformation correction network model, the original data set is completed to determine a second target data set.

[0065] Specifically, the terminal device uses the target perspective transformation correction network model to perform a distribution analysis on the original data set. When it is determined through the distribution analysis that the original data set is missing data in a certain direction, the data set generation algorithm can be used to randomly generate a target image at the location where the data is missing, and instruct the user to manually label the location information and type information of the target of interest for each randomly generated target image. In this way, the original data set is supplemented based on the randomly generated target image and its corresponding annotation information, thereby determining the second target data set.

[0066] Step 150: Based on the second target data set, train the initial target detection network model to determine a preset target detection network model.

[0067] The initial target detection network model is a network model that includes any existing supervised learning target detection algorithm, such as any existing supervised learning-based prediction algorithm, model, or neural network, without specific limitation.

[0068] Specifically, the terminal device first divides the second target data set into two data sets and uses one of the data sets as the second training sample set and the other data set as the second test sample set. The data amounts of the second training sample set and the second test sample set can be equal or different. For example, if the second target data set contains 100 second target data, the second training sample set can contain 50 second target data and the second test sample set can contain 50 second target data, or the second training sample set can contain 60 second target data and the second test sample set can contain 40 second target data. This is not specifically limited here.

[0069] Based on this, the terminal device uses the second training sample set to train the initial target detection network model, obtains the loss value of the intermediate target detection network model after the preset number of trainings, and stops training when it is determined that the loss value of the intermediate target detection network model after the preset number of trainings is less than or equal to the second loss threshold. At the same time, the intermediate target detection network model corresponding to the time of stopping training is determined as the preset target detection network model; conversely, when it is determined that the loss value of the intermediate target detection network model after the preset number of trainings is greater than the second loss threshold, the second training sample set is used to continue training the intermediate target detection network model after the preset number of trainings. Until the preset target detection network model is determined when the training is stopped. It should be noted that each time the intermediate target detection network model after the last training is trained, the model parameters of the intermediate target detection network model after the last training must be automatically updated before the current training is carried out.

[0070] The model training method provided by the present invention is that the terminal device determines the target perspective transformation correction network model by training the initial perspective transformation correction network model based on the first target data set determined after data screening and data supplementation of the original data set, and then determines the preset target detection network model by training the initial target detection network model based on the second target data set determined after data supplementation of the target perspective transformation correction network model based on the original data set. Since each original data in the original data set is the original image taken at the corresponding perspective and the type information and position information of the target of interest in the original image, each first target data in the first target data set includes the type information and position information of the target of interest in the image of interest taken at the preset perspective. Therefore, without deliberately acquiring a new data set, it is only necessary to simply mark the position information and type information of the target in the original image, screen and supplement the data, complete the data, and perform simple auxiliary network training to determine a second target data set with a large amount of data and rich data content, thereby also being able to determine a preset target detection network model for identifying the target of interest in the image taken at the perspective of interest. This not only improves the accuracy and reliability of identifying the target of interest in images with a large or small perspective, but also greatly improves the scope of application of the trained preset target detection network model.

[0071] Optionally, the specific implementation process of step 120 may include:

[0072] First, based on preset target of interest requirement information, the original data set is screened to determine the target of interest data set, where each target of interest in the target of interest data set includes an image of interest of the target of interest at a preset perspective and type information and position information of the target of interest; then, based on a preset perspective transformation threshold, preset data distribution requirement information, and a first preset quantity threshold, a plurality of first perspective transformation matrices are determined; further, when it is determined that the correlation of the plurality of first perspective transformation matrices satisfies a uniform distribution condition, the perspective transformation matrix is ​​used to perform a random transformation on an image of interest randomly selected from the target of interest data set for each perspective transformation matrix to determine a transformed image; then, based on the transformed image and the first perspective transformation matrix, the target of interest data set is supplemented to determine the first target data set.

[0073] Specifically, the terminal device first obtains preset target of interest requirement information. The preset target of interest requirement information can be manually input into the terminal device by the user, and the preset target of interest requirement information contains targets of interest with preset perspectives and specified category information. Since a certain category of specified targets can usually include multiple targets, for example, when the target of the specified category information is a face, the corresponding specified targets can include but are not limited to female faces of different face shapes, male faces of different face shapes, etc. Therefore, based on the preset target of interest requirement information, the original data set is filtered. That is, for each target of interest in a certain category of targets of interest, all raw data in the original data set containing the target of interest at the preset perspective is used as the data of interest. In this way, all the data of interest that meets the preset target of interest requirement information is filtered out from the original data set, thereby determining the data set of interest.

[0074] At this time, for the data set of interest, the preset perspective transformation threshold, preset data distribution requirement information and the first preset quantity threshold can be input into the perspective transformation model to obtain multiple first perspective transformation matrices output by the perspective transformation model, and the correlation coefficient of the multiple first perspective transformation matrices is calculated using the Euclidean distance to analyze whether the distribution of the multiple first perspective transformation matrices is uniform, and when the correlation of the multiple first perspective transformation matrices meets the uniform distribution condition, for each first perspective transformation matrix, the first perspective transformation matrix is ​​used to randomly transform the image of interest randomly selected from the data set of interest to determine the transformed image; since the image of interest is randomly selected from the data set of interest here, there is a possibility that the same image of interest is selected for random transformation at least twice, but try to ensure that the image of interest selected each time is different.

[0075] Finally, based on the transformed image and the first perspective transformation matrix, the data set of interest is supplemented. That is, the first perspective transformation matrix and the transformed image are supplemented to the data of interest corresponding to the image of interest selected this time, so that the data of interest includes not only the type and location information of the image of interest and the target of interest, but also the first perspective transformation matrix and the transformed image. At this point, the data supplementation process for the data set of interest using one first perspective transformation matrix is ​​completed. In this way, the data supplementation process for the data set of interest can be used to supplement the data set of interest using the next first perspective transformation matrix. After completing the data supplementation of the data set of interest using multiple first perspective transformation matrices, the first target data set can be obtained. Alternatively, the data supplementation process for each perspective transformation matrix of the data set of interest can be completed in parallel or simultaneously in this way to obtain the first target data set. This is not specifically limited here.

[0076] In the model training method provided by the present invention, a terminal device screens the original data set to determine a data set of interest, then uses multiple evenly distributed first perspective transformation matrices to randomly transform a portion of the images of interest within the data set of interest. The data set of interest is then supplemented based on the multiple transformed images and the multiple first perspective transformation matrices obtained from the random transformations. This combination of data screening and perspective transformation techniques effectively improves the rationality and reliability of determining the first target data set, while also supplementing the data set required for model training, laying the foundation for the accuracy of subsequent model training.

[0077] Optionally, in step 120, a plurality of first perspective transformation matrices are determined based on a preset perspective transformation threshold, preset data distribution requirement information, and a first preset quantity threshold. The specific implementation process may include:

[0078] First, based on a preset perspective transformation threshold, preset data distribution requirement information, and a first preset quantity threshold, a uniformly distributed and normalized first random number sequence is determined; and then, based on preset matrix combination requirement information, the first random number sequence is matrix combined to determine a plurality of first perspective transformation matrices.

[0079] Specifically, the terminal device can use any pseudo-random number generation algorithm to randomly generate a uniformly distributed and normalized first random number sequence based on a preset perspective transformation threshold, preset data distribution requirement information and a first preset quantity threshold. The first random number sequence contains multiple first random numbers and the number of first random numbers is the same as the first preset quantity threshold. At this time, based on the preset matrix combination requirement information, the first random number sequence is matrix combined to determine multiple first perspective transformation matrices. The preset matrix combination requirement information can be input into the terminal device in advance by the user, and the preset matrix combination requirement information includes matrix combination method information, that is, each several first random numbers are selected as a group of combination matrices. For example, each 6 first random numbers can be selected as a group of combination matrices. When the first random number sequence contains 60 first random numbers, they can be combined into 10 first perspective transformation matrices.

[0080] It should be noted that, since the perspective transformation can be achieved through the following

[0081]

[0082] In formula (1), Represents the three coordinates after transmission transformation, represents the two-dimensional coordinates before the transmission transformation, m 11 、m 21 、m 31 、m 12 、m 22 、m 32 、m 13 、m23 、m 33 Represents the 9 different coefficients in the standard perspective transformation matrix.

[0083] By analyzing formula (1), we can know that m 13 and m 23 Responsible for translation transformation, so it can be 0, and m 33 Is a scaling factor, which can be considered to be 1, so the perspective transformation of formula 1 can be simplified to the following form:

[0084]

[0085] In formula (2), the simplified perspective transformation matrix contains 6 coefficients that are independent of each other, m 31 and m 32 There are limitations between them, so it is only necessary to randomly generate them within a limited range to obtain the perspective transformation matrix and transform the XY coordinates of each point in the image. If there is no one-to-one correspondence after the transformation, it is discarded or interpolated. In other words, each first perspective transformation matrix determined in this solution is determined through reasonable analysis and simplification, that is, the 3*3 first perspective transformation matrix that meets the requirements is determined by simplifying the standard 3*3 perspective transformation matrix. Therefore, when performing matrix combination for the first random number sequence in this solution, each first random number selected is also 6.

[0086] In the model training method provided by the present invention, the terminal device determines multiple first perspective transformation matrices by performing matrix combination on the generated uniformly distributed and normalized first random number sequence; thereby improving the rationality and reliability of determining the first perspective transformation matrix.

[0087] Optionally, the specific implementation process of step 130 may include:

[0088] First, for each original image in the original data set, the target perspective transformation correction network model is used to identify the perspective transformation distribution of the target of interest in the original image, and the perspective transformation distribution map is determined; then the deviation of the center of gravity of the perspective transformation vector information from the uniform distribution center, the variance of the perspective transformation vector information and the correlation coefficient of the perspective transformation vector information in the perspective transformation map are determined; further, when the deviation is greater than the deviation threshold, the variance is less than the variance threshold or the correlation coefficient is greater than the coefficient threshold, based on the preset target of interest attention weight, as well as the deviation, variance or correlation coefficient, multiple target images generated for the data missing position of the target of interest in the original image are determined; then, for each target image, the target image is used to complete the original data set to determine a second target data set.

[0089] Specifically, for each original image in the original data set, the terminal device can input the original image into the target perspective transformation correction network model to identify the perspective transformation distribution of the target of interest, and obtain the perspective transformation distribution map output by the target perspective transformation correction network model. The perspective transformation distribution map can be an image obtained after the original image is perspective transformed and corrected using the target perspective transformation correction network model, such as Figure 3 The original image shown in the figure is corrected by perspective transformation. Figure 3 In FIG, 301 is the original image, 302 is the image after perspective transformation correction, and A, B, C, and D are four corresponding points before and after perspective transformation correction.

[0090] At this time, the perspective transformation distribution map is analyzed to identify the perspective transformation vector information contained in the perspective transformation distribution map. The perspective transformation vector information is used as a high-dimensional vector. The Euclidean distance is used to calculate the deviation of the center of gravity of the perspective transformation vector information from the center of uniform distribution, the variance of the perspective transformation vector information, and the correlation coefficient of the perspective transformation vector information. Based on this, it is analyzed whether the perspective transformation distribution map is uniformly distributed. Any existing correlation algorithm can be used here to analyze whether the perspective transformation distribution map has correlation and whether the distribution is sufficiently wide. When it is determined that there is no correlation and the distribution is not wide, a dataset generation algorithm is used to randomly generate target images for data completion. That is, when it is determined that the distribution is uneven, the data missing location that causes the uneven distribution is determined in the image of interest. That is, when the deviation is greater than the deviation threshold, the variance is less than the variance threshold, or the correlation coefficient is greater than the coefficient threshold, the dataset generation algorithm is used to generate multiple target images for the data missing location of the target of interest in the original image, so that the first target dataset can be determined after the original dataset is completed using each target image.

[0091] The model training method provided by the present invention determines the data missing locations for the target of interest in the original data set by analyzing the perspective transformation distribution of the target of interest in the original image through a trained target perspective transformation correction network model, and generates multiple target images for the data missing locations to complete the original data set, thereby ensuring that the data volume of the second target data set is large enough and the data content is rich enough, thereby providing reliable data support for subsequent model training.

[0092] Optionally, in step 130, based on the preset attention weight of the target of interest, and the deviation, variance, or correlation coefficient, multiple target images generated for the data missing position of the target of interest in the original image are determined, and the specific implementation process may include:

[0093] First, based on a preset target of interest attention weight and a second preset quantity threshold, as well as a deviation, variance or correlation coefficient, a plurality of second perspective transformation matrices are determined; further, when it is determined that the correlation of the plurality of second perspective transformation matrices satisfies a uniform distribution condition, for each second perspective transformation matrix, the second perspective transformation matrix is ​​used to randomly transform the data missing position of the target of interest in the original image to determine the target image.

[0094] Specifically, the terminal device can set the center of gravity, variance, or correlation coefficient of the random number to be generated to be the deviation of the center of gravity of the perspective transformation vector information in the perspective transformation distribution map from the center of uniform distribution, the variance of the perspective transformation vector information, or the correlation coefficient of the perspective transformation vector information. On this basis, based on the preset target of interest attention weight and the second preset number threshold, as well as the deviation, variance, or correlation coefficient, any pseudo-random number generation algorithm is used to randomly generate a uniformly distributed and normalized second random number sequence, wherein the second random number sequence contains multiple second random numbers and the number of second random numbers is the same as the second preset number threshold. At this time, the second random number sequence is then matrix-combined. Here, for the second random number sequence, six second random numbers can also be selected as a group to determine multiple second perspective transformation matrices. Further, a correlation analysis is performed on the multiple second perspective transformation matrices. If it is determined that the correlation of the multiple second perspective transformation matrices meets the uniform distribution condition, each second perspective transformation matrix is ​​used to randomly transform the missing data position of the target of interest in the original image using each second perspective transformation matrix to determine each target image used to complete the original data set.

[0095] It should be noted that each second perspective transformation matrix may also be a simplified perspective transformation matrix determined by equations (2) to (3).

[0096] The model training method provided by the present invention improves the reliability and accuracy of completing the original data set by generating multiple second perspective transformation matrices with correlation for the data missing positions when the terminal device determines that the original data set is missing data, and then using each second perspective transformation matrix to determine each target image for the data missing position in the original image.

[0097] Optionally, in step 130, for each target image, the target image is used to complete the original data set to determine the second target data set. The specific implementation process may include:

[0098] For each target image, when the target image is an image containing an object of interest, the target image is annotated with the location information and type information of the object of interest to determine the annotation information; when the target image is a background image without an object of interest, the target image is compensated and distorted to determine a negative sample image; based on the target image and the annotation information, or based on the negative sample image, the original data set is completed to determine a second target data set.

[0099] Specifically, for each target image, the terminal device first determines whether the target image contains the target of interest. If the target image contains the target of interest, the position information and type information of the target of interest in the target image can be annotated. For example, the position information and type information of the target of interest in the target image can be annotated manually and with the assistance of the terminal device to obtain the annotation information. On the contrary, if the target image is a background image that does not contain the target of interest, the target image can be compensated and distorted using a conventional compensation distortion method, and the image obtained after the compensation and distortion is determined as a negative sample image. The original data set is then supplemented based on the target image and the annotation information, or based on the negative sample image, that is, the annotation information and the target image are added to the original data set as a new set of data, or the negative sample image is added to the negative sample image set of the original data set, and the negative sample image set is used to store images that do not contain the target of interest and have been compensated and distorted. At this time, the data supplement process of the original data set using one target image is completed. In this way, the next target image can be used to supplement the original data set. After completing the data complementation of the original dataset for multiple target images, a second target dataset can be obtained. Alternatively, the second target dataset can be obtained by completing the data complementation process for each target image in parallel or simultaneously in this manner. This is not specifically limited here.

[0100] The model training method provided by the present invention is that the terminal device determines, for each target image, the target image and annotation information, or the negative sample image, used to complete the original data set by marking the target image containing the target of interest with the location information and type information of the target of interest or performing compensation and distortion processing on the target image not containing the target of interest; thereby improving the necessity and rationality of data completion for the original data set, ensuring that the data volume of the second target data set determined through data completion is large enough and the data content is rich enough, thereby providing reliable data support for subsequent training models.

[0101] Reference Figure 4 , which is the second flow chart of the model training method provided by the present invention, such as Figure 4As shown, for the acquired original data set, a first target data set is generated based on the data set generation algorithm, and then the initial perspective transformation correction network model is trained using the first target data set to determine the target perspective transformation correction network model, and then the target perspective transformation correction network model is used to complete the original data set to determine the second target data set, and finally the second target data set is used to train the initial target detection network model to determine the preset target detection network model. The specific implementation process involved can refer to the aforementioned embodiment. It will not be repeated here. The preset target detection network model determined by the model training method can accurately identify the target of interest in the image taken in the wide-angle scene, and can also accurately identify the target of interest in the small-angle image, for the situation where there are many images taken in the wide-angle scene and fewer images taken in the small-angle scene.

[0102] Reference Figure 5 , which is a flow chart of the target detection method provided by the present invention. The target detection method may be executed by a terminal device or server. The terminal device may be a PC, portable device, laptop, smartphone, tablet computer, portable wearable device, or other electronic device. The server may be a single server, a server cluster composed of multiple servers, a cloud computing center, or the like. The present invention does not specifically limit the specific form of the terminal device or server. The following method embodiments are described using a terminal device as an example.

[0103] like Figure 5 As shown, the target detection method includes the following steps:

[0104] Step 510: Obtain a set of images to be tested, and train a preset target detection network model determined according to the aforementioned model training method.

[0105] Among them, the image set to be tested includes images containing targets of interest taken at different perspectives. For example, the image set to be tested may include large-perspective images of targets of interest taken at a large perspective and small-perspective images containing targets of interest taken at a small perspective; and the number of large-perspective images may be greater than the number of small-perspective images, or may be less than the number of small-perspective images.

[0106] Specifically, the terminal device may acquire the test image set by a user inputting the test image set into the terminal device. This input method may include, but is not limited to, input on the terminal device, input via an application on another device, or input via a photo and upload. For example, the test image set may be acquired by a user manually inputting the test image set into the terminal device, or by manually inputting the test image set into an application on another device connected to the terminal device. The method for acquiring the test image set is not specifically limited herein.

[0107] Step 520: Input the image set to be tested into a preset target detection network model, and determine the target type information and target position information of the target of interest at a preset viewing angle output by the preset target detection network model.

[0108] The preset viewing angle may be a large viewing angle or a small viewing angle, and the different viewing angles may include but are not limited to a large viewing angle, a small viewing angle, and an angle between the small viewing angle and the large viewing angle.

[0109] Specifically, during actual application, the terminal device can use a preset target detection network model to detect targets of interest in the image set to be tested, and output target type information and target location information of the target of interest at a preset viewing angle. For example, when the number of wide-angle images is greater than the number of narrow-angle images, the target type information and target location information of the target of interest can be identified when the preset viewing angle is wide, and the target type information and target location information of the target of interest can also be identified when the preset viewing angle is narrow.

[0110] The target detection method provided by the present invention is a method in which a terminal device detects targets of interest under a preset viewing angle on an image to be tested through a trained preset target detection network model, thereby ensuring the accuracy, reliability, convenience and speed of detecting targets of interest under a large viewing angle or a small viewing angle, and also greatly improving the scope of application of the preset target detection network model.

[0111] The model training device provided by the present invention is described below. The model training device described below and the model training method described above can be referenced to each other.

[0112] Reference Figure 6 , which is a structural diagram of the model training device provided by the present invention, such as Figure 6 As shown, the model training device 600 includes:

[0113] A first acquisition module 610 is configured to acquire an original data set, wherein each original data in the original data set includes an original image captured at a corresponding viewing angle and type information and position information of an object of interest in the original image;

[0114] A first determination module 620 is configured to perform data screening and data supplementation on the original data set to determine a first target data set; wherein each first target data in the first target data set includes type information and location information of an object of interest in an image of interest captured at a preset viewing angle;

[0115] A first training module 630 is configured to train an initial perspective transformation correction network model based on the first target data set to determine a target perspective transformation correction network model;

[0116] A second determination module 640 is configured to perform data completion on the original dataset based on the target perspective transformation correction network model to determine a second target dataset;

[0117] The second training module 650 is used to train the initial target detection network model based on the second target data set to determine a preset target detection network model.

[0118] Optionally, the first determination module 620 can be specifically used to perform data screening on the original data set based on preset target of interest requirement information to determine the data set of interest, where each data of interest in the data set of interest includes an image of interest of the target of interest at a preset perspective and type information and location information of the target of interest; determine multiple first perspective transformation matrices based on a preset perspective transformation threshold, preset data distribution requirement information and a first preset quantity threshold; when it is determined that the correlation of the multiple first perspective transformation matrices meets the uniform distribution condition, use the first perspective transformation matrix to randomly transform the image of interest randomly selected from the data set of interest for each first perspective transformation matrix to determine a transformed image; based on the transformed image and the first perspective transformation matrix, perform data supplement on the data set of interest to determine the first target data set.

[0119] Optionally, the first determination module 620 can also be used to determine a uniformly distributed and normalized first random number sequence based on the preset perspective transformation threshold, the preset data distribution requirement and the first preset quantity threshold; and perform matrix combination on the first random number sequence based on preset matrix combination requirement information to determine the multiple first perspective transformation matrices.

[0120] Optionally, the second determination module 640 can be specifically used to identify the perspective transformation distribution of the target of interest in each original image in the original data set using the target perspective transformation correction network model, and determine the perspective transformation distribution map; determine the deviation of the center of gravity of the perspective transformation vector information from the uniform distribution center, the variance of the perspective transformation vector information and the correlation coefficient of the perspective transformation vector information in the perspective transformation distribution map; when the deviation is greater than the deviation threshold, the variance is less than the variance threshold or the correlation coefficient is greater than the coefficient threshold, determine multiple target images generated for the data missing position of the target of interest in the original image based on the preset target of interest attention weight, and the deviation, the variance or the correlation coefficient; for each target image, use the target image to complete the data of the original data set to determine the second target data set.

[0121] Optionally, the second determination module 640 can also be used to determine multiple second perspective transformation matrices based on a preset target of interest attention weight and a second preset quantity threshold, as well as the deviation, the variance or the correlation coefficient; when it is determined that the correlation of the multiple second perspective transformation matrices meets the uniform distribution condition, for each second perspective transformation matrix, the second perspective transformation matrix is ​​used to randomly transform the data missing position of the target of interest in the original image to determine the target image.

[0122] Optionally, the second determination module 640 can also be specifically used to, for each target image, when the target image is an image containing the target of interest, label the target image with the location information and type information of the target of interest to determine the labeling information; when the target image is a background image that does not contain the target of interest, perform compensation and distortion processing on the target image to determine a negative sample image; based on the target image and the labeling information, or based on the negative sample image, perform data completion on the original data set to determine the second target data set.

[0123] Optionally, the initial perspective transformation correction network model in the first training module 630 is a network model including a residual network and a U-net network.

[0124] The target detection device provided by the present invention is described below. The target detection device described below and the target detection method described above can be referenced to each other.

[0125] Reference Figure 7 , which is a schematic diagram of the structure of the target detection device provided by the present invention, such as Figure 7 As shown, the target detection device 700 includes:

[0126] A second acquisition module 710 is configured to acquire a set of images to be tested, which are images containing an object of interest captured from different viewing angles, and a preset target detection network model determined by training using the model training method provided by any embodiment of the present invention.

[0127] The target detection module 720 is used to input the image set to be tested into the preset target detection network model, and determine the target type information and target position information of the target of interest output by the preset target detection network model under the preset perspective, and the preset perspective belongs to the different perspectives.

[0128] Figure 8 An example of a physical structure diagram of an electronic device is shown below. Figure 8As shown, the electronic device 800 may include: a processor 810, a communications interface 820, a memory 830, and a communication bus 840, wherein the processor 810, the communications interface 820, and the memory 830 communicate with each other via the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute the model training method, which includes:

[0129] Acquire an original data set, where each original data in the original data set includes an original image captured at a corresponding viewing angle and type information and position information of an object of interest in the original image;

[0130] Performing data screening and data supplementation on the original data set to determine a first target data set; wherein each first target data in the first target data set includes type information and position information of an object of interest in an image of interest captured at a preset viewing angle;

[0131] Based on the first target data set, an initial perspective transformation correction network model is trained to determine a target perspective transformation correction network model;

[0132] Based on the target perspective transformation correction network model, the original data set is supplemented to determine a second target data set;

[0133] Based on the second target data set, an initial target detection network model is trained to determine a preset target detection network model. Alternatively, a target detection method is performed, the method comprising:

[0134] Obtaining a set of images to be tested, and a preset target detection network model determined by training according to the model training method provided by any embodiment of the present invention, wherein the set of images to be tested includes images containing targets of interest taken from different perspectives;

[0135] The image set to be tested is input into the preset target detection network model, and the target type information and target position information of the target of interest under a preset viewing angle output by the preset target detection network model are determined.

[0136] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially 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 and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method 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. Various media that can store program code.

[0137] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can perform the model training method provided by the above methods, which includes:

[0138] Acquire an original data set, where each original data in the original data set includes an original image captured at a corresponding viewing angle and type information and position information of an object of interest in the original image;

[0139] Performing data screening and data supplementation on the original data set to determine a first target data set; wherein each first target data in the first target data set includes type information and position information of an object of interest in an image of interest captured at a preset viewing angle;

[0140] Based on the first target data set, an initial perspective transformation correction network model is trained to determine a target perspective transformation correction network model;

[0141] Based on the target perspective transformation correction network model, the original data set is supplemented to determine a second target data set;

[0142] Based on the second target data set, an initial target detection network model is trained to determine a preset target detection network model. Alternatively, a target detection method is performed, the method comprising:

[0143] Obtaining a set of images to be tested, and a preset target detection network model determined by training according to the model training method provided by any embodiment of the present invention, wherein the set of images to be tested includes images containing targets of interest taken from different perspectives;

[0144] The image set to be tested is input into the preset target detection network model, and the target type information and target position information of the target of interest output by the preset target detection network model under a preset viewing angle are determined, and the preset viewing angle belongs to the different viewing angles.

[0145] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the model training method provided by the above methods, the method comprising:

[0146] Acquire an original data set, where each original data in the original data set includes an original image captured at a corresponding viewing angle and type information and position information of an object of interest in the original image;

[0147] Performing data screening and data supplementation on the original data set to determine a first target data set; wherein each first target data in the first target data set includes type information and position information of an object of interest in an image of interest captured at a preset viewing angle;

[0148] Based on the first target data set, an initial perspective transformation correction network model is trained to determine a target perspective transformation correction network model;

[0149] Based on the target perspective transformation correction network model, the original data set is supplemented to determine a second target data set;

[0150] Based on the second target data set, an initial target detection network model is trained to determine a preset target detection network model. Alternatively, a target detection method is performed, the method comprising:

[0151] Obtaining a set of images to be tested, and a preset target detection network model determined by training according to the model training method provided by any embodiment of the present invention, wherein the set of images to be tested includes images containing targets of interest taken from different perspectives;

[0152] The image set to be tested is input into the preset target detection network model, and the target type information and target position information of the target of interest output by the preset target detection network model under a preset viewing angle are determined, and the preset viewing angle belongs to the different viewing angles.

[0153] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0154] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.

[0155] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A model training method, characterized in that: include: Acquire an original data set, where each original data in the original data set includes an original image captured at a corresponding viewing angle and type information and position information of an object of interest in the original image; Performing data screening and data supplementation on the original data set to determine a first target data set; wherein each first target data in the first target data set includes type information and position information of an object of interest in an image of interest captured at a preset viewing angle; Based on the first target data set, an initial perspective transformation correction network model is trained to determine a target perspective transformation correction network model; wherein the initial perspective transformation correction network model is a network model including a residual network and a U-net network, and the residual network is a backbone network of the initial perspective transformation correction network model; the input of the initial perspective transformation correction network model is an image in the first target data set, and the output is type information of the specified target and a six-dimensional vector, and there is a corresponding relationship between the six-dimensional vector and the coefficients in the perspective transformation matrix; Based on the target perspective transformation correction network model, the original data set is supplemented to determine a second target data set; Based on the second target data set, the initial target detection network model is trained to determine a preset target detection network model.

2. The model training method according to claim 1, characterized in that The screening and supplementing of the original data set to determine the first target data set includes: Based on preset target of interest requirement information, the original data set is screened to determine a target of interest data set, where each target of interest in the target of interest data set includes an image of interest of the target of interest at a preset viewing angle and type information and location information of the target of interest; Determining a plurality of first perspective transformation matrices based on a preset perspective transformation threshold, preset data distribution requirement information, and a first preset quantity threshold; When it is determined that the correlation of the plurality of first perspective transformation matrices satisfies a uniform distribution condition, for each first perspective transformation matrix, randomly transforming an image of interest randomly selected from the data set of interest using the first perspective transformation matrix to determine a transformed image; Based on the transformed image and the first perspective transformation matrix, data supplementation is performed on the dataset of interest to determine the first target dataset.

3. The model training method according to claim 1, characterized in that The method of performing data completion on the original data set based on the target perspective transformation correction network model to determine a second target data set includes: For each original image in the original data set, using the target perspective transform correction network model to identify the perspective transform distribution of the target of interest in the original image, and determine a perspective transform distribution map; determining a deviation of the center of gravity of the perspective transformation vector information in the perspective transformation distribution map from a uniform distribution center, a variance of the perspective transformation vector information, and a correlation coefficient of the perspective transformation vector information; When the deviation is greater than a deviation threshold, the variance is less than a variance threshold, or the correlation coefficient is greater than a coefficient threshold, determining, based on a preset target of interest attention weight and the deviation, the variance, or the correlation coefficient, a plurality of target images generated for the data-missing position of the target of interest in the original image; For each target image, the original data set is completed using the target image to determine the second target data set.

4. The model training method according to claim 3, characterized in that The step of determining, based on a preset target of interest attention weight, and the deviation, the variance, or the correlation coefficient, a plurality of target images generated for a data-missing location of the target of interest in the original image comprises: Determining a plurality of second perspective transformation matrices based on a preset target of interest attention weight and a second preset quantity threshold, and the deviation, the variance, or the correlation coefficient; When it is determined that the correlation of the multiple second perspective transformation matrices meets the uniform distribution condition, for each second perspective transformation matrix, the data missing position of the target of interest in the original image is randomly transformed using the second perspective transformation matrix to determine the target image.

5. The model training method according to claim 3, characterized in that: The method of performing data completion on the original data set using the target image for each target image to determine the second target data set includes: For each target image, if the target image is an image containing the object of interest, labeling the target image with position information and type information of the object of interest to determine labeling information; When the target image is a background image that does not contain the target of interest, performing compensation and distortion processing on the target image to determine a negative sample image; Based on the target image and the annotation information, or based on the negative sample image, data completion is performed on the original data set to determine the second target data set.

6. The model training method according to claim 2, characterized in that The determining of a plurality of first perspective transformation matrices based on a preset perspective transformation threshold, preset data distribution requirement information, and a first preset quantity threshold includes: Determining a uniformly distributed and normalized first random number sequence based on the preset perspective transformation threshold, the preset data distribution requirement, and the first preset quantity threshold; Based on preset matrix combination requirement information, matrix combination is performed on the first random number sequence to determine the multiple first perspective transformation matrices.

7. A target detection method, characterized in that: include: Obtaining a set of images to be tested, and a preset target detection network model determined by training according to the model training method according to any one of claims 1 to 6, wherein the set of images to be tested includes images containing targets of interest taken from different perspectives; The image set to be tested is input into the preset target detection network model, and the target type information and target position information of the target of interest output by the preset target detection network model under a preset viewing angle are determined, and the preset viewing angle belongs to the different viewing angles.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, it implements the model training method according to any one of claims 1 to 6, or the target detection method according to claim 7.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the model training method according to any one of claims 1 to 6, or the target detection method according to claim 7.