Image processing method and device
By introducing a closed-loop feedback mechanism into the image annotation system, combined with manual annotation and model iteration, the value weight of the image is calculated and trained, which solves the problems of low efficiency, high cost and underutilized data in the existing technology, and achieves high efficiency image annotation process.
Patent Information
- Application Number
- CN202310153110.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-21
- Publication Date
- 2024-08-30
AI Technical Summary
The existing image annotation system lacks a closed-loop feedback mechanism, resulting in the inability to transfer manual annotation experience to the model, and relies on a large amount of data for model iteration, which is inefficient and costly, and the image data is not fully utilized.
By inputting the image to be annotated into the target annotation model, the predicted annotation results are determined, and compared with the manually adjusted comparison annotation results, the value weight of the predicted annotation results is calculated, and the images with poor annotation effects are determined to be images to be rechecked, using closed-loop feedback The mechanism trains the target labeling model and combines manual labeling and model iteration to form an iterative mechanism.
It reduces the cost of manual annotation, improves the annotation efficiency and quality, effectively mines high-value images and difficult example data, makes full use of the images to be annotated, and continuously improves the annotation quality and efficiency.
Smart Images

Figure CN118570805A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to an image processing method and device. Background Art
[0002] Artificial intelligence technology is booming in today's society, and all fields are pursuing intelligence. Data labeling is the prerequisite for intelligence. The development of intelligent technology cannot be separated from the support of a large amount of labeled data.
[0003] For visual perception tasks, the model requires a large number of annotated images for algorithm learning, so as to achieve and improve the model capabilities. Most of the current image annotation systems are manually annotated. As the demand for data volume increases, relying solely on manual annotation is inefficient and costly. The results and efficiency of manual annotation are highly related to the professionalism and proficiency of the annotators, and there is a certain degree of subjectivity, resulting in unstable annotation quality. Therefore, using pre-annotation models to improve annotation efficiency is the development trend of image data processing today, but the current pre-annotation model lacks a closed-loop feedback mechanism, resulting in the inability to pass the experience of manual annotation to the model. The optimization and iteration of the pre-annotation model still requires a large amount of data for improvement. The separation of manual annotation and model iteration leads to insufficient utilization of image data. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide an image processing method and device to combine manual annotation and model iteration to form a closed-loop feedback iteration mechanism, effectively mine high-value images and difficult data, use less data, continuously enhance the annotation capability of the target annotation model, and continuously improve the annotation quality and efficiency.
[0005] In a first aspect, an image processing method is provided, the method comprising:
[0006] Inputting the image to be annotated into the target annotation model to determine the predicted annotation result of the image to be annotated;
[0007] Determining a value weight of the predicted annotation result based on the predicted annotation result and the corresponding comparative annotation result;
[0008] In response to the value weight being greater than a first preset threshold, determining the image to be annotated corresponding to the value weight as an image to be re-examined;
[0009] In response to the number of the images to be annotated and / or the number of the images to be reviewed meeting a predetermined condition, the target annotation model is trained based on each of the images to be reviewed.
[0010] In some possible embodiments, inputting the image to be labeled into the target labeling model to determine the predicted labeling result of the image to be labeled includes:
[0011] Acquire a set of images to be annotated, wherein the set of images to be annotated includes a plurality of images to be annotated;
[0012] Determine the latest version of the target annotation model based on the update time of the target annotation model;
[0013] Each of the images to be annotated in the set of images to be annotated is input into the target annotation model respectively, and a predicted annotation result corresponding to each of the images to be annotated is determined.
[0014] In some possible embodiments, determining the value weight of the predicted annotation result based on the predicted annotation result and the corresponding comparative annotation result includes:
[0015] Obtaining a comparative annotation result corresponding to the image to be annotated, wherein the comparative annotation result is a predicted annotation result of the image to be annotated after manual adjustment;
[0016] A preset scoring algorithm is used based on the predicted annotation result and the corresponding comparative annotation result to determine a value weight of the predicted annotation result, wherein the value weight is used to characterize the difference between the predicted annotation result and the corresponding comparative annotation result.
[0017] In some possible embodiments, the determining the value weight of the predicted annotation result by using a preset scoring algorithm based on the predicted annotation result and the corresponding comparative annotation result includes:
[0018] Determining a matching weight and a matching coefficient of the image to be labeled based on the predicted labeling result and the comparative labeling result corresponding to the image to be labeled;
[0019] The product of the matching weight and the matching coefficient is calculated to determine the value weight.
[0020] In some possible embodiments, the prediction annotation result includes a plurality of prediction annotation boxes and corresponding labels, and the comparison annotation result includes a plurality of comparison annotation boxes and corresponding labels;
[0021] The determining the matching weight and matching coefficient of the image to be labeled based on the predicted labeling result and the comparative labeling result corresponding to the image to be labeled includes:
[0022] Determining a comparison annotation frame that matches the predicted annotation frame;
[0023] The matching weight and matching coefficient are determined based on the number of the predicted annotation boxes, the number of the compared annotation boxes, and the number of the compared annotation boxes matching the predicted annotation boxes.
[0024] In some possible embodiments, determining a comparison annotation box that matches the predicted annotation box includes:
[0025] For each of the compared annotation frames, in response to the existence of a predicted annotation frame with the same label and the same position, it is determined that the compared annotation frame matches the predicted annotation frame.
[0026] In some possible embodiments, determining a comparison annotation box that matches the predicted annotation box includes:
[0027] For each of the compared annotation frames, determining a predicted annotation frame having the same label as the compared annotation frame;
[0028] Calculating an intersection-over-union ratio of the comparison annotation frame and each of the predicted annotation frames having the same label as the comparison annotation frame;
[0029] In response to the intersection-over-union ratio being greater than a second preset threshold, it is determined that the compared annotation box matches the predicted annotation box.
[0030] In a second aspect, an image processing device is provided, the device comprising:
[0031] A first determination module is used to input the image to be labeled into the target labeling model to determine the predicted labeling result of the image to be labeled;
[0032] A second determination module, configured to determine a value weight of the predicted annotation result based on the predicted annotation result and the corresponding comparative annotation result;
[0033] A third determination module, configured to determine the image to be annotated corresponding to the value weight as an image to be re-examined in response to the value weight being greater than a first preset threshold;
[0034] A training module is used for training the target annotation model based on each of the images to be rechecked in response to the number of the images to be annotated and / or the number of the images to be rechecked satisfying a predetermined condition.
[0035] According to a third aspect, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method according to the first aspect is implemented.
[0036] According to a fourth aspect, an electronic device is provided, comprising a memory and a processor, wherein the memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method as described in the first aspect.
[0037] The embodiment of the present invention can reduce the manual annotation cost and improve the annotation efficiency and annotation quality by annotating the images to be annotated through the target annotation model. Then, the predicted annotation result obtained by the target annotation model is compared with the manually adjusted comparison annotation result, and the value weight of the predicted annotation result is calculated, and the value weight characterizes the annotation effect of the predicted annotation result of the image to be annotated. The images to be annotated with poor annotation effect are determined as images to be re-examined, which can effectively mine high-value images and difficult case data, use less data, and make full use of the images to be annotated. When the number of images to be annotated and / or the number of images to be re-examined meet the predetermined conditions, the target annotation model is trained using each image to be re-examined, thereby combining manual annotation and model iteration to form a closed-loop feedback iteration mechanism, continuously strengthening the annotation ability of the target annotation model, and continuously improving the annotation quality and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The above and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:
[0039] Figure 1 is a schematic diagram of an image processing system according to an embodiment of the present invention;
[0040] Figure 2 is a flowchart of an image processing method according to an embodiment of the present invention;
[0041] Figure 3 is a schematic diagram of a predicted annotation result of an image to be annotated according to an embodiment of the present invention;
[0042] Figure 4 is a flow chart of a method for determining a prediction and annotation result according to an embodiment of the present invention;
[0043] Figure 5 is a flow chart of a method for determining a value weight of a prediction and annotation result according to an embodiment of the present invention;
[0044] Figure 6 is a schematic diagram of an embodiment of the present invention in which the positions of the comparison mark box and the prediction mark box are the same or similar;
[0045] Figure 7 is a schematic diagram of the overlap ratio between the comparison annotation box and the prediction annotation box according to an embodiment of the present invention;
[0046] Figure 8 is a flowchart of an image processing method according to an embodiment of the present invention;
[0047] Fig. 9 is a schematic diagram of an image processing device according to an embodiment of the present invention;
[0048] Fig.10 is a schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0049] The present invention is described below based on embodiments, but the present invention is not limited to these embodiments. In the detailed description of the present invention below, some specific details are described in detail. It is possible for a person skilled in the art to fully understand the present invention without the description of these details. In order to avoid confusing the essence of the present invention, known methods, processes, flows, components and circuits are not described in detail.
[0050] In addition, persons of ordinary skill in the art will appreciate that the drawings provided herein are for illustration purposes and are not necessarily drawn to scale.
[0051] Unless the context clearly requires otherwise, words such as “include”, “including” and the like in the specification should be interpreted as including rather than being exclusive or exhaustive; that is, as meaning “including but not limited to”.
[0052] In the description of the present invention, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present invention, unless otherwise specified, "plurality" means two or more.
[0053] The solutions described in this specification and in the examples, if they involve the processing of personal information, will be processed on the premise of having a legal basis (such as obtaining the consent of the subject of personal information, or being necessary for the performance of a contract, or complying with the provisions of laws and administrative regulations, etc.), and will only be processed within the scope of the regulations or agreements. If a user refuses to process personal information other than the necessary information for basic functions, it will not affect the user's use of basic functions.
[0054] Figure 1 Schematic diagram of an image processing system according to an embodiment of the present invention. Figure 1 As shown, the image processing system of this embodiment includes a server 11 and a terminal 12. Among them, the terminal 12 can be a general terminal that can run a client application or applet with an image annotation function. For example, the terminal can be a terminal device such as a mobile phone, a computer, a tablet computer, or a car computer. In some embodiments, the terminal 12 can also be a dedicated terminal with an application program solidified in a dedicated integrated circuit. Among them, the open platform enables third-party developers to develop their own applets based on the open platform by providing an application programming interface (Application Programming Interface, API) to third-party developers. The applet can specifically be a program developed on the basis of an application within the platform and used to perform corresponding operations.
[0055] The server 11 completes the processing of the image data by obtaining the image to be annotated and the comparative annotation results of the terminal 12. In this process, the server 11 first obtains the image to be annotated, wherein the image to be annotated can be an existing image data set or real-time image data collected by an image acquisition terminal, and the present embodiment does not limit the source of the image data to be annotated. The server 11 inputs the acquired image to be annotated into the target annotation model to obtain the corresponding predicted annotation result. Then the image to be annotated and the corresponding predicted annotation result are sent to the terminal 12, and the terminal 12 displays the image to be annotated and the corresponding predicted annotation result on the current page, and obtains the manually adjusted predicted annotation result, i.e., the comparative annotation result, through the human-computer interaction interface. Then the comparative annotation result is sent to the server 11. The server 11 compares the predicted annotation result and the comparative annotation result based on a preset algorithm, determines the value weight of the predicted annotation result, determines the image to be annotated whose value weight is greater than the first preset threshold as the image to be re-examined, and in response to the number of the images to be annotated and / or the number of the images to be re-examined meeting the predetermined conditions, uses each of the images to be re-examined to train the target annotation model.
[0056] The system of the embodiment of the present invention can reduce the manual annotation cost and improve the annotation efficiency and annotation quality by annotating the images to be annotated through the target annotation model. Then, the predicted annotation result obtained by the target annotation model is compared with the manually adjusted comparison annotation result, and the value weight of the predicted annotation result is calculated, and the value weight represents the annotation effect of the predicted annotation result of the image to be annotated. The images to be annotated with poor annotation effect are determined as images to be re-examined, which can effectively mine high-value images and difficult case data, use less data, and make full use of the images to be annotated. When the number of images to be annotated and / or the number of images to be re-examined meet the predetermined conditions, the target annotation model is trained using each image to be re-examined, thereby combining manual annotation and model iteration to form a closed-loop feedback iteration mechanism, continuously strengthening the annotation ability of the target annotation model, and continuously improving the annotation quality and efficiency.
[0057] Figure 2 FIG. 1 is a flow chart of an image processing method according to an embodiment of the present invention. Figure 2 As shown, the image processing method of this embodiment includes the following steps:
[0058] In step S201, the image to be annotated is input into a target annotation model to determine a predicted annotation result of the image to be annotated.
[0059] Among them, the image to be labeled is used to train the target labeling model, and the image to be labeled may include multiple image objects to be labeled. The target labeling model is a deep learning model for image processing, such as Transformer-based Deformable DETR and YOLOv5-related deep learning models. The image to be labeled is determined based on the purpose of the target labeling model, for example: the target labeling model is used to identify defects, then the image to be labeled is an image containing defect objects; the target labeling model is used to identify lesions, then the image to be labeled is an image containing lesion objects; the target labeling model is used to identify vehicles, then the image to be labeled is an image containing vehicle objects. This embodiment does not limit the type of image to be labeled.
[0060] The target annotation model processes the image to be annotated to obtain the predicted annotation result of the image to be annotated.
[0061] In one possible implementation, the target annotation model is used to identify a specific object, such as a vehicle, a person, or a trademark, and the label is a default label. In the predicted annotation results, only the predicted annotation box can be distinguished, and the labels corresponding to the predicted annotation boxes are all default labels.
[0062] In a possible implementation, the target annotation model is used to identify different objects, such as facial features of a person, different types of cars, and different types of objects, etc. The predicted annotation result includes a predicted annotation box and a corresponding label. Figure 3 is a schematic diagram of the predicted annotation results of the image to be annotated according to an embodiment of the present invention. Figure 3 As shown, the figure takes a face image as an example, including a predicted annotation box 311 and a corresponding "eye" label 312, a predicted annotation box 321 and a corresponding "eye" label 312, a predicted annotation box 331 and a corresponding "nose" label 332, and a predicted annotation box 341 and a corresponding "mouth" label 342. Optionally, the label corresponding to the predicted annotation box can also be represented by the color of the predicted annotation box, that is, based on a preset comparison rule, different colors of the predicted annotation box represent different types of labels. For example, a red predicted annotation box represents eyes, a green predicted annotation box represents a nose, and so on.
[0063] Figure 4 FIG. 1 is a flow chart of a method for determining a prediction and annotation result according to an embodiment of the present invention. Figure 4 As shown, the method for determining the prediction and annotation results includes the following steps:
[0064] In step S401, a set of images to be annotated is obtained, where the set of images to be annotated includes a plurality of images to be annotated.
[0065] The image to be annotated can be a picture or video automatically obtained from the Internet, with a legal basis, and containing relevant image objects. For example, if the image object is a car, the picture or video containing the car is automatically obtained. If the video is obtained, the image containing the car can be automatically captured in the video. The image to be annotated can also be an image taken using an image acquisition terminal, under the premise of legality.
[0066] In step S402, based on the update time of the target annotation model, the latest version of the target annotation model is determined.
[0067] Among them, if the target annotation model meets the update conditions during the image annotation process, it can be trained and updated. Therefore, there may be different versions of the target annotation model. The latest version of the target annotation model can be determined based on the update timestamp or corresponding version number of the target annotation model. For example, the target annotation model with version number 1 annotates the Nth image to be annotated. After the annotation is completed, the update conditions are met, and the target annotation model is trained and updated. The updated version number is 2. At this time, the N+1th image to be annotated is input into the target annotation model, and it is necessary to determine whether the current target annotation model is the latest version.
[0068] In step S403, each of the images to be annotated in the set of images to be annotated is input into the target annotation model to determine a predicted annotation result corresponding to each of the images to be annotated.
[0069] Specifically, when starting to process the images to be annotated in the image set to be annotated, it is first necessary to determine whether the current model is the latest version of the target annotation model. If not, the target annotation model is updated. After the update is successful, the images to be annotated are input into the target annotation model to determine the predicted annotation results corresponding to each of the images to be annotated. The above method can ensure that the current target annotation model is the latest version of the target annotation model, so that the target annotation model is updated in a timely manner and the annotation capability of the target annotation model is improved.
[0070] In step S202, based on the predicted annotation result and the corresponding comparative annotation result, a value weight of the predicted annotation result is determined. Optionally, the value weight is used to characterize the difference between the predicted annotation result and the corresponding comparative annotation result.
[0071] In an optional implementation, firstly, a comparative annotation result corresponding to the image to be annotated is obtained, and the comparative annotation result is a predicted annotation result of the image to be annotated after manual adjustment. Furthermore, this embodiment uses a preset scoring algorithm based on the predicted annotation result and the corresponding comparative annotation result to determine the value weight of the predicted annotation result.
[0072] That is to say, after the target annotation model annotates the image to be annotated to obtain the predicted annotation result, the server displays the image to be annotated and the corresponding predicted annotation result on the terminal display, and obtains the manually adjusted and modified comparative annotation result through the human-computer interaction page. Among them, the manual adjustment and modification content may include: modifying the size of the predicted annotation box, adding or deleting the annotation box, modifying the label corresponding to the annotation box, etc. Further, all the annotation boxes and corresponding labels on the image to be annotated after manual adjustment and modification are used as comparative annotation results, and the annotation boxes in the comparative annotation results are all comparative annotation boxes. The above method only needs to make a small amount of adjustments and modifications based on the predicted annotation results. Compared with manual annotation, it reduces the amount of manually annotated data, reduces labor costs, and improves the efficiency of image processing.
[0073] In a possible implementation, the comparison annotation result is the result of manually annotating the image to be annotated. That is, without waiting for the target annotation model to process the image to be annotated, the server directly sends the image to be annotated and displays it on the terminal display, and obtains the comparison annotation result of the manual annotation through the human-computer interaction page. Directly annotating the image to be annotated can be unaffected by the predicted annotation result, ensuring the independence and accuracy of the manual annotation.
[0074] Figure 5 is a flow chart of a method for determining the value weight of a prediction and annotation result according to an embodiment of the present invention. Figure 5 As shown, the method for determining the value weight of the prediction and annotation results includes the following steps:
[0075] In step S501, a matching weight and a matching coefficient of the image to be labeled are determined based on the predicted labeling result and the comparative labeling result corresponding to the image to be labeled.
[0076] Specifically, first determine a comparison annotation frame that matches the predicted annotation frame. The condition for determining that a set of comparison annotation frames in the image to be annotated matches the predicted annotation frame is that the labels of the comparison annotation frame and the predicted annotation frame are the same, and the positions are the same or close. The same or close positions may refer to the same or close positions of the edges of the comparison annotation frame and the edges corresponding to the predicted annotation frame, that is, the shapes and sizes of the comparison annotation frames and the predicted annotation frames that are the same or close in position are also similar.
[0077] In the actual processing process, for each of the comparison annotation frames, it is possible to first search in the prediction annotation results whether there is a prediction annotation frame with the same label as the comparison annotation frame. If so, it is determined whether the prediction annotation frame with the same label as the comparison annotation frame is located at the same or similar position as the comparison annotation frame. Alternatively, the position of the comparison annotation frame is first determined, and then it is searched whether there is a prediction annotation frame within a predetermined range. If so, it is further determined whether the prediction annotation frame has the same label as the comparison annotation frame.
[0078] In a possible implementation, a method for determining whether the predicted annotation box is in the same or similar position as the comparison annotation box may be to determine the shape and relative position of each comparison annotation box and the predicted annotation box on the image to be annotated, and in response to the shape and relative position satisfying the preset shape condition and distance condition respectively, the predicted annotation box with the same label as the comparison annotation box is considered to be in the same or similar position as the comparison annotation box. For example, in response to the preset shape condition that the deviation of the shape size of the comparison annotation box and the predicted annotation box is less than the preset size deviation threshold, the predicted annotation box is searched within a preset range with the position coordinates of the comparison annotation box as the center. If a predicted annotation box exists, it is determined that the comparison annotation box matches the predicted annotation box.
[0079] Figure 6 is a schematic diagram of an embodiment of the present invention in which the comparison markup box and the prediction markup box are located at the same or similar positions. Figure 6 As shown, the position coordinates of the upper left corner 602 of the comparison annotation box 601 and the position coordinates of the upper left corner 604 of each prediction annotation box 603 with the same label as the comparison annotation box are determined, and then the distance between the upper left corner 602 and the upper left corner 604 is calculated, and it is determined whether the distance is less than a preset distance threshold, wherein the preset distance threshold can be 1 cm, 1.5 cm or 2 cm, etc. The size of the preset distance threshold can be set or changed according to the actual demand for the accuracy of the prediction annotation box position. The smaller the preset distance threshold, the higher the accuracy requirement for the prediction annotation box position. If the distance between the upper left corner 602 of the comparison annotation box 601 and the upper left corner 604 of the prediction annotation box 603 is not less than the preset distance threshold, it means that the comparison annotation box 601 and the prediction annotation box 603 do not match. If it is less than, it is further determined whether the size of the comparison annotation box 601 and the size of the prediction annotation box 603 are less than the preset size deviation threshold. If not, it means that the comparison annotation box 601 and the prediction annotation box 603 do not match. If it is smaller, it means that the comparison mark box 601 and the prediction mark box 603 match.
[0080] In a possible implementation, the method for determining whether the predicted annotation box is in the same or similar position as the corresponding comparison annotation box can also be to calculate the intersection-over-union (IOU) of the predicted annotation box and the comparison annotation box. IOU is a concept used in target detection, which refers to the overlap rate of the comparison annotation box and the predicted annotation box, that is, the ratio of their intersection to their union. The ideal situation is complete overlap, that is, the ratio is 1. The calculation formula of the intersection-over-union ratio is as follows:
[0081]
[0082] Among them, BOX1 refers to the annotation range of the comparison annotation box, BOX2 refers to the annotation range of the prediction annotation box, IOU refers to the overlap rate between the comparison annotation box and the prediction annotation box, and the value range of IOU is [0, 1]. The larger the IOU is, the closer the annotation range of the comparison annotation box is to the annotation range of the prediction annotation box. Furthermore, it can be said that the annotation quality of the prediction annotation box is higher.
[0083] Figure 7 FIG. 1 is a schematic diagram of the overlap ratio between the comparison annotation box and the prediction annotation box according to an embodiment of the present invention. Figure 7 As shown, region 701 is the intersection range of the comparison annotation box and the prediction annotation box, and region 702 is the union of the annotation ranges of the comparison annotation box and the prediction annotation box.
[0084] After calculating the IOU of the comparison annotation box and the prediction annotation box, in response to the intersection-and-union ratio being greater than the second preset threshold, it is determined that the comparison annotation box matches the prediction annotation box. Specifically, determine whether the IOU is greater than the second preset threshold. The second preset threshold is within the value range of the IOU, such as 0.5, 0.6, 0.7, etc. Similarly, the size of the second preset threshold can also be set or changed according to the actual requirements for the accuracy of the position of the prediction annotation box. The larger the second preset threshold, the higher the accuracy requirements for the position and size of the prediction annotation box. If the IOU is not greater than the second preset threshold, it means that the comparison annotation box 601 and the prediction annotation box 603 do not match. If it is greater than, it means that the comparison annotation box 601 and the prediction annotation box 603 match.
[0085] After determining one or more comparison annotation boxes with the same label as each comparison annotation box by the above method, the matching weight and matching coefficient are determined based on the number of the predicted annotation boxes, the number of the comparison annotation boxes, and the number of the comparison annotation boxes matching the predicted annotation boxes.
[0086] For each image to be annotated, the calculation formula for calculating the matching weight of the predicted annotation result and the comparison annotation result of the image to be annotated is as follows:
[0087]
[0088] Among them, match value Indicates the matching weight between the predicted annotation result and the comparison annotation result, march num Indicates the number of comparison annotation boxes that match the predicted annotation box, boxnum model Indicates the total number of comparison annotation boxes, boxnum relabel Indicates the number of predicted annotation boxes. march value∈[0, 1], the larger the value, the higher the similarity between the predicted annotation result and the comparative annotation result, and the lower the re-examination value; the smaller the value, the lower the similarity between the predicted annotation result and the comparative annotation result, and the higher the re-examination value.
[0089] When the number of image objects in the to-be-annotated image is large, the number of cases where the target annotation model misses or over-labels image objects when annotating the to-be-annotated image. Missing label refers to the fact that there are image objects in the to-be-annotated image that are not labeled, and over-label refers to labeling non-image objects in the to-be-annotated image as image objects. At this time, using missing label or over-label as an important indicator to evaluate the matching degree between the predicted annotation result and the comparative annotation result can help screen out more images to be annotated with a large number of missing labels or over-labels as images to be re-examined, and then using the images to be re-examined to train the target annotation model can help improve the probability of missing labels or over-labeling of the target annotation model. In this implementation, the matching coefficient is used to characterize the impact of missing labels or over-labeling of the predicted annotation result on the similarity between the predicted annotation result and the comparative annotation result.
[0090] The calculation formula for calculating the matching coefficient between the predicted annotation result and the comparison annotation result of the image to be annotated is as follows:
[0091]
[0092] Among them, coef num It indicates the matching coefficient between the predicted annotation result and the comparison annotation result. The max(x, y) function indicates finding the larger value of x and y. In other words, max(boxnum model , boxnum relabel ) represents the larger number between the number of predicted annotation boxes and the number of comparison annotation boxes. num Indicates the number of comparison annotation boxes that match the predicted annotation box. If max(boxnum model , boxnum relabel ) = boxnum model , it means that the predicted label result is missing. If max(boxnum model , bboxnum relabel ) = boxnum relabel , it means that the predicted result has multiple labels. num ∈[0, 1], the larger the value, the higher the similarity between the predicted annotation result and the comparison annotation result, and the lower the re-examination value; the smaller the value, the lower the similarity between the predicted annotation result and the comparison annotation result, and the higher the re-examination value. The matching coefficient can also be coef num =max(boxnum model , boxnum relabel )-match num+1, at this time, coef num ∈[1, +∞), the smaller the value, the higher the similarity between the predicted annotation result and the comparative annotation result, and the lower the re-examination value; the larger the value, the lower the similarity between the predicted annotation result and the comparative annotation result, and the higher the re-examination value.
[0093] In step S502, the product of the matching weight and the matching coefficient is calculated to determine the value weight.
[0094] Specifically, the calculation formula of value weight is as follows:
[0095] L value =match value *coef num
[0096] Among them, L value Indicates the value weight of the image to be annotated, match value Indicates the matching weight between the predicted annotation result and the comparison annotation result, coef num Indicates the matching coefficient between the predicted annotation result and the comparison annotation result. L value ∈[0, 1], the larger the value, the higher the similarity between the predicted annotation result and the comparative annotation result, and the lower the re-examination value; the smaller the value, the lower the similarity between the predicted annotation result and the comparative annotation result, and the higher the re-examination value.
[0097] Optionally, the above-mentioned value weight scoring algorithm can also be embodied as a deep learning model based on the principle of the algorithm.
[0098] In step S203, in response to the value weight being greater than a first preset threshold, the image to be annotated corresponding to the value weight is determined as an image to be re-inspected.
[0099] In step S204, in response to the number of the images to be annotated and / or the number of the images to be reviewed meeting a predetermined condition, the target annotation model is trained based on each of the images to be reviewed.
[0100] In a possible implementation, the predetermined condition may be that the number of images to be annotated is higher than a third preset threshold and / or the number of images to be rechecked is higher than a fourth preset threshold. The third preset threshold is not less than the fourth preset threshold. For example, the third preset threshold is 5000 and the fourth preset threshold is 3000.
[0101] In a possible implementation, the predetermined condition may also be that the number of images to be annotated is higher than a third preset threshold and the ratio of the number of images to be annotated to the number of images to be rechecked is higher than a fifth preset threshold. For example, if the third preset threshold is 5000, the ratio of the number of images to be annotated to the number of images to be rechecked is 5:3.
[0102] In a possible implementation, the predetermined condition may also be that the number of images to be rechecked is higher than a fourth preset threshold and the ratio of the number of images to be annotated to the number of images to be rechecked is higher than a fifth preset threshold. For example, if the fourth preset threshold is 3000, the ratio of the number of images to be annotated to the number of images to be rechecked is 5:3.
[0103] By limiting the number of images to be annotated and / or images to be rechecked in the above predetermined conditions, it can be ensured that the test data set is not affected by abnormal data. The more the number of test data, the more it can reflect the annotation ability of the target annotation model. By limiting the ratio of the number of images to be annotated to images to be annotated to images to be rechecked in the predetermined conditions, the annotation ability of the target annotation model can be controlled. The larger the ratio of the number of images to be annotated to images to be annotated to images to be rechecked, the better the annotation ability of the target annotation model. In the above embodiment, the ratio of the number of images to be annotated to images to be rechecked can be adjusted according to the actual application situation.
[0104] The method of the embodiment of the present invention can reduce the manual annotation cost and improve the annotation efficiency and annotation quality by annotating the image to be annotated through the target annotation model. Then, the predicted annotation result obtained by the target annotation model is compared with the manually adjusted comparison annotation result, and the value weight of the predicted annotation result is calculated, and the value weight represents the annotation effect of the predicted annotation result of the image to be annotated. The image to be annotated with poor annotation effect is determined as the image to be re-examined, which can effectively mine high-value images and difficult case data, use less data, and make full use of the image to be annotated. When the number of images to be annotated and / or the number of images to be re-examined meet the predetermined conditions, the target annotation model is trained using each image to be re-examined, thereby combining manual annotation and model iteration to form a closed-loop feedback iteration mechanism, continuously strengthening the annotation ability of the target annotation model, and continuously improving the annotation quality and efficiency.
[0105] Figure 8 FIG. 1 is a flow chart of an image processing method according to an embodiment of the present invention. Figure 8 As shown, the image processing method of this embodiment includes the following steps:
[0106] In step S801, a set of images to be annotated is obtained, where the set of images to be annotated includes a plurality of images to be annotated.
[0107] In step S802, it is determined whether to update the target annotation model.
[0108] Specifically, the images to be annotated in the image set to be annotated are input into the target annotation model, and before annotation, it is determined whether the target annotation model needs to be updated. Among them, if the target annotation model meets the update conditions during the image annotation process, it can be trained and updated. Therefore, there may be different versions of the target annotation model. The latest version of the target annotation model can be determined according to the update timestamp or the corresponding version number of the target annotation model. For example, the target annotation model with version number 1 annotates the Nth image to be annotated. After the annotation is completed, the update conditions are met, and the target annotation model is trained and updated. The updated version number is 2. At this time, the N+1th image to be annotated is input into the target annotation model, and it is necessary to determine whether the current target annotation model is the latest version. If it is not the latest version, the target annotation model needs to be updated, and go to step S803. If it is not the latest version, there is no need to update the target annotation model, and go to step S804.
[0109] In step S803, the target annotation model is updated, that is, the target annotation model is updated to the latest version.
[0110] In step S804, the target annotation model is used to annotate each image to be annotated in the annotated data set to obtain a predicted annotation result set, wherein the predicted annotation result set can be expressed as Lmodel = {Lm1, Lm2, ..., Lmn}, where n is the number of images to be annotated.
[0111] In step S805, a comparative annotation result set corresponding to the image set to be annotated is obtained, wherein the comparative annotation result set is a predicted annotation result set of the image to be annotated after manual adjustment. The comparative annotation result set can be expressed as Lrelabel={Lr1, Lr2, ..., Lrn}, where n is the number of images to be annotated.
[0112] In step S806, the predicted annotation result set and the manually adjusted comparative annotation result set are sent to the "data mining scoring model". The data mining scoring model is a deep learning model constructed based on a scoring algorithm.
[0113] In step S807, the value weight matrix of the data set to be labeled is determined.
[0114] The data mining scoring model determines the value weight matrix and related label information based on the predicted annotation result set and the manually adjusted comparative annotation result set. The value weight matrix can be expressed as Lvalue = {Lv1, Lv2, ..., Lvn}, where n is the number of images to be annotated.
[0115] Specifically, for each image to be annotated, the prediction and comparison results corresponding to the image to be annotated are determined from the prediction and comparison result sets, and then the value weight of the image to be annotated is calculated. The value weights of all images to be annotated in the image set to be annotated form a value weight matrix.
[0116] The calculation formula of value weight is as follows:
[0117] L value =match value *coef num
[0118] Among them, L value Indicates the value weight of the image to be annotated, match value Indicates the matching weight between the predicted annotation result and the comparison annotation result, coef num Indicates the matching coefficient between the predicted annotation result and the comparison annotation result. value The calculation formula is as follows:
[0119]
[0120] Among them, match value Indicates the matching weight between the predicted annotation result and the comparison annotation result, match num Indicates the number of comparison annotation boxes that match the predicted annotation box. The target annotation model can determine the comparison annotation boxes that match the predicted annotation box based on the preset matching rule. For example, the preset matching rule can be that the intersection and union ratio of the comparison annotation box and each predicted annotation box with the same label as the comparison annotation box is greater than a second preset threshold. boxnum model Indicates the total number of comparison annotation boxes, boxnum relabel Indicates the number of predicted annotation boxes. march value ∈[0, 1], the larger the value, the higher the similarity between the predicted annotation result and the comparative annotation result, and the lower the re-examination value; the smaller the value, the lower the similarity between the predicted annotation result and the comparative annotation result, and the higher the re-examination value.
[0121] Among them, coef num The calculation formula is as follows:
[0122]
[0123] Among them, coef num It indicates the matching coefficient between the predicted annotation result and the comparison annotation result. The max(x, y) function indicates finding the larger value of x and y. In other words, max(boxnum model , boxnum relabel) represents the larger number between the number of predicted annotation boxes and the number of comparison annotation boxes. num Indicates the number of comparison annotation boxes that match the predicted annotation box. If max(boxnum model , boxnum relabel ) = boxnum model , it means that the predicted label result is missing. If max(boxnum model , boxnum relabel ) = boxnum relabel , it means that the predicted result has multiple labels. num ∈[0, 1], the larger the value, the higher the similarity between the predicted annotation result and the comparative annotation result, and the lower the re-examination value; the smaller the value, the lower the similarity between the predicted annotation result and the comparative annotation result, and the higher the re-examination value.
[0124] In step S808, the image set to be reviewed is determined.
[0125] Specifically, the images to be annotated whose value weights in the data set to be annotated are greater than a first preset threshold are determined as images to be rechecked to form an image set to be rechecked.
[0126] After determining the image set to be re-examined, it can be further determined whether to enable the automatic update mode of the target annotation model. Whether the update is required is determined based on the actual situation.
[0127] In step S809, it is determined whether a predetermined condition is satisfied.
[0128] Specifically, it is determined whether the number of images to be annotated and / or the number of images to be rechecked meets a predetermined condition.
[0129] In a possible implementation, the predetermined condition may be that the number of images to be annotated is higher than a third preset threshold and / or the number of images to be rechecked is higher than a fourth preset threshold. The third preset threshold is not less than the fourth preset threshold. For example, the third preset threshold is 5000 and the fourth preset threshold is 3000.
[0130] In a possible implementation, the predetermined condition may also be that the number of images to be annotated is higher than a third preset threshold and the ratio of the number of images to be annotated to the number of images to be rechecked is not less than a fifth preset threshold. For example, if the third preset threshold is 5000, the ratio of the number of images to be annotated to the number of images to be rechecked is 5:3.
[0131] In a possible implementation, the predetermined condition may also be that the number of images to be rechecked is higher than a fourth preset threshold and the ratio of the number of images to be annotated to the number of images to be rechecked is not less than a fifth preset threshold. For example, if the fourth preset threshold is 3000, the ratio of the number of images to be annotated to the number of images to be rechecked is 5:3.
[0132] If satisfied, go to step S803; if not satisfied, go to step S810.
[0133] In step S810, end.
[0134] The method of the embodiment of the present invention obtains a predicted annotation result set by annotating the image set to be annotated using the target annotation model, and then compares the predicted annotation result set obtained by the target annotation model with the manually adjusted comparison annotation result set to obtain a value weight matrix of the image set to be annotated, and determines whether the target annotation model meets the predetermined conditions by analyzing the value weight matrix, thereby updating the target annotation matrix. In this way, manual annotation and model iteration are combined to form a closed-loop feedback iteration mechanism, which continuously strengthens the annotation capability of the target annotation model and continuously improves the annotation quality and efficiency.
[0135] Fig. 9 Schematic diagram of an image processing device according to an embodiment of the present invention. Fig. 9 As shown, the image processing device of the embodiment of the present invention includes:
[0136] A first determination module 901 is used to input the image to be annotated into the target annotation model to determine the predicted annotation result of the image to be annotated;
[0137] A first determination module 902, configured to determine a value weight of the predicted annotation result based on the predicted annotation result and the corresponding comparative annotation result;
[0138] A first determination module 903, configured to determine the image to be annotated corresponding to the value weight as an image to be re-examined in response to the value weight being greater than a first preset threshold;
[0139] The training module 904 is configured to train the target annotation model based on each of the images to be rechecked in response to the number of the images to be annotated and / or the number of the images to be rechecked satisfying a predetermined condition.
[0140] The device of the embodiment of the present invention can reduce the manual annotation cost and improve the annotation efficiency and annotation quality by annotating the image to be annotated through the target annotation model. Then, the predicted annotation result obtained by the target annotation model is compared with the manually adjusted comparison annotation result, and the value weight of the predicted annotation result is calculated, and the value weight represents the annotation effect of the predicted annotation result of the image to be annotated. The image to be annotated with poor annotation effect is determined as the image to be re-examined, which can effectively mine high-value images and difficult case data, use less data, and make full use of the image to be annotated. When the number of images to be annotated and / or the number of images to be re-examined meet the predetermined conditions, the target annotation model is trained using each image to be re-examined, thereby combining manual annotation and model iteration to form a closed-loop feedback iteration mechanism, continuously strengthening the annotation ability of the target annotation model, and continuously improving the annotation quality and efficiency.
[0141] Fig.10 Schematic diagram of an electronic device according to an embodiment of the present invention. Fig.10 As shown, Fig.10 The electronic device shown is a general address query device, which includes a general computer hardware structure, which at least includes a processor 1001 and a memory 1002. The processor 1001 and the memory 1002 are connected via a bus 1003. The memory 1002 is suitable for storing instructions or programs executable by the processor 1001. The processor 1001 can be an independent microprocessor or a collection of one or more microprocessors. Thus, the processor 1001 executes the method flow of the above-mentioned embodiment or implements the module architecture in the system as described above to process data and control other devices by executing the instructions stored in the memory 1002. The bus 1003 connects the above-mentioned multiple components together, and at the same time connects the above-mentioned components to the display controller 1004 and the display device and the input / output (I / O) device 1005. The input / output (I / O) device 1005 can be a mouse, a keyboard, a modem, a network interface, a touch input device, a somatosensory input device, a printer, and other devices known in the art. Typically, input / output devices 1005 are connected to the system through input / output (I / O) controller 1006 .
[0142] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices (equipment) or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application may adopt a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0143] The present application is described with reference to flowcharts of methods, apparatuses (devices) and computer program products according to embodiments of the present application. It should be understood that each process in the flowchart can be implemented by computer program instructions.
[0144] These computer program instructions may be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device that implements the process Figure 1 A function specified in a process or multiple processes.
[0145] These computer program instructions may also be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce the instructions for implementing the process Figure 1 A device that specifies functions in a process or multiple processes.
[0146] Another embodiment of the present invention relates to a non-volatile storage medium for storing a computer-readable program, wherein the computer-readable program is used for a computer to execute part or all of the above method embodiments.
[0147] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by specifying relevant hardware through a program, and the program is stored in a storage medium, including several instructions for a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
Claims
1. An image processing method, It is characterized in that The method comprises: Inputting the image to be annotated into the target annotation model to determine the predicted annotation result of the image to be annotated; Determining a value weight of the predicted annotation result based on the predicted annotation result and the corresponding comparative annotation result; In response to the value weight being greater than a first preset threshold, determining the image to be annotated corresponding to the value weight as an image to be re-examined; In response to the number of the images to be annotated and / or the number of the images to be reviewed meeting a predetermined condition, the target annotation model is trained based on each of the images to be reviewed.
2. The method according to claim 1, It is characterized in that The step of inputting the image to be annotated into the target annotation model and determining the predicted annotation result of the image to be annotated includes: Acquire a set of images to be annotated, wherein the set of images to be annotated includes a plurality of images to be annotated; Determine the latest version of the target annotation model based on the update time of the target annotation model; Each of the images to be annotated in the set of images to be annotated is input into the target annotation model respectively, and a predicted annotation result corresponding to each of the images to be annotated is determined.
3. The method according to claim 1, It is characterized in that The determining the value weight of the predicted annotation result based on the predicted annotation result and the corresponding comparative annotation result includes: Obtaining a comparative annotation result corresponding to the image to be annotated, wherein the comparative annotation result is a predicted annotation result of the image to be annotated after manual adjustment; A preset scoring algorithm is used based on the predicted annotation result and the corresponding comparative annotation result to determine a value weight of the predicted annotation result, wherein the value weight is used to characterize the difference between the predicted annotation result and the corresponding comparative annotation result.
4. The method according to claim 3, It is characterized in that The method of using a preset scoring algorithm based on the predicted annotation result and the corresponding comparative annotation result to determine the value weight of the predicted annotation result includes: Determining a matching weight and a matching coefficient of the image to be labeled based on the predicted labeling result and the comparative labeling result corresponding to the image to be labeled; The product of the matching weight and the matching coefficient is calculated to determine the value weight.
5. The method according to claim 4, It is characterized in that The predicted annotation result includes a plurality of predicted annotation boxes and corresponding labels, and the compared annotation result includes a plurality of compared annotation boxes and corresponding labels; The determining the matching weight and matching coefficient of the image to be labeled based on the predicted labeling result and the comparative labeling result corresponding to the image to be labeled includes: Determining a comparison annotation frame that matches the predicted annotation frame; The matching weight and matching coefficient are determined based on the number of the predicted annotation boxes, the number of the compared annotation boxes, and the number of the compared annotation boxes matching the predicted annotation boxes.
6. The method according to claim 5, It is characterized in that The determining a comparison annotation frame that matches the predicted annotation frame includes: For each of the compared annotation frames, in response to the existence of a predicted annotation frame with the same label and the same position, it is determined that the compared annotation frame matches the predicted annotation frame.
7. The method according to claim 5, It is characterized in that The determining a comparison annotation frame that matches the predicted annotation frame includes: For each of the compared annotation frames, determining a predicted annotation frame having the same label as the compared annotation frame; Calculating an intersection-over-union ratio of the comparison annotation frame and each of the predicted annotation frames having the same label as the comparison annotation frame; In response to the intersection-over-union ratio being greater than a second preset threshold, it is determined that the compared annotation box matches the predicted annotation box.
8. An image processing device, It is characterized in that The device comprises: A first determination module is used to input the image to be labeled into the target labeling model to determine the predicted labeling result of the image to be labeled; A second determination module, configured to determine a value weight of the predicted annotation result based on the predicted annotation result and the corresponding comparative annotation result; A third determination module, configured to determine the image to be annotated corresponding to the value weight as an image to be re-examined in response to the value weight being greater than a first preset threshold; A training module is used for training the target annotation model based on each of the images to be rechecked in response to the number of the images to be annotated and / or the number of the images to be rechecked satisfying a predetermined condition.
9. An electronic device comprising a memory and a processor, It is characterized in that The memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
