Data detection method and device, electronic equipment and storage medium
By combining the detection results of multiple small models and detecting large models, the problem of large models and small models is solved, and the resource optimization is achieved.
Patent Information
- Application Number
- CN202411853966.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2044-12-16
AI Technical Summary
When large models work together with small models, further detection results of multiple small models need to be detected, resulting in excessive consumption of computing resources.
By combining multiple initial detection results of the same task type, using a large model to detect the combined data, intermediate detection results are obtained, and the secondary detection results of each data to be detected based on the intermediate detection results and data mapping relationship, the second detection results of each data to be detected are determined. Thus, the final test results are obtained.
It reduces the number of detections of large models and reduces the computing resources consumed by the collaborative work between large models and small models.
Smart Images

Figure CN119313981A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a data detection method, device, electronic device and storage medium. Background Art
[0002] A small model refers to a model with a small number of parameters (generally in the millions) and a simple model structure, and its calculation speed is faster. A large model refers to a model with a large number of parameters (generally in the billions) and a complex model structure, and its detection results are more accurate. At present, the collaboration between large and small models is a technical trend, that is, for the same task type, such as image target recognition tasks, image classification tasks, image semantic segmentation tasks, etc., the small model is responsible for rapid response and improving the detection rate, while the large model can further test the detection results of the small model to remove the false positives of the small model. The collaboration between the two can break through the bottleneck of a single model and provide more flexible and efficient intelligent services.
[0003] However, if further testing is required on multiple test results of the obtained small model, it is necessary to use the large model to separately test each test result of the obtained small model, and the large model consumes more computing resources. Therefore, the computing resources consumed by the large model and the small model to work together are relatively large. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a data detection method, device, electronic device and storage medium to solve the problem of large computing resources consumed by the collaborative work of large models and small models. The specific technical solution is as follows:
[0005] In one aspect of an embodiment of the present application, a data detection method is provided, the method comprising:
[0006] Obtaining initial test results obtained by performing a test on a plurality of to-be-tested data using a small model;
[0007] Combining the initial detection results that belong to the same task type among the acquired initial detection results to obtain combined data of the task type and a data mapping relationship between each combined initial detection result and the combined data;
[0008] Using the large model to be used of the task type to detect the combined data, and obtaining an intermediate detection result of the task type; wherein the parameter amount of the small model is smaller than the parameter amount of the large model; and for the data to be detected, the object category that can be detected by the large model to be used of the task type includes the object category represented by the initial detection result of the task type;
[0009] For each initial detection result of the task type, based on the intermediate detection result and the data mapping relationship, determine the portion corresponding to the initial detection result from the intermediate detection result to obtain a secondary detection result of the data to be detected corresponding to the initial detection result;
[0010] According to the secondary detection result of each data to be detected, the final detection result of the data to be detected is determined.
[0011] Optionally, combining the initial detection results belonging to the same task type among the acquired initial detection results to obtain combined data of the task type, and a data mapping relationship between each combined initial detection result and the combined data, includes:
[0012] When the number of initial detection results belonging to the same task type obtained reaches a preset number, the preset number of initial detection results of the task type obtained are combined to obtain combined data of the task type, and a data mapping relationship between each combined initial detection result and the combined data;
[0013] or,
[0014] When the preset detection cycle is reached, the initial detection results belonging to the same task type among the initial detection results obtained in this detection cycle are combined to obtain the combined data of the task type, as well as the data mapping relationship between each combined initial detection result and the combined data.
[0015] Optionally, before combining the initial detection results belonging to the same task type among the acquired initial detection results to obtain combined data of the task type and a data mapping relationship between each combined initial detection result and the combined data, the method further includes:
[0016] Obtaining the model correspondence of each small model that generates each initial detection result; wherein the large model corresponding to a small model is recorded in the model correspondence of the small model; the small model with the model correspondence has the same task type as the large model, and the object category that can be detected by the large model for the data to be detected includes the object category that can be detected by the small model;
[0017] According to the obtained model correspondence, the initial detection results generated by the small models corresponding to the same large model in the obtained initial detection results are determined to obtain the initial detection results belonging to the same task type, and the large model is determined as the large model to be used for the task type.
[0018] Optionally, for each initial detection result of the task type, based on the intermediate detection result and the data mapping relationship, determining the portion corresponding to the initial detection result from the intermediate detection result, and obtaining the secondary detection result of the data to be detected corresponding to the initial detection result, the method further includes:
[0019] For each initial detection result, obtain a label correspondence relationship of the object category represented by the initial detection result; wherein the label correspondence relationship of the object category represents: a correspondence relationship between a label representing the object category in a small model that generates the initial detection result and a label representing the object category in a corresponding large model;
[0020] For each initial detection result of the task type, based on the intermediate detection result and the data mapping relationship, determining a portion corresponding to the initial detection result from the intermediate detection result to obtain a secondary detection result of the data to be detected corresponding to the initial detection result, including:
[0021] For each initial detection result of the task type, based on the intermediate detection results and the data mapping relationship, determine a portion corresponding to the initial detection result from the intermediate detection results as the detection result to be used;
[0022] According to the label correspondence of the object category represented by the initial detection result, the label in the small model corresponding to the label in the large model contained in the detection result to be used is determined as the label contained in the secondary detection result of the data to be detected corresponding to the initial detection result.
[0023] Optionally, the method further comprises:
[0024] When a small model of any task type is newly deployed, the large model of the task type is incrementally trained using the training data set of the small model;
[0025] Generate a model correspondence between the small model and the large model, as well as a correspondence between a label representing a detectable object category in the small model and a label representing the object category in the corresponding large model.
[0026] Optionally, determining the final detection result of each data to be detected according to the secondary detection result of the data to be detected includes:
[0027] For each piece of data to be detected, determining a final detection result of the data to be detected according to a secondary detection result of the data to be detected and an initial detection result of the data to be detected;
[0028] or,
[0029] For each piece of data to be detected, the secondary detection result of the data to be detected is determined as the final detection result of the data to be detected.
[0030] Optionally, in the case where the task type is a target recognition task, the data to be detected corresponding to the initial detection result of the task type is an image, and the initial detection result belonging to the task type includes: a local image extracted from the image to be detected according to the position of the specified object detected by the small model for the image to be detected;
[0031] The initial detection results of the same task type among the acquired initial detection results are combined to obtain the combined data of the task type, and the data mapping relationship between each combined initial detection result and the combined data includes:
[0032] Splicing the local images contained in the initial detection results belonging to the same task type to obtain a spliced image as the combined data of the task type;
[0033] The data mapping relationship between each combined initial detection result and the combined data represents the splicing position of the local image in each initial detection result in the spliced image;
[0034] For each initial detection result of the task type, based on the intermediate detection result and the data mapping relationship, determining a portion corresponding to the initial detection result from the intermediate detection result to obtain a secondary detection result of the data to be detected corresponding to the initial detection result, including:
[0035] Based on the position of the specified object contained in the stitched image represented by the intermediate detection result and the position of the local image in each initial detection result represented by the data mapping relationship in the stitched image, the detection result of the local image in each initial detection result at the stitching position in the stitched image is determined as the secondary detection result of the data to be detected.
[0036] The present application also provides a data detection device, the device comprising:
[0037] A detection result acquisition module is used to obtain initial detection results obtained by the small model for detecting multiple data to be detected;
[0038] A combination module, used to combine the initial detection results belonging to the same task type among the acquired initial detection results to obtain combined data of the task type, and a data mapping relationship between each combined initial detection result and the combined data;
[0039] A large model detection module, used to detect the combined data using the large model to be used of the task type to obtain an intermediate detection result of the task type; wherein the parameter amount of the small model is smaller than the parameter amount of the large model; and for the data to be detected, the object category that can be detected by the large model to be used of the task type includes the object category represented by the initial detection result of the task type;
[0040] A secondary detection result determination module is used to determine, for each initial detection result of the task type, a portion corresponding to the initial detection result from the intermediate detection result based on the intermediate detection result and the data mapping relationship, and obtain a secondary detection result of the data to be detected corresponding to the initial detection result;
[0041] The final detection result determination module is used to determine the final detection result of the data to be detected according to the secondary detection result of each data to be detected.
[0042] The present application also provides an electronic device, including:
[0043] Memory, used to store computer programs;
[0044] The processor is used to implement any of the above-mentioned data detection methods when executing the program stored in the memory.
[0045] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any of the above-mentioned data detection methods is implemented.
[0046] An embodiment of the present application also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the above-mentioned data detection methods.
[0047] Beneficial effects of the embodiments of the present application:
[0048] The detection method provided in the embodiment of the present application combines multiple initial detection results belonging to the same task type, and then uses a large model to detect the combined data to obtain an intermediate detection result, and then obtains a secondary detection result of each data to be detected based on the intermediate detection result and the data mapping relationship, and determines the final detection result of the data to be detected based on the secondary detection result of the data to be detected. In this way, the large model only needs to perform one detection to obtain the final detection result for multiple data to be detected of the small model. Therefore, this solution can reduce the number of times the large model detects data, and thus can reduce the computing resources consumed by the large model and the small model working together.
[0049] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] 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, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0051] Figure 1 A first flow chart of the data detection method provided in the embodiment of the present application;
[0052] Figure 2 A second flow chart of the data detection method provided in the embodiment of the present application;
[0053] Figure 3 A third flow chart of the data detection method provided in the embodiment of the present application;
[0054] Figure 4 A fourth flow chart of the data detection method provided in the embodiment of the present application;
[0055] Figure 5 A fifth flow chart of the data detection method provided in the embodiment of the present application;
[0056] Figure 6 A schematic diagram of the structure of a data detection device provided in an embodiment of the present application;
[0057] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.
[0059] In order to reduce the computing resources consumed by the collaboration between large models and small models, the embodiments of the present application provide a data detection method, device, electronic device and readable storage medium, which can be applied to electronic devices, such as computers and servers. In a specific application scenario, the method can be applied to the back-end device deployed by the large model, or to a processing device that is independent of the back-end device, and the processing device communicates with the back-end device. The back-end device can be one or more. When there are multiple back-end devices, the data detection method can be applied to one of the back-end devices. The method includes:
[0060] Obtaining initial test results obtained by performing a test on a plurality of to-be-tested data using a small model;
[0061] Combining the initial detection results that belong to the same task type among the acquired initial detection results to obtain combined data of the task type and a data mapping relationship between each combined initial detection result and the combined data;
[0062] The combined data is detected using the large model to be used for the task type to obtain an intermediate detection result of the task type; wherein the parameter amount of the small model is smaller than the parameter amount of the large model; and for the data to be detected, the object category that can be detected by the large model to be used for the task type includes the object category represented by the initial detection result of the task type;
[0063] For each initial detection result of the task type, based on the intermediate detection results and the data mapping relationship, determine the part corresponding to the initial detection result from the intermediate detection results, and obtain the secondary detection result of the data to be detected corresponding to the initial detection result;
[0064] According to the secondary detection result of each data to be detected, the final detection result of the data to be detected is determined.
[0065] In this embodiment, multiple initial detection results belonging to the same task type are combined, and then the combined data is detected using a large model to obtain an intermediate detection result, and then a secondary detection result of each data to be detected is obtained based on the intermediate detection result and the data mapping relationship, and the final detection result of the data to be detected is determined according to the secondary detection result of the data to be detected. In this way, the large model only needs to perform one detection to obtain the final detection result for multiple data to be detected of the small model. Therefore, this solution can reduce the number of times the large model detects data, and thus reduce the computing resources consumed by the large model and the small model working together.
[0066] The following is an illustrative introduction to the data detection method provided in the embodiment of the present application, taking the back-end device deployed by the large model as the execution subject.
[0067] like Figure 1 As shown, the data detection method may include the following steps:
[0068] S101, obtaining initial detection results obtained by performing detection on a plurality of to-be-detected data using a small model;
[0069] Among them, the small model is a model with smaller parameters than the large model, and the small model usually has a simpler model structure than the large model. For example, the small model can be a shallow neural network, a lightweight convolutional neural network (such as MobileNet (mobile network)) or a small recurrent neural network (such as LSTM (Long Short-Term Memory) or GRU (Gated Recurrent Unit)). The large model can be a deep convolutional neural network (such as ResNet (residual network), Inception (inception), EfficientNet (efficient network)) or a large transformer-based model (such as BERT (Bidirectional Encoder Representation from Transformers, a bidirectional encoder representation model based on transformers), GPT (Generative Pre-Trained Transformer, a generative pre-trained model)).
[0070] The small model can be deployed in a front-end device, which communicates with a back-end device, and there can be multiple such front-end devices. Whenever the small model detects the data to be detected and obtains an initial detection result, the front-end device can send the obtained initial detection result to the back-end device, so that the back-end device obtains the initial detection result obtained by the small model for the data to be detected. Alternatively, the back-end device can also periodically obtain each initial detection result generated within a detection cycle from each front-end device. The multiple initial detection results obtained are derived from a small model or from multiple small models. In a specific application scenario, the front-end device where the small model is deployed can be an image acquisition device, and the image acquisition module in the image acquisition device is used to acquire images in the scene in real time as data to be detected, and the small model is used to perform target recognition on the acquired images.
[0071] In one implementation, the large model and the small model can also be deployed in the back-end device, and the business responsible for the large model and the business responsible for the small model can be decoupled from each other. Then the front-end device can send the collected data to be detected to the back-end device, and then the back-end device can first use the small model to detect multiple data to be detected to obtain initial detection results, and then perform subsequent steps S102-S105 to further detect the initial detection results obtained by the small model using the large model.
[0072] The data to be detected is the data that needs to be detected by the model. For example, if the data to be detected is an image that needs to be identified, the corresponding initial detection result may include the object category of the specified object identified by the small model, and the position of the detection frame of the specified object; if the data to be detected is an image that needs to be classified, the corresponding initial detection result may include the classification result of the image identified by the small model; if the data to be detected is an image that needs to be semantically segmented, the corresponding initial detection result may include the segmentation result of the small model for each pixel in the image; if the data to be detected is a text that needs to be identified as a sensitive word, the initial detection result may include the position of the sensitive word identified by the small model in the text. Of course, it is not limited to this.
[0073] S102, combining the initial detection results belonging to the same task type among the acquired initial detection results to obtain combined data of the task type and a data mapping relationship between each combined initial detection result and the combined data;
[0074] In one implementation, this step may be performed when the number of initial detection results belonging to the same task type obtained reaches a preset number; or, when a preset detection cycle is reached, the initial detection results belonging to the same task type among the initial detection results obtained in this detection cycle are combined. For example, the initial detection results belonging to the same task type obtained within 2 minutes are combined every 2 minutes. The data mapping relationship may represent the corresponding position of the initial detection result in the combined data.
[0075] In one implementation, the task type may be a target recognition task, and the data to be detected corresponding to the initial detection result of the task type is an image. The initial detection result belonging to the task type includes: a local image extracted from the image to be detected according to the position of the specified object detected by the small model for the image to be detected.
[0076] Among them, when the small model and the large model are respectively deployed on the front-end device and the back-end device, the front-end device can extract a partial image from the image to be detected according to the position of the specified object detected by the small model for the image to be detected, and then the front-end device sends the partial image to the back-end device. Alternatively, the front-end device can send the image to be detected and the position of the specified object detected by the small model for the image to be detected to the back-end device, and then the back-end device extracts the partial image from the image to be detected, which is also possible.
[0077] In the case where the task type is a target recognition task, the initial detection results of the same task type among the acquired initial detection results are combined to obtain the combined data of the task type, and the data mapping relationship between each combined initial detection result and the combined data includes:
[0078] The local images contained in the initial detection results belonging to the same task type are spliced to obtain a spliced image as the combined data of the task type; then, the data mapping relationship between each combined initial detection result and the combined data represents the splicing position of the local image in each initial detection result in the spliced image.
[0079] This embodiment does not limit the specific stitching method. It only needs to ensure that the stitched image can simultaneously contain the image information of each local image, and record the position of each local image in the stitched image to obtain a data mapping relationship.
[0080] For example, Figure 2 As shown, the small model and the large model are deployed on the front-end device and the back-end device respectively. The data to be detected are three images. The small model identifies the positions of the cow, horse, and sheep in the images respectively for the three images and represents them in the form of detection frames. The front-end device can send the three images and the positions of the detection frames in the three images to the back-end device; the back-end device can cut out the three images according to the positions of the detection frames, and obtain three partial images representing the cow, horse, and sheep respectively, and then cover the three partial images in turn with the blank image of the same specified size to obtain a spliced image. In this case, if there are many partial images obtained and a blank image of a specified size cannot accommodate all the partial images to be spliced, multiple spliced images can be generated.
[0081] If the task type is an image classification task, the data to be detected is the image to be detected, and the initial detection results may include: images belonging to the specified category in the data to be detected. For example, the image classification task is specifically used to identify whether a specified object exists in the image, and the small model will divide the identified image into two categories: images containing the specified object, and images not containing the specified object. In this case, the combined initial detection results may include: images containing the specified object are detected from multiple images detected by the small model, and at this time, the images containing the specified object can be directly spliced to obtain a spliced image. The data mapping relationship between each combined initial detection result and the combined data indicates the splicing position of each image containing the specified object in the spliced image.
[0082] In one implementation, if the task type is a sensitive word detection task for text, the data to be detected is the text to be detected, and the initial detection result may include: the paragraphs containing sensitive words identified by the small model for the text to be detected. In other words, the small model can perform sensitive word recognition on the text to be detected, obtain the position information of the sensitive words in the text, and then extract the paragraphs containing sensitive words from each text to be detected according to the received position information, and combine the extracted paragraphs to obtain a combined text; the data mapping relationship indicates the position of each extracted paragraph in the combined text.
[0083] S103, using the large model to be used for the task type to detect the combined data, and obtain an intermediate detection result of the task type;
[0084] Among them, the number of parameters of the small model is smaller than the number of parameters of the large model; and for the data to be detected, the object category that can be detected by the large model of this task type includes the object category represented by the initial detection result of this task type.
[0085] In this step, a large model belonging to the same task type as the combined data can be determined as the large model to be used, and then the combined data is input into the large model to be used, so as to obtain the intermediate detection result output by the large model to be used. For example, when the task type is a target recognition task, the spliced image can be input into the large model used to perform the target recognition task, and the target recognition result of the large model for the combined data can be obtained as the intermediate detection result; the intermediate detection result includes the position of the specified object contained in the spliced image, and can also include the object category of the specified object.
[0086] When the task type is a sensitive word detection task for a text, the object category represented by the initial detection result may refer to the sensitive category of the sensitive word, and the intermediate detection result may include the position of the sensitive word contained in the combined text, and may also include the sensitive category of the sensitive word.
[0087] It is understandable that the large model to be used for this task type has the function of this task type, which does not mean that the process of using the large model to detect data and the form of the output detection results are completely consistent with the small model of this task type. For example, when the task type is an image classification task, the data to be detected is the image to be detected, and the output of the small model for the image to be detected is the classification result for the entire image. After the spliced image obtained by splicing the images to be detected is input into the large model that performs the image classification task, the large model can output the classification results for each image area in the spliced image, each of which can be the area where a spliced local image is located.
[0088] When training the large model, multiple sample images can be spliced into a spliced sample image, and the position information of each sample image in the spliced sample image can be recorded as a data mapping relationship, and then the spliced sample image and the data mapping relationship can be input into the large model to be trained, and the predicted classification result of the large model for each sample image can be obtained. Then, the model loss is calculated according to the actual category of each sample image and the predicted classification result, so as to adjust the model parameters of the large model until the model converges and the trained large model is obtained. It can be seen that in this case, the large model has the function of classifying images, but the output result is not completely consistent with the small model. The small model outputs one result for an entire image, while the large model can output the classification results of each local image at a time for the spliced image.
[0089] In addition, the object categories that can be detected by the large model to be used for this task type need to include the object categories represented by the initial detection results of this task type. For example, if the task type is a target recognition task, the specified objects included in each initial detection result include: cows, horses, and sheep, then the large model to be used also needs to have the ability to detect cows, horses, and sheep in the image. For example, the large model to be used can be trained with images containing cows, images containing horses, and images containing sheep.
[0090] S104, for each initial detection result of the task type, based on the intermediate detection results and the data mapping relationship, determine the part corresponding to the initial detection result from the intermediate detection results, and obtain the secondary detection result of the to-be-detected data corresponding to the initial detection result;
[0091] In one implementation, when the task type is a target recognition task, for each data to be detected corresponding to the initial detection result of the task type, based on the position of the specified object contained in the stitched image represented by the intermediate detection result and the position of the local image in each initial detection result represented by the data mapping relationship in the stitched image, the detection result of the local image in each initial detection result at the stitching position in the stitched image is determined as the secondary detection result of the data to be detected.
[0092] For example, the category of the designated object represented by the initial detection result of the data to be detected is a cow, and according to the intermediate detection result and the data mapping relationship, it can be determined that the type of the designated object in the local image in the initial detection result at the stitching position in the stitching image is a sheep. In this case, the result containing the sheep in the data to be detected can be used as the secondary detection result of the data to be detected; if it is determined according to the intermediate detection result that the designated object does not exist at the stitching position of the local image in the stitching image, then it can be determined that the secondary detection result of the data to be detected is that the designated object does not exist.
[0093] In one implementation method, when the task type is sensitive word detection in text, for each data to be detected corresponding to the initial detection result of the task type, based on the position of the sensitive words in the spliced text represented by the intermediate detection results, and the position of the paragraphs of the sensitive words in each initial detection result represented by the data mapping relationship in the spliced text, the detection result of the paragraph containing the sensitive words in each initial detection result at the splicing position in the spliced text is determined as the secondary detection result of the data to be detected.
[0094] For example, the initial detection result of a data to be detected indicates that the 10th word in the 1st paragraph of the text to be detected is a sensitive word, then the 1st paragraph of the text to be detected can be extracted as the initial detection result; after text splicing, the paragraph is located in the 2nd paragraph of the spliced text; after large model detection, if the intermediate detection result indicates that there are no sensitive words in the 2nd paragraph of the spliced text, then it can be determined that the secondary detection result of the data to be detected is that there are no sensitive words; if the intermediate detection result indicates that the 9th word in the 2nd paragraph of the spliced text is a sensitive word, then it can be determined that the secondary detection result of the data to be detected is: the 1st paragraph and the 9th word of the text to be detected are sensitive words.
[0095] It can be seen that in this scheme, the combined data is input into the large model to be used, and the large model to be used only needs to perform one processing to obtain secondary detection results for multiple data to be detected, without the need to input each data to be detected into the large model to be used multiple times, so that the large model to be used performs multiple processing.
[0096] S105, determining the final detection result of each data to be detected according to the secondary detection result of the data to be detected.
[0097] In one implementation, since the detection result of the large model is more accurate than the detection result of the small model, the secondary detection result of the data to be detected can be directly determined as the final detection result of the data to be detected.
[0098] Alternatively, the final detection result of the data to be detected can be determined based on the secondary detection result of the data to be detected and the initial detection result of the data to be detected, so as to obtain the final detection result by combining the secondary detection result and the initial detection result, so that the final detection result is more accurate.
[0099] For example, the initial detection result obtained by the small model for the data to be detected is characterized by: the first confidence that the data to be detected contains the specified object, and the secondary detection result corresponding to the data to be detected is characterized by: the second confidence that the data to be detected contains the specified object. The first confidence and the second confidence can be weightedly added to obtain a comprehensive confidence. Since the detection result of the large model is more accurate than the detection result of the small model, the weight value of the second confidence can be set higher. Then, when the comprehensive confidence is greater than the preset threshold, it is determined that the data to be detected contains the specified object as the final detection result.
[0100] In this embodiment, multiple initial detection results belonging to the same task type are combined, and then the combined data is detected using a large model to obtain an intermediate detection result, and then a secondary detection result of each data to be detected is obtained based on the intermediate detection result and the data mapping relationship, and the final detection result of the data to be detected is determined according to the secondary detection result of the data to be detected. In this way, the large model only needs to perform one detection to obtain the final detection result for multiple data to be detected of the small model. Therefore, this solution can reduce the number of times the large model detects data, and thus reduce the computing resources consumed by the large model and the small model working together.
[0101] In an embodiment of the present application, before combining the initial detection results belonging to the same task type among the acquired initial detection results to obtain the combined data of the task type and the data mapping relationship between each combined initial detection result and the combined data, the data detection method further includes:
[0102] Step D1, obtaining the model correspondence relationship of each small model that generates each initial detection result; wherein the large model corresponding to a small model is recorded in the model correspondence relationship of the small model; the small model with the model correspondence relationship has the same task type as the large model, and the object category that can be detected by the large model for the data to be detected includes the object category that can be detected by the small model;
[0103] When the small model and the large model are deployed on the front-end device and the back-end device respectively, since there may be multiple large models deployed on the back-end device and different large models are used to perform different task types, in this embodiment, after the front-end device uses the small model to detect the data to be detected, the front-end device can send the model correspondence of the small model that generates the initial detection result to the back-end device, and the back-end device can use the model correspondence to determine the large model to be used for the task type.
[0104] In this embodiment, the model correspondence of the small model can be stored in the front-end device where the small model is deployed during the deployment stage of the large model and the small model. For example, for the same task type, the small model 1 is deployed in the front-end device and the large model 1 is deployed in the back-end device, then the model correspondence can be that the small model 1 corresponds to the large model 1. In this way, after the back-end device obtains the model correspondence, the large model 1 can be determined as the large model to be used. In the case where the small model and the large model are deployed on the back-end device at the same time, the model correspondence can be stored in the back-end device.
[0105] The model correspondence can also be generated according to the identification of the task type. For example, the identification recorded for the small model that performs the target recognition task is a, and the identification recorded for the large model that can perform the target recognition task is A. Then the model correspondence can be: identification a corresponds to identification A. In this way, after the back-end device obtains the model correspondence, the large model with the identification of the task type A can be determined as the large model to be used.
[0106] Step D2, based on the obtained model correspondence, determine the initial detection results generated by the small models corresponding to the same large model in each of the obtained initial detection results, obtain the initial detection results belonging to the same task type, and determine the large model as the large model to be used for the task type.
[0107] Since the small model and the large model that have a model correspondence relationship have the same task type, after obtaining the model correspondence relationship of the small model that generates the initial detection result, the large model corresponding to the small model to which each initial detection result belongs can be determined based on the model correspondence relationship, thereby determining the initial detection results of the same task type. Correspondingly, since the small models to which the initial detection results of the same task type belong all correspond to the large model of the same task type, the large model of the same task type can also be determined based on the obtained model correspondence relationship.
[0108] Furthermore, for each data to be detected corresponding to the initial detection result of the task type, based on the intermediate detection result and the data mapping relationship, determining a part of the detection result representing the data to be detected from the intermediate detection result as the secondary detection result of the data to be detected, the data detection method may further include:
[0109] For each initial detection result, obtain a label correspondence relationship of the object category represented by the initial detection result; wherein the label correspondence relationship of the object category represents: a correspondence relationship between a label representing the object category in a small model that generates the initial detection result and a label representing the object category in a corresponding large model;
[0110] Similarly, in this step, when the small model and the large model are deployed on the front-end device and the back-end device respectively, the label correspondence of the object category that the small model can detect can be stored in the front-end device where the small model is deployed during the deployment stage of the large model and the small model. Furthermore, when the front-end device sends the initial detection result to the back-end device, the label correspondence of the object category represented by the initial detection result can be sent together, so that the back-end device can obtain the label correspondence of the object category represented by the initial detection result from the front-end device for each initial detection result. When the small model and the large model are deployed on the back-end device at the same time, the label correspondence can be stored in the back-end device.
[0111] In this case, for each initial detection result of the task type, based on the intermediate detection result and the data mapping relationship, the part corresponding to the initial detection result is determined from the intermediate detection result to obtain the secondary detection result of the data to be detected corresponding to the initial detection result, which may include:
[0112] Step E1, for each initial detection result of the task type, based on the intermediate detection results and the data mapping relationship, determine the part corresponding to the initial detection result from the intermediate detection results as the detection result to be used;
[0113] Step E2, based on the label correspondence of the object category represented by the initial detection result, determine the label in the small model corresponding to the label in the large model contained in the detection result to be used as the label contained in the secondary detection result of the data to be detected corresponding to the initial detection result.
[0114] Among them, the label is used to represent the object category of the specified object that the model can detect. For example, for the same specified object in the target recognition task, the label of the small model is a1, and the label of the large model is A1. Then the label of the large model corresponding to the label a1 of the small model is A1. In this way, if the secondary detection result of the data to be detected contains label A1, then according to the label correspondence, it can be determined that the label A1 corresponds to the label a1 in the small model, and then it can be determined that the secondary detection result represents that the data to be detected contains the specified object. If the secondary detection result of the data to be detected does not contain label A1, it can be determined that the secondary detection result represents that the specified object does not exist in the data to be detected. At this time, if the initial detection result contains label a1, it means that the small model may be a false alarm. Therefore, the detection results of the small model can be filtered through this solution to reduce false alarms.
[0115] In this embodiment, if the small model and the large model are deployed on the front-end device and the back-end device respectively, during the model deployment phase, the corresponding relationship of each small model can be sent to the front-end device where each small model is deployed. Figure 3 As shown, the small model deployed on the front-end device 1 has a task type identifier a, and the object categories of the specified objects it can detect are a1 and a2. The correspondence 1 of the small model includes: model correspondence: a corresponds to A, label correspondence: a1 corresponds to A1, a2 corresponds to A2. The small model deployed on the front-end device 2 has a task type identifier a, and the object categories of the specified objects it can detect are b1 and b2. The correspondence 2 of the small model includes: model correspondence: a corresponds to A, label correspondence: b1 corresponds to A2, b2 corresponds to A3. Afterwards, when it is necessary to use the large model at the back end to perform a secondary test on the initial test result obtained by the small model test, the front-end device can send the initial test result obtained by the small model test and the correspondence recorded by itself to the back-end device. In this way, when it is necessary to test the initial test result obtained by the small model, the small model can send the correspondence recorded by itself to the back-end device, thereby reducing the storage burden of the back-end device.
[0116] A policy scheduling module may also be provided in the back-end device. When the back-end device receives the initial detection result sent by the front-end device, it may cache the received initial detection result in a preset storage space, and then schedule the large model to further detect the initial detection result through the policy scheduling module task priority, detection period, back-end hardware resources and other information combined with the preset scheduling strategy, so as to achieve balanced load of the back-end device, balance the device detection performance peak, give full play to the hardware performance, and efficiently utilize the hardware resources of the back-end device. For example, the back-end device may record the priority of each front-end device, and then, during the preset peak period, or when the occupancy rate of the back-end hardware resources is high, the initial detection result from the front-end device with a high priority may be detected first; afterwards, during the detection period outside the peak period, or when the occupancy rate of the back-end hardware resources is low, the initial detection result of the front-end device with a low priority may be detected.
[0117] In this embodiment, the computing resources consumed by the collaboration between the large model and the small model can be reduced. Furthermore, the large model corresponding to a small model is recorded in the model correspondence of the small model; the small model with the model correspondence has the same task type as the large model, and the object category that can be detected by the large model for the data to be detected includes the object category that can be detected by the small model. It is possible to determine the initial detection results belonging to the same task type in the acquired initial detection results according to the model correspondence, and determine the large model of the task type for the initial detection results belonging to the same task type according to the acquired model correspondence, thereby achieving decoupling between the small model and the large model, and providing a basis for the subsequent detection of the combined data using the large model. Moreover, through the model correspondence, only one large model can detect multiple initial detection results of multiple small models, thereby reducing the number of large models deployed on the back-end device and reducing the consumption of resources such as memory.
[0118] In one embodiment of the present application, the data detection method further includes:
[0119] Step F1, when a small model of any task type is newly deployed, incremental training is performed on the large model of the task type using the training data set of the small model;
[0120] The training data set of the small model may include: sample data used to train the small model, and corresponding true value labels. For example, when the task type of the small model is a target recognition task, the sample data is a sample image, and the true value label corresponding to the sample image represents the category of the specified object contained in the sample image, and the location of the specified object.
[0121] Step F2, generating a model correspondence between the small model and the large model, and a correspondence between the label representing the detectable object category in the small model and the label representing the object category in the corresponding large model.
[0122] When the small model and the large model are deployed on the front-end device and the back-end device respectively, the back-end device can send the generated model correspondence and label correspondence to the front-end device where the small model is deployed. After sending the model correspondence and label correspondence to the front-end device, the front-end device can store the model correspondence, thereby generating an initial detection result on the small model, and then send the model correspondence to the back-end device, so that the back-end device can determine the corresponding large model to be used for subsequent detection based on the model correspondence. If the small model and the large model are deployed on the back-end device at the same time, the model correspondence and label correspondence can be stored on the back-end device.
[0123] In this embodiment, when the large model and the small model are deployed, the training data set of the small model belonging to the same task type can be used to train the large model of the task type. Figure 4 As shown, for the same task type, the label of object category 1 that can be detected by small model 1 is a1, and the label of object category 2 is a2; the label of object category 2 that can be detected by small model 2 is b1, and the label of object category 3 is b2; the identification of the task type of small model 1, small model 2, and small model 3 is all a. Then, small model 1 can be trained using the training data sets of object category 1 and object category 2; small model 2 can be trained using the training data sets of object category 2 and object category 3; wherein the training data set of each object category is the data preset for the object category. For example, if object category 1 is a cow, an image containing a cow can be obtained as a sample image in the training data set of object category 1, and the sample image can be annotated to obtain the true value label of each sample image in the training data set of object category 1. Of course, images that do not contain cows can also be obtained for the training data set, and such images can be used as negative samples.
[0124] At the same time, for the same task type, the above training data can be used to train the large model, and finally the trained small models and the large model can be deployed according to the needs. For example, the trained small models are deployed to the front-end device, and the trained large model is deployed to the back-end device. The identifier of the task type recorded in the back-end device is A, and the labels for the detected object categories are A1, A2, and A3 respectively. Then, the model correspondence relationship of each small model and the label correspondence relationship of each object category can be established, where the correspondence relationship 1 of small model 1 includes: model correspondence relationship: a corresponds to A, and the label correspondence relationship includes: a1 corresponds to A1, and a2 corresponds to A2. The correspondence relationship 2 of small model 2 includes: model correspondence relationship: a corresponds to A, and the label correspondence relationship: b1 corresponds to A2, and b2 corresponds to A3.
[0125] After the large model and the small model are deployed and put into collaborative work, whenever a small model of any task type is newly deployed, the large model of the task type is incrementally trained using the training data set of the small model, so that the large model can accurately perform subsequent tests on the data tested by the small model. Figure 4 In the example, small model 3 is a newly deployed model. The label of object category 3 that it can detect is c1, and the label of object category 4 is c2. Then the training data sets of object category 3 and object category 4 can be used to train small model 3; at the same time, the training data sets of object category 3 and object category 4 can be used to perform incremental training on the large model. The label of object category 3 in the large model is A3, and the label of object category 4 is A4. Then the correspondence 3 of small model 3 includes: model correspondence: a corresponds to A, label correspondence: c1 corresponds to A3, c2 corresponds to A4.
[0126] In this embodiment, the computing resources consumed by the collaboration between the large model and the small model can be reduced. Furthermore, by incrementally training the large model for the same task type using the same training data set as the small model, the large model can also have the detection capability of the small model, so that the large model can more accurately detect the data detected by the small model.
[0127] For ease of understanding, the following Figure 5 The data detection method provided in the embodiment of the present application is exemplarily introduced.
[0128] like Figure 5As shown, three small models are deployed on the three front-end devices, which are used to identify cows, horses and sheep in the image respectively. The label of cow in the small model of front-end device 1 is a1, the label of horse in the small model of front-end device 2 is a1, and the label of sheep in the small model of front-end device 3 is a1. The identifier of the task type recorded by each front-end device is a. In the large model A of the back-end device, the labels of cow, horse and sheep are A1, A2 and A3 respectively. Each front-end device can be a camera.
[0129] Then, when the small model 1 detects that there is a cow in the image, the front-end device 1 can use the image as the data to be detected, and send the model correspondence (a corresponds to A), label correspondence (a1 corresponds to A1) of the small model 1, the image, and the position of the detection frame representing the cow to the policy scheduling module of the back-end device. Similarly, when the small model 2 detects that there is a horse in the image, the front-end device 2 can use the image as the data to be detected, and send the model correspondence (a corresponds to A), label correspondence (a1 corresponds to A2) of the small model 2, the image, and the position of the detection frame representing the horse to the policy scheduling module of the back-end device. When the small model 3 detects that there is a sheep in the image, the front-end device 3 can use the image as the data to be detected, and send the model correspondence (a corresponds to A), label correspondence (a1 corresponds to A3) of the small model 3, the image, and the position of the detection frame representing the sheep to the policy scheduling module of the back-end device.
[0130] The strategy scheduling module can cut out the received images according to the detection frame to obtain a cow cutout image (i.e., a partial image), a horse cutout image, and a sheep cutout image, and then splice the cutout images into one image to obtain a spliced image, and record the coordinate mapping relationship (i.e., data mapping relationship) between each cutout image and the spliced image. Afterwards, the policy scheduling module can schedule the large model to detect the stitched image according to task priority, and / or other scheduling strategies such as detection period, effect acceptance, back-end hardware resources, etc., to obtain an intermediate detection result; and then restore the large model label to the small model label according to the label correspondence, that is, according to the label correspondence of the object category represented by the initial detection result, determine the label in the small model corresponding to the label in the large model contained in the detection result to be used, as the label contained in the secondary detection result of the data to be detected corresponding to the initial detection result; and restore the coordinates from the stitched image to the image detected by the small model, that is, based on the position of the specified object contained in the stitched image represented by the intermediate detection result and the position of the local image in each initial detection result represented by the data mapping relationship in the stitched image, determine the detection result of the local image in each initial detection result at the stitching position in the stitched image as the secondary detection result of the data to be detected.
[0131] In this embodiment, multiple initial detection results belonging to the same task type are combined, and then the combined data is detected using a large model to obtain an intermediate detection result, and then a secondary detection result of each data to be detected is obtained based on the intermediate detection result and the data mapping relationship, and the final detection result of the data to be detected is determined according to the secondary detection result of the data to be detected. In this way, the large model only needs to perform one detection to obtain the final detection result for multiple data to be detected of the small model. Therefore, this solution can reduce the number of times the large model detects data, and thus reduce the computing resources consumed by the large model and the small model working together.
[0132] Based on the same inventive concept, the present application also provides a data detection device, such as Figure 6 As shown, the device comprises:
[0133] The detection result acquisition module 601 is used to obtain initial detection results obtained by the small model for detecting multiple data to be detected;
[0134] A combining module 602 is used to combine the initial detection results belonging to the same task type among the acquired initial detection results to obtain combined data of the task type and a data mapping relationship between each combined initial detection result and the combined data;
[0135] The large model detection module 603 is used to detect the combined data using the large model to be used of the task type to obtain an intermediate detection result of the task type; wherein the parameter amount of the small model is smaller than the parameter amount of the large model; and for the data to be detected, the object category that can be detected by the large model to be used of the task type includes the object category represented by the initial detection result of the task type;
[0136] A secondary detection result determination module 604 is used to determine, for each initial detection result of the task type, a portion corresponding to the initial detection result from the intermediate detection result based on the intermediate detection result and the data mapping relationship, and obtain a secondary detection result of the to-be-detected data corresponding to the initial detection result;
[0137] The final detection result determination module 605 is used to determine the final detection result of each data to be detected according to the secondary detection result of the data to be detected.
[0138] Optionally, the combining module 602 is specifically configured to combine the preset number of initial detection results of the same task type when the number of initial detection results belonging to the same task type reaches a preset number, to obtain combined data of the task type, and a data mapping relationship between each combined initial detection result and the combined data;
[0139] Or, when a preset detection cycle is reached, the initial detection results belonging to the same task type among the initial detection results obtained in this detection cycle are combined to obtain combined data of the task type, as well as a data mapping relationship between each combined initial detection result and the combined data.
[0140] Optionally, the device further includes: a model correspondence acquisition module, which is used to combine the initial detection results belonging to the same task type among the initial detection results obtained in the combination module 602 to obtain the combined data of the task type, and the data mapping relationship between each combined initial detection result and the combined data, and obtain the model correspondence relationship of each small model that generates each initial detection result; wherein the model correspondence relationship of a small model records the large model corresponding to the small model; the task type of the small model with the model correspondence relationship is the same as that of the large model, and the object category that can be detected by the large model for the data to be detected includes the object category that can be detected by the small model;
[0141] The initial detection result determination module is used to determine the initial detection results generated by the small models corresponding to the same large model in the obtained initial detection results according to the obtained model correspondence, obtain the initial detection results belonging to the same task type, and determine the large model as the large model to be used for the task type.
[0142] Optionally, the device further comprises:
[0143] The label correspondence acquisition module is used for, for each initial detection result of the task type, the secondary detection result determination module 604 determines the portion corresponding to the initial detection result from the intermediate detection result based on the intermediate detection result and the data mapping relationship, and obtains the label correspondence of the object category represented by the initial detection result for each initial detection result before obtaining the secondary detection result of the to-be-detected data corresponding to the initial detection result; wherein the label correspondence of the object category represents: the correspondence between the label representing the object category in the small model that generates the initial detection result and the label representing the object category in the corresponding large model;
[0144] The secondary detection result determination module 604 includes:
[0145] A detection result to be used determination submodule, for each initial detection result of the task type, based on the intermediate detection result and the data mapping relationship, determining a portion corresponding to the initial detection result from the intermediate detection result as the detection result to be used;
[0146] The label determination submodule is used to determine the label in the small model corresponding to the label in the large model contained in the detection result to be used, based on the label correspondence of the object category represented by the initial detection result, as the label contained in the secondary detection result of the data to be detected corresponding to the initial detection result.
[0147] Optionally, the device further comprises:
[0148] An incremental training module is used to perform incremental training on a large model of any task type using the training data set of the small model when a small model of the task type is newly deployed;
[0149] The model correspondence generation module is used to generate a model correspondence between the small model and the large model, as well as a correspondence between a label representing a detectable object category in the small model and a label representing the object category in the corresponding large model.
[0150] Optionally, the final detection result determination module 605 is specifically used to:
[0151] For each piece of data to be detected, determining a final detection result of the data to be detected according to a secondary detection result of the data to be detected and an initial detection result of the data to be detected;
[0152] Or, for each data to be detected, the secondary detection result of the data to be detected is determined as the final detection result of the data to be detected.
[0153] Optionally, in the case where the task type is a target recognition task, the data to be detected corresponding to the initial detection result of the task type is an image, and the initial detection result belonging to the task type includes: a local image extracted from the image to be detected according to the position of the specified object detected by the small model for the image to be detected;
[0154] A combination module 602 is specifically used to stitch together the local images included in the initial detection results belonging to the same task type to obtain a stitched image as the combination data of the task type;
[0155] The data mapping relationship between each combined initial detection result and the combined data represents the splicing position of the local image in each initial detection result in the spliced image;
[0156] The secondary detection result determination module 604 is specifically used for:
[0157] Based on the position of the specified object contained in the stitched image represented by the intermediate detection result and the position of the local image in each initial detection result represented by the data mapping relationship in the stitched image, the detection result of the local image in each initial detection result at the stitching position in the stitched image is determined as the secondary detection result of the data to be detected.
[0158] The present application also provides an electronic device, such as Figure 7 As shown, including:
[0159] Memory 701, used for storing computer programs;
[0160] The processor 702 is used to implement any of the steps of the above-mentioned data detection method when executing the program stored in the memory 701.
[0161] Furthermore, the electronic device may further include a communication bus and / or a communication interface, and the processor 702, the communication interface, and the memory 701 communicate with each other via the communication bus.
[0162] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0163] The communication interface is used for communication between the above electronic device and other devices.
[0164] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0165] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0166] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned data detection methods are implemented.
[0167] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any of the data detection methods in the above embodiments.
[0168] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a solid-state hard disk (SSD), etc.
[0169] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0170] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, electronic device, and computer-readable storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0171] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims
1. A data detection method, characterized in that: The method comprises: Obtaining initial test results obtained by performing a test on a plurality of to-be-tested data using a small model; Combining the initial detection results that belong to the same task type among the acquired initial detection results to obtain combined data of the task type and a data mapping relationship between each combined initial detection result and the combined data; Using the large model to be used of the task type to detect the combined data, and obtaining an intermediate detection result of the task type; wherein the parameter amount of the small model is smaller than the parameter amount of the large model; and for the data to be detected, the object category that can be detected by the large model to be used of the task type includes the object category represented by the initial detection result of the task type; For each initial detection result of the task type, based on the intermediate detection result and the data mapping relationship, determine the portion corresponding to the initial detection result from the intermediate detection result to obtain a secondary detection result of the data to be detected corresponding to the initial detection result; According to the secondary detection result of each data to be detected, the final detection result of the data to be detected is determined.
2. The method according to claim 1, characterized in that The initial detection results of the same task type among the acquired initial detection results are combined to obtain the combined data of the task type, and the data mapping relationship between each combined initial detection result and the combined data includes: When the number of initial detection results belonging to the same task type obtained reaches a preset number, the preset number of initial detection results of the task type obtained are combined to obtain combined data of the task type, and a data mapping relationship between each combined initial detection result and the combined data; or, When the preset detection cycle is reached, the initial detection results belonging to the same task type among the initial detection results obtained in this detection cycle are combined to obtain the combined data of the task type, as well as the data mapping relationship between each combined initial detection result and the combined data.
3. The method according to claim 1, characterized in that Before combining the initial detection results belonging to the same task type among the acquired initial detection results to obtain the combined data of the task type and the data mapping relationship between each combined initial detection result and the combined data, the method further includes: Obtaining the model correspondence of each small model that generates each initial detection result; wherein the large model corresponding to a small model is recorded in the model correspondence of the small model; the small model with the model correspondence has the same task type as the large model, and the object category that can be detected by the large model for the data to be detected includes the object category that can be detected by the small model; According to the obtained model correspondence, the initial detection results generated by the small models corresponding to the same large model in the obtained initial detection results are determined to obtain the initial detection results belonging to the same task type, and the large model is determined as the large model to be used for the task type.
4. The method according to claim 3, characterized in that For each initial detection result of the task type, based on the intermediate detection result and the data mapping relationship, determining the portion corresponding to the initial detection result from the intermediate detection result, and obtaining the secondary detection result of the to-be-detected data corresponding to the initial detection result, the method further includes: For each initial detection result, obtain a label correspondence relationship of the object category represented by the initial detection result; wherein the label correspondence relationship of the object category represents: a correspondence relationship between a label representing the object category in a small model that generates the initial detection result and a label representing the object category in a corresponding large model; For each initial detection result of the task type, based on the intermediate detection result and the data mapping relationship, determining a portion corresponding to the initial detection result from the intermediate detection result to obtain a secondary detection result of the data to be detected corresponding to the initial detection result, including: For each initial detection result of the task type, based on the intermediate detection results and the data mapping relationship, determine a portion corresponding to the initial detection result from the intermediate detection results as the detection result to be used; According to the label correspondence of the object category represented by the initial detection result, the label in the small model corresponding to the label in the large model contained in the detection result to be used is determined as the label contained in the secondary detection result of the data to be detected corresponding to the initial detection result.
5. The method according to claim 4, characterized in that The method further comprises: When a small model of any task type is newly deployed, the large model of the task type is incrementally trained using the training data set of the small model; Generate a model correspondence between the small model and the large model, as well as a correspondence between a label representing a detectable object category in the small model and a label representing the object category in the corresponding large model.
6. The method according to claim 1, characterized in that Determining the final detection result of each data to be detected according to the secondary detection result of the data to be detected includes: For each piece of data to be detected, determining a final detection result of the data to be detected according to a secondary detection result of the data to be detected and an initial detection result of the data to be detected; or, For each piece of data to be detected, the secondary detection result of the data to be detected is determined as the final detection result of the data to be detected.
7. The method according to claim 1, characterized in that In the case where the task type is a target recognition task, the data to be detected corresponding to the initial detection result of the task type is an image, and the initial detection result belonging to the task type includes: a local image extracted from the image to be detected according to the position of the specified object detected by the small model for the image to be detected; The initial detection results of the same task type among the acquired initial detection results are combined to obtain the combined data of the task type, and the data mapping relationship between each combined initial detection result and the combined data includes: Splicing the local images contained in the initial detection results belonging to the same task type to obtain a spliced image as the combined data of the task type; The data mapping relationship between each combined initial detection result and the combined data represents the splicing position of the local image in each initial detection result in the spliced image; For each initial detection result of the task type, based on the intermediate detection result and the data mapping relationship, determining a portion corresponding to the initial detection result from the intermediate detection result to obtain a secondary detection result of the data to be detected corresponding to the initial detection result, including: Based on the position of the specified object contained in the stitched image represented by the intermediate detection result and the position of the local image in each initial detection result represented by the data mapping relationship in the stitched image, the detection result of the local image in each initial detection result at the stitching position in the stitched image is determined as the secondary detection result of the data to be detected.
8. A data detection device, characterized in that: The device comprises: A detection result acquisition module is used to obtain initial detection results obtained by the small model for detecting multiple data to be detected; A combination module, used to combine the initial detection results belonging to the same task type among the acquired initial detection results to obtain combined data of the task type, and a data mapping relationship between each combined initial detection result and the combined data; A large model detection module, used to detect the combined data using the large model to be used of the task type to obtain an intermediate detection result of the task type; wherein the parameter amount of the small model is smaller than the parameter amount of the large model; and for the data to be detected, the object category that can be detected by the large model to be used of the task type includes the object category represented by the initial detection result of the task type; A secondary detection result determination module is used to determine, for each initial detection result of the task type, a portion corresponding to the initial detection result from the intermediate detection result based on the intermediate detection result and the data mapping relationship, and obtain a secondary detection result of the data to be detected corresponding to the initial detection result; The final detection result determination module is used to determine the final detection result of the data to be detected according to the secondary detection result of each data to be detected.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-7 when executing a program stored in a memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Key point positioning model training method, positioning method, device and equipment
CN109740567A
Garbage detection method and system, electronic equipment and storage medium
CN117422886A
Processing method and device for optimizing detection result of large target detection model
CN117671428A
Industrial environment data analysis method, device and system based on AI model
CN118227984A
Generation method and device of target detection model, equipment and storage medium
CN118941763A
Cited By
Analysis method, device and equipment based on model collaboration
CN121686007A