Image processing method and device, computer device, storage medium and program product
By using labeled evaluation models for selection and iterative training, an image recognition model suitable for the target domain is generated. This solves the problem of insufficient adaptability of deep neural networks across different data sources, and improves recognition accuracy and enhances the interpretability of the transfer process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2022-03-09
- Publication Date
- 2026-05-19
AI Technical Summary
Existing technologies cannot effectively improve the recognition accuracy of transfer networks in target domains, especially in deep neural network applications, where it is difficult to ensure the model's adaptability to data from different sources.
By acquiring sample images from the target dataset, the predicted annotations are evaluated using an annotation evaluation model, high-quality sample images are selected, and the recognition model is iteratively trained until the recognition effect reaches a set threshold, thereby generating a second image recognition model suitable for the target domain.
It significantly improves the adaptability of the transferred image recognition model in the target domain, ensures recognition accuracy, and enhances the interpretability of the transfer process.
Smart Images

Figure CN116797859B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, specifically to an image processing method, apparatus, computer equipment, storage medium, and program product. Background Technology
[0002] With the development of artificial intelligence technology, its research and application in domain transfer are increasing. Domain transfer is used to transfer a model from the data distribution of the source domain to the data distribution of the target domain, after which the model can be used to perform tasks corresponding to the target domain.
[0003] Taking image recognition models as an example, related technologies use methods to extract specific features from image samples in the target domain to generate pseudo-labels, thereby achieving domain adaptation during neural network training. However, this cannot guarantee an effective improvement in the adaptability of the transfer network, i.e., it cannot guarantee the accuracy of the transfer network's recognition. Summary of the Invention
[0004] This application provides an image processing method, apparatus, computer device, storage medium, and program product, which can solve the problem in related technologies that cannot ensure the accuracy of migration network recognition. The technical solution is as follows:
[0005] On the one hand, an image processing method is provided, the method including:
[0006] Obtain the target dataset to be identified; the target dataset includes multiple target domain sample images; wherein, the target domain sample images are sample images of the target domain to be identified;
[0007] The target dataset is identified based on the first image recognition model, and the first predicted annotations of multiple target domain sample images of the target dataset are obtained.
[0008] The first predicted annotations of multiple target domain sample images are evaluated based on the annotation evaluation model to obtain the evaluation values of multiple first predicted annotations; the evaluation values are used to represent the matching degree between the first predicted annotations and the real annotations of the target domain sample images.
[0009] A first image recognition model is trained based on the evaluation values of multiple first prediction labels, a second image recognition model applicable to the target domain is obtained, and the recognition results of the second image recognition model for multiple target domain sample images are determined.
[0010] In one possible implementation, before recognizing the target dataset based on the first image recognition model, the following is also included:
[0011] The initial recognition model is trained based on multiple preset source domain sample images and the standard annotation of each source domain sample image to obtain the first image recognition model.
[0012] Generate sample annotations for each source domain sample image based on the standard annotations of each source domain sample image, and obtain the sample evaluation value corresponding to each sample annotation.
[0013] The initial evaluation model is trained based on multiple source domain sample images, the sample annotations of each source domain sample image, and the evaluation values of each sample to obtain the annotation evaluation model.
[0014] In one possible implementation, sample annotations for each source domain sample image are generated based on the standard annotations for each source domain sample image, including:
[0015] Multiple standard labels are randomly classified to obtain multiple random labels, and these random labels are set as sample labels for multiple source domain sample images.
[0016] In one possible implementation, the sample evaluation value corresponding to each sample label is obtained, including:
[0017] Determine the degree of overlap between each sample label and the standard label, and determine the sample evaluation value based on the degree of overlap.
[0018] In one possible implementation, an initial evaluation model is trained based on multiple source domain sample images, sample annotations for each source domain sample image, and evaluation values for each sample, to obtain an annotation-based evaluation model, including:
[0019] Merge each source domain sample image with its corresponding sample annotation to generate multiple training sample images;
[0020] The initial evaluation model is trained based on multiple training sample images and the corresponding sample evaluation values for each training image to obtain the labeled evaluation model.
[0021] In one possible implementation, a first image recognition model is trained based on the evaluation values of multiple first predicted labels to obtain a second image recognition model suitable for the target domain, and the recognition results of the second image recognition model for multiple target domain sample images are determined, including:
[0022] The proportion of target domain sample images in the target dataset whose evaluation values are greater than or equal to a preset threshold is determined based on the evaluation values of multiple first prediction annotations.
[0023] If the determined ratio is greater than or equal to the preset ratio, then the first image recognition model is set as the second image recognition model applicable to the target domain.
[0024] The first prediction label is set as the recognition result of multiple target domain sample images.
[0025] One possible implementation also includes:
[0026] If the determined ratio is less than the preset ratio, then the image to be corrected is selected from the target domain sample images whose evaluation value is less than the preset threshold.
[0027] Receive correction information for the image to be corrected, correct the first predicted label of the image to be corrected based on the correction information, so that the evaluation value of the corrected first predicted label is greater than or equal to a preset threshold, and make the ratio of target domain sample images with evaluation values greater than or equal to the preset threshold greater than or equal to a preset ratio.
[0028] The first image recognition model is trained based on target domain sample images with evaluation values greater than or equal to a preset threshold, and the second image recognition model is obtained. The recognition results of the second image recognition model for multiple target domain sample images are then obtained.
[0029] In one possible implementation, selecting the image to be corrected from the target domain sample images with evaluation values less than a preset threshold includes:
[0030] The number of samples to be corrected is determined based on the ratio of target domain sample images whose evaluation values are greater than or equal to a preset threshold and the preset ratio.
[0031] From the target domain sample images with evaluation values less than a preset threshold, select the target domain sample image with the largest number of evaluation values to be corrected and set it as the image to be corrected.
[0032] In one possible implementation, a first image recognition model is trained based on target domain sample images with evaluation values greater than or equal to a preset threshold to obtain a second image recognition model, including:
[0033] The first image recognition model is trained based on target domain sample images with evaluation values greater than or equal to a preset threshold to obtain the trained first image recognition model.
[0034] The trained first image recognition model is used as the new first image recognition model. The steps of recognizing the target dataset, obtaining the first predicted label, evaluating the first predicted label to obtain the evaluation value, determining the ratio of target domain sample images in the target dataset whose evaluation value is greater than or equal to a preset threshold, selecting the image to be corrected, correcting the first predicted label of the image to be corrected, and training the first image recognition model are repeated until the ratio determined by the evaluation value of the first predicted label output by the first image recognition model is greater than or equal to the preset ratio. The trained first recognition model is then set as the second recognition model.
[0035] On the other hand, an image processing apparatus is provided, the apparatus comprising:
[0036] The acquisition module is used to acquire the target dataset to be identified; the target dataset includes multiple target domain sample images; wherein, the target domain sample images are sample images of the target domain to be identified;
[0037] The first recognition module is used to recognize the target dataset based on the first image recognition model and obtain the first predicted annotations of multiple target domain sample images of the target dataset.
[0038] The evaluation module is used to evaluate the first predicted annotations of multiple target domain sample images based on the annotation evaluation model, and obtain the evaluation values of the first predicted annotations. The evaluation values are used to represent the matching degree between the first predicted annotations and the real annotations of the target domain sample images.
[0039] The second recognition module is used to train the first image recognition model based on the evaluation values of multiple first prediction labels, obtain a second image recognition model applicable to the target domain, and determine the recognition results of the second image recognition model for multiple target domain sample images.
[0040] In one possible implementation, the image processing apparatus further includes a training module for:
[0041] The initial recognition model is trained based on multiple preset source domain sample images and the standard annotation of each source domain sample image to obtain the first image recognition model.
[0042] Generate sample annotations for each source domain sample image based on the standard annotations of each source domain sample image, and obtain the sample evaluation value corresponding to each sample annotation.
[0043] The initial evaluation model is trained based on multiple source domain sample images, the sample annotations of each source domain sample image, and the evaluation values of each sample to obtain the annotation evaluation model.
[0044] In one possible implementation, when the training module generates sample annotations for each source domain sample image based on the standard annotations of each source domain sample image, it specifically performs the following:
[0045] Multiple standard labels are randomly classified to obtain multiple random labels, and these random labels are set as sample labels for multiple source domain sample images.
[0046] In one possible implementation, when the training module obtains the sample evaluation value corresponding to each sample label, it specifically uses the following:
[0047] Determine the degree of overlap between each sample label and the standard label, and determine the sample evaluation value based on the degree of overlap.
[0048] In one possible implementation, when the training module trains the initial evaluation model based on multiple source domain sample images, the sample annotations for each source domain sample image, and the evaluation value for each sample to obtain the labeled evaluation model, it is specifically used for:
[0049] Merge each source domain sample image with its corresponding sample annotation to generate multiple training sample images;
[0050] The initial evaluation model is trained based on multiple training sample images and the corresponding sample evaluation values for each training image to obtain the labeled evaluation model.
[0051] In one possible implementation, when the second recognition module trains the first image recognition model based on the evaluation values of multiple first prediction annotations, obtains a second image recognition model applicable to the target domain, and determines the recognition results of the second image recognition model for multiple target domain sample images, it is specifically used for:
[0052] The proportion of target domain sample images in the target dataset whose evaluation values are greater than or equal to a preset threshold is determined based on the evaluation values of multiple first prediction annotations.
[0053] If the determined ratio is greater than or equal to the preset ratio, then the first image recognition model is set as the second image recognition model applicable to the target domain.
[0054] The first prediction label is set as the recognition result of multiple target domain sample images.
[0055] In one possible implementation, the second identification module is also used for:
[0056] If the determined ratio is less than the preset ratio, then the image to be corrected is selected from the target domain sample images whose evaluation value is less than the preset threshold.
[0057] Receive correction information for the image to be corrected, correct the first predicted label of the image to be corrected based on the correction information, so that the evaluation value of the corrected first predicted label is greater than or equal to a preset threshold, and make the ratio of target domain sample images with evaluation values greater than or equal to the preset threshold greater than or equal to a preset ratio.
[0058] The first image recognition model is trained based on target domain sample images with evaluation values greater than or equal to a preset threshold, and the second image recognition model is obtained. The recognition results of the second image recognition model for multiple target domain sample images are then obtained.
[0059] In one possible implementation, when the second recognition module selects the image to be corrected from the target domain sample images with evaluation values less than a preset threshold, it specifically performs the following:
[0060] The number of samples to be corrected is determined based on the ratio of target domain sample images whose evaluation values are greater than or equal to a preset threshold and the preset ratio.
[0061] From the target domain sample images with evaluation values less than a preset threshold, select the target domain sample image with the largest number of evaluation values to be corrected and set it as the image to be corrected.
[0062] In one possible implementation, when the second recognition module trains the first image recognition model based on target domain sample images with evaluation values greater than or equal to a preset threshold to obtain the second image recognition model, it is specifically used for:
[0063] The first image recognition model is trained based on target domain sample images with evaluation values greater than or equal to a preset threshold to obtain the trained first image recognition model.
[0064] The trained first image recognition model is used as the new first image recognition model. The steps of recognizing the target dataset, obtaining the first predicted label, evaluating the first predicted label to obtain the evaluation value, determining the ratio of target domain sample images in the target dataset whose evaluation value is greater than or equal to a preset threshold, selecting the image to be corrected, correcting the first predicted label of the image to be corrected, and training the first image recognition model are repeated until the ratio determined by the evaluation value of the first predicted label output by the first image recognition model is greater than or equal to the preset ratio. The trained first recognition model is then set as the second recognition model.
[0065] On the other hand, a computer device is provided, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the above-described image processing method.
[0066] On the other hand, a computer-readable storage medium is provided on which a computer program is stored, which, when executed by a processor, implements the above-described image processing method.
[0067] On the other hand, a computer program product is provided, including a computer program that, when executed by a processor, implements the image processing method described above.
[0068] The beneficial effects of the technical solution provided in this application are:
[0069] The first predicted annotations of the multiple target domain sample images are evaluated by the annotation evaluation model to obtain the evaluation values of the multiple first predicted annotations. The first image recognition model is then retrained using the evaluation values to obtain a second image recognition model suitable for the target domain. The annotation evaluation model can intuitively understand the accuracy of the first predicted annotations, thereby ensuring that the adaptability of the second image recognition model obtained after transfer can be effectively improved, thus ensuring the recognition accuracy of the second image recognition model.
[0070] In addition, by selecting high-quality target domain sample images, selectively correcting the first predicted annotations of the target domain sample images, and then inputting the target domain sample images into the first image recognition model for continuous iteration until the recognition effect reaches the set threshold, a second image recognition model is obtained. This method can enhance the interpretability of the transfer process and significantly improve the adaptability of the second image recognition model to the target domain.
[0071] The image processing method proposed in this application can achieve good results in the field of image recognition by applying deep neural networks to data from different fields based on known data and models. Attached Figure Description
[0072] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below.
[0073] Figure 1 A schematic diagram illustrating the implementation environment of an image processing method provided in this application embodiment;
[0074] Figure 2 A schematic flowchart of an image processing method provided in an embodiment of this application;
[0075] Figure 3 A schematic diagram of the acquisition scheme for the first image recognition model provided in an embodiment of this application;
[0076] Figure 4 This is a schematic diagram of an image processing scheme provided in one example of this application;
[0077] Figure 5 A schematic flowchart of an image processing method provided in an embodiment of this application;
[0078] Figure 6 A schematic diagram illustrating the training process of the labeled evaluation model provided as an example in this application;
[0079] Figure 7 A schematic diagram of the structure of the annotation evaluation model provided as an example in this application;
[0080] Figure 8A schematic diagram illustrating the image processing scheme provided as an example in this application;
[0081] Figure 9 This is a schematic diagram of the structure of an image processing apparatus provided in an embodiment of this application;
[0082] Figure 10 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0083] The embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the embodiments described below with reference to the accompanying drawings are exemplary descriptions for explaining the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions of the embodiments of this application.
[0084] Those skilled in the art will understand that, unless otherwise stated, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the terms “comprising” and “including” as used in embodiments of this application mean that the corresponding feature can be implemented as the presented feature, information, data, step, operation, element, and / or component, but do not exclude implementation as other features, information, data, step, operation, element, component, and / or combinations thereof supported by the art. It should be understood that when we say that an element is “connected” or “coupled” to another element, the one element can be directly connected or coupled to the other element, or it can mean that the one element and the other element establish a connection relationship through an intermediate element. Furthermore, “connected” or “coupled” as used herein can include wireless connection or wireless coupling. The term “and / or” as used herein indicates at least one of the items defined by the term; for example, “A and / or B” indicates implementation as “A,” or implementation as “A,” or implementation as “A and B.”
[0085] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0086] Deep neural networks have achieved good results in image recognition due to their strong nonlinear descriptive capabilities. However, they also have some problems in application. First, due to their complex structure and numerous parameters, deep neural networks require a large number of labeled samples for supervised learning. Second, when using deep neural networks with data from different sources, it is necessary to assume that the feature vectors of the test set and the training set follow the same statistical distribution, but this assumption is difficult to hold in real-world applications.
[0087] Related techniques can utilize a large number of source domain samples with class labels, a small number of target domain samples with class labels, and relatively easy-to-obtain unlabeled target domain samples for semi-supervised transfer learning, thereby improving the adaptability of convolutional neural networks to target domain samples.
[0088] This approach uses only a small number of labeled target domain samples to fine-tune the neural network. It requires high quality for the small number of labeled target domain samples and fails to consider the differences between the statistical distribution of the small number of labeled samples in the target domain and the overall sample distribution. If the differences are large, the network's ability to adapt to the samples will be greatly weakened.
[0089] Other related techniques extract image sample features from the target domain to generate the current pseudo-annotation result of the image samples in the target domain; use the first neural network to process the image samples in the joint domain, and output the processing result of the first neural network; the image samples in the joint domain and their current annotation result include the image samples in the source domain and their annotation results, as well as the image samples in the target domain and their current pseudo-annotation result; adjust the parameter values of the network parameters of the first neural network based on the processing result of the first neural network and the current annotation result of the image samples in the joint domain. This method can obtain the interrelationships between various images in the target domain, as well as the relationship between the target domain and source domain sample images.
[0090] While this approach takes into account the relationships between images in the target domain and the relationship between the target domain and source domain sample images, and extracts specific features from image samples in the target domain to generate pseudo-labels, achieving domain adaptation during neural network training, the quality of the generated pseudo-labels is difficult to guarantee. There is a lack of intuitive observation indicators to measure the quality of pseudo-labels, and it cannot be ensured that this adaptive method can effectively improve the network's adaptability.
[0091] This application uses an annotation evaluation mechanism to intuitively understand the recognition effect after model transfer, and selects a high-quality annotated sample set of the target domain. It selectively adds manual intervention operations, and then inputs the sample set into the recognition model to continuously iterate until the recognition effect reaches the set threshold. This method can enhance the interpretability of the transfer process and significantly improve the network's adaptability to the target domain.
[0092] The embodiments of this application can be applied to various scenarios, including but not limited to artificial intelligence. For example, the image processing method provided in this application can be used to train on existing labeled image datasets to obtain prediction results for unknown data. Taking building recognition in remote sensing imagery as an example, model training based on existing public datasets can be applied to building recognition in other specific areas and achieve good results.
[0093] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.
[0094] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily include computer vision, speech processing, natural language processing, as well as machine learning / deep learning, autonomous driving, and intelligent transportation.
[0095] Machine learning (ML) is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence; its applications span all areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and instructional learning.
[0096] Figure 1 This is a schematic diagram of the implementation environment of an image processing method provided in an embodiment of the present invention. See also... Figure 1 Specifically, the first image recognition model is an image recognition model applicable to the source domain. Based on the first image recognition model, multiple target domain sample images in the target dataset are recognized to obtain first predicted labels for the multiple target domain sample images. The first predicted labels for the multiple target domain sample images are evaluated based on the label evaluation model to obtain evaluation values for the multiple first predicted labels. The first image recognition model is trained based on the evaluation values of the multiple first predicted labels to obtain a second image recognition model applicable to the target domain.
[0097] Understandable Figure 1 This represents an example application scenario and does not limit the application scenarios of the image processing method in this application.
[0098] Figure 2 This is a flowchart illustrating an image processing method provided in an embodiment of this application. The method can be executed by a computer device. Figure 2 As shown, the method may include the following steps:
[0099] Step 201: Obtain the target dataset to be identified; the target dataset includes multiple target domain sample images.
[0100] Among them, the target domain sample image is the sample image of the target domain to be identified, that is, the target domain sample image does not have a corresponding standard label.
[0101] Step 202: Based on the first image recognition model, the target dataset is identified to obtain the first predicted annotations of multiple target domain sample images of the target dataset.
[0102] The first image recognition model is an image recognition model applicable to the source domain. It can be trained from source domain sample images with corresponding standard annotations. The specific acquisition process of the first image recognition model will be described in detail below.
[0103] Step 203: Evaluate the first predicted annotations of multiple target domain sample images based on the annotation evaluation model to obtain the evaluation values of multiple first predicted annotations.
[0104] The evaluation value is used to represent the degree of matching between the first predicted label and the real label of the target domain sample image, that is, it can represent the accuracy of the first predicted label. The higher the evaluation value, the more accurate the first predicted label is.
[0105] Among them, the true annotation of the target domain image refers to the completely correct annotation of the target domain image, which is the ideal annotation and is not necessarily the same as the standard annotation.
[0106] The specific process for obtaining the annotation evaluation model will be described in detail below.
[0107] Step 204: Train the first image recognition model based on the evaluation values of multiple first prediction labels, obtain the second image recognition model applicable to the target domain, and determine the recognition results of the second image recognition model for multiple target domain sample images.
[0108] Training the first image recognition model based on the evaluation values of multiple first prediction labels refers to improving the parameters of the first image recognition model. In this application, the training of the model refers to adjusting and improving the parameters of the model.
[0109] Specifically, the process of obtaining a second image recognition model suitable for the target domain based on a first image recognition model applicable to the source domain is the image recognition model transfer process.
[0110] In the specific implementation process, based on the evaluation values of multiple first prediction labels, target domain sample images with high recognition accuracy can be selected from multiple target domain sample images, and the first prediction labels of target domain sample images with low recognition accuracy can be corrected. The first image recognition model can be retrained using the target domain sample images with high recognition accuracy and the target domain sample images with corrected first prediction labels to obtain a second image recognition model suitable for the target domain. The specific transfer process of the first image recognition model will be described in detail below.
[0111] In the above embodiments, the first predicted annotations of multiple target domain sample images are evaluated by the annotation evaluation model to obtain the evaluation values of multiple first predicted annotations. The first image recognition model is then retrained using the evaluation values to obtain a second image recognition model suitable for the target domain. The annotation evaluation model can intuitively understand the accuracy of the first predicted annotations and can effectively improve the adaptability of the second image recognition model obtained after transfer, thereby ensuring the recognition accuracy of the second image recognition model.
[0112] The process of obtaining the first image recognition model and the annotation evaluation model will be further explained below with reference to the embodiments.
[0113] In one possible implementation, before step S202 identifies the target dataset based on the first image recognition model, it may further include:
[0114] The initial recognition model is trained based on multiple preset source domain sample images and the standard annotation of each source domain sample image to obtain the first image recognition model.
[0115] The source domain sample images are pre-set with standard annotations, which can be ideal, real annotations derived from the sample images.
[0116] The initial recognition model can be a semantic segmentation network, such as a fully convolutional network (FCN), UNet network, or HRNet network (high-resolution network). UNet network is a fully convolutional neural network that performs pixel-level classification and outputs the category of each pixel.
[0117] Specifically, the initial recognition model's process of recognizing an image can be the process by which a semantic segmentation network predicts each pixel of the image.
[0118] like Figure 3As shown, in one example, a source domain sample image of size 512×512 RGB (color system) three channels is input, along with the corresponding standard label of 512×512 single channel, for training to obtain the first image recognition model.
[0119] In one possible implementation, before training the initial recognition model based on multiple preset source domain sample images and the standard annotations of each source domain sample image to obtain the first image recognition model, the following may also be included:
[0120] For any target to be sampled, random sampling at different scales is used to obtain the source domain sample image corresponding to the target.
[0121] Taking the identification of buildings in remote sensing imagery as an example, firstly, in terms of data sampling, the same building may appear at different sizes in remote sensing images, i.e., multi-scale issues arise due to resolution and other factors. This application employs a multi-scale random sampling method, sampling the same ground feature multiple times at different scales to construct a multi-scale dataset for training, effectively utilizing the spatial information of remote sensing imagery and also achieving the effect of expanding the dataset.
[0122] In one possible implementation, for any target to be sampled, obtaining source domain sample images corresponding to the target through random sampling at different scales can include:
[0123] For any target to be sampled, random sampling at different scales is used to obtain the initial source domain sample image corresponding to the target;
[0124] Geometric transformations are performed on the initial source domain sample image to obtain the source domain sample image.
[0125] Specifically, in terms of data augmentation, for remote sensing imagery, because the same ground feature captured by the sensor at different angles during the imaging process will appear in different positions and shapes on the image, transformed samples can help the model better learn the rotation-invariant characteristics of the ground feature, thus better adapting to images with different shapes. Therefore, data augmentation operations that perform geometric transformations (including horizontal flipping, vertical flipping, and diagonal flipping) on the training data are used.
[0126] In practical implementation, taking the recognition of building images using a fully convolutional network as an example, such as... Figure 4As shown, the input image is scaled and then fed into a fully convolutional network. At the network's connection layers, different encoders can be selected to extract image spatial features at various scales. A sigmoid activation layer is used to map the network's output to obtain the final output. During training, a random weight averaging strategy can be used to enhance the model's generalization ability, and a periodic moving average operation is added to limit the variation of the weights. Here, sigmoid is a mathematical function used as the activation function of the neural network, mapping variables to the range of 0 to 1.
[0127] In one possible implementation, such as Figure 5 As shown, before step S202 identifies the target dataset based on the first image recognition model, it may further include:
[0128] Step S501: Generate sample annotations for each source domain sample image based on the standard annotations for each source domain sample image, and obtain the sample evaluation value corresponding to each sample annotation.
[0129] Specifically, step S501, which generates sample annotations for each source domain sample image based on the standard annotations for each source domain sample image, may include:
[0130] Multiple standard labels are randomly classified to obtain multiple random labels, and these random labels are set as sample labels for multiple source domain sample images.
[0131] In practice, this can be understood as randomly assigning labels to source domain sample images, which can generate multiple sample pairs that are different from the standard labels.
[0132] Specifically, step S501, obtaining the sample evaluation value corresponding to each sample label, may include:
[0133] Determine the degree of overlap between each sample label and the standard label, and determine the sample evaluation value based on the degree of overlap.
[0134] The evaluation value can be used to represent the quality of the sample annotation. The higher the evaluation value, the closer the sample annotation is to the standard annotation, indicating that the quality of the sample annotation is higher. Conversely, the lower the evaluation value, the greater the difference between the sample annotation and the standard annotation, indicating that the quality of the sample annotation is lower.
[0135] In the specific implementation process, the intersection-union ratio between sample annotations and standard annotations can be calculated to obtain the evaluation value of the sample annotations.
[0136] Step S502: The initial evaluation model is trained based on multiple source domain sample images, the sample annotations of each source domain sample image, and the evaluation values of each sample to obtain the labeled evaluation model.
[0137] In the specific implementation process, the source domain sample image and sample annotation can be used as the input of the initial evaluation model, and the evaluation value can be used as the output of the initial evaluation model to train the initial evaluation model and obtain the annotation evaluation model.
[0138] In one possible implementation, step S502 trains an initial evaluation model based on multiple source domain sample images, sample annotations for each source domain sample image, and evaluation values for each sample, to obtain an annotation-based evaluation model, which may include:
[0139] (1) Merge each source domain sample image with its corresponding sample label to generate multiple training sample images;
[0140] (2) The initial evaluation model is trained based on multiple training sample images and the sample evaluation values corresponding to each training image to obtain the labeled evaluation model.
[0141] Specifically, for each source domain sample image, the source domain sample image can be merged with the corresponding sample annotation to generate a training sample image. Then, the initial evaluation model is trained based on the training sample image and the corresponding sample evaluation value to obtain the annotation evaluation model.
[0142] In one example, such as Figure 6 As shown, the initial evaluation model can employ a convolutional neural network. The source domain sample image can be a 512×512 three-channel image, i.e., the 512×512×3 source dataset image shown in the figure. Based on the 512×512×1 single-channel standard image of the source domain sample image, 512×512×1 random labels are randomly generated, and the intersection-over-union ratio (IoU) between the standard labels and the random labels is calculated to obtain the evaluation value of the random labels for the source domain sample image, i.e., the label evaluation shown in the figure. Then, the 512×512 three-channel image and the 512×512 single-channel labels are merged to generate a new 512×512 four-channel image, resulting in the training sample images, i.e., the training sample set shown in the figure. Labels are assigned to these four-channel images according to the calculated evaluation values, and a convolutional neural network is used for training. A sigmoid activation layer is used to map the model results to the range of 0-1, thus obtaining the label evaluation model.
[0143] Taking ResNet50 as an example for labeling and evaluation models, such as Figure 7As shown, ResNet50 is a deep residual network that is easy to optimize and has a relatively low computational burden, containing 49 convolutional layers and 1 fully connected layer. The annotation evaluation model proposed in this application uses the feature extraction part of ResNet50, and adds batch normalization on the last fully connected layer to accelerate the model's convergence speed. Batch normalization can internally store the exponential moving average of the mean and variance of each batch of data read during training, so that even if the mean and variance change over time during training, the feature data can still be adaptively normalized. Overfitting is avoided by using Dropout. Dropout refers to temporarily discarding neural network units from the network with a certain probability during the training process of a deep learning network. The Smooth L1 Loss function can be used to reduce the model's sensitivity to outliers and anomalies, enabling smoother model convergence. The Smooth L1 Loss function is a regression loss function.
[0144] In the above embodiments, the annotation evaluation mechanism can intuitively understand the recognition effect of the first image recognition model after transfer, and select high-quality target domain sample images. The first prediction annotation of the target domain sample images is selectively corrected, and the target domain sample image is then input into the first image recognition model for continuous iteration until the recognition effect reaches the set threshold to obtain the second image recognition model. This method can enhance the interpretability of the transfer process and significantly improve the adaptability of the second image recognition model to the target domain.
[0145] The above embodiments illustrate the specific acquisition process of the first image recognition model and the annotation evaluation model. The following will further illustrate the specific acquisition process of the second image recognition model in conjunction with the accompanying drawings and embodiments.
[0146] In one possible implementation, step 204, which trains a first image recognition model based on the evaluation values of multiple first prediction labels, obtains a second image recognition model suitable for the target domain, and determines the recognition results of the second image recognition model for multiple target domain sample images, may include:
[0147] (1) Determine the ratio of target domain sample images in the target dataset whose evaluation values are greater than or equal to a preset threshold based on the evaluation values of multiple first prediction annotations.
[0148] (2) If the determined ratio is greater than or equal to the preset ratio, the first image recognition model is set as the second image recognition model applicable to the target domain.
[0149] (3) Set the first prediction label as the recognition result of multiple target domain sample images.
[0150] Specifically, if the evaluation value is greater than or equal to the preset threshold, it can be determined that the first predicted label matches the real label or standard label well. If the ratio of target domain sample images with evaluation values greater than or equal to the preset threshold in the target dataset is greater than or equal to the preset ratio, it indicates that the first image recognition model can accurately identify target domain sample images, and the first image recognition model can be applied to the target domain.
[0151] In one possible implementation, step 204, which trains a first image recognition model based on the evaluation values of multiple first prediction labels, obtains a second image recognition model suitable for the target domain, and determines the recognition results of the second image recognition model for multiple target domain sample images, may further include:
[0152] (4) If the determined ratio is less than the preset ratio, then select the image to be corrected from the target domain sample images whose evaluation value is less than the preset threshold.
[0153] (5) Receive correction information for the image to be corrected, correct the first prediction label of the image to be corrected based on the correction information, so that the evaluation value of the corrected first prediction label is greater than or equal to a preset threshold, and make the ratio of target domain sample images with evaluation values greater than or equal to the preset threshold greater than or equal to a preset ratio.
[0154] (6) Train the first image recognition model based on the target domain sample images with evaluation values greater than or equal to the preset threshold, obtain the second image recognition model, and obtain the recognition results of the second image recognition model for multiple target domain sample images.
[0155] Specifically, selecting the image to be corrected from the target domain sample images with evaluation values less than a preset threshold can include:
[0156] The number of samples to be corrected is determined based on the ratio of target domain sample images whose evaluation values are greater than or equal to a preset threshold and the preset ratio.
[0157] From the target domain sample images with evaluation values less than a preset threshold, select the target domain sample image with the largest number of evaluation values to be corrected and set it as the image to be corrected.
[0158] In one example, the preset threshold is 0.6, the preset ratio is 80%, and the target dataset contains 10,000 target domain sample images. These 10,000 target domain sample images are input into the first image recognition model. If there are 8,000 target domain sample images with a first predicted label evaluation value greater than or equal to 0.6, then the first image recognition model is suitable for the target domain. If there are fewer than 8,000 target domain sample images with a first predicted label evaluation value greater than or equal to 0.6, for example, only 7,000, then 1,000 target domain sample images with higher first predicted label evaluation values are selected from those with evaluation values less than 0.6. These are the images to be corrected. The first predicted labels of these images to be corrected are then corrected, resulting in a total of 8,000 target domain sample images with a first predicted label evaluation value greater than or equal to 0.6. The first image recognition model is then retrained using these 8,000 corrected target domain sample images to obtain the second image recognition model.
[0159] Specifically, the first image recognition model is trained based on target domain sample images with evaluation values greater than or equal to a preset threshold to obtain the second image recognition model, including:
[0160] The first image recognition model is trained based on target domain sample images with evaluation values greater than or equal to a preset threshold to obtain the trained first image recognition model.
[0161] The trained first image recognition model is used as the new first image recognition model. The steps of recognizing the target dataset, obtaining the first predicted label, evaluating the first predicted label to obtain the evaluation value, determining the ratio of target domain sample images in the target dataset whose evaluation value is greater than or equal to a preset threshold, selecting the image to be corrected, correcting the first predicted label of the image to be corrected, and training the first image recognition model are repeated until the ratio determined by the evaluation value of the first predicted label output by the first image recognition model is greater than or equal to the preset ratio. The trained first recognition model is then set as the second recognition model.
[0162] In one example, the preset threshold is 0.6, the preset ratio is 80%, and the target dataset contains 10,000 target domain sample images. These 10,000 target domain sample images are input into the first image recognition model. If fewer than 8,000 target domain sample images have a first predicted label evaluation value greater than or equal to 0.6 (for example, only 7,000), then from these target domain sample images with a first predicted label evaluation value less than 0.6, the 1,000 target domain sample images with higher first predicted label evaluation values are selected. These are the images to be corrected, and the first predicted labels of these images are corrected. A total of 8,000 target domain sample images with a first predicted label evaluation value greater than or equal to 0.6 are obtained after correction. The first image recognition model is retrained using target domain sample images. Then, 10,000 target domain sample images are repeatedly input into the first image recognition model. It is determined whether the number of target domain sample images with a first predicted label evaluation value greater than or equal to 0.6 is greater than or equal to 8,000. If the condition is met, a second image recognition model is obtained. If the condition is not met, the process of selecting the image to be corrected, correcting the first predicted label of the image to be corrected, and retraining the first image recognition model using target domain sample images with a first predicted label evaluation value greater than or equal to 0.6 is repeated until 10,000 target domain sample images are input into the trained first image recognition model and the number of target domain sample images with a first predicted label evaluation value greater than or equal to 0.6 is greater than or equal to 8,000.
[0163] To more clearly illustrate the image processing method of this application, the following will further explain the image processing method of this application with examples.
[0164] Taking building identification in remote sensing imagery as an example, such as Figure 8 As shown, given source domain sample images with standard annotations, and a remote sensing image of a specific region A is obtained, the task is to identify buildings within the remote sensing image of region A. The specific process is as follows:
[0165] The initial recognition model is trained based on the source domain sample images and the standard annotations of each source domain sample image to obtain the first image recognition model.
[0166] The standard annotations of each source domain sample image are randomly classified to obtain the sample annotations of each source domain sample image, and the sample evaluation value corresponding to each sample annotation is obtained.
[0167] The initial evaluation model is trained based on multiple source domain sample images, sample annotations for each source domain sample image, and evaluation values for each sample to obtain the annotation evaluation model.
[0168] Based on the first image recognition model, the remote sensing image of region A is identified to obtain the first predicted label for the remote sensing image of region A;
[0169] The first predicted labels of multiple remote sensing images of region A are evaluated based on the label evaluation model, and the evaluation values of multiple first predicted labels are obtained.
[0170] Determine the proportion of remote sensing images in region A whose evaluation values are greater than or equal to a preset threshold;
[0171] If the determined ratio is greater than or equal to the preset ratio, then the first image recognition model is set as the second image recognition model applicable to region A.
[0172] The identification results of the remote sensing image with the first predicted label set as region A;
[0173] If the determined ratio is less than the preset ratio, then the image to be corrected is selected from the remote sensing images whose evaluation value is less than the preset threshold.
[0174] Receive correction information for the image to be corrected, and correct the first predicted annotation of the image to be corrected based on the correction information;
[0175] The first image recognition model is trained on remote sensing images whose evaluation values are greater than or equal to a preset threshold until the evaluation values of the first predicted annotations output by the trained first image recognition model meet the preset ratio condition. Then, the second image recognition model is obtained, and the recognition results for the remote sensing images of region A are obtained.
[0176] In the example above, a label evaluation model was used, which can generate a large number of random labels for training and evaluate the first predicted label. This enhances the interpretability of the model results while ensuring generalization ability, and is beneficial for manual verification and improvement of model parameters.
[0177] Automatic screening of target domain sample images based on annotation evaluation models can significantly reduce the cost of manual intervention and significantly improve the adaptability of neural networks to the target domain.
[0178] The image processing method described above evaluates the first predicted annotations of multiple target domain sample images using an annotation evaluation model, obtains evaluation values for multiple first predicted annotations, and then retrains the first image recognition model using the evaluation values to obtain a second image recognition model suitable for the target domain. The annotation evaluation model can intuitively understand the accuracy of the first predicted annotations, thereby ensuring that the adaptability of the second image recognition model obtained after transfer can be effectively improved, thus ensuring the recognition accuracy of the second image recognition model.
[0179] In addition, by selecting high-quality target domain sample images, selectively correcting the first predicted annotations of the target domain sample images, and then inputting the target domain sample images into the first image recognition model for continuous iteration until the recognition effect reaches the set threshold, a second image recognition model is obtained. This method can enhance the interpretability of the transfer process and significantly improve the adaptability of the second image recognition model to the target domain.
[0180] The image processing method proposed in this application can achieve good results in the field of image recognition by applying deep neural networks to data from different fields based on known data and models.
[0181] Figure 9 This is a schematic diagram of the structure of an image processing apparatus provided in an embodiment of this application. Figure 9 As shown, the device includes:
[0182] The acquisition module 901 is used to acquire the target dataset to be identified; the target dataset includes multiple target domain sample images; wherein, the target domain sample images are sample images of the target domain to be identified;
[0183] The first recognition module 902 is used to recognize the target dataset based on the first image recognition model and obtain the first predicted annotation of multiple target domain sample images of the target dataset;
[0184] The evaluation module 903 is used to evaluate the first predicted annotations of multiple target domain sample images based on the annotation evaluation model, and obtain the evaluation values of the multiple first predicted annotations; the evaluation values are used to represent the matching degree between the first predicted annotations and the real annotations of the target domain sample images.
[0185] The second recognition module 904 is used to train the first image recognition model based on the evaluation values of multiple first prediction labels, obtain a second image recognition model applicable to the target domain, and determine the recognition results of the second image recognition model for multiple target domain sample images.
[0186] In one possible implementation, the image processing device 90 further includes a training module for:
[0187] The initial recognition model is trained based on multiple preset source domain sample images and the standard annotation of each source domain sample image to obtain the first image recognition model.
[0188] Generate sample annotations for each source domain sample image based on the standard annotations of each source domain sample image, and obtain the sample evaluation value corresponding to each sample annotation.
[0189] The initial evaluation model is trained based on multiple source domain sample images, the sample annotations of each source domain sample image, and the evaluation values of each sample to obtain the annotation evaluation model.
[0190] In one possible implementation, when the training module generates sample annotations for each source domain sample image based on the standard annotations of each source domain sample image, it specifically performs the following:
[0191] Multiple standard labels are randomly classified to obtain multiple random labels, and these random labels are set as sample labels for multiple source domain sample images.
[0192] In one possible implementation, when the training module obtains the sample evaluation value corresponding to each sample label, it specifically uses the following:
[0193] Determine the degree of overlap between each sample label and the standard label, and determine the sample evaluation value based on the degree of overlap.
[0194] In one possible implementation, when the training module trains the initial evaluation model based on multiple source domain sample images, the sample annotations for each source domain sample image, and the evaluation value for each sample to obtain the labeled evaluation model, it is specifically used for:
[0195] Merge each source domain sample image with its corresponding sample annotation to generate multiple training sample images;
[0196] The initial evaluation model is trained based on multiple training sample images and the corresponding evaluation values for each training image to obtain an annotated evaluation model. In one possible implementation, when the second recognition module 904 trains the first image recognition model based on the evaluation values of multiple first predicted annotations, obtains a second image recognition model applicable to the target domain, and determines the recognition results of the second image recognition model for multiple target domain sample images, it is specifically used for:
[0197] The proportion of target domain sample images in the target dataset whose evaluation values are greater than or equal to a preset threshold is determined based on the evaluation values of multiple first prediction annotations.
[0198] If the determined ratio is greater than or equal to the preset ratio, then the first image recognition model is set as the second image recognition model applicable to the target domain.
[0199] The first prediction label is set as the recognition result of multiple target domain sample images.
[0200] In one possible implementation, the second identification module 904 is further used for:
[0201] If the determined ratio is less than the preset ratio, then the image to be corrected is selected from the target domain sample images whose evaluation value is less than the preset threshold.
[0202] Receive correction information for the image to be corrected, correct the first predicted label of the image to be corrected based on the correction information, so that the evaluation value of the corrected first predicted label is greater than or equal to a preset threshold, and make the ratio of target domain sample images with evaluation values greater than or equal to the preset threshold greater than or equal to a preset ratio.
[0203] The first image recognition model is trained based on target domain sample images with evaluation values greater than or equal to a preset threshold, and the second image recognition model is obtained. The recognition results of the second image recognition model for multiple target domain sample images are then obtained.
[0204] In one possible implementation, when the second recognition module 904 selects the image to be corrected from the target domain sample images with evaluation values less than a preset threshold, it is specifically used for:
[0205] The number of samples to be corrected is determined based on the ratio of target domain sample images whose evaluation values are greater than or equal to a preset threshold and the preset ratio.
[0206] From the target domain sample images with evaluation values less than a preset threshold, select the target domain sample image with the largest number of evaluation values to be corrected and set it as the image to be corrected.
[0207] In one possible implementation, when the second recognition module 904 trains the first image recognition model based on target domain sample images with evaluation values greater than or equal to a preset threshold to obtain the second image recognition model, it is specifically used for:
[0208] The first image recognition model is trained based on target domain sample images with evaluation values greater than or equal to a preset threshold to obtain the trained first image recognition model.
[0209] The trained first image recognition model is used as the new first image recognition model. The steps of recognizing the target dataset, obtaining the first predicted label, evaluating the first predicted label to obtain the evaluation value, determining the ratio of target domain sample images in the target dataset whose evaluation value is greater than or equal to a preset threshold, selecting the image to be corrected, correcting the first predicted label of the image to be corrected, and training the first image recognition model are repeated until the ratio determined by the evaluation value of the first predicted label output by the first image recognition model is greater than or equal to the preset ratio. The trained first recognition model is then set as the second recognition model.
[0210] The image processing device described above evaluates the first predicted annotations of multiple target domain sample images using an annotation evaluation model, obtains evaluation values for multiple first predicted annotations, and then retrains the first image recognition model using the evaluation values to obtain a second image recognition model suitable for the target domain. The annotation evaluation model can intuitively understand the accuracy of the first predicted annotations, thereby ensuring that the adaptability of the second image recognition model obtained after transfer can be effectively improved, thus ensuring the recognition accuracy of the second image recognition model.
[0211] In addition, by selecting high-quality target domain sample images, selectively correcting the first predicted annotations of the target domain sample images, and then inputting the target domain sample images into the first image recognition model for continuous iteration until the recognition effect reaches the set threshold, a second image recognition model is obtained. This method can enhance the interpretability of the transfer process and significantly improve the adaptability of the second image recognition model to the target domain.
[0212] The image processing method proposed in this application can achieve good results in the field of image recognition by applying deep neural networks to data from different fields based on known data and models.
[0213] Figure 10 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. For example... Figure 10 As shown, the computer device includes: a memory and a processor; at least one program, stored in the memory, which, when executed by the processor, can achieve the following compared to the prior art:
[0214] The first predicted annotations of multiple target domain sample images are evaluated by the annotation evaluation model to obtain the evaluation values of the first predicted annotations. The first image recognition model is then retrained using the evaluation values to obtain a second image recognition model suitable for the target domain. The annotation evaluation model can intuitively understand the accuracy of the first predicted annotations, thereby ensuring that the adaptability of the second image recognition model obtained after transfer can be effectively improved, thus ensuring the recognition accuracy of the second image recognition model.
[0215] In addition, by selecting high-quality target domain sample images, selectively correcting the first predicted annotations of the target domain sample images, and then inputting the target domain sample images into the first image recognition model for continuous iteration until the recognition effect reaches the set threshold, a second image recognition model is obtained. This method can enhance the interpretability of the transfer process and significantly improve the adaptability of the second image recognition model to the target domain.
[0216] The image processing method proposed in this application can achieve good results in the field of image recognition by applying deep neural networks to data from different fields based on known data and models.
[0217] In one alternative embodiment, a computer device is provided, such as Figure 10 As shown, Figure 10 The computer device 1000 shown includes a processor 1001 and a memory 1003. The processor 1001 and the memory 1003 are connected, for example, via a bus 1002. Optionally, the computer device 1000 may further include a transceiver 1004, which can be used for data interaction between the computer device and other computer devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 1004 is not limited to one type, and the structure of the computer device 1000 does not constitute a limitation on the embodiments of this application.
[0218] Processor 1001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 1001 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0219] Bus 1002 may include a pathway for transmitting information between the aforementioned components. Bus 1002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 1002 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 10 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0220] The memory 1003 may be a ROM (Read Only Memory) or other type of static storage device capable of storing static information and instructions, RAM (Random Access Memory) or other type of dynamic storage device capable of storing information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.
[0221] The memory 1003 stores application code (computer program) that executes the solution of this application, and its execution is controlled by the processor 1001. The processor 1001 executes the application code stored in the memory 1003 to implement the content shown in the foregoing method embodiments.
[0222] Computer equipment includes, but is not limited to: virtualized computer equipment, virtual machines, servers, service clusters, and user terminals.
[0223] This application provides a computer-readable storage medium storing a computer program that, when run on a computer, enables the computer to execute the corresponding content of the image processing method described in the foregoing method embodiments.
[0224] This application provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the image processing method described above.
[0225] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0226] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0227] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0228] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods shown in the above embodiments.
[0229] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0230] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0231] The modules described in the embodiments of this disclosure can be implemented in software or in hardware. The names of the modules are not necessarily limiting in certain circumstances; for example, the first recognition module can also be described as "a module for recognizing sample images of a target domain".
[0232] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
Claims
1. An image processing method, characterized in that, The method includes: Obtain the target dataset to be identified; the target dataset includes multiple target domain sample images; wherein, the target domain sample images are sample images of the target domain to be identified; The target dataset is identified based on a first image recognition model to obtain first predicted labels for multiple target domain sample images of the target dataset; wherein, the first image recognition model is an image recognition model applicable to the source domain; The first predicted annotations of the multiple target domain sample images are evaluated based on the annotation evaluation model to obtain evaluation values of the multiple first predicted annotations; the evaluation values are used to represent the matching degree between the first predicted annotations and the true annotations of the target domain sample images. The first image recognition model is trained based on the evaluation values of the multiple first prediction labels, a second image recognition model applicable to the target domain is obtained, and the recognition results of the second image recognition model for the multiple target domain sample images are determined. Before recognizing the target dataset based on the first image recognition model, the method further includes: The initial recognition model is trained based on multiple preset source domain sample images and the standard annotation of each source domain sample image to obtain the first image recognition model. Generate sample annotations for each source domain sample image based on the standard annotations of each source domain sample image, and obtain the sample evaluation value corresponding to each sample annotation; The initial evaluation model is trained based on multiple source domain sample images, sample annotations for each source domain sample image, and evaluation values for each sample to obtain the annotation evaluation model.
2. The image processing method according to claim 1, characterized in that, The step of generating sample annotations for each source domain sample image based on the standard annotations of each source domain sample image includes: The multiple standard labels are randomly classified to obtain multiple random labels, and the random labels are set as sample labels for the multiple source domain sample images.
3. The image processing method according to claim 1, characterized in that, The step of obtaining the sample evaluation value corresponding to each sample label includes: Determine the degree of overlap between each sample label and the standard label, and determine the sample evaluation value based on the degree of overlap.
4. The image processing method according to claim 1, characterized in that, The step of training an initial evaluation model based on multiple source domain sample images, sample annotations for each source domain sample image, and evaluation values for each sample to obtain the annotation evaluation model includes: Merge each source domain sample image with its corresponding sample label to generate multiple training sample images; The initial evaluation model is trained based on the multiple training sample images and the sample evaluation values corresponding to each training image to obtain the labeled evaluation model.
5. The image processing method according to claim 1, characterized in that, The process of training the first image recognition model based on the evaluation values of the plurality of first prediction labels, obtaining a second image recognition model applicable to the target domain, and determining the recognition results of the second image recognition model for the plurality of target domain sample images includes: The proportion of target domain sample images in the target dataset whose evaluation values are greater than or equal to a preset threshold is determined based on the evaluation values of the multiple first prediction annotations. If the determined ratio is greater than or equal to the preset ratio, then the first image recognition model is set as the second image recognition model applicable to the target domain; The first predicted label is set as the recognition result of the multiple target domain sample images.
6. The image processing method according to claim 5, characterized in that, Also includes: If the determined ratio is less than the preset ratio, then the image to be corrected is selected from the target domain sample images whose evaluation value is less than the preset threshold. Receive correction information for the image to be corrected, correct the first predicted label of the image to be corrected based on the correction information, so that the evaluation value of the corrected first predicted label is greater than or equal to the preset threshold, and make the ratio of the target domain sample images with the evaluation value greater than or equal to the preset threshold greater than or equal to the preset ratio. The first image recognition model is trained on the target domain sample images whose evaluation values are greater than or equal to the preset threshold, and the second image recognition model is obtained. The recognition results of the second image recognition model for the multiple target domain sample images are then obtained.
7. The image processing method according to claim 6, characterized in that, The step of selecting the image to be corrected from the target domain sample images with evaluation values less than the preset threshold includes: The number of samples to be corrected is determined based on the ratio of target domain sample images whose evaluation values are greater than or equal to a preset threshold and the preset ratio. From the target domain sample images whose evaluation values are less than the preset threshold, the target domain sample image with the largest evaluation value is selected as the image to be corrected.
8. The image processing method according to claim 6, characterized in that, The step of training the first image recognition model based on target domain sample images with evaluation values greater than or equal to the preset threshold to obtain the second image recognition model includes: The first image recognition model is trained based on the target domain sample images whose evaluation values are greater than or equal to the preset threshold, and the trained first image recognition model is obtained. The trained first image recognition model is used as the new first image recognition model, and the following steps are repeated: recognizing the target dataset, obtaining the first predicted label, evaluating the first predicted label to obtain the evaluation value, determining the ratio of target domain sample images in the target dataset whose evaluation value is greater than or equal to a preset threshold, selecting the image to be corrected, correcting the first predicted label of the image to be corrected, and training the first image recognition model, until the ratio determined by the evaluation value of the first predicted label output by the first image recognition model is greater than or equal to the preset ratio, and the trained first image recognition model is set as the second image recognition model.
9. An image processing apparatus, characterized in that, The device includes: An acquisition module is used to acquire a target dataset to be identified; the target dataset includes multiple target domain sample images; wherein, the target domain sample images are sample images of the target domain to be identified; The first recognition module is used to recognize the target dataset based on a first image recognition model to obtain first predicted labels for multiple target domain sample images of the target dataset; wherein, the first image recognition model is an image recognition model applicable to the source domain; An evaluation module is used to evaluate the first predicted annotations of the multiple target domain sample images based on an annotation evaluation model, and obtain evaluation values for the multiple first predicted annotations; the evaluation values are used to represent the degree of matching between the first predicted annotations and the true annotations of the target domain sample images. The second recognition module is used to train the first image recognition model based on the evaluation values of the plurality of first prediction labels, obtain a second image recognition model applicable to the target domain, and determine the recognition result of the second image recognition model for the plurality of target domain sample images; The training module is used to train the initial recognition model based on a set of multiple source domain sample images and the standard annotation of each source domain sample image to obtain the first image recognition model. Generate sample annotations for each source domain sample image based on the standard annotations of each source domain sample image, and obtain the sample evaluation value corresponding to each sample annotation; The initial evaluation model is trained based on multiple source domain sample images, sample annotations for each source domain sample image, and evaluation values for each sample to obtain the annotation evaluation model.
10. The image processing apparatus according to claim 9, characterized in that, When the training module generates sample annotations for each source domain sample image based on the standard annotations of each source domain sample image, it is specifically used for: The multiple standard labels are randomly classified to obtain multiple random labels, and the random labels are set as sample labels for the multiple source domain sample images.
11. The image processing apparatus according to claim 9, characterized in that, When the training module obtains the sample evaluation value corresponding to each sample label, it is specifically used for: Determine the degree of overlap between each sample label and the standard label, and determine the sample evaluation value based on the degree of overlap.
12. The image processing apparatus according to claim 9, characterized in that, When the training module trains the initial evaluation model based on multiple source domain sample images, sample annotations for each source domain sample image, and evaluation values for each sample to obtain the labeled evaluation model, it is specifically used for: Merge each source domain sample image with its corresponding sample label to generate multiple training sample images; The initial evaluation model is trained based on the multiple training sample images and the sample evaluation values corresponding to each training image to obtain the labeled evaluation model.
13. The image processing apparatus according to claim 9, characterized in that, When the second recognition module trains the first image recognition model based on the evaluation values of the plurality of first prediction labels, obtains a second image recognition model applicable to the target domain, and determines the recognition results of the second image recognition model for the plurality of target domain sample images, it is specifically used for: The proportion of target domain sample images in the target dataset whose evaluation values are greater than or equal to a preset threshold is determined based on the evaluation values of the multiple first prediction annotations. If the determined ratio is greater than or equal to the preset ratio, then the first image recognition model is set as the second image recognition model applicable to the target domain; The first predicted label is set as the recognition result of the multiple target domain sample images.
14. The image processing apparatus according to claim 13, characterized in that, The second identification module is also used for: If the determined ratio is less than the preset ratio, then the image to be corrected is selected from the target domain sample images whose evaluation value is less than the preset threshold. Receive correction information for the image to be corrected, correct the first predicted label of the image to be corrected based on the correction information, so that the evaluation value of the corrected first predicted label is greater than or equal to the preset threshold, and make the ratio of the target domain sample images with the evaluation value greater than or equal to the preset threshold greater than or equal to the preset ratio. The first image recognition model is trained on the target domain sample images whose evaluation values are greater than or equal to the preset threshold, and the second image recognition model is obtained. The recognition results of the second image recognition model for the multiple target domain sample images are then obtained.
15. The image processing apparatus according to claim 14, characterized in that, When the second recognition module selects an image to be corrected from target domain sample images with evaluation values less than the preset threshold, it is specifically used for: The number of samples to be corrected is determined based on the ratio of target domain sample images whose evaluation values are greater than or equal to a preset threshold and the preset ratio. From the target domain sample images whose evaluation values are less than the preset threshold, the target domain sample image with the largest evaluation value is selected as the image to be corrected.
16. The image processing apparatus according to claim 14, characterized in that, When the second recognition module trains the first image recognition model on target domain sample images with evaluation values greater than or equal to the preset threshold to obtain the second image recognition model, it is specifically used for: The first image recognition model is trained based on the target domain sample images whose evaluation values are greater than or equal to the preset threshold, and the trained first image recognition model is obtained. The trained first image recognition model is used as the new first image recognition model, and the following steps are repeated: recognizing the target dataset, obtaining the first predicted label, evaluating the first predicted label to obtain the evaluation value, determining the ratio of target domain sample images in the target dataset whose evaluation value is greater than or equal to a preset threshold, selecting the image to be corrected, correcting the first predicted label of the image to be corrected, and training the first image recognition model, until the ratio determined by the evaluation value of the first predicted label output by the first image recognition model is greater than or equal to the preset ratio, and the trained first image recognition model is set as the second image recognition model.
17. A computer device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the image processing method according to any one of claims 1 to 8.
18. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the image processing method according to any one of claims 1 to 8.
19. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the image processing method according to any one of claims 1 to 8.