Image recognition task processing method and device, computer equipment and storage medium
By decomposing the image recognition task into sub-tasks and processing it in parallel with multiple computing nodes, combined with transfer learning technology, the problems of low image recognition efficiency and insufficient accuracy in the prior art are solved, and efficient recognition of different parts of the vehicle is achieved.
Patent Information
- Application Number
- CN202411173452.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-12-13
AI Technical Summary
The existing image recognition technology is inefficient when processing large numbers of vehicle images and cannot accurately identify the impact loss situations in different parts of the vehicle.
By decomposing the image data to be identified into multiple subtasks and processing these subtasks in parallel with multiple computing nodes, the target model is trained in combination with transfer learning techniques to improve recognition accuracy.
The processing efficiency and accuracy of image recognition tasks are improved, and accurate identification of different parts of the vehicle is ensured.
Smart Images

Figure CN119127429A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image recognition and financial technology, and in particular to an image recognition task processing method, device, computer equipment and storage medium. Background Art
[0002] With the rapid development of computer vision technology, image recognition technology is widely used in the fields of vehicle insurance claims, risk assessment, etc. By identifying relevant images for vehicle review, insurance claims or risk assessment, etc., it can save manpower for insurance companies to achieve automatic review and case closing. At present, the processing of image recognition tasks is usually done by inputting the image to be recognized in the image recognition task into the image processing model. When users need to recognize a large number of vehicle images to obtain the risk of each vehicle, the traditional image recognition method needs to recognize the image to be recognized one by one, resulting in low processing efficiency of the image recognition task. In addition, due to the single model, it is usually impossible to accurately identify different collision damage conditions of different parts of the vehicle (such as tires, bumpers, windows, etc.). Therefore, how to improve the processing efficiency and accuracy of image recognition tasks has become an urgent problem to be solved. Summary of the invention
[0003] The present application provides a method, apparatus, computer device and storage medium for processing image recognition tasks to improve the processing efficiency and accuracy of image recognition tasks.
[0004] In a first aspect, the present application provides a method for processing an image recognition task, the method comprising:
[0005] When receiving an image recognition task, obtaining image data to be recognized;
[0006] When the amount of the image data to be recognized is greater than a preset threshold, the image recognition task is decomposed based on the image data to be recognized to obtain at least one image recognition subtask;
[0007] Processing each of the image recognition subtasks based on the computing nodes corresponding to each of the image recognition subtasks to obtain recognition results of each of the image recognition subtasks;
[0008] The recognition results of each of the image recognition subtasks are combined to obtain an image recognition result of the image recognition task.
[0009] In a second aspect, the present application further provides an image recognition task processing device, the device comprising:
[0010] A data acquisition module is used to acquire the image data to be recognized when receiving an image recognition task;
[0011] A recognition task decomposition module, configured to decompose the image recognition task based on the image data to be recognized to obtain at least one image recognition subtask when the amount of the image data to be recognized is greater than a preset threshold;
[0012] A subtask processing module, used to process each of the image recognition subtasks based on the computing nodes corresponding to each of the image recognition subtasks, to obtain a recognition result of each of the image recognition subtasks;
[0013] The result obtaining module is used to merge the recognition results of each of the image recognition subtasks to obtain the image recognition result of the image recognition task.
[0014] In a third aspect, the present application also provides a computer device, comprising a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement the image recognition task processing method as described above when executing the computer program.
[0015] In a fourth aspect, 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, the processor implements the image recognition task processing method as described above.
[0016] The present application discloses an image recognition task processing method, device, computer equipment and storage medium. When receiving an image recognition task, the image data to be recognized is obtained; when the data volume of the image data to be recognized is greater than a preset threshold, the image recognition task is decomposed based on the image data to be recognized to obtain at least one image recognition subtask; based on the computing nodes corresponding to each image recognition subtask, each image recognition subtask is processed respectively to obtain the recognition result of each image recognition subtask; the recognition results of each image recognition subtask are merged to obtain the image recognition result of the image recognition task. The present application can decompose the image recognition task into multiple subtasks according to the image data to be recognized in the image recognition task, and the computing nodes corresponding to each subtask process the subtask respectively, and finally merge the recognition results of each image recognition subtask to obtain the image recognition result of the image recognition task. Multiple different image recognition subtasks can be processed in parallel by multiple computing nodes, thereby improving the processing efficiency of the image recognition task. At the same time, each computing node corresponds to different image recognition subtasks one by one, thereby improving the recognition accuracy of each image recognition subtask, thereby improving the recognition accuracy of the image recognition task. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1 is a schematic flow chart of a first embodiment of an image recognition task processing method provided by an embodiment of the present application;
[0019] Figure 2 is a schematic flow chart of a second embodiment of an image recognition task processing method provided by an embodiment of the present application;
[0020] Figure 3 is a schematic flow chart of a third embodiment of an image recognition task processing method provided by an embodiment of the present application;
[0021] Figure 4 A schematic block diagram of an image recognition task processing device provided in an embodiment of the present application;
[0022] Figure 5 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] 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 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 without creative work are within the scope of protection of this application.
[0024] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0025] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0026] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0027] The embodiments of the present application provide an image recognition task processing method, device, computer equipment and storage medium. The image recognition task processing method can be applied to a server, and multiple computing nodes are used to process multiple different image recognition subtasks in parallel, thereby improving the processing efficiency of the image recognition task. At the same time, each computing node corresponds to a different image recognition subtask, thereby improving the recognition accuracy of each image recognition subtask, thereby improving the recognition accuracy of the image recognition task. The server can be an independent server or a server cluster.
[0028] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0029] See also Figure 1 , Figure 1 This is a schematic flow chart of an image recognition task processing method provided by an embodiment of the present application. The image recognition task processing method can be applied to a server, and is used to simultaneously process multiple different image recognition subtasks through multiple computing nodes, thereby improving the processing efficiency of the image recognition task. At the same time, each computing node corresponds to a different image recognition subtask one by one, thereby improving the recognition accuracy of each image recognition subtask, thereby improving the recognition accuracy of the image recognition task.
[0030] like Figure 1 As shown, the image recognition task processing method specifically includes steps S101 to S104.
[0031] S101, when receiving an image recognition task, obtaining image data to be recognized;
[0032] In one embodiment, the image data to be recognized includes at least one image to be recognized.
[0033] In one embodiment, the image recognition task may be tasks such as face recognition, object detection, and image classification.
[0034] S102: When the amount of the image data to be recognized is greater than a preset threshold, decomposing the image recognition task based on the image data to be recognized to obtain at least one image recognition subtask;
[0035] In one embodiment, when the amount of the image data to be identified is greater than a preset threshold, the image to be identified is classified according to the image features of the image to be identified, a classification result of the image data to be identified is obtained, and then the image recognition task is decomposed into at least one image recognition subtask corresponding to the classification result of the image data to be identified. The preset threshold can be set by the user according to actual needs.
[0036] In another embodiment, when the amount of the image data to be identified is not greater than a preset threshold, the preset image recognition model can be directly used to identify the image data to be identified one by one.
[0037] Furthermore, when the data volume of the image data to be identified is greater than a preset threshold, the image recognition task is decomposed based on the image data to be identified, and after obtaining at least one image recognition subtask, it also includes: when the matching degree between the image recognition subtask and each of the computing nodes is less than a preset matching degree threshold, obtaining the computing node with the highest matching degree as the target computing node of the image recognition subtask; obtaining transfer learning data based on the image data to be identified corresponding to the image recognition subtask; training the initial image recognition model of the target computing node based on the transfer learning data to obtain a target image recognition model, and processing the image recognition subtask based on the target image recognition model to obtain a recognition result of the image recognition subtask.
[0038] In one embodiment, when the matching degree between all computing nodes and the image recognition subtask is lower than the preset matching degree threshold, some measures need to be taken to ensure that the image recognition subtask can be effectively executed, so that even if the initial matching degree is not high, the model can be effectively trained through transfer learning technology to complete the image recognition subtask and provide accurate results for the entire image recognition task.
[0039] In a specific embodiment, first, the node with the highest matching degree with the image recognition subtask is screened out from all computing nodes. The matching degree can be calculated based on the performance parameters of each computing node and the image feature parameters of the image recognition subtask. Then, part of the data is extracted from the image data to be recognized of the image recognition subtask as transfer learning data, or image data related to the image recognition subtask is collected as transfer learning data. Finally, the initial image recognition model on the target computing node is trained using the transfer learning data. During the training process, the model will learn how to better recognize and process the image data in the image recognition subtask, and obtain an optimized and adjusted target image recognition model.
[0040] In one embodiment, a trained target image recognition model is used to process the image recognition subtask to obtain a recognition result of the image recognition subtask.
[0041] S103, processing each of the image recognition subtasks based on the computing nodes corresponding to each of the image recognition subtasks respectively to obtain a recognition result of each of the image recognition subtasks;
[0042] Furthermore, before the computing nodes corresponding to each of the image recognition subtasks are used to process each of the image recognition subtasks respectively and obtain the recognition results of each of the image recognition subtasks, it also includes: based on the performance parameters of each of the computing nodes and the feature parameters of each image to be recognized in the image recognition subtask, matching the computing nodes with the image recognition subtasks to obtain the matching degree between each of the computing nodes and each of the image recognition subtasks; based on a preset matching degree threshold and the matching degree, obtaining the matching result between each of the computing nodes and each of the image recognition subtasks; based on the matching result, distributing each of the image recognition subtasks to the corresponding computing nodes.
[0043] In one embodiment, the image recognition subtask that each computing node is most suitable for processing can be determined by analyzing the performance parameters of each computing node, such as processing power, memory size, storage capacity, network bandwidth, and the categories that the pre-stored model of the computing node is good at processing, etc. The ability of the computing node to process the image recognition subtask can be evaluated.
[0044] In one embodiment, the characteristic parameters of each image to be recognized in the image recognition subtask can be obtained by image feature analysis, such as the size, category, complexity of image features, etc. The computing resources required for each image recognition subtask can be evaluated.
[0045] In one embodiment, the matching degree between each computing node and each image recognition subtask is calculated based on the performance parameters of each computing node and the characteristic parameters of each image to be recognized in the image recognition subtask, and then whether the computing node matches the image recognition subtask is determined based on the matching degree. The matching degree can be calculated by a certain algorithm, for example, different weights can be assigned based on the degree of influence of each parameter on the task processing efficiency, and then a comprehensive score is calculated as the matching degree.
[0046] In one embodiment, the matching result between each computing node and each image recognition subtask can be determined based on a preset matching degree threshold and a calculated matching degree. Specifically, if the matching degree between a computing node and the current image recognition subtask is higher than the threshold, the computing node is considered suitable for processing the image recognition subtask. If there are multiple computing nodes whose matching degrees are higher than the threshold, the computing node with the highest matching degree is used as the computing node matched by the image recognition subtask.
[0047] In one embodiment, each image recognition subtask is distributed to a corresponding computing node based on the matching results to ensure that each image recognition subtask can be distributed to the computing node that best suits it, efficiently utilizing computing resources and improving the processing efficiency and recognition accuracy of image recognition tasks.
[0048] The above-mentioned embodiments can realize effective matching and distribution of computing nodes and image recognition subtasks, thereby improving the processing efficiency and accuracy of image recognition tasks.
[0049] Furthermore, the computing nodes corresponding to each of the image recognition subtasks are used to process each of the image recognition subtasks respectively to obtain recognition results of each of the image recognition subtasks, including: based on the image recognition model preset in the computing nodes, image recognition is performed on the image data to be recognized in the image recognition subtask to obtain the recognition results of the image recognition subtasks.
[0050] In one embodiment, pre-trained image recognition models are loaded from the computing nodes. These models can be based on deep learning methods, such as convolutional neural networks, or traditional machine learning methods, such as support vector machines, decision trees, etc.
[0051] In one embodiment, necessary preprocessing, such as resizing, normalization, etc., is performed on the image data to be recognized that does not meet the input requirements of the current model according to the image recognition model to match the input requirements of the model.
[0052] In one embodiment, each computing node simultaneously uses its own preset image recognition model to recognize each image to be recognized in the image recognition subtask to obtain a corresponding image recognition result, which may be a classification label of the image, an object detection frame, etc.
[0053] S104: Merge the recognition results of the image recognition subtasks to obtain an image recognition result of the image recognition task.
[0054] In one embodiment, the recognition results of all subtasks are collected from each computing node, which may include classification labels, detection boxes, segmentation masks, or any other task-specific outputs.
[0055] In one embodiment, the recognition results from each image recognition subtask are merged into a unified data structure, such as a database, a data warehouse, or a distributed file system. The merging process can be based on predefined rules or algorithms. For example, the results can be sorted according to the identity of the subtask or a specific attribute of the image (such as image ID or acquisition order).
[0056] In one embodiment, the final image recognition result is output to the user or other system for further processing, for example, to check whether the merged data is consistent with the image data to be recognized, to ensure that there are no missing or repeated recognition results.
[0057] The above embodiment provides an image recognition task processing method, device, computer equipment and storage medium. When receiving an image recognition task, the image data to be recognized is obtained; when the data volume of the image data to be recognized is greater than a preset threshold, the image recognition task is decomposed based on the image data to be recognized to obtain at least one image recognition subtask; based on the computing nodes corresponding to each image recognition subtask, each image recognition subtask is processed respectively to obtain the recognition result of each image recognition subtask; the recognition results of each image recognition subtask are merged to obtain the image recognition result of the image recognition task. The present application can decompose the image recognition task into multiple subtasks according to the image data to be recognized in the image recognition task, and the computing nodes corresponding to each subtask process the subtask respectively, and finally merge the recognition results of each image recognition subtask to obtain the image recognition result of the image recognition task. Multiple different image recognition subtasks can be processed in parallel by multiple computing nodes, thereby improving the processing efficiency of the image recognition task. At the same time, each computing node corresponds to different image recognition subtasks one by one, thereby improving the recognition accuracy of each image recognition subtask, thereby improving the recognition accuracy of the image recognition task.
[0058] See also Figure 2 , Figure 2 This is a schematic flow chart of an image recognition task processing method provided by an embodiment of the present application. The image recognition task processing method can be applied to a server to decompose an image recognition task into multiple image recognition subtasks according to the image data to be recognized, so as to process multiple image recognition subtasks in parallel and improve the processing efficiency of the image recognition task.
[0059] like Figure 2 As shown, the image recognition task processing method specifically includes steps S201 to S205.
[0060] S201, obtaining the task objective of the image recognition task;
[0061] In one embodiment, the task objective can be directly obtained from the image recognition task, or can be obtained by analyzing the task information of the image recognition task.
[0062] S202, based on the task objective, extracting features of each image to be identified in the image data to be identified, to obtain image features of each image to be identified;
[0063] Furthermore, based on the task objective, feature extraction is performed on each image to be identified in the image data to be identified to obtain image features of each image to be identified, including: determining a feature extraction model based on the task objective; and based on the feature extraction model, feature extraction is performed on each image to be identified to obtain image features of each image to be identified.
[0064] In one embodiment, selecting a suitable feature extraction method according to the task objective can reduce the dimension of the image and retain the key information in the image. Common feature extraction methods include LBP (Local Binary Patterns) and HOG (Histogram of Oriented Gradients): 1) LBP: extract image texture information by calculating the relationship between a pixel and its neighboring pixels. You can use the LBP algorithm library or implement the LBP algorithm yourself to traverse each pixel of the image and calculate its local binary pattern features. 2) HOG: Calculate the gradient directional histogram of the local area of the image to describe the edge and texture features of the image. You can use the HOG function provided by OpenCV and other libraries for feature extraction, and set appropriate parameters (such as pixel block size, cell size, and the number of gradient directions of the histogram).
[0065] In another embodiment, the image to be identified can also be preprocessed before feature extraction to improve the accuracy and robustness of subsequent algorithms. Specifically, 1. Image resizing: Use an image processing library (such as OpenCV) to perform image scaling operations, and the image can be uniformly adjusted to a fixed size, such as 224x224 or 299x299. 2. Grayscale: Convert a color image to a grayscale image, and use a grayscale conversion function (such as OpenCV's cvtColor function) to convert a three-channel image to a single-channel grayscale image. 3. Contrast enhancement: Apply a histogram equalization algorithm to increase the contrast of the image and make the details more prominent. The equalizeHist function in OpenCV can be used to implement the histogram equalization operation. 4. Noise removal: Use a filter (such as a median filter, a Gaussian filter) to denoise the image to reduce the impact of noise on subsequent processing. The medianBlur and GaussianBlur functions in OpenCV can be used for filtering operations.
[0066] S203, calculating the feature similarity of each of the images to be identified based on the image features of each of the images to be identified;
[0067] In one embodiment, the extracted image features are converted into a form that can be used to calculate similarity. For example, if the image features are vectors, these vectors can be used directly; if the image features are local descriptors of the image (such as SIMATIC Scale Invariant Feature Transform or SURF), these descriptors need to be matched into a common feature space, such as by feature matching or feature aggregation.
[0068] In one embodiment, a suitable similarity measurement method is selected. Common similarity measurements include Euclidean distance, cosine similarity, Manhattan distance, etc. For image recognition tasks, Euclidean distance or cosine similarity is usually used to measure the similarity between feature vectors.
[0069] In one embodiment, for a group of images to be identified, the pairwise similarities between them are calculated to form a distance matrix. The distance matrix is an n×n matrix, where n is the number of images, and each element in the matrix represents the similarity of the corresponding image pair. Among them, an image pair includes two images to be identified.
[0070] S204, classifying the image to be identified based on the feature similarity to obtain an image data classification result;
[0071] In one embodiment, when the similarity between two images to be identified exceeds a preset similarity threshold, the two images to be identified are considered similar. The similarity threshold can be set by the user according to actual needs.
[0072] In one embodiment, two or more to-be-recognized images with similarity are determined as one category. After all to-be-recognized images in the to-be-recognized image data are divided, the image data classification result is obtained.
[0073] In one embodiment, the image data classification result includes the category of the image to be identified and the category characteristics of each category of the image.
[0074] S205: Based on the image data classification result, decompose the image recognition task into at least one image recognition subtask.
[0075] In one embodiment, the image recognition task is decomposed into the same number of image recognition subtasks according to the category and number of categories of the image data to be recognized, so that the image recognition subtasks are distributed to different computing nodes for parallel processing, thereby improving the processing efficiency of the image recognition processing task.
[0076] For example, assuming that the image recognition task is target detection, the image data classification result obtained according to the feature similarity is: the image to be recognized whose target is still objects is classified as still objects, the image to be recognized whose target is people is classified as people, and the image to be recognized whose target is animals is classified as animals. The image recognition task is decomposed into still objects image recognition subtasks, people image recognition subtasks, and animal image recognition subtasks.
[0077] In another embodiment, the recognition task corresponding to each image to be recognized can also be used as an image recognition subtask. After feature extraction of the image to be recognized, the corresponding image recognition subtask is distributed to the matching computing node for processing according to the feature parameters of the image to be recognized, so as to improve the processing efficiency of the image recognition subtask, and then improve the processing efficiency of the image recognition task.
[0078] In the above embodiment, the image recognition task is decomposed into a plurality of image recognition subtasks according to the image data to be recognized, so that the plurality of image recognition subtasks are processed in parallel, thereby improving the processing efficiency of the image recognition task.
[0079] See also Figure 3 , Figure 3 This is a schematic flow chart of an image recognition task processing method provided by an embodiment of the present application. The image recognition task processing method can be applied to a server to divide a sample image data set, and then train a pre-trained model according to different sample image subsets, so that the image recognition model of each computing node can accurately process the corresponding image to be recognized.
[0080] like Figure 3 As shown, the image recognition task processing method specifically includes steps S301 to S303.
[0081] S301, obtaining a sample image data set, wherein the sample image data set includes at least one sample image;
[0082] S302, dividing the sample image data set based on image features corresponding to each of the sample images in the sample image data set to obtain at least one sample image subset;
[0083] S303: Distribute the sample image subset to the computing nodes, and train the pre-trained model based on the computing nodes and the sample image subset to obtain an image recognition model corresponding to each of the computing nodes.
[0084] In one embodiment, the data source of the sample image dataset may be a professional database, a public dataset, etc.
[0085] In one embodiment, the sample image dataset should cover various possible scenes and objects, so as to improve the generalization ability of the model. The sample image dataset includes multiple sample images, and each image should have one or more features related to the scene or object.
[0086] In one embodiment, feature extraction is performed on each sample image, for example, using methods such as color histogram, edge detection, corner detection, feature descriptors (such as SI FT, SURF), etc. to extract image features. Then, the sample image dataset is divided into multiple sample image subsets according to these features, and each sample image subset contains sample images with similar features.
[0087] In one embodiment, the sample image subsets are distributed to different computing nodes to process data in parallel. Each computing node will train the pre-trained model according to the sample image subset assigned to it. The pre-trained model can be a trained model or a randomly initialized model. The training process should use the images in the sample image subset and the corresponding labels to optimize the model parameters in order to obtain more accurate image recognition results.
[0088] In a specific embodiment, it is crucial to select a suitable pre-trained model for training to obtain an image recognition model. You can try to use advanced deep learning models, such as convolutional neural networks, and perform model tuning, including adjusting the number of network layers, convolution kernel size, activation function, optimizer, etc. Among them, hyperparameter tuning is a key step. Hyperparameters and hyperparameter tuning methods can be:
[0089] 1) Learning rate: The learning rate controls the update speed of the model parameters and can be tuned by grid search, learning rate decay, adaptive learning rate algorithm, etc. Specifically, grid search tries a series of predefined learning rate values and selects the learning rate that performs best on the validation set. Learning rate decay gradually reduces the learning rate during training, for example, using methods such as exponential decay or cosine annealing. Adaptive learning rate algorithm uses adaptive algorithms such as Adam, Adagrad, RMSprop, etc., which automatically adjust the learning rate.
[0090] 2) Batch size: The batch size determines the number of samples used each time the model parameters are updated. The batch size can be tuned by: training in small batches, trying different batch sizes, and evaluating their impact on the model training effect and convergence speed. Batch normalization: Using a batch normalization layer can make the model more robust to the choice of batch size.
[0091] 3) Regularization parameters: Regularization parameters are used to control the complexity of the model and prevent overfitting. They can be tuned in the following ways: Grid search: Try different values of regularization parameters to find the parameters with the best performance on the validation set. Early stopping method: Monitor the performance on the validation set during training and stop training when the performance no longer improves to avoid overfitting.
[0092] 4) Network layers and width: The depth and width of the network have a great impact on the performance of the model, and can be tuned by the following methods: Network structure search, using automated search algorithms to explore different network structures, such as genetic algorithms, reinforcement learning, etc. Gradually increase the number of layers or width: Start with a shallow, narrow network, gradually increase the number of layers or width, and evaluate the performance improvement.
[0093] 5) Activation function selection: Different activation functions have an impact on the expressiveness and convergence speed of the model, which can be tuned by the following methods: Try different activation functions, such as ReLU, Leaky ReLU, ELU, PReLU, etc., and evaluate the difference in performance. Use adaptive activation functions, such as Swi sh, Mi sh, etc. These activation functions can automatically adjust their shape according to the characteristics of the data.
[0094] 6) Optimizer selection: The optimizer controls how the parameters are updated. Different optimizers have an impact on the training speed and performance of the model. You can tune it in the following ways: try different optimizers, such as stochastic gradient descent, Adam, Adagrad, RMSprop, etc., and evaluate the difference in performance. Adaptive learning rate algorithm: Many optimizers have an adaptive learning rate feature that can automatically adjust the learning rate based on gradient changes.
[0095] In the above embodiment, the sample image data set is divided according to the image features of the sample images to obtain multiple sample image subsets, each sample image subset contains sample images with similar features, and then the pre-trained model is trained according to different sample image subsets, so that the image recognition model of each computing node can accurately process the corresponding image to be recognized.
[0096] See also Figure 4 , Figure 4 The embodiment of the present application provides a schematic block diagram of an image recognition task processing device, which is used to execute the aforementioned image recognition task processing method. The image recognition task processing device can be configured on a server.
[0097] like Figure 4 As shown, the image recognition task processing device 400 includes:
[0098] The data acquisition module 401 is used to acquire the image data to be recognized when receiving an image recognition task;
[0099] A task decomposition module 402 is used to decompose the image recognition task based on the image data to be recognized to obtain at least one image recognition subtask when the amount of the image data to be recognized is greater than a preset threshold;
[0100] The subtask processing module 403 is used to process each of the image recognition subtasks based on the computing nodes corresponding to each of the image recognition subtasks to obtain the recognition results of each of the image recognition subtasks;
[0101] The result obtaining module 404 is used to combine the recognition results of each of the image recognition subtasks to obtain the image recognition result of the image recognition task.
[0102] Furthermore, the identification task decomposition module 402 includes:
[0103] A task target acquisition unit, used to acquire the task target of the image recognition task;
[0104] An image feature obtaining unit, configured to extract features of each image to be identified in the image data to be identified based on the task objective, and obtain image features of each image to be identified;
[0105] A similarity calculation unit, used for calculating the feature similarity of each of the images to be identified based on the image features of each of the images to be identified;
[0106] A classification result obtaining unit, used for classifying the image to be identified based on the feature similarity to obtain an image data classification result;
[0107] A task decomposition unit is used to decompose the image recognition task into at least one image recognition subtask based on the image data classification result.
[0108] Furthermore, the image feature obtaining unit includes:
[0109] A model determination subunit, used to determine a feature extraction model based on the task objective;
[0110] The feature extraction subunit is used to extract features of each of the images to be identified based on the feature extraction model to obtain image features of each of the images to be identified.
[0111] Furthermore, the subtask processing module 403 includes:
[0112] The image recognition unit is used to perform image recognition on the image data to be recognized in the image recognition subtask based on the image recognition model preset in the computing node, so as to obtain the recognition result of the image recognition subtask.
[0113] Furthermore, the image recognition task processing device 400 further includes a model training module, and the model training module includes:
[0114] A sample image acquisition unit, used to acquire a sample image data set, wherein the sample image data set includes at least one sample image;
[0115] a sample subset obtaining unit, configured to divide the sample image data set based on image features corresponding to each of the sample images in the sample image data set to obtain at least one sample image subset;
[0116] The model training unit is used to distribute the sample image subset to the computing nodes, and train the pre-trained model based on the computing nodes and the sample image subset to obtain the image recognition model corresponding to each computing node.
[0117] Furthermore, the image recognition task processing device 400 further includes a task distribution module, and the task distribution module includes:
[0118] A matching degree calculation unit, used to match the computing nodes with the image recognition subtasks based on the performance parameters of the computing nodes and the characteristic parameters of the images to be recognized in the image recognition subtasks, and obtain the matching degree between the computing nodes and the image recognition subtasks;
[0119] A matching result obtaining unit, used for obtaining the matching result between each computing node and each image recognition subtask based on a preset matching degree threshold and the matching degree;
[0120] A task distribution unit is used to distribute each of the image recognition subtasks to a corresponding computing node based on the matching result.
[0121] Furthermore, the image recognition task processing device 400 further includes a transfer learning module, and the transfer learning module includes:
[0122] A computing node determining unit, configured to, when the matching degree between the image recognition subtask and each of the computing nodes is less than a preset matching degree threshold, obtain the computing node with the highest matching degree as the target computing node of the image recognition subtask;
[0123] A data acquisition unit, used to acquire transfer learning data based on the image data to be recognized corresponding to the image recognition subtask;
[0124] A recognition result obtaining unit is used to train the initial image recognition model of the target computing node based on the transfer learning data to obtain a target image recognition model, and to process the image recognition subtask based on the target image recognition model to obtain a recognition result of the image recognition subtask.
[0125] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device and each module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0126] The above-mentioned device can be implemented in the form of a computer program. Figure 5 Runs on the computer device shown.
[0127] See also Figure 5 , Figure 5 1 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device may be a server.
[0128] See also Figure 5 The computer device includes a processor, a memory and a network interface connected through a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.
[0129] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any image recognition task processing method.
[0130] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
[0131] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any image recognition task processing method.
[0132] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0133] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0134] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0135] When receiving an image recognition task, obtaining image data to be recognized;
[0136] When the amount of the image data to be recognized is greater than a preset threshold, the image recognition task is decomposed based on the image data to be recognized to obtain at least one image recognition subtask;
[0137] Processing each of the image recognition subtasks based on the computing nodes corresponding to each of the image recognition subtasks to obtain recognition results of each of the image recognition subtasks;
[0138] The recognition results of each of the image recognition subtasks are combined to obtain an image recognition result of the image recognition task.
[0139] In one embodiment, when the processor decomposes the image recognition task based on the image data to be recognized to obtain at least one image recognition subtask, it is configured to implement:
[0140] Obtaining a task objective of the image recognition task;
[0141] Based on the task objective, extracting features of each image to be identified in the image data to be identified, and obtaining image features of each image to be identified;
[0142] Calculating the feature similarity of each of the images to be identified based on the image features of each of the images to be identified;
[0143] Based on the feature similarity, classify the image to be identified to obtain an image data classification result;
[0144] Based on the image data classification result, the image recognition task is decomposed into at least one image recognition subtask.
[0145] In one embodiment, when the processor extracts features of each image to be identified in the image data to be identified based on the task objective and obtains image features of each image to be identified, it is used to implement:
[0146] Based on the task objective, determining a feature extraction model;
[0147] Based on the feature extraction model, feature extraction is performed on each of the images to be identified to obtain image features of each of the images to be identified.
[0148] In one embodiment, when the processor processes each of the image recognition subtasks based on the computing nodes corresponding to each of the image recognition subtasks to obtain the recognition results of each of the image recognition subtasks, it is used to implement:
[0149] Based on the image recognition model preset in the computing node, image recognition is performed on the image data to be recognized in the image recognition subtask to obtain a recognition result of the image recognition subtask.
[0150] In one embodiment, before the processor processes each of the image recognition subtasks based on the computing nodes corresponding to each of the image recognition subtasks to obtain the recognition results of each of the image recognition subtasks, it is further configured to implement:
[0151] Acquire a sample image data set, wherein the sample image data set includes at least one sample image;
[0152] Based on image features corresponding to each of the sample images in the sample image data set, the sample image data set is divided to obtain at least one sample image subset;
[0153] The sample image subsets are distributed to the computing nodes, and a pre-trained model is trained based on the computing nodes and the sample image subsets to obtain an image recognition model corresponding to each of the computing nodes.
[0154] In one embodiment, before the processor processes each of the image recognition subtasks based on the computing nodes corresponding to each of the image recognition subtasks to obtain the recognition results of each of the image recognition subtasks, it is further configured to implement:
[0155] Based on the performance parameters of each computing node and the characteristic parameters of each image to be recognized in the image recognition subtask, the computing node and the image recognition subtask are matched to obtain the matching degree between each computing node and each image recognition subtask;
[0156] Based on a preset matching degree threshold and the matching degree, obtaining a matching result between each computing node and each image recognition subtask;
[0157] Based on the matching result, each of the image recognition subtasks is distributed to a corresponding computing node.
[0158] In one embodiment, when the amount of the image data to be recognized is greater than a preset threshold, the processor decomposes the image recognition task based on the image data to be recognized to obtain at least one image recognition subtask, and is further used to implement:
[0159] When the matching degree between the image recognition subtask and each of the computing nodes is less than a preset matching degree threshold, obtaining the computing node with the highest matching degree as the target computing node of the image recognition subtask;
[0160] Based on the to-be-recognized image data corresponding to the image recognition subtask, obtaining transfer learning data;
[0161] The initial image recognition model of the target computing node is trained based on the transfer learning data to obtain a target image recognition model, and the image recognition subtask is processed based on the target image recognition model to obtain a recognition result of the image recognition subtask.
[0162] A computer-readable storage medium is also provided in an embodiment of the present application, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and the processor executes the program instructions to implement any image recognition task processing method provided in the embodiment of the present application.
[0163] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (Smart Medi a Card, SMC), a secure digital (Secure Digital, SD) card, a flash memory card (Flash Card), etc., equipped on the computer device.
[0164] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for processing an image recognition task, characterized in that: include: When receiving an image recognition task, obtaining image data to be recognized; When the amount of the image data to be recognized is greater than a preset threshold, the image recognition task is decomposed based on the image data to be recognized to obtain at least one image recognition subtask; Processing each of the image recognition subtasks based on the computing nodes corresponding to each of the image recognition subtasks to obtain recognition results of each of the image recognition subtasks; The recognition results of each of the image recognition subtasks are combined to obtain an image recognition result of the image recognition task.
2. The image recognition task processing method according to claim 1, characterized in that: The step of decomposing the image recognition task based on the image data to be recognized to obtain at least one image recognition subtask includes: Obtaining a task objective of the image recognition task; Based on the task objective, extracting features of each image to be identified in the image data to be identified, and obtaining image features of each image to be identified; Calculating the feature similarity of each of the images to be identified based on the image features of each of the images to be identified; Based on the feature similarity, classify the image to be identified to obtain an image data classification result; Based on the image data classification result, the image recognition task is decomposed into at least one image recognition subtask.
3. The image recognition task processing method according to claim 2, characterized in that: The step of extracting features of each image to be identified in the image data to be identified based on the task objective to obtain image features of each image to be identified includes: Based on the task objective, determining a feature extraction model; Based on the feature extraction model, feature extraction is performed on each of the images to be identified to obtain image features of each of the images to be identified.
4. The image recognition task processing method according to claim 1, characterized in that: The processing of each image recognition subtask based on the computing nodes corresponding to each image recognition subtask to obtain the recognition results of each image recognition subtask includes: Based on the image recognition model preset in the computing node, image recognition is performed on the image data to be recognized in the image recognition subtask to obtain a recognition result of the image recognition subtask.
5. The image recognition task processing method according to claim 4, characterized in that: Before the processing of each image recognition subtask based on the computing nodes corresponding to each image recognition subtask to obtain the recognition results of each image recognition subtask, the method further includes: Acquire a sample image data set, wherein the sample image data set includes at least one sample image; Based on image features corresponding to each of the sample images in the sample image data set, the sample image data set is divided to obtain at least one sample image subset; The sample image subsets are distributed to the computing nodes, and a pre-trained model is trained based on the computing nodes and the sample image subsets to obtain an image recognition model corresponding to each of the computing nodes.
6. The image recognition task processing method according to claim 1, characterized in that: Before the processing of each image recognition subtask based on the computing nodes corresponding to each image recognition subtask to obtain the recognition results of each image recognition subtask, the method further includes: Based on the performance parameters of each computing node and the characteristic parameters of each image to be recognized in the image recognition subtask, the computing node and the image recognition subtask are matched to obtain the matching degree between each computing node and each image recognition subtask; Based on a preset matching degree threshold and the matching degree, obtaining a matching result between each computing node and each image recognition subtask; Based on the matching result, each of the image recognition subtasks is distributed to a corresponding computing node.
7. The image recognition task processing method according to any one of claims 1 to 6, characterized in that: When the amount of the image data to be recognized is greater than a preset threshold, after decomposing the image recognition task based on the image data to be recognized and obtaining at least one image recognition subtask, the method further includes: When the matching degree between the image recognition subtask and each of the computing nodes is less than a preset matching degree threshold, obtaining the computing node with the highest matching degree as the target computing node of the image recognition subtask; Based on the to-be-recognized image data corresponding to the image recognition subtask, obtaining transfer learning data; The initial image recognition model of the target computing node is trained based on the transfer learning data to obtain a target image recognition model, and the image recognition subtask is processed based on the target image recognition model to obtain a recognition result of the image recognition subtask.
8. An image recognition task processing device, characterized in that: include: A data acquisition module is used to acquire the image data to be recognized when receiving an image recognition task; A recognition task decomposition module, configured to decompose the image recognition task based on the image data to be recognized to obtain at least one image recognition subtask when the amount of the image data to be recognized is greater than a preset threshold; A subtask processing module, used to process each of the image recognition subtasks based on the computing nodes corresponding to each of the image recognition subtasks, to obtain a recognition result of each of the image recognition subtasks; The result obtaining module is used to merge the recognition results of each of the image recognition subtasks to obtain the image recognition result of the image recognition task.
9. A computer device, characterized in that: The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is used to execute the computer program and implement the image recognition task processing method according to any one of claims 1 to 7 when executing the computer program.
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 processor implements the image recognition task processing method according to any one of claims 1 to 7.
