Task deployment method and device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202510902999.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2045-06-30
AI Technical Summary
[0003]本发明实施例提供一种任务部署方法,旨在解决现有任务部署方法存在算法参数无法自适应进行改变,只能重新训练新的算法进行任务部署,使得任务部署的成本高,工作效率低的问题
[0035]第四方面,本发明实施例提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现发明实施例提供的任务部署方法中的步骤。
Smart Images

Figure CN120973968B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence, and more particularly to a task deployment method, apparatus, electronic device, and storage medium. Background Technology
[0002] Current task deployment methods rely on images captured by cameras for monitoring and recognition. Different tasks require different algorithms for computation. Once the cameras are installed, the algorithm parameters are fixed and cannot be adaptively changed over time or according to evolving needs. This necessitates retraining new algorithms for deployment, resulting in high deployment costs and low efficiency. Therefore, a low-cost, high-efficiency task deployment method is urgently needed to address the problems of existing methods where algorithm parameters cannot be adaptively changed, requiring retraining and leading to high costs and low efficiency. Summary of the Invention
[0003] This invention provides a task deployment method to address the problem of high cost and low efficiency in existing task deployment methods, where algorithm parameters cannot be adaptively changed, necessitating the retraining of new algorithms. The invention involves annotating images in the search results on the target device using an algorithm model or its first model parameters to obtain a labeled dataset. Based on this dataset, the first model parameters of the algorithm model are trained and adjusted to obtain second model parameters. These second model parameters are then deployed to the target device, enabling it to perform the image search task. This solves the problem of high cost and low efficiency in existing task deployment methods where algorithm parameters cannot be adaptively changed, requiring retraining of new algorithms.
[0004] In a first aspect, embodiments of the present invention provide a task deployment method, the method comprising the following steps:
[0005] After the target device performs an image search task through an algorithm model or the first model parameter of the algorithm model, the images in the image search results are labeled to obtain a labeled dataset, which includes the images and the corresponding labels of the images;
[0006] Based on the labeled dataset, the first model parameters of the algorithm model are trained and adjusted to obtain the second model parameters of the algorithm model;
[0007] The second model parameters of the algorithm model are deployed to the target device so that the target device can perform the image search task using the second model parameters.
[0008] Optionally, the step of labeling the images in the image search results to obtain a labeled dataset includes:
[0009] The images in the image search results are sent to the annotation terminal for annotation.
[0010] The system receives image annotation data returned by the annotation terminal and constructs an annotation dataset, wherein the image annotation data includes images that are either positive or negative samples.
[0011] Optionally, the step of labeling the images in the image search results to obtain a labeled dataset includes:
[0012] Determine the true type of each image in the image search results, and determine the task target type of the image search task;
[0013] Based on the correlation between the actual type and the task target type, the image is labeled as a positive sample or a negative sample;
[0014] Once all images in the image search results are labeled, a labeled dataset is obtained.
[0015] Optionally, labeling the image as a positive or negative sample based on the correlation between the real type and the task target type includes:
[0016] Extract the first semantic features of the real type and the second semantic features of the task target type;
[0017] Based on the semantic similarity between the first semantic feature and the second semantic feature, the relevance between the real type and the task target type is determined;
[0018] If the relevance is less than a preset relevance threshold, the image is labeled as a negative sample.
[0019] If the relevance is greater than or equal to a preset relevance threshold, the image is labeled as a positive sample.
[0020] Optionally, the step of training and adjusting the first model parameters of the algorithm model based on the labeled dataset to obtain the second model parameters of the algorithm model includes:
[0021] The images in the labeled dataset are input into the algorithm model to obtain the output labels;
[0022] The error loss is obtained by calculating the output label and the annotation label using a preset loss function;
[0023] With minimizing the error loss as the optimization objective, the first model parameters are adjusted using the backpropagation algorithm. The adjustment process of the first model parameters is iterated until a preset stopping condition is reached, and then the second model parameters of the algorithm model are obtained.
[0024] Optionally, the step of calculating the error loss by using a preset loss function on the output label and the annotation label includes:
[0025] The first error loss between the output label and the labeled label is calculated using the cross-entropy loss function;
[0026] Based on the relevance of the image, the first error loss is weighted and adjusted to obtain the second error loss.
[0027] Optionally, deploying the second model parameters of the algorithm model to the target device includes:
[0028] Based on the deployment environment of the target device, the parameters of the second model are made lightweight.
[0029] The lightweighted second model parameters are deployed to the target device.
[0030] In a second aspect, embodiments of the present invention provide a task deployment apparatus, the task deployment apparatus comprising:
[0031] The annotation module is used to annotate the images in the image search results after the target device performs an image search task through an algorithm model or the first model parameters of the algorithm model, so as to obtain an annotation dataset, the annotation dataset including the images and the annotation labels corresponding to the images;
[0032] The training and adjustment module is used to train and adjust the first model parameters of the algorithm model based on the labeled dataset to obtain the second model parameters of the algorithm model.
[0033] An image search module is used to deploy the second model parameters of the algorithm model to the target device, so that the target device can perform the image search task through the second model parameters.
[0034] Thirdly, embodiments of the present invention provide an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps in the task deployment method provided in embodiments of the present invention.
[0035] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in the task deployment method provided in the embodiments of the invention.
[0036] In this embodiment of the invention, after the target device performs an image search task using an algorithm model or its first model parameters, the images in the image search results are labeled to obtain a labeled dataset, which includes images and their corresponding labels. Based on the labeled dataset, the first model parameters of the algorithm model are trained and adjusted to obtain second model parameters. The second model parameters are then deployed to the target device so that the target device can perform the image search task using the second model parameters. This invention solves the problem of existing task deployment methods where algorithm parameters cannot be adaptively changed, requiring the retraining of new algorithms for task deployment, resulting in high deployment costs and low efficiency. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0038] Figure 1 This is a flowchart of a task deployment method provided in an embodiment of the present invention;
[0039] Figure 2 This is a schematic diagram of the structure of a task deployment device provided in an embodiment of the present invention;
[0040] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0041] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0042] like Figure 1 As shown, Figure 1 This is a flowchart of a task deployment method provided in an embodiment of the present invention, which includes the following steps:
[0043] 101. After the target device performs an image search task using the algorithm model or the first model parameter of the algorithm model, the images in the image search results are labeled to obtain a labeled dataset.
[0044] In this embodiment of the invention, the task deployment method described above can be applied to a task deployment platform, which can be built on or distributed servers. The task deployment platform includes a data interface (for sensors or users to upload data), a knowledge database, and a knowledge database construction program. The data interface can be used to annotate images in the image search results after the target device performs an image search task using an algorithm model or the first model parameters of the algorithm model. The knowledge database construction program can be used to construct the knowledge database, which is specifically used to provide additional related information for the identified data entities, thereby improving the depth of the data recognition system's understanding of the content.
[0045] The target device mentioned above can be a device capable of performing task deployment, such as a smartphone, computer, or other smart device.
[0046] The algorithm model described above can be understood as a description of a problem or task, usually represented by mathematical symbols, graphics, or code. The algorithm model describes the input, processing, and output of a problem, enabling the computer to execute the task according to certain rules and steps.
[0047] The first model parameter mentioned above can be understood as the original model parameter of the algorithm model.
[0048] The image search task described above can be understood as a task of retrieving or querying an image database using an algorithm model or the first model parameter of the algorithm model.
[0049] The above image search results can be understood as the list of images related to the query returned after the target device performs an image search task through an algorithm model or the first model parameter of the algorithm model.
[0050] The above annotations can be understood as adding labels or annotations to images to describe their content.
[0051] The above-mentioned labeled dataset includes images and their corresponding labels.
[0052] It should be noted that tags or annotations can be added to each image in the image search results; these tags can describe the content of the image.
[0053] 102. Based on the labeled dataset, the first model parameters of the algorithm model are trained and adjusted to obtain the second model parameters of the algorithm model.
[0054] In this embodiment of the invention, the above-mentioned labeled dataset includes images and corresponding labels for the images.
[0055] The training adjustments described above can be understood as the process of updating model parameters by optimizing the algorithm to reduce prediction errors. These adjustments include selecting a loss function, initializing parameters, and setting the learning rate.
[0056] The second model parameter mentioned above is the model parameter of the algorithm model obtained by training and adjusting the first model parameter of the algorithm model based on the labeled dataset.
[0057] It should be noted that the algorithm model is trained using labeled datasets, and the model's performance is optimized by adjusting the model's parameters.
[0058] 103. Deploy the second model parameters of the algorithm model to the target device so that the target device can perform image search tasks through the second model parameters.
[0059] In this embodiment of the invention, the above deployment can be understood as installation or arrangement.
[0060] Specifically, the second model parameters of the algorithm model can be deployed to the target device, which can then use these parameters to perform image search tasks, such as searching for images similar to the query image in an image database.
[0061] It should be noted that the second model parameters of the algorithm model are deployed to the target device. After deployment, the target device can use the second model parameters to perform image search tasks. In other words, when the target device receives an image search task, it can perform image recognition and search based on the second model parameters of the algorithm model to find images relevant to the search query.
[0062] In this embodiment of the invention, after the target device performs an image search task using an algorithm model or its first model parameters, the images in the image search results are labeled to obtain a labeled dataset, which includes images and their corresponding labels. Based on the labeled dataset, the first model parameters of the algorithm model are trained and adjusted to obtain second model parameters. The second model parameters are then deployed to the target device so that the target device can perform the image search task using the second model parameters. This invention solves the problem of existing task deployment methods where algorithm parameters cannot be adaptively changed, requiring the retraining of new algorithms for task deployment, resulting in high deployment costs and low efficiency.
[0063] It is understood that in the specific implementation of this application, data such as image data, knowledge data, and user data are involved. When the embodiments in this application are applied to specific products or technologies, user permission or consent is required. Furthermore, the collection, use, and processing of related data, as well as the training, deployment, and invocation of algorithm models, must comply with the relevant laws, regulations, and standards of the relevant countries and regions.
[0064] Optionally, in the step of annotating the images in the image search results to obtain the annotation dataset, the images in the image search results can be sent to the annotation terminal for annotation; the image annotation data returned by the annotation terminal can be received to construct the annotation dataset.
[0065] In this embodiment of the invention, the above-mentioned image annotation data includes whether the image is a positive sample or a negative sample.
[0066] The aforementioned image search results can be a list of images related to the query returned after the target device performs an image search task using an algorithm model or the first model parameter of the algorithm model.
[0067] The aforementioned annotation terminal can be understood as a device or platform for manually annotating data. For example, it could be an online interface that allows users to annotate images in search results. Specifically, users can draw boxes or mark specific objects on the images.
[0068] The above annotations can be understood as adding labels or annotations to images to describe their content.
[0069] The image annotation data mentioned above can be used to add structured tags or annotations to the images.
[0070] The above-mentioned labeled dataset includes images and their corresponding labels.
[0071] Optionally, in the step of labeling the images in the image search results to obtain the labeled dataset, the true type of each image in the image search results and the task target type of the image search task can be determined; based on the correlation between the true type and the task target type, the images can be labeled as positive or negative samples; and after labeling all images in the image search results, the labeled dataset is obtained.
[0072] In this embodiment of the invention, the aforementioned real type can be the category to which the image belongs in actual application.
[0073] The above-mentioned task target types can be understood as the targets that the current image search task needs to identify or classify.
[0074] The correlation between the real type and the task target type mentioned above can be understood as the degree of similarity between the real type of the image and the task target type.
[0075] The positive samples mentioned above can be understood as images that are highly relevant to the type of task objective.
[0076] The negative samples mentioned above can be understood as images that are unrelated to or have a low degree of relevance to the task objective.
[0077] The above-mentioned labeled dataset includes images and their corresponding labels.
[0078] In one possible implementation, for example, if the true type of image A is highly correlated with the task target type, then image A is determined to be labeled as a positive sample; if the true type of image A is unrelated to the task target type or has a low correlation, then image A is determined to be labeled as a negative sample.
[0079] Optionally, in the step of labeling an image as a positive or negative sample based on the relevance between the real type and the task target type, the first semantic feature of the real type and the second semantic feature of the task target type can be extracted; the relevance between the real type and the task target type can be determined based on the semantic similarity between the first and second semantic features; if the relevance is less than a preset relevance threshold, the image is labeled as a negative sample; if the relevance is greater than or equal to the preset relevance threshold, the image is labeled as a positive sample.
[0080] In this embodiment of the invention, the first semantic feature is a semantic feature extracted based on the real type.
[0081] The second semantic feature mentioned above is a semantic feature extracted based on the task target type.
[0082] The semantic similarity mentioned above can be understood as measuring the similarity between the first semantic feature and the second semantic feature. It should be noted that the first semantic feature and the second semantic feature use the same vector space.
[0083] The aforementioned preset relevance threshold is a relevance threshold pre-set by the system.
[0084] It should be noted that, based on the first semantic feature of the real type and the second semantic feature of the task target type, the similarity between the first semantic feature and the second semantic feature can be calculated by cosine similarity to determine the relevance between the real type and the task target type. When the relevance is less than the preset relevance threshold, the image is labeled as a negative sample, and when the relevance is greater than or equal to the preset relevance threshold, the image is labeled as a positive sample.
[0085] Optionally, in the step of training and adjusting the first model parameters of the algorithm model based on the labeled dataset to obtain the second model parameters of the algorithm model, the images in the labeled dataset can be input into the algorithm model to obtain the output labels; the output labels and labeled labels are calculated using a preset loss function to obtain the error loss; with minimizing the error loss as the optimization objective, the first model parameters are adjusted using the backpropagation algorithm, and the adjustment process of the first model parameters is iterated until a preset stopping condition is reached to obtain the second model parameters of the algorithm model.
[0086] In this embodiment of the invention, the above-mentioned labeled dataset includes images and corresponding labels for the images.
[0087] The output labels mentioned above can be understood as the model's classification results for the input images.
[0088] The aforementioned preset loss function is a loss function pre-set by the system, such as the cross-entropy loss function or the mean squared error loss function.
[0089] The aforementioned error loss can be understood as a function that measures the difference between the model's prediction and the true value, and is used to evaluate model performance.
[0090] Minimizing the error loss mentioned above can be understood as minimizing the difference between the predicted result and the labeled result.
[0091] The backpropagation algorithm described above is a method for training neural networks. The backpropagation algorithm minimizes the loss function by calculating the gradient of the loss function with respect to the parameters and updating the parameters.
[0092] The above adjustments can be understood as optimizing model performance by adjusting model parameters during model training.
[0093] The above iteration can be understood as repeating the adjustment process of the first model parameters.
[0094] The aforementioned preset stopping conditions can be understood as the training process stopping when a set standard is met. These preset stopping conditions include the number of iterations and the stability of the validation loss.
[0095] The second model parameters mentioned above are obtained by adjusting the first model parameters.
[0096] Specifically, images from the labeled dataset can be input into the algorithm model to obtain output labels. The error loss between the output labels and the labeled labels is calculated using a preset loss function. With minimizing the error loss as the optimization objective, the backpropagation algorithm is used to adjust the model parameters. The adjustment process of the first model parameters is iterated until a preset stopping condition is reached, and then the second model parameters of the algorithm model are obtained.
[0097] Optionally, in the step of calculating the error loss by using a preset loss function to calculate the output label and the annotation label, the first error loss between the output label and the annotation label can be calculated using the cross-entropy loss function; and the first error loss can be weighted and adjusted according to the relevance of the corresponding images to obtain the second error loss.
[0098] In this embodiment of the invention, the loss function is used to measure the difference between the model's predicted result and the true label. The aforementioned cross-entropy loss function is a loss function used for classification problems; it measures the model's performance by calculating the difference between the output label and the labeled label. Specifically, the cross-entropy loss function calculates the difference between the probability distribution of each category and the probability distribution of the true label. The greater the difference between the distributions, the greater the loss; the smaller the difference between the distributions, the smaller the loss.
[0099] The relevance of the above images can be understood as the similarity between the images.
[0100] The aforementioned first error loss can be the first error loss between the output label and the labeled label. Error loss is a function that measures the difference between the model's prediction and the true value.
[0101] The aforementioned weighted adjustment can be understood as a process of adjusting the weights of the first error loss based on the relevance of the corresponding images.
[0102] The second error loss mentioned above is an error loss obtained by weighting and adjusting the first error loss based on the relevance of the corresponding images.
[0103] It should be noted that by weighting the first error loss, the loss of images with different relevance can be better balanced, making the model more flexible and accurate when processing images with different importance.
[0104] Optionally, in the step of deploying the second model parameters of the algorithm model to the target device, the second model parameters can be lightweighted according to the deployment environment of the target device; and the lightweighted second model parameters can be deployed to the target device.
[0105] In this embodiment of the invention, the above-mentioned deployment environment can be understood as the physical and network environment where the target device is located, including hardware configuration, operating system, network connection and other environments, and may also include the target device's computing power, storage space, power supply and other resources.
[0106] The aforementioned lightweighting process can be understood as a process of reducing the complexity or number of model parameters.
[0107] The above deployment can be installation or arrangement.
[0108] Specifically, based on the deployment environment of the target device, the second model parameters are lightweighted to reduce the model size and computational complexity, and the lightweighted second model parameters are then deployed to the target device.
[0109] It should be noted that this invention can improve the availability of the model in resource-constrained environments and increase operational efficiency. This invention can adapt to different deployment environments and meet the needs of different scenarios.
[0110] In one possible implementation, for example, when the algorithm model is an image classification model, the model parameters of the image classification model have high performance on the server, but the target device has limited resources. In order to deploy the image classification model on the target device, it is necessary to perform lightweight processing on the model parameters. This can be done by pruning the model parameters, removing unimportant neurons and connections to reduce the model size, and quantizing the weights of the model parameters, using fewer bits to represent the weights to reduce the model's storage requirements. The lightweighted model parameters are then deployed to the target device. Through lightweight processing, the size and complexity of the model are reduced, making the model more suitable for running on resource-constrained target devices.
[0111] like Figure 2 As shown, an embodiment of the present invention provides a task deployment device, which includes:
[0112] The annotation module 201 is used to annotate the images in the image search results after the target device performs an image search task through an algorithm model or the first model parameters of the algorithm model, so as to obtain an annotation dataset, the annotation dataset including the images and the annotation labels corresponding to the images;
[0113] The training and adjustment module 202 is used to train and adjust the first model parameters of the algorithm model based on the labeled dataset to obtain the second model parameters of the algorithm model.
[0114] The deployment module 203 is used to deploy the second model parameters of the algorithm model to the target device, so that the target device can perform the image search task through the second model parameters.
[0115] Optionally, the annotation module 201 is further configured to send the images in the image search results to the annotation terminal for annotation; receive the image annotation data returned by the annotation terminal, and construct an annotation dataset, wherein the image annotation data includes images that are positive or negative samples.
[0116] Optionally, the annotation module 201 is further configured to determine the true type of each image in the image search results and the task target type of the image search task; to annotate the image as a positive sample or a negative sample according to the correlation between the true type and the task target type; and to complete the annotation of all images in the image search results to obtain an annotated dataset.
[0117] Optionally, the annotation module 201 is further configured to extract a first semantic feature of the real type and a second semantic feature of the task target type; determine the relevance between the real type and the task target type based on the semantic similarity between the first semantic feature and the second semantic feature; if the relevance is less than a preset relevance threshold, the image is labeled as a negative sample; if the relevance is greater than or equal to the preset relevance threshold, the image is labeled as a positive sample.
[0118] Optionally, the training adjustment module 202 is further configured to input the images in the labeled dataset into the algorithm model to obtain output labels; calculate the error loss by using a preset loss function to calculate the output labels and labeled labels; adjust the first model parameters by using a backpropagation algorithm with the goal of minimizing the error loss; iterate the adjustment process of the first model parameters until a preset stopping condition is reached to obtain the second model parameters of the algorithm model.
[0119] Optionally, the training adjustment module 202 is further configured to calculate a first error loss between the output label and the labeled label using a cross-entropy loss function; and to adjust the first error loss by weighting it according to the relevance of the image to obtain a second error loss.
[0120] Optionally, the deployment module 203 is further configured to perform lightweight processing on the second model parameters according to the deployment environment of the target device; and deploy the lightweight second model parameters to the target device.
[0121] like Figure 3 As shown, embodiments of the present invention also provide an electronic device, including a processor, which can execute any of the above-described task deployment methods.
[0122] Specifically, it includes a processor 301 and a memory 302, as well as a computer program stored in the memory 302 and capable of running on the processor 301 to execute a task deployment method, wherein:
[0123] Processor 301 executes the calculator program for the task deployment method stored in memory 302, and performs the following steps:
[0124] After the target device performs an image search task through an algorithm model or the first model parameter of the algorithm model, the images in the image search results are labeled to obtain a labeled dataset, which includes the images and the corresponding labels of the images;
[0125] Based on the labeled dataset, the first model parameters of the algorithm model are trained and adjusted to obtain the second model parameters of the algorithm model;
[0126] The second model parameters of the algorithm model are deployed to the target device so that the target device can perform the image search task using the second model parameters.
[0127] Optionally, the processor 301 performs the step of labeling the images in the image search results to obtain a labeled dataset, including:
[0128] The images in the image search results are sent to the annotation terminal for annotation.
[0129] The system receives image annotation data returned by the annotation terminal and constructs an annotation dataset, wherein the image annotation data includes images that are either positive or negative samples.
[0130] Optionally, the processor 301 performs the step of labeling the images in the image search results to obtain a labeled dataset, including:
[0131] Determine the true type of each image in the image search results, and determine the task target type of the image search task;
[0132] Based on the correlation between the actual type and the task target type, the image is labeled as a positive sample or a negative sample;
[0133] Once all images in the image search results are labeled, a labeled dataset is obtained.
[0134] Optionally, the step of processor 301 labeling the image as a positive or negative sample based on the correlation between the real type and the task target type includes:
[0135] Extract the first semantic features of the real type and the second semantic features of the task target type;
[0136] Based on the semantic similarity between the first semantic feature and the second semantic feature, the relevance between the real type and the task target type is determined;
[0137] If the relevance is less than a preset relevance threshold, the image is labeled as a negative sample.
[0138] If the relevance is greater than or equal to a preset relevance threshold, the image is labeled as a positive sample.
[0139] Optionally, the processor 301 performs training and adjustment of the first model parameters of the algorithm model based on the labeled dataset to obtain the second model parameters of the algorithm model, including:
[0140] The images in the labeled dataset are input into the algorithm model to obtain the output labels;
[0141] The error loss is obtained by calculating the output label and the annotation label using a preset loss function;
[0142] With minimizing the error loss as the optimization objective, the first model parameters are adjusted using the backpropagation algorithm. The adjustment process of the first model parameters is iterated until a preset stopping condition is reached, and then the second model parameters of the algorithm model are obtained.
[0143] Optionally, the processor 301 performs the calculation of the error loss by using a preset loss function on the output label and the annotation label, including:
[0144] The first error loss between the output label and the labeled label is calculated using the cross-entropy loss function;
[0145] Based on the relevance of the image, the first error loss is weighted and adjusted to obtain the second error loss.
[0146] Optionally, the process of deploying the second model parameters of the algorithm model to the target device, performed by processor 301, includes:
[0147] Based on the deployment environment of the target device, the parameters of the second model are made lightweight.
[0148] The lightweighted second model parameters are deployed to the target device.
[0149] This invention also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the task deployment method provided in this invention and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0150] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0151] The above description discloses only preferred embodiments of the present invention and should not be construed as limiting the scope of the present invention. Therefore, equivalent variations made in accordance with the claims of the present invention are still within the scope of the present invention.
Claims
1. A task deployment method, characterized in that, The method includes the following steps: After the target device executes an image search task using an algorithm model or the first model parameters of the algorithm model, the true type of each image in the image search results is determined, as well as the task target type of the image search task is determined; a first semantic feature of the true type and a second semantic feature of the task target type are extracted; based on the semantic similarity between the first semantic feature and the second semantic feature, the relevance between the true type and the task target type is determined; if the relevance is less than a preset relevance threshold, the image is labeled as a negative sample; if the relevance is greater than or equal to the preset relevance threshold, the image is labeled as a positive sample; all images in the image search results are labeled to obtain a labeled dataset, which includes the images and their corresponding labels; Based on the labeled dataset, the first model parameters of the algorithm model are trained and adjusted to obtain the second model parameters of the algorithm model; The second model parameters of the algorithm model are deployed to the target device so that the target device can perform the image search task using the second model parameters.
2. The task deployment method as described in claim 1, characterized in that, The images in the image search results are labeled to obtain a labeled dataset, including: The images in the image search results are sent to the annotation terminal for annotation. The system receives image annotation data returned by the annotation terminal and constructs an annotation dataset, wherein the image annotation data includes images that are either positive or negative samples.
3. The task deployment method as described in claim 1, characterized in that, The step of training and adjusting the first model parameters of the algorithm model based on the labeled dataset to obtain the second model parameters of the algorithm model includes: The images in the labeled dataset are input into the algorithm model to obtain the output labels; The error loss is obtained by calculating the output label and the annotation label using a preset loss function; With minimizing the error loss as the optimization objective, the first model parameters are adjusted using the backpropagation algorithm. The adjustment process of the first model parameters is iterated until a preset stopping condition is reached, and then the second model parameters of the algorithm model are obtained.
4. The task deployment method as described in claim 3, characterized in that, The step of calculating the error loss by using a preset loss function on the output label and the annotation label includes: The first error loss between the output label and the labeled label is calculated using the cross-entropy loss function; Based on the relevance of the image, the first error loss is weighted and adjusted to obtain the second error loss.
5. The task deployment method as described in any one of claims 1 to 4, characterized in that, The step of deploying the second model parameters of the algorithm model to the target device includes: Based on the deployment environment of the target device, the parameters of the second model are made lightweight. The lightweighted second model parameters are deployed to the target device.
6. A task deployment device, characterized in that, The task deployment device includes: The annotation module is used to determine the true type of each image in the image search results and the task target type of the image search task after the target device performs an image search task through an algorithm model or the first model parameters of the algorithm model; extract a first semantic feature of the true type and a second semantic feature of the task target type; determine the relevance between the true type and the task target type based on the semantic similarity between the first semantic feature and the second semantic feature; if the relevance is less than a preset relevance threshold, the image is labeled as a negative sample; if the relevance is greater than or equal to the preset relevance threshold, the image is labeled as a positive sample; and after annotating all images in the image search results, an annotation dataset is obtained, which includes the images and the corresponding annotation labels. The training and adjustment module is used to train and adjust the first model parameters of the algorithm model based on the labeled dataset to obtain the second model parameters of the algorithm model. An image search module is used to deploy the second model parameters of the algorithm model to the target device, so that the target device can perform the image search task through the second model parameters.
7. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of the task deployment method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the task deployment method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Pulsar search model training method, pulsar search model application method, pulsar search model training device and pulsar search model application equipment
CN115130570A
Image recognition method and device based on multi-data source target detection model
CN118298251A