Target detection method, device, equipment, storage medium and product
By introducing a secondary detection model into the object detection system, obtaining scene division information and adapting to adjust the parameters of the small model, the problem of poor detection performance of small models is solved and the detection rate of target detection is improved.
Patent Information
- Application Number
- CN202411428765.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-10-14
AI Technical Summary
In object detection, small models with coordinated size and models have poor detection performance, resulting in unsatisfactory final detection rate.
By setting a secondary detection model in the backend device, the scene features in the scene image are detected, the scene division information is obtained, and the front-end device is sent, so that the corresponding model parameters can be obtained according to the types of different scene areas, and the smallest Parameter adaptation of the model.
By using different model parameters for detection for different scenarios, the detection performance is improved, the adaptability of small models is enhanced, and the final detection rate is improved.
Smart Images

Figure CN118968038B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image detection technology, and in particular to target detection methods, devices, equipment, storage media and products. Background Art
[0002] Image-based target detection and tracking technology has been widely used in various industries. Due to differences in computing power and resources at different ends, models are divided into small models and large models. Small models are generally deployed in front-end devices (such as user devices or edge devices, etc.), and large models are generally deployed in back-end devices (such as cloud platforms, servers, etc.).
[0003] In related technologies, the collaboration of large and small models generally involves the small model making a preliminary judgment on the abnormal state within the target area, and the large model performing secondary analysis on the image based on the abnormality detected by the small model. This is a sequential operation process of small model + large model, with the purpose of removing false positives. It can effectively reduce the computing pressure on the back-end, improve the analysis efficiency of image data, and enable the back-end devices to connect to more front-end devices.
[0004] In this solution, the small model generally uses the same set of parameters and algorithms to deal with all scenarios, and the detection performance is poor. The small model may not be able to detect some situations where abnormalities should exist, and naturally will not be further detected by the back-end, resulting in an unsatisfactory actual detection rate. Summary of the invention
[0005] The main purpose of this application is to provide a target detection method, device, equipment, storage medium and product, aiming to solve the technical problem in the related technology that the detection performance of small and medium models in collaboration between large and small models is poor, resulting in an unsatisfactory final detection rate.
[0006] To achieve the above-mentioned purpose, the present application proposes a target detection method, which is applied to a backend device, wherein the backend device is provided with a secondary detection model for performing target detection;
[0007] The method comprises:
[0008] Acquire a scene image of a target detection area, wherein the target detection area is an area where a front-end device performs target detection, and a primary detection model for performing target detection is provided in the front-end device;
[0009] Detecting scene features in the scene image through a secondary detection model to obtain scene division information corresponding to the scene image, wherein the scene division information includes region division information of at least one scene region and a scene type of each scene region;
[0010] The scene division information is sent to the front-end device, so that the front-end device divides the target detection area into multiple scene areas based on the scene division information, and obtains the model parameters corresponding to each scene area according to the scene type of each scene area, and performs target detection on each scene area according to the model parameters corresponding to each scene area through the first-level detection model.
[0011] In a possible implementation of the present application, before acquiring the scene image of the target detection area, the method further includes:
[0012] Obtaining the first-level detection results corresponding to the first-level detection model and the second-level detection results corresponding to the second-level detection model for various targets within a preset time period;
[0013] The first-level detection result is used as the predicted label, and the second-level detection result is used as the true value label to construct a classification result;
[0014] The segmentation curve of the classification result is smoothly fitted to generate a relationship parameter curve, wherein the relationship parameter curve includes the region division information and the corresponding relationship between the model parameters.
[0015] In a possible implementation of the present application, the step of constructing a classification result using the primary detection result as a predicted label and the secondary detection result as a true value label includes:
[0016] Correcting part of the secondary detection result according to the secondary correction instruction to obtain a corrected detection result;
[0017] Adjusting the loss function based on the corrected detection result to generate an adjusted loss function, wherein the weight of the corrected detection result in the adjusted loss function is higher than the weight of other secondary detection results;
[0018] The first-level detection result is used as a predicted label, the second-level detection result and the corrected detection result are used as true value labels, and a classification result is constructed based on the adjusted loss function.
[0019] In a possible implementation of the present application, after sending the scene division information to the front-end device, the method further includes:
[0020] Acquire multiple image frames to be detected within a preset time range before and after a first-level alarm frame, wherein the first-level alarm frame is an image frame when a first-level detection model determines that a warning target is detected;
[0021] The target detection is performed on the image frame to be detected through the secondary detection model to determine whether a warning target is detected.
[0022] In a possible implementation of the present application, the step of obtaining a plurality of image frames to be detected within a preset time range before and after the first-level alarm frame includes:
[0023] Acquire multiple image frames to be selected within a preset time range before and after the first-level alarm frame;
[0024] Sorting the plurality of candidate image frames from high to low according to the image quality scores corresponding to the candidate image frames to obtain a sorting result;
[0025] The first N images in the sorting results are selected as image frames to be detected, where N is a positive integer.
[0026] In a possible implementation of the present application, the sorting of the plurality of candidate image frames from high to low according to the image quality scores corresponding to the candidate image frames to obtain the sorting result includes:
[0027] Acquire auxiliary selection information corresponding to each image frame to be selected, wherein the auxiliary selection information includes at least one of target detection confidence, target classification confidence, target position point set, position point set continuity information, and motion speed;
[0028] Sorting the multiple to-be-selected image frames based on the auxiliary selection information to obtain a primary sorting result;
[0029] Selecting the first M first-level sorting results as first-level image frames to be selected, where M is a positive integer and M is greater than N;
[0030] The plurality of candidate image frames are sorted from high to low according to the image quality scores corresponding to the first-level candidate image frames to obtain a sorting result.
[0031] In a possible implementation of the present application, the step of acquiring a plurality of image frames to be detected within a preset time range before and after the first-level alarm frame further includes:
[0032] Obtain a training sample set, wherein the training sample set includes a plurality of sample images and a true value label corresponding to each sample image;
[0033] Processing the sample images in the training sample set by using the secondary detection model to obtain sample processing results;
[0034] Correcting the true value label corresponding to each sample image in the training sample set according to the sample processing result to obtain a corrected training sample set;
[0035] Training the initial selection model based on the modified training sample set to obtain a frame selection model corresponding to the secondary detection model;
[0036] The step of obtaining a plurality of image frames to be detected within a preset time range before and after the first-level alarm frame includes:
[0037] Acquire multiple image frames to be selected within a preset time range before and after the first-level alarm frame;
[0038] The image frame to be detected is selected from the multiple image frames to be selected through the frame selection model.
[0039] In a possible implementation of the present application, a plurality of different secondary detection models are provided in the backend device;
[0040] The performing target detection on the image frame to be detected by the secondary detection model to determine whether a warning target is detected includes:
[0041] Obtaining the computational load and / or detection requirements corresponding to the primary detection model;
[0042] Determine a target secondary detection model according to the calculation amount and / or detection requirement;
[0043] The target secondary detection model is used to perform target detection on the image frame to be detected to determine whether a warning target is detected.
[0044] In addition, to achieve the above-mentioned purpose, the present application also proposes a target detection device, which is applied to a back-end device, wherein a secondary detection model for performing target detection is provided in the back-end device;
[0045] The device comprises:
[0046] An acquisition module, used to acquire a scene image of a target detection area, wherein the target detection area is an area where a front-end device performs target detection, and a primary detection model for performing target detection is provided in the front-end device;
[0047] A scene module, configured to detect scene features in the scene image through a secondary detection model to obtain scene division information corresponding to the scene image, wherein the scene division information includes region division information of at least one scene region and a scene type of each scene region;
[0048] A detection module is used to send the scene division information to the front-end device so that the front-end device divides the target detection area into multiple scene areas based on the scene division information, and obtains the model parameters corresponding to each scene area according to the scene type of each scene area, and performs target detection on each scene area according to the model parameters corresponding to each scene area through the first-level detection model.
[0049] In addition, to achieve the above-mentioned purpose, the present application also proposes a target detection device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the target detection method as described above.
[0050] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the target detection method as described above are implemented.
[0051] In addition, to achieve the above-mentioned purpose, the present application also proposes a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the target detection method described above are implemented.
[0052] One or more technical solutions proposed in this application have at least the following technical effects:
[0053] Obtain a scene image of the target detection area; detect scene features in the scene image through the secondary detection model to obtain scene division information corresponding to the scene image; send the scene division information to the front-end device, so that the front-end device divides the target detection area into multiple scene areas based on the scene division information, and obtains the model parameters corresponding to each scene area according to the scene type of each scene area, and performs target detection on each scene area according to the model parameters corresponding to each scene area through the primary detection model. Since different model parameters can be used for different scenes for detection, the parameters of the small model can be adapted to ensure that targeted detection can be performed according to the differences in scene areas during detection, thereby improving the detection performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0055] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0056] Figure 1 A schematic diagram of a process flow provided for the first embodiment of the target detection method of the present application;
[0057] Figure 2 A schematic diagram of a scene division information construction process according to an embodiment of the present application;
[0058] Figure 3 A schematic diagram of scene division according to an embodiment of the present application;
[0059] Figure 4 A schematic diagram of a parameter scene adaptation process according to an embodiment of the present application;
[0060] Figure 5 A schematic diagram of a result correction process according to an embodiment of the present application;
[0061] Figure 6 This is a schematic diagram of classification results according to an embodiment of the present application;
[0062] Figure 7 This is a schematic diagram of the change of the modified classification result according to an embodiment of the present application;
[0063] Figure 8 A schematic diagram of a flow chart provided for the second embodiment of the target detection method of the present application;
[0064] Fig. 9 A schematic diagram of a complete target detection process according to an embodiment of the present application;
[0065] Fig.10 This is a schematic diagram of the module structure of the target detection device according to an embodiment of the present application;
[0066] Fig.11 Schematic diagram of the device structure of the hardware operating environment involved in the target detection method in the embodiment of the present application.
[0067] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0068] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0069] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0070] Based on this, the present application embodiment provides a target detection method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the target detection method of the present application.
[0071] In this embodiment, the target detection method is applied to a backend device, and a secondary detection model for performing target detection is provided in the backend device;
[0072] The target detection method comprises steps S10 to S30:
[0073] Step S10: Acquire a scene image of the target detection area.
[0074] It should be noted that the execution subject of this embodiment can be the backend device or a platform or system composed of multiple backend devices. The backend device can be a target detection device set in the cloud, such as a server or cloud server, or other other devices that can achieve the same or similar functions. A secondary detection model for target detection can be set in the backend device. In this embodiment and the following embodiments, the target detection method of this application is described by taking the backend device as an example.
[0075] It should be noted that the target detection area is the area where the front-end device performs target detection, and the back-end device can be connected to one or more front-end devices at the same time. The front-end device can be a user device, such as a smart phone, a tablet computer, or other devices with camera and recognition functions, such as a camera, etc. It can also be an edge device set on the user side, such as a smart camera, etc. A first-level detection model for target detection is set in the front-end device.
[0076] In actual use, the first-level detection model and the second-level detection model can be models with the same functions and can both perform target detection. However, due to limitations in computing power and resources, the detection performance, detection efficiency and / or detection accuracy of the second-level detection model are higher than those of the first-level detection model. On this basis, the second-level detection model can also be referred to as the large model, and the first-level detection model can be referred to as the small model.
[0077] In a specific implementation, the back-end device can access the front-end device and read the scene image of the target detection area from the front-end device. In order to ensure the accuracy of scene recognition, there can be multiple scene images read, which is not limited in this embodiment.
[0078] Step S20: Detect scene features in the scene image using a secondary detection model to obtain scene division information corresponding to the scene image.
[0079] It should be noted that the scene division information includes region division information of at least one scene region and the scene type of each scene region.
[0080] In actual use, the secondary detection model may include a sub-model or sub-module for scene recognition. After acquiring the scene image of the target detection area, in order to ensure that the detection performance of the small model, that is, the primary detection model, can be improved, the scene features in the scene image can be detected through the sub-model or sub-module in the secondary detection model, thereby obtaining the scene division information corresponding to the scene image.
[0081] For example: the secondary detection model may include a depth estimation model. When one or more scene images are obtained, the depth estimation model can be used to determine the distance distribution of the scene area, and detect through scene features such as walls and parking lot landmarks in the scene area. The target detection area can be classified into a variety of different detailed small scenes, such as long-distance scenes, close-distance scenes, wall scenes, parking lot scenes, etc., thereby generating scene division information corresponding to the scene image.
[0082] Step S30: Send the scene division information to the front-end device, so that the front-end device divides the target detection area into multiple scene areas based on the scene division information, and obtains the model parameters corresponding to each scene area according to the scene type of each scene area, and performs target detection on each scene area according to the model parameters corresponding to each scene area through the first-level detection model.
[0083] It should be noted that when training the small model, i.e., the first-level detection model, different training can be performed for different areas, thereby generating multiple sets of model parameters.
[0084] In actual use, after the scene division information is generated, the scene division information can be sent to the front-end device. The front-end device will then divide the target detection area into multiple scene areas according to the scene division information, and search for appropriate model parameters according to the scene type of each scene area in the scene division information. After that, the first-level detection model is used to perform target detection on each scene area according to the model parameters corresponding to each scene area, thereby ensuring that different model parameters can be used for different scenes for detection, realizing parameter adaptation of the small model, and ensuring that targeted detection can be performed according to the differences in scene areas during detection, thereby improving detection performance.
[0085] For ease of understanding, now combined Figure 2 and Figure 3 This is for illustration only, but not for limitation. Figure 2 This is a schematic diagram of the scene division information construction process of this embodiment. Figure 3 The following is a schematic diagram of scene division in this embodiment.
[0086] like Figure 2As shown, the large model (i.e., the secondary detection model) may be provided with a sub-model or sub-module for scene recognition, such as a depth estimation model. When one or more scene images are obtained, the depth estimation model may be used to determine the near and far distribution of the scene area, and the scene area may be divided into close-range scenes, special scenes, and long-range scenes. After that, the special scenes may be further divided (e.g., divided into wall scenes, parking lot scenes, etc.) through scene features such as walls and parking lot landmarks in the scene area, thereby realizing the division of the target detection area, and classifying it into a variety of different refined small scenes to generate scene division information corresponding to the scene image. After that, the scene parameters may be sent down to the small model (i.e., the primary detection model);
[0087] The first-level detection model divides the target detection area according to the scene division information, splitting it into Figure 3 The wall scene, parking lot scene, close-range and long-range scene, etc. are shown, and the model parameters corresponding to each scene area are obtained according to the scene type in the scene division information, ensuring that the adapted optimal model parameters can be used to perform target detection in each scene area, differentially solving complex perimeter problems, and improving the overall detection performance of the first-level detection model.
[0088] In a specific implementation, in order to ensure that the model parameters of each scene area of the small model can be reasonably obtained, before step S10 in this embodiment, the following may also be included:
[0089] Obtaining the first-level detection results corresponding to the first-level detection model and the second-level detection results corresponding to the second-level detection model for various targets within a preset time period;
[0090] The first-level detection result is used as the predicted label, and the second-level detection result is used as the true value label to construct a classification result;
[0091] The segmentation curve of the classification result is smoothly fitted to generate a relationship parameter curve.
[0092] It should be noted that the preset time period can be pre-set by the administrator of the target detection device, such as setting the preset time period to within 1 day, 3 days or other time periods, etc., and this embodiment does not limit this.
[0093] In actual use, model-based parameter scene adaptation can be implemented based on the entire scene. The best approach is to combine scene segmentation and perform independent parameter adaptation for each segmented scene. The ultimate goal is to allow the small model to provide the large model with pre-selected targets within the capability of the large model as much as possible, thereby achieving the best coordination between large and small models. Based on this, the first-level detection results can be used as prediction labels, and the second-level detection results can be used as true value labels to construct classification results.
[0094] Afterwards, the segmentation curve of the classification result is smoothly fitted to generate a relationship parameter curve, wherein the relationship parameter curve includes the corresponding relationship between the region division information and the model parameters.
[0095] In actual use, before constructing the classification result with the first-level detection result as the prediction label and the second-level detection result as the true value label, you can also first construct a model loss value based on the first-level detection result and the second-level detection result, and adjust the model parameters of the first-level detection result according to the model loss value until the model loss value meets the preset conditions (such as less than a certain value or no longer changes after multiple consecutive adjustments), and then construct the classification result based on the first-level detection result and the second-level detection result. Among them, the model loss value can be calculated using the sigmoid loss function. Of course, it can also be calculated using other algorithms with the same or similar functions, and this embodiment does not limit this.
[0096] In a possible implementation of this embodiment, a large model may also have detection errors. To avoid the influence of such errors, the step of constructing a classification result using the primary detection result as a predicted label and the secondary detection result as a true value label in this embodiment may include:
[0097] Correcting part of the secondary detection result according to the secondary correction instruction to obtain a corrected detection result;
[0098] Adjusting the loss function based on the corrected detection result to generate an adjusted loss function;
[0099] The first-level detection result is used as a predicted label, the second-level detection result and the corrected detection result are used as true value labels, and a classification result is constructed based on the adjusted loss function.
[0100] It should be noted that the secondary correction instruction can be input by the manager or developer of the target detection equipment, and is an instruction for correcting some erroneous secondary detection results. Part of the secondary detection results can be corrected according to the secondary correction instruction, and the corrected part of the secondary detection results can be used as the corrected detection results.
[0101] In order to ensure the influence of the correction result on the parameters, the loss function can be adjusted based on the correction test result to generate an adjusted loss function, wherein the weight of the correction test result in the adjusted loss function is higher than the weight of other secondary test results.
[0102] Afterwards, the first-level detection results are used as predicted labels, the second-level detection results and the corrected detection results are used as true value labels, and the classification results are constructed based on the adjusted loss function.
[0103] For ease of understanding, now combined Figure 4 , 5, 6 and 7 are used to illustrate, but not to limit, this solution. Figure 4 is a schematic diagram of the parameter scene adaptation process of this embodiment, Figure 5 is a schematic diagram of the result correction process of this embodiment, Figure 6 is a schematic diagram of the classification result of this embodiment, Figure 7 Schematic diagram of the modified classification result change in this embodiment.
[0104] like Figure 4 As shown in the figure, model-based parameter scene adaptation can be implemented based on the entire scene. The best approach is to combine scene segmentation and perform independent parameter adaptation for each segmented scene. The ultimate goal is to allow the small model to provide the large model with pre-selected targets within the capability of the large model as much as possible, thereby achieving the best coordination between large and small models.
[0105] The training of the new model requires a large amount of data, with the focus on data from actual points. The purpose of the collaboration between the large and small models is to make the small model adapt to the performance of the large model. Therefore, the results of the large model and the process of the small model can be introduced to achieve the generation of labeled data.
[0106] Combine all targets within a period of time (that is, for various targets within a preset period of time, the small model can lower the threshold to ensure that the pseudo labels in the detection process of all packets are obtained), obtain the targets coordinated by the large and small models (all targets, including those filtered by the large model), and combine the process and parameters to realize automatic pseudo-label generation.
[0107] In this process, the result of each small model process module can be used as a label number, and the result of the large model is the predicted true value label. More importantly, the large model supports external information interaction feedback, and the feedback information is used as the true value label correction. The process is as follows Figure 5 As shown;
[0108] If only the parameter adjustment of a single model is involved, such as a detection model, a binary classifier (including but not limited to logistic regression, k-nearest neighbor, decision tree, etc.) is used. Only the normalized size information of the target and the detection confidence of the small model are needed as labels. If the output result of the large model is a person or a car, the true value is 1, otherwise it is 0. The generated data is as follows Figure 6 As shown in the table, if all the results are put into the distribution diagram, Figure 6 As shown in the distribution diagram;
[0109] If the parameters of multiple internal models are involved, a multi-label classifier can be used, including the introduction of detection / classification thresholds, target size, displacement step size and other detailed parameters. Specific methods involve decision trees, neural networks, etc., which are extensions of the binary classifier and have better scene parameter adaptability.
[0110] The classifier loss function can be a sigmoid function, including but not limited to the following. The general target data only needs to rely on the result of the large model as the true value result, in order to make the small model as adaptable as possible to the performance of the large model.
[0111] In actual application, we can also modify some targets based on user feedback. The modified targets (c, f) have relatively larger weights (β, γ) in loss calculation, so that the prediction results are modified especially for this block of content, as follows:
[0112] Loss = Lnorm + (βLattr - γLrep)
[0113] Where Lnorm is the uncorrected prediction result of the large model, Lattr is the incorrect target predicted by the large model, but the user feedback is the correct target; Lrep is the correct target predicted by the large model, but the user feedback is the wrong target.
[0114] The above loss calculation is used as an optimization correction, which is more adaptable to special environmental scenarios at a certain point (such as Figure 7 As shown by the blue arrow in the middle, the left picture becomes the right picture). Figure 7 Middle: The horizontal axis is the small model detection value of the target, and the vertical axis is the normalized size of the target; the blue × points are the targets whose prediction results of the large model are the correct category; the orange × points are the targets whose prediction results of the large model are the correct category, but the actual user feedback is an abnormal object; the yellow The orange dots are targets that the large model predicts are in the wrong category; The points are where the large model misclassifies the target, but the actual user feedback should be a normal object.
[0115] Based on the classification results, for example, the segmentation curve of the two-class classification can be smoothly fitted to obtain the relationship parameter curve between the area division information (such as target size) and the model parameters (such as the small model detection confidence) in the scene. The parameter relationship is directly sent to the small model so that the small model can determine the model parameters of each scene area and realize the point scene parameter adaptation of the small model.
[0116] Among them, based on the classification model, each target of the output of the small model can be preprocessed, and only those that meet the target of the result in the figure above are sent to the large model. In terms of process, the results of the small model are first sent to the scene parameter correction model in the large model for target preprocessing (such as filtering, screening, etc.);
[0117] At the same time, the large model will continue to optimize the classification model and update the parameters based on the subsequent actual target detection results while operating with the original set of parameters.
[0118] This embodiment provides a target detection method, which obtains a scene image of a target detection area; detects scene features in the scene image through a secondary detection model to obtain scene division information corresponding to the scene image; sends the scene division information to a front-end device, so that the front-end device divides the target detection area into multiple scene areas based on the scene division information, and obtains model parameters corresponding to each scene area according to the scene type of each scene area, and performs target detection on each scene area according to the model parameters corresponding to each scene area through a primary detection model. Since different model parameters can be used for different scenes for detection, the parameters of the small model are adaptive, ensuring that targeted detection can be performed according to the differences in scene areas during detection, thereby improving the detection performance.
[0119] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can refer to the above introduction, and will not be repeated later. Figure 8 After step S30, the target detection method further includes steps S40 to S50:
[0120] Step S40: acquiring a plurality of image frames to be detected within a preset time range before and after the first-level alarm frame.
[0121] It should be noted that the first-level alarm frame is an image frame when the first-level detection model determines that a warning target is detected, wherein the warning target can be a target that needs to be warned after detection, and can be pre-set by the manager of the target detection equipment, such as using pedestrians and vehicles as warning targets.
[0122] In actual use, the preset time length can also be set in advance by the manager of the target detection equipment. For example, if the preset time length is set to 3 seconds, the image frames collected within three seconds before and after the moment corresponding to the first-level alarm frame can be obtained as the image frames to be detected, thereby obtaining multiple image frames to be detected.
[0123] In a possible implementation of this embodiment, in order to ensure that the detection of the large model is more effective and avoid meaningless detection, step S40 in this embodiment may include:
[0124] Acquire multiple image frames to be selected within a preset time range before and after the first-level alarm frame;
[0125] Sorting the plurality of candidate image frames from high to low according to the image quality scores corresponding to the candidate image frames to obtain a sorting result;
[0126] The first N images in the sorting results are selected as image frames to be detected.
[0127] It should be noted that in order to ensure that the detection of large models is more effective, it is necessary to select images that are more likely to contain valid information as image frames to be detected, and images with better image quality can be selected as image frames to be detected. Therefore, multiple image frames within a preset time range before and after the first-level alarm frame can be first selected as image frames to be selected. Afterwards, the multiple image frames to be selected are sorted from high to low according to the image quality scores corresponding to each image frame to be selected. Finally, the top N images in the sorting results are selected as image frames to be detected.
[0128] Wherein, N is a positive integer and can be pre-set by the administrator of the target detection device, such as setting N to 8. The image quality score can be calculated by an image quality assessment model (Image Quality Assessment, IQA), or by a pre-set image instruction evaluation algorithm, such as a peak signal-to-noise ratio (PSNR) algorithm.
[0129] For ease of understanding, an example is given below, but this solution is not limited thereto, such as:
[0130] The image frames collected per second are 6.25 frames, the preset duration is 3 seconds, N=8, and there are 18 image frames within 3 seconds before and after the first-level alarm frame. At this time, there are 18 image frames to be selected. At this time, the image quality score corresponding to each image frame to be selected can be obtained and sorted from large to small. At this time, the first 8 image frames to be selected in the sorting result can be used as the image frames to be detected.
[0131] In a possible implementation of this embodiment, other information may be combined with the image quality score to select the image frame to be detected. At this time, the step of sorting the multiple image frames to be selected from high to low according to the image quality score corresponding to each image frame to be selected to obtain the sorting result may include:
[0132] Obtaining auxiliary selection information corresponding to each image frame to be selected;
[0133] Sorting the multiple to-be-selected image frames based on the auxiliary selection information to obtain a primary sorting result;
[0134] Selecting the first M images from the first-level sorting results as first-level image frames to be selected;
[0135] The plurality of candidate image frames are sorted from high to low according to the image quality scores corresponding to the first-level candidate image frames to obtain a sorting result.
[0136] It should be noted that M is a positive integer and M is greater than N, such as setting N to 8 and M to 12. The auxiliary selection information includes at least one of target detection confidence, target classification confidence, target position point set, position point set continuity information, and motion speed.
[0137] For ease of understanding, an example is given below, but this solution is not limited to the following:
[0138] Assume that M=12, N=8, the number of image frames collected per second is 6.25, the preset duration is 3 seconds, and the auxiliary selection information is the target detection confidence. Then, there are 18 image frames within 3 seconds before and after the first-level alarm frame. At this time, there are 18 image frames to be selected. You can first sort the image frames from large to small according to the target detection confidence corresponding to each candidate image frame to obtain the first-level sorting result, and use the first 12 candidate image frames in the first-level sorting result as the first-level candidate image frames. After that, sort the 18 candidate image frames from high to low according to the image quality score corresponding to each first-level candidate image frame to obtain the sorting result, and use the first 8 first-level candidate image frames in the sorting result as the image frames to be detected.
[0139] In a possible implementation of this embodiment, the auxiliary selection information may be multiplied by the image quality score (or similar means, such as addition, etc.), and the obtained product may be used as a sorting basis to sort the image frames to be selected, for example:
[0140] Assume that N=8, the number of image frames collected per second is 6.25, the preset duration is 3 seconds, and the auxiliary selection information is the target detection confidence. Then, there are 18 image frames within 3 seconds before and after the first-level alarm frame. At this time, there are 18 image frames to be selected. The target detection confidence corresponding to each image frame to be selected can be multiplied by the image quality score to obtain the sorting basis score. Then, the 18 image frames to be selected are sorted from large to small according to the sorting basis score to obtain the sorting result, and the first 8 first-level image frames to be selected in the sorting result are used as the image frames to be detected.
[0141] In a possible implementation of this embodiment, since the best image quality is not equal to the target most suitable large model, in order to ensure that the image of the most suitable large model can be selected as the image frame to be detected, before step S40 in this embodiment, the following may also be included:
[0142] Get the training sample set.
[0143] Processing the sample images in the training sample set by using the secondary detection model to obtain sample processing results;
[0144] Correcting the true value label corresponding to each sample image in the training sample set according to the sample processing result to obtain a corrected training sample set;
[0145] Training the initial selection model based on the modified training sample set to obtain a frame selection model corresponding to the secondary detection model;
[0146] The step of obtaining a plurality of image frames to be detected within a preset time range before and after the first-level alarm frame includes:
[0147] Obtain multiple candidate image frames within a preset time range before and after the first-level alarm frame;
[0148] Select the image frame to be detected from the multiple candidate image frames through the frame selection model.
[0149] It should be noted that the training sample set contains multiple sample images and the corresponding ground truth labels. The ground truth labels can be labels indicating whether a certain target is included in the sample image set by manual annotation or other forms, such as scoring results.
[0150] In actual use, since the purpose of frame selection is to adapt to the capabilities of the large model, select a small number of targets that adapt to the capabilities of the large model within a long time series to achieve high detection rate and low false alarm rate. Therefore, the dataset labels in model training need to be appropriately adapted and optimized, that is, the ground truth labels corresponding to each sample image in the training sample set are corrected according to the sample processing results to obtain the corrected training sample set.
[0151] For the convenience of understanding, an example of correcting the ground truth label is given below, but it does not limit the present solution:
[0152] Obtain the sample processing results of each sample image in the training sample set processed by the large model (i.e., the secondary detection model); the ground truth labels of all sample images are corrected with the large model processing results. The correction process can be:
[0153] If a2 ≥ conf, then the sample label is corrected: a3 = a1 * [β * (a2 - conf) / (1 - conf) + γ]
[0154] If a2 < conf, then the sample label is corrected: a3 = a1 * [γ * (a2 - conf) / conf + γ]
[0155] In the formula, β + γ = 1, which can be set in advance by the administrator of the target detection device, such as setting β = 0.2; conf can be the scoring threshold of the large model, which can be set in advance by the administrator of the target detection device; a1 is the scoring value in the ground truth label, a2 is the scoring value in the large model processing result, and a3 is the scoring value in the corrected ground truth label.
[0156] In actual use, the initial selection model is trained according to the corrected training sample set. When the training converges, the initial selection model trained to convergence can be used as the frame selection model corresponding to the secondary detection model.
[0157] In a specific implementation, the frame selection model may include a convolutional neural network (CNN) network and a coding and decoding structure. The process of selecting a to-be-detected image frame from a plurality of to-be-selected image frames through the frame selection model may be:
[0158] Combine multiple candidate image frames into an image sequence, first send them to the CNN network for target semantic feature extraction, split the feature map into patches and send them to the encoder-decoder structure to determine the target posture and key points, crop the image sequence according to the key points, send them to the CNN network (score the key points of the target in different postures), output the final scoring result of the target for each image in the sequence, and finally sort them based on the scoring results to select the image frames to be detected.
[0159] Among them, the model is trained based on the corrected labels and is only adapted to a certain secondary detection model. If multiple different secondary detection models are set in the back-end device, each secondary detection model needs to be set with a corresponding scoring frame selection model, combined with the collaborative matching module application. During training, the feature point map of the crop can also be slightly expanded at the edge, and the expanded part can be randomly blurred to achieve better robustness of the model; for the crop data of key points, the specific data of the same batch, such as the image data of the lower body of the person, is blurred, or a mosaic (mask) is randomly added to make the model focus on the head and shoulder area of the upper body of the person and improve the recognition of the occluded environment.
[0160] Step S50: performing target detection on the image frame to be detected by using the secondary detection model to determine whether a warning target is detected.
[0161] In actual use, the image frames to be detected can be respectively input into the secondary detection model for target detection. If a warning target is detected in any image frame to be detected, it can be determined that the warning target is detected.
[0162] It is understandable that the small model may not be able to detect some situations where abnormalities should exist. In order to avoid missed detections, the detection range can be expanded to a certain extent. By using the secondary detection model to detect multiple image frames to be detected within a preset time range before and after the first-level alarm frame, missed detections can be avoided as much as possible, thereby improving the detection rate.
[0163] In a possible implementation of this embodiment, in order to ensure that different detection requirements can be met, a plurality of different secondary detection models may be provided in the back-end device. Step S50 in this embodiment may include:
[0164] Obtaining the computational load and / or detection requirements corresponding to the primary detection model;
[0165] Determine a target secondary detection model according to the calculation amount and / or detection requirement;
[0166] The target secondary detection model is used to perform target detection on the image frame to be detected to determine whether a warning target is detected.
[0167] It should be noted that the back-end device may be connected to multiple different front-end devices at the same time, and the computing amount and / or detection requirements of the first-level detection models in different front-end devices may be different. In order to meet various different detection requirements, multiple different second-level detection models can be set in the back-end device, so that different second-level detection models correspond to different computing amounts and / or detection requirements. Then, when detection is required, the computing amount and / or detection requirements corresponding to the first-level detection model can be obtained, and the computing amount and / or detection requirements corresponding to the first-level detection model can be matched with the second-level detection models in the back-end device to determine the target second-level detection model. After that, the target second-level detection model is used to perform target detection on the image frame to be detected to determine whether the warning target is detected.
[0168] For ease of understanding, now combined Fig. 9 This is for illustration only, but not for limitation. Fig. 9 Schematic diagram of the complete target detection process of this embodiment.
[0169] like Fig. 9 As shown in the figure, the large model (i.e., the second-level detection model) obtains scene images, generates scene division information and passes it to the small model (i.e., the first-level detection model), preliminarily realizing the scene adaptation of the small model. The small model no longer uses the same set of parameters and algorithms to deal with all complex scenes. It refines the scene and replaces different parameters and algorithm libraries for different scene areas, improving the comprehensive performance of the small model in complex environments.
[0170] The scene parameter correction model in the large model, the pre-processing results of the small model / the processing results of the large model (including external feedback on target information, etc.) will grade and label the samples of the actual points based on a certain scoring system. The graded labeling results are sent to the scene parameter correction model to correct the scene parameters of the small model in real time and improve the performance of the small model alone;
[0171] In the large and small model collaboration mode, the main function of the small model is to provide a large number of suitable preprocessing targets for the large model. The small model involves the collaboration of multiple internal modules. It simply lowers the threshold of the detection model, which generates a large amount of pre-selected detection box information. However, in subsequent modules such as the tracking module, too many boxes will interfere with each other, which will have a negative impact and reduce the output of correct targets. At the same time, too many targets will generate a large load on the backend, and some targets are beyond the performance of the large model, so the synergy will fail.
[0172] Therefore, it is necessary to obtain appropriate model parameters through the scene parameter correction model, or to implement preliminary target filtering based on the scene parameter correction model, and to intermittently correct the parameters based on the actual environment scene, so as to provide the large model with the maximum high-quality pre-selected targets within the capability range and realize application point adaptation;
[0173] The large model is designed with a target frame selection model, which combines the pre-selected targets and corresponding timing information of the small model to obtain the timing score of the target, and corrects the target frame information based on the score, providing more effective information for the large model and maximizing the operability of the large model;
[0174] The collaboration between large and small models has a collaborative matching module, which automatically identifies the computational complexity of the small model and matches the best large model type (such as large model 1, large model 2, and large model 3) and processing method based on application requirements.
[0175] This embodiment provides a target detection method. Since the detection range will be expanded to a certain extent, multiple image frames to be detected within a preset time range before and after the first-level alarm frame are detected through a second-level detection model, which can avoid missed detections as much as possible, thereby improving the detection rate.
[0176] This application also provides a target detection device, please refer to Fig.10 , the target detection device comprises:
[0177] An acquisition module 10 is used to acquire a scene image of a target detection area, wherein the target detection area is an area where a front-end device performs target detection, and a primary detection model for performing target detection is provided in the front-end device;
[0178] A scene module 20, configured to detect scene features in the scene image through a secondary detection model to obtain scene division information corresponding to the scene image, wherein the scene division information includes region division information of at least one scene region and a scene type of each scene region;
[0179] The detection module 30 is used to send the scene division information to the front-end device, so that the front-end device divides the target detection area into multiple scene areas based on the scene division information, and obtains the model parameters corresponding to each scene area according to the scene type of each scene area, and performs target detection on each scene area according to the model parameters corresponding to each scene area through the first-level detection model.
[0180] The target detection device provided by the present application adopts the target detection method in the above embodiment, which can solve the technical problem that the detection performance of the small and medium models in the related technology is poor, resulting in an unsatisfactory final detection rate. Compared with the prior art, the beneficial effects of the target detection device provided by the present application are the same as the beneficial effects of the target detection method provided by the above embodiment, and the other technical features in the target detection device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0181] The present application provides a target detection device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the target detection method in the above-mentioned embodiment one.
[0182] Reference below Fig.11 , which shows a schematic diagram of the structure of a target detection device suitable for implementing the embodiment of the present application. The target detection device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.11 The target detection device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0183] like Fig.11As shown, the target detection device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the target detection device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the target detection device to communicate with other devices wirelessly or by wire to exchange data. Although the target detection device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0184] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0185] The target detection device provided by the present application adopts the target detection method in the above embodiment, which can solve the technical problem that the detection performance of the small and medium models in the related technology is poor, resulting in an unsatisfactory final detection rate. Compared with the prior art, the beneficial effects of the target detection device provided by the present application are the same as the beneficial effects of the target detection method provided by the above embodiment, and the other technical features in the target detection device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0186] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0187] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0188] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the target detection method in the above-mentioned embodiment.
[0189] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0190] The computer-readable storage medium may be included in the target detection device; or may exist independently without being assembled into the target detection device.
[0191] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the target detection device, the target detection device: obtains a scene image of a target detection area, wherein the target detection area is an area where a front-end device performs target detection, and a first-level detection model for performing target detection is provided in the front-end device; detects scene features in the scene image through a second-level detection model to obtain scene division information corresponding to the scene image, wherein the scene division information includes area division information of at least one scene area and a scene type of each scene area; sends the scene division information to the front-end device, so that the front-end device divides the target detection area into multiple scene areas based on the scene division information, obtains model parameters corresponding to each scene area according to the scene type of each scene area, and performs target detection on each scene area according to the model parameters corresponding to each scene area through the first-level detection model.
[0192] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0193] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0194] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0195] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned target detection method, and can solve the technical problem in the related art that the detection performance of small and medium models in large and small models is poor, resulting in an unsatisfactory final detection rate. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the target detection method provided in the above-mentioned embodiment, and will not be repeated here.
[0196] The present application also provides a computer program product, including a computer program, which implements the steps of the target detection method as described above when executed by a processor.
[0197] The computer program product provided by this application can solve the technical problem in the related art that the detection performance of the small model in the large and small models is poor, resulting in an unsatisfactory final detection rate. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the target detection method provided by the above embodiment, and will not be repeated here.
[0198] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A target detection method, characterized in that: Applied to a backend device, wherein the backend device is provided with a secondary detection model for performing target detection; The method comprises: Acquire a scene image of a target detection area, wherein the target detection area is an area where a front-end device performs target detection, and a primary detection model for performing target detection is provided in the front-end device; Detecting scene features in the scene image through a secondary detection model to obtain scene division information corresponding to the scene image, wherein the scene division information includes region division information of at least one scene region and a scene type of each scene region; The scene division information is sent to the front-end device, so that the front-end device divides the target detection area into multiple scene areas based on the scene division information, obtains the model parameters corresponding to each scene area according to the scene type of each scene area, and performs target detection on each scene area according to the model parameters corresponding to each scene area through the first-level detection model; Wherein, the secondary detection model has a target detection function, and the secondary detection model includes a sub-model or sub-module for scene recognition; Before acquiring the scene image of the target detection area, the method further includes: Obtaining the first-level detection results corresponding to the first-level detection model and the second-level detection results corresponding to the second-level detection model for various targets within a preset time period; The first-level detection result is used as the predicted label, and the second-level detection result is used as the true value label to construct a classification result; The segmentation curve of the classification result is smoothly fitted to generate a relationship parameter curve, wherein the relationship parameter curve includes the region division information and the corresponding relationship between the model parameters.
2. The target detection method according to claim 1, characterized in that: The step of constructing a classification result using the primary detection result as a predicted label and the secondary detection result as a true value label includes: Correcting part of the secondary detection result according to the secondary correction instruction to obtain a corrected detection result; Adjusting the loss function based on the corrected detection result to generate an adjusted loss function, wherein the weight of the corrected detection result in the adjusted loss function is higher than the weight of other secondary detection results; The first-level detection result is used as a predicted label, the second-level detection result and the corrected detection result are used as true value labels, and a classification result is constructed based on the adjusted loss function.
3. The target detection method according to any one of claims 1 to 2, characterized in that: After sending the scene division information to the front-end device, the method further includes: Acquire multiple image frames to be detected within a preset time range before and after a first-level alarm frame, wherein the first-level alarm frame is an image frame when a first-level detection model determines that a warning target is detected; The target detection is performed on the image frame to be detected through the secondary detection model to determine whether a warning target is detected.
4. The target detection method according to claim 3, characterized in that: The step of obtaining a plurality of image frames to be detected within a preset time range before and after the first-level alarm frame includes: Acquire multiple image frames to be selected within a preset time range before and after the first-level alarm frame; Sorting the plurality of candidate image frames from high to low according to the image quality scores corresponding to the candidate image frames to obtain a sorting result; The first N images in the sorting results are selected as image frames to be detected, where N is a positive integer.
5. The target detection method according to claim 4, characterized in that: The step of sorting the plurality of candidate image frames from high to low according to the image quality scores corresponding to the candidate image frames to obtain the sorting results includes: Acquire auxiliary selection information corresponding to each image frame to be selected, wherein the auxiliary selection information includes at least one of target detection confidence, target classification confidence, target position point set, position point set continuity information, and motion speed; Sorting the multiple to-be-selected image frames based on the auxiliary selection information to obtain a primary sorting result; Selecting the first M first-level sorting results as first-level image frames to be selected, where M is a positive integer and M is greater than N; The plurality of candidate image frames are sorted from high to low according to the image quality scores corresponding to the first-level candidate image frames to obtain a sorting result.
6. The target detection method according to claim 3, characterized in that: The step of obtaining a plurality of image frames to be detected within a preset time range before and after the first-level alarm frame also includes: Obtain a training sample set, wherein the training sample set includes a plurality of sample images and a true value label corresponding to each sample image; Processing the sample images in the training sample set by using the secondary detection model to obtain sample processing results; Correcting the true value label corresponding to each sample image in the training sample set according to the sample processing result to obtain a corrected training sample set; Training the initial selection model based on the modified training sample set to obtain a frame selection model corresponding to the secondary detection model; The step of obtaining a plurality of image frames to be detected within a preset time range before and after the first-level alarm frame includes: Acquire multiple image frames to be selected within a preset time range before and after the first-level alarm frame; The image frame to be detected is selected from the multiple image frames to be selected through the frame selection model.
7. The target detection method according to claim 3, characterized in that: The backend device is provided with a plurality of different secondary detection models; The performing target detection on the image frame to be detected by the secondary detection model to determine whether a warning target is detected includes: Obtaining the computational load and / or detection requirements corresponding to the primary detection model; Determine a target secondary detection model according to the calculation amount and / or detection requirement; The target secondary detection model is used to perform target detection on the image frame to be detected to determine whether a warning target is detected.
8. A target detection device, characterized in that: Applied to a backend device, wherein the backend device is provided with a secondary detection model for performing target detection; The device comprises: An acquisition module, used to acquire a scene image of a target detection area, wherein the target detection area is an area where a front-end device performs target detection, and a primary detection model for performing target detection is provided in the front-end device; A scene module, configured to detect scene features in the scene image through a secondary detection model to obtain scene division information corresponding to the scene image, wherein the scene division information includes region division information of at least one scene region and a scene type of each scene region; A detection module, used to send the scene division information to the front-end device, so that the front-end device divides the target detection area into multiple scene areas based on the scene division information, and obtains the model parameters corresponding to each scene area according to the scene type of each scene area, and performs target detection on each scene area according to the model parameters corresponding to each scene area through the first-level detection model; Wherein, the secondary detection model has a target detection function, and the secondary detection model includes a sub-model or sub-module for scene recognition; The acquisition module is also used to obtain the first-level detection results corresponding to the first-level detection model and the second-level detection results corresponding to the second-level detection model for various targets within a preset time period; construct a classification result using the first-level detection result as a prediction label and the second-level detection result as a true value label; and smoothly fit the segmentation curve of the classification result to generate a relationship parameter curve, wherein the relationship parameter curve includes the correspondence between the area division information and the model parameters.
9. A target detection device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the target detection method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the target detection method according to any one of claims 1 to 7 are implemented.
11. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the target detection method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
AI-based early warning method and device, storage medium and electronic equipment
CN118097543A