Image processing method and apparatus, and electronic device and storage medium

By aligning data domain features and dividing multi-modal models under preset attributes in image processing, the problem of difficulty in obtaining balanced data of irrelevant attributes in image processing is solved, and the generalization and detection accuracy of the model are improved.

WO2024183592A1PCT designated stage expired Publication Date: 2024-09-12BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/079143
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-07
Filing Date
2024-02-28
Publication Date
2024-09-12

AI Technical Summary

Technical Problem

It is difficult to obtain balanced training data on irrelevant attributes in image processing with the existing technology, resulting in poor model generalization, and the data domain division in the domain adaptive method is inflexible and costly.

Method used

During the training process of the target model, the data of each data domain under the preset attributes are feature aligned, and the multi-modal model is used to divide the data domain of the sample image to prevent the model from learning features of irrelevant attributes and improve generalization.

Benefits of technology

It achieves flexible and low-cost division of irrelevant attribute data domains, prevents the model from learning irrelevant attribute features, and improves the generalization and detection accuracy of the image processing model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024079143_12092024_PF_FP_ABST
    Figure CN2024079143_12092024_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the embodiments of the present disclosure are an image processing method and apparatus, and an electronic device and a storage medium. The method comprises: inputting an image to be processed into a target model; and processing said image by means of the target model, so as to obtain a processing result of said image under a target task, wherein a training process of the target model comprises a feature alignment process performed for data in each data domain under a preset attribute, the preset attribute comprises an attribute unrelated to the target task, and the data of each data domain under the preset attribute is obtained by means of performing data domain division on a sample image at least partially on the basis of a multi-modal model. During a training process of a target model, data domain classification under an unrelated attribute is firstly performed on a sample image on the basis of a multi-modal model, and then the target model is made to perform feature alignment under different types of data domains, such that the target model can be prevented from learning features of an attribute unrelated to a task, and the model generalization can thus be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Image processing method, device, electronic device and storage medium

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on March 7, 2023, with application number 202310238233.4 and invention name “An image processing method, device, electronic device and storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field

[0003] The embodiments of the present disclosure relate to the field of data processing technology, and in particular to an image processing method, device, electronic device, and storage medium. Background Art

[0004] Deep learning algorithms have become a commonly used image processing method, in which the training data of deep learning models can be considered the determining factor of the algorithm's performance.

[0005] When acquiring training data, it is desirable to maintain a relatively balanced distribution of attributes irrelevant to the task across both positive and negative training data to prevent the model from learning features of irrelevant attributes. However, obtaining training data that is balanced across irrelevant attributes is difficult. Neither meticulously designing attributes and controlling the data collection process nor meticulously labeling the training data with attributes offers flexibility and is costly.

[0006] Existing technologies attempt to reduce the model's fit to irrelevant attributes through domain adaptation to improve model generalization. However, how to properly divide the data domains under irrelevant attributes has become a technical problem that needs to be solved urgently.

[0007] Summary of the Invention

[0008] Embodiments of the present disclosure provide an image processing method, apparatus, electronic device, and storage medium.

[0009] In a first aspect, an embodiment of the present disclosure provides an image processing method, comprising:

[0010] Input the image to be processed into the target model;

[0011] Processing the image to be processed by the target model to obtain a processing result of the image to be processed under the target task;

[0012] Among them, the training process of the target model includes a feature alignment process for the data of each data domain under preset attributes; the preset attributes include attributes unrelated to the target task; the data of each data domain under the preset attributes are obtained at least in part by dividing the sample image into data domains based on a multimodal model.

[0013] In a second aspect, the embodiments of the present disclosure further provide an image processing device, including:

[0014] An input module, used to input the image to be processed into the target model;

[0015] An output module, configured to process the image to be processed using the target model to obtain a processing result of the image to be processed under the target task;

[0016] Among them, the training process of the target model includes a feature alignment process for the data of each data domain under preset attributes; the preset attributes include attributes unrelated to the target task; the data of each data domain under the preset attributes are obtained at least in part by dividing the sample image into data domains based on a multimodal model.

[0017] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:

[0018] one or more processors;

[0019] a storage device for storing one or more programs,

[0020] When the one or more programs are executed by the one or more processors, the one or more processors implement the image processing method as described in any one of the embodiments of the present disclosure.

[0021] In a fourth aspect, an embodiment of the present disclosure further provides a storage medium comprising computer-executable instructions, which, when executed by a computer processor, are used to execute the image processing method as described in any one of the embodiments of the present disclosure.

[0022] The technical solution of the embodiment of the present disclosure is to input the image to be processed into the target model; process the image to be processed through the target model to obtain the processing result of the image to be processed under the target task; wherein, the training process of the target model includes a feature alignment process of the data in each data domain under preset attributes; the preset attributes include attributes unrelated to the target task; the data in each data domain under the preset attributes are obtained at least in part by dividing the sample image into data domains based on a multimodal model. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.

[0024] FIG1 is a schematic flow chart of an image processing method provided by an embodiment of the present disclosure;

[0025] FIG2 is a schematic diagram of a framework of a feature alignment process in an image processing method provided by an embodiment of the present disclosure;

[0026] FIG3 is a schematic diagram of a framework of a second data domain determination step in an image processing method provided by an embodiment of the present disclosure;

[0027] FIG4 is a schematic diagram of a training framework for an image processing method provided by an embodiment of the present disclosure when applied to a living body detection model;

[0028] FIG5 is a schematic structural diagram of an image processing device provided by an embodiment of the present disclosure;

[0029] FIG6 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0030] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.

[0031] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0032] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.

[0033] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0034] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".

[0035] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0036] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0037] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) must comply with the requirements of relevant laws, regulations and relevant provisions.

[0038] Figure 1 is a flow chart of an image processing method provided by an embodiment of the present disclosure. This embodiment of the present disclosure is applicable to image processing scenarios, such as liveness detection based on facial images. The method can be performed by an image processing device, which can be implemented in software and / or hardware and can be configured in electronic devices such as mobile phones and computers.

[0039] As shown in FIG1 , the image processing method provided in this embodiment may include:

[0040] S110, inputting the image to be processed into the target model;

[0041] S120, processing the image to be processed by the target model to obtain a processing result of the image to be processed under the target task;

[0042] Among them, the training process of the target model includes a feature alignment process for data in each data domain under preset attributes; the preset attributes include attributes unrelated to the target task; the data in each data domain under the preset attributes are at least partially obtained by dividing the sample image into data domains based on a multimodal model.

[0043] In the disclosed embodiments, the trained target model can be used to execute the target task on the processed image. During the training process of the target model, it is expected that the model can learn the logical relationship between the features of attributes relevant to the target task and the execution results, so as to better execute the target task. At the same time, it is necessary to prevent the model from learning the logical relationship between the features of attributes unrelated to the target task and the execution results, so as to prevent the features of unrelated attributes from affecting the execution results.

[0044] In an embodiment of the present disclosure, at least one attribute that is not related to the target task can be pre-set based on experience or experiments based on a specific target task, which can be referred to as a preset attribute in the present disclosure. Among them, each data domain under the preset attribute can be understood as at least two categories when classifying data based on the preset attribute. For example, when the preset attribute is an image brightness attribute, each data domain under the preset attribute can include two data domains, bright and dark. Accordingly, the training process of the target model can include, for each preset attribute, a feature alignment process for the data of each data domain contained therein.

[0045] Among them, feature alignment of data in each data domain can be considered as making the features of data in each data domain reach a higher preset similarity. In the embodiment of the present disclosure, the target model can be gradually equipped with the ability to feature align data in each data domain during training based on the existing domain adaptation method, so as to improve the generalization of the target model. Among them, the existing domain adaptation method may include but is not limited to a domain adaptation method based on a domain adversarial neural network (DANN), a domain adaptation method based on meta-learning to simulate domain offset, etc., which are not exhaustively listed here. Thus, when the trained target model is executing the target task, the features of the data in each data domain under the preset attributes can be considered as invariants, which can prevent the features of irrelevant attributes from affecting the execution results.

[0046] In the process of feature alignment of the target model, at least part of the data of each data domain used can be determined based on the multimodal model. In the embodiment of the present disclosure, the multimodal model can be pre-trained based on large-scale, multimodal general sample data to obtain the ability to extract at least the data features of the image modality and the text modality and the cross-modal feature matching capability including at least the image-text feature matching capability, that is, the multimodal pre-trained model can be used to process at least the data of the image modality and the text modality. Furthermore, based on the feature extraction capability and image-text feature matching capability of the multimodal model, the sample image can be divided into data domains under preset attributes. Among them, the sample image can be considered as an image in the training sample set of the target model.

[0047] Before data domain segmentation based on the multimodal model, corresponding descriptive text can be constructed for each data domain under each preset attribute. Furthermore, the descriptive text for each data domain is updated as the preset attribute is updated. That is, for a specific task, when the corresponding preset attribute is updated (e.g., added, deleted, or modified), the data domains under the updated preset attribute are also updated accordingly, and the descriptive text for each data domain is also updated accordingly.

[0048] The descriptive text is used to describe the category represented by each data field and can be considered as explanatory text for each data field. For example, Table 1 shows the descriptive text corresponding to the bright and dark data fields when the preset attribute is image brightness. It should be understood that the descriptive text corresponding to the bright and dark data fields can be constructed based on experience or experimentation and is not limited to the descriptive text in Table 1.

[0049] Table 1

[0050] On this basis, the multimodal model can extract the features of the sample image and the features of the descriptive text of each data domain under the current preset attributes based on the feature extraction capability of multimodal data. Furthermore, based on the image-text feature matching capability, it can determine the descriptive text that matches the sample image, and thus use the data domain corresponding to the matching descriptive text as the data domain of the sample image, thereby achieving data domain division of the sample image under the current preset attributes. Accordingly, the target model can perform feature alignment on the data (i.e., sample images) contained in each data domain for the current preset attributes.

[0051] Once the target model has the ability to align features across data domains under the current preset attribute, it can select the next preset attribute as the current preset attribute and reacquire the descriptive text corresponding to each data domain under the current preset attribute. Accordingly, the multimodal model can perform domain segmentation of the sample image based on the reacquired descriptive text; and the target model can perform feature alignment on the data across the data domains based on the sample image after the re-domain segmentation. This prevents the target model from learning the logical relationship between features and execution results of multiple unrelated attributes, thereby improving the model's generalization.

[0052] In some implementations, the target model can also simultaneously perform feature alignment on the data of each data domain under at least two preset attributes to improve the efficiency of optimizing the generalization of the model. For example, it is assumed that the preset attributes can include brightness and clarity; the data domain under the brightness attribute can include bright and dark; the data domain under the clarity attribute can include high and low. For the same sample image, the multimodal model can simultaneously determine its second data domain A (for example, bright or dark) under the brightness attribute, and the second data domain B (for example, high or low) under the clarity attribute. Thus, the target model can simultaneously perform feature alignment based on the data of each data domain under the brightness attribute and the clarity attribute of the sample image.

[0053] Unlike traditional methods of acquiring balanced training data across irrelevant attributes during data collection or annotation, or partitioning data domains based on experiments or experience, the technical solutions of the disclosed embodiments leverage the cross-modal feature matching capabilities of a large-scale multimodal pre-set model to partition the data domains of sample images under different pre-set attributes by updating the descriptive text of each data domain under different pre-set attributes. This allows for flexible, universal, low-cost, and explicit domain partitioning. The explicit domain partitioning can be understood as meaning that the classification benchmark for the domain partitioning is known.

[0054] The technical solution of the embodiment of the present disclosure is to input the image to be processed into the target model; process the image to be processed through the target model to obtain the processing result of the image to be processed under the target task; wherein, the training process of the target model includes a feature alignment process of the data in each data domain under preset attributes; the preset attributes include attributes unrelated to the target task; the data in each data domain under the preset attributes are obtained at least in part by dividing the sample image into data domains based on a multimodal model.

[0055] During target model training, the cross-modal feature matching capabilities of the multimodal model are leveraged to determine the classification of the sample image's data domain under irrelevant attributes, enabling flexible, cost-effective, and reasonable data domain partitioning. Furthermore, by aligning the target model's features across data domains of different attribute categories, the target model is prevented from learning features of attributes irrelevant to the task, thereby improving the model's generalization.

[0056] The various optional schemes in the image processing method provided in the embodiment of the present disclosure and the above embodiment can be combined. The image processing method provided in this embodiment describes in detail the feature alignment process in the target model training process. After the target model extracts the first feature of each sample image, by training the target model with the data domain where it is difficult to accurately predict each sample image based on the first feature, the first features extracted by the target model in different data domains can achieve a high degree of similarity, which can enable the target model to have the ability to align the features of each data domain under preset attributes.

[0057] For example, FIG2 is a schematic diagram of a framework of a feature alignment process in an image processing method provided by an embodiment of the present disclosure. As shown in FIG2 , in the image processing method provided by this embodiment, the feature alignment process during the training process of the target model may include:

[0058] First, a first feature of a sample image is extracted using a target model, wherein the target model may include a first network structure for extracting image features, so as to extract the first feature of each sample image based on the first network structure.

[0059] Then, a first data domain of the sample image under a preset attribute is predicted based on the first feature. Each first feature can be input into an existing second network structure for predicting image categories based on image features, so as to predict the first data domain of each sample image under the preset attribute based on the second network structure.

[0060] Next, the domain partition loss is determined based on the first data domain and the second data domain of the sample image under the preset attributes determined by the multimodal model. Partitioning loss is determined. While extracting the first feature and predicting the first data domain, the second data domain of each sample image can also be determined by the multimodal model. Thus, the domain partition loss can be determined based on each first data domain and each second data domain. Exemplarily, a first prediction vector can be generated from each first data domain, a second prediction vector can be generated from each second data domain, and the loss between the first prediction vector and the second prediction vector (e.g., cross entropy loss) can be determined as the domain partition loss.

[0061] Finally, the target model is trained with the goal of increasing the domain partition loss so that the target model aligns the first features of the sample images under each data domain. Since the first feature is used to determine the first data domain of the sample image under the preset attributes, the greater the domain partition loss, the more difficult it is to predict the accurate data domain of each sample image based on the first feature. By training the target model with this goal, the first features extracted by the target model under different data domains can achieve a high degree of similarity. That is, the first features have been aligned in different data domains for these task-irrelevant attributes, and image processing operations based on the first features will not be affected by these irrelevant attributes. As a result, the target model can have the ability to align features of each data domain under the preset attributes, with greater generalization.

[0062] Furthermore, in some implementations, the feature alignment process during target model training may also include simultaneously aligning data in each data domain under at least two preset attributes. In this case, domain partitioning sub-losses under the at least two preset attributes may be determined based on a first data domain of a sample image under the at least two preset attributes and a second data domain of the sample image under the at least two preset attributes determined by the multimodal model, and a final domain partitioning loss may be determined based on each domain partitioning sub-loss.

[0063] Exemplarily, it is assumed that the preset attributes may include brightness and clarity; the data domain under the brightness attribute may include bright and dark; the data domain under the clarity attribute may include high and low. For the same sample image, the multimodal model can simultaneously determine its second data domain A (for example, bright or dark) under the brightness attribute, and the second data domain B (for example, high or low) under the clarity attribute. The first data domain C (for example, bright or dark) under the brightness attribute and the first data domain D (for example, high or low) under the clarity attribute are predicted based on the first feature extracted by the target model. At this time, the domain division sub-loss 1 under the brightness attribute can be determined based on the second data domain A and the first data domain C, and the domain division sub-loss 2 under the clarity attribute can be determined based on the second data domain B and the first data domain D; and then the final domain division loss can be determined based on the domain division sub-loss 1 and the domain division sub-loss 2.

[0064] Among them, the weighted loss of each domain partitioning sub-loss can be used as the final domain partitioning loss. For example, the domain partitioning sub-loss 1 and the domain partitioning sub-loss 2 can be weighted to obtain the final domain partitioning loss. In the process of calculating the weighted loss of each domain partitioning sub-loss, the weight coefficient of each domain partitioning sub-loss can be determined according to the distribution of the training sample set in the corresponding preset attribute. For example, if the training sample set has an obvious imbalance in the distribution of positive and negative examples under the irrelevant brightness attribute (for example, the positive examples are all bright and the negative examples are all dark), the irrelevant brightness attribute will cause the image processing results to be more affected. In this case, the weight coefficient of the domain partitioning sub-loss corresponding to the brightness attribute can be increased to make the target model pay more attention to the feature alignment ability under the brightness attribute.

[0065] In some optional implementations, training the target model with the goal of increasing the domain partition loss may include: determining an optimization gradient for predicting a first feature of the first data domain with the goal of reducing the domain partition loss; inverting the optimization gradient to obtain a reversed gradient of the first feature, and iterating the target model according to the reversed gradient.

[0066] Referring to Figure 2 again, the second network structure may include, for example, a gradient reversal layer (GRL) and a classifier. During the forward propagation of the first feature, GRL may pass the first feature to the classifier for processing to obtain a first data domain. The domain partition loss may be determined by the first data domain and the second data domain. Afterwards, the optimized gradient δ of the first feature input to the first classifier may be determined with the goal of reducing the domain partition loss; then, the optimized gradient δ may be reversed by GRL to obtain a reversed gradient -δ; finally, the reversed gradient -δ may be passed to the target model so that the target model adjusts the model parameters based on the reversed gradient -δ. It is understandable that the second network structure is only effective during the training phase of the target model to assist the target model in aligning the features of the data in each data domain under preset attributes. The second network structure may not play a role in the stage where the trained target model performs the target task on the processed image.

[0067] In these optional implementations, gradient reversal can enable the first features extracted by the target model in different data domains to achieve a higher similarity, thereby achieving domain adaptation of the target model.

[0068] In some optional implementations, the multimodal model may include an image encoder, a text encoder, and a cross-modal feature matching module. For example, FIG3 is a schematic diagram of a framework for determining the second data domain in an image processing method provided by an embodiment of the present disclosure. As shown in FIG3 , in these optional implementations, the step of determining the second data domain may include:

[0069] First, the sample image is encoded by an image encoder to obtain image features.

[0070] Then, the description text of each data field under the preset attribute is encoded by the text encoder to obtain each text feature.

[0071] Next, a cross-modal feature matching module is used to determine a target text feature that matches the image feature from among the text features. For example, the cross-modal feature matching module can calculate the similarity between the image feature and each text feature, and select the text feature with the highest similarity as the target text feature that matches the image feature.

[0072] Finally, the data domain corresponding to the target text feature is used as the second data domain corresponding to the sample image.

[0073] In these optional implementations, the data domain of the sample image is divided under preset attributes based on the feature extraction capability and image-text feature matching capability of the multimodal model.

[0074] The technical solution of the disclosed embodiments describes in detail the feature alignment process during target model training. After the target model extracts the first feature of each sample image, by training the target model on data domains where it is difficult to accurately predict the sample image based on the first feature, the first features extracted by the target model in different data domains can achieve a high degree of similarity, thus enabling the target model to align features across data domains under preset attributes.

[0075] In addition, the image processing method provided in the embodiment of the present disclosure and the image processing method provided in the above embodiment belong to the same disclosed concept. Technical details not fully described in this embodiment can be referred to the above embodiment, and the same technical features have the same beneficial effects in this embodiment and the above embodiment.

[0076] The various optional schemes in the image processing method provided in the embodiment of the present disclosure and the above-mentioned embodiment can be combined. In the image processing method provided in this embodiment, the target model may include a liveness detection model, and the preset attributes may include at least one of the following: image brightness, image sharpness, image color temperature, image saturation, and image clarity. Among them, the liveness detection model can be used to perform the target task of detecting whether a facial image is a real facial image. By aligning the features of each data domain under preset attributes such as image brightness, image sharpness, image color temperature, image saturation, and image clarity during the training process of the liveness detection model, the generalization of the model can be improved, and the liveness detection model can be prevented from learning the logical relationship between the features of irrelevant attributes and the execution results, thereby improving the detection accuracy.

[0077] For example, Figure 4 is a schematic diagram of a training framework for a liveness detection model in an image processing method provided by an embodiment of the present disclosure. As shown in Figure 4, in the image processing method provided by this embodiment, the training process of the liveness detection model may include:

[0078] First, the first feature of the facial image is extracted through the living body detection model.

[0079] Then, a first data domain of the sample image under a preset attribute is predicted based on the first feature, wherein a current preset attribute can be selected from each preset attribute in sequence, and the first data domain of the sample image under the current preset attribute is predicted.

[0080] Next, a domain partition loss is determined based on the first data domain and a second data domain of the sample image under preset attributes determined by the multimodal model.

[0081] The multimodal model may include an image encoder, a text encoder, and a cross-modal feature matching module. The step of determining the second data domain may include: encoding the sample image using the image encoder to obtain image features; encoding the descriptive text of each data domain under the current preset attributes using the text encoder to obtain each text feature; determining a target text feature that matches the image feature from each text feature using the cross-modal feature matching module; and using the data domain corresponding to the target text feature as the second data domain corresponding to the sample image.

[0082] Finally, the target model is trained with the goal of increasing the domain division loss so that the target model can align the first features of the sample images under each data domain.

[0083] The training of the target model with the goal of increasing the domain partition loss may include: determining an optimization gradient for predicting a first feature of the first data domain with the goal of reducing the domain partition loss; reversing the optimization gradient to obtain a reversed gradient of the first feature, and iterating the target model according to the reversed gradient.

[0084] After the liveness detection model has achieved feature alignment for each data domain under the current preset attribute, it can select the next preset attribute as the current preset attribute, and repeat the above steps until the liveness detection model has achieved feature alignment for each data domain under each preset attribute. In addition, the target model can also simultaneously perform feature alignment on data from each data domain under at least two preset attributes to improve the efficiency of optimizing the generalization of the model.

[0085] In addition to the aforementioned image quality-related attributes such as brightness and clarity, the preset attributes may also include other attributes, such as image content attributes. Image content attributes, such as whether the image contains a preset object or whether the preset object in the image is a preset action, are not exhaustive here.

[0086] In the technical solution of the embodiment of the present disclosure, the target model may include a liveness detection model, and the preset attributes may include at least one of the following: image brightness, image sharpness, image color temperature, image saturation, and image clarity. The liveness detection model can be used to perform the target task of detecting whether a facial image is a real facial image. By aligning the features of each data domain under preset attributes such as image brightness, image sharpness, image color temperature, image saturation, and image clarity during the training process of the liveness detection model, the generalization of the model can be improved, and the liveness detection model can be prevented from learning the logical relationship between the features of irrelevant attributes and the execution results, thereby improving detection accuracy.

[0087] In addition, the image processing method provided in the embodiment of the present disclosure and the image processing method provided in the above embodiment belong to the same disclosed concept. Technical details not fully described in this embodiment can be referred to the above embodiment, and the same technical features have the same beneficial effects in this embodiment and the above embodiment.

[0088] Figure 5 is a schematic diagram of the structure of an image processing device provided by an embodiment of the present disclosure. The image processing device provided by this embodiment is applicable to image processing scenarios, such as liveness detection based on facial images.

[0089] As shown in FIG5 , the image processing apparatus provided by the embodiment of the present disclosure may include:

[0090] Input module 510, used for inputting the image to be processed into the target model;

[0091] An output module 520 is used to process the image to be processed using the target model to obtain a processing result of the image to be processed under the target task;

[0092] Among them, the training process of the target model includes a feature alignment process for data in each data domain under preset attributes; the preset attributes include attributes unrelated to the target task; the data in each data domain under the preset attributes are at least partially obtained by dividing the sample image into data domains based on a multimodal model.

[0093] In some optional implementations, the image processing apparatus may further include:

[0094] The model training module can be used to perform feature alignment based on the following steps:

[0095] Extracting the first feature of the sample image through the target model;

[0096] Predicting a first data domain of the sample image under a preset attribute according to the first feature;

[0097] determining a domain partition loss based on the first data domain and a second data domain of the sample image under preset attributes determined by the multimodal model;

[0098] The target model is trained with the goal of increasing the domain division loss so that the target model aligns the first features of the sample images under each data domain.

[0099] In some optional implementations, the multimodal model includes an image encoder, a text encoder, and a cross-modal feature matching module;

[0100] Accordingly, the model training module may be used to determine the second data domain based on the following steps:

[0101] Encode the sample image through the image encoder to obtain image features;

[0102] The description text of each data field under the preset attribute is encoded by a text encoder to obtain each text feature;

[0103] Through the cross-modal feature matching module, the target text features that match the image features are determined from the various text features;

[0104] The data domain corresponding to the target text feature is used as the second data domain corresponding to the sample image.

[0105] In some optional implementations, the description text of each data field is updated as the preset attributes are updated.

[0106] In some optional implementations, the model training module can be used to:

[0107] determining an optimization gradient for predicting a first feature of a first data domain with the goal of reducing a domain partition loss;

[0108] The optimization gradient is reversed to obtain the reverse gradient of the first feature, and the target model is iterated according to the reverse gradient.

[0109] In some optional implementations, the target model includes a living body detection model, and the preset attributes include at least one of the following: image brightness, image sharpness, image color temperature, image saturation, and image clarity.

[0110] The image processing device provided by the embodiments of the present disclosure can execute the image processing method provided by any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.

[0111] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.

[0112] Reference is now made to FIG6 , which illustrates a schematic diagram of the structure of an electronic device (e.g., a terminal device or server in FIG6 ) 600 suitable for implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. The electronic device illustrated in FIG6 is merely an example and should not limit the functionality and scope of use of the embodiments of the present disclosure.

[0113] As shown in Figure 6, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. Various programs and data required for the operation of the electronic device 600 are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0114] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although FIG. 6 shows the electronic device 600 with various devices, it should be understood that not all of the devices shown are required to be implemented or present. More or fewer devices may alternatively be implemented or present.

[0115] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the image processing method of the embodiment of the present disclosure are performed.

[0116] The electronic device provided by the embodiment of the present disclosure and the image processing method provided by the above embodiment belong to the same disclosed concept. For technical details not fully described in this embodiment, please refer to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0117] An embodiment of the present disclosure provides a computer storage medium having a computer program stored thereon. When the program is executed by a processor, the image processing method provided by the above embodiment is implemented.

[0118] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM) or flash memory (FLASH), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.

[0119] In some embodiments, the client and server can communicate using any currently known or later developed network protocol, such as HTTP (Hypertext Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or later developed network.

[0120] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0121] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: inputs the image to be processed into the target model; processes the image to be processed through the target model to obtain the processing result of the image to be processed under the target task; wherein, the training process of the target model includes a feature alignment process of the data in each data domain under preset attributes; the preset attributes include attributes unrelated to the target task; the data in each data domain under the preset attributes are obtained at least in part based on the data domain division of the sample image based on the multimodal model.

[0122] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0123] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0124] The units involved in the embodiments described in this disclosure may be implemented in software or hardware, wherein the names of the units and modules do not, in certain circumstances, limit the units and modules themselves.

[0125] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: Field Programmable Gate Array (FPGA), Application Specific Integrated Circuit (ASIC), Application Specific Standard Parts (ASSP), System on Chip (SOC), Complex Programmable Logic Device (CPLD), and the like.

[0126] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0127] According to one or more embodiments of the present disclosure, there is provided an image processing method, the method comprising:

[0128] Input the image to be processed into the target model;

[0129] Processing the image to be processed by the target model to obtain a processing result of the image to be processed under the target task;

[0130] Among them, the training process of the target model includes a feature alignment process for the data of each data domain under preset attributes; the preset attributes include attributes unrelated to the target task; the data of each data domain under the preset attributes are obtained at least in part by dividing the sample image into data domains based on a multimodal model.

[0131] According to one or more embodiments of the present disclosure, there is provided an image processing method, further comprising:

[0132] In some optional implementations, the feature alignment process includes:

[0133] extracting a first feature of the sample image by using the target model;

[0134] predicting a first data domain of the sample image under the preset attribute according to the first feature;

[0135] determining a domain partition loss based on the first data domain and a second data domain of the sample image under preset attributes determined by the multimodal model;

[0136] The target model is trained with the goal of increasing the domain division loss, so that the target model aligns the first features of the sample images under each data domain.

[0137] According to one or more embodiments of the present disclosure, there is provided an image processing method, further comprising:

[0138] In some optional implementations, the multimodal model includes an image encoder, a text encoder, and a cross-modal feature matching module;

[0139] Accordingly, the step of determining the second data field includes:

[0140] Encoding the sample image by the image encoder to obtain image features;

[0141] Encoding the description text of each data field under the preset attribute by the text encoder to obtain each text feature;

[0142] Determining, by a cross-modal feature matching module, a target text feature that matches the image feature from among the text features;

[0143] The data domain corresponding to the target text feature is used as the second data domain corresponding to the sample image.

[0144] According to one or more embodiments of the present disclosure, there is provided an image processing method, further comprising:

[0145] In some optional implementations, the description text of each data field is updated as the preset attribute is updated.

[0146] According to one or more embodiments of the present disclosure, there is provided an image processing method, further comprising:

[0147] In some optional implementations, training the target model with the goal of increasing the domain partition loss includes:

[0148] determining an optimization gradient for predicting a first feature of the first data domain with the goal of reducing the domain partition loss;

[0149] The optimized gradient is reversed to obtain a reverse gradient of the first feature, and the target model is iterated according to the reverse gradient.

[0150] According to one or more embodiments of the present disclosure, there is provided an image processing method, further comprising:

[0151] In some optional implementations, the target model includes a living body detection model, and the preset attributes include at least one of the following: image brightness, image sharpness, image color temperature, image saturation, and image clarity.

[0152] According to one or more embodiments of the present disclosure, there is provided an image processing apparatus, including:

[0153] An input module, used to input the image to be processed into the target model;

[0154] An output module, configured to process the image to be processed using the target model to obtain a processing result of the image to be processed under the target task;

[0155] Among them, the training process of the target model includes a feature alignment process for the data of each data domain under preset attributes; the preset attributes include attributes unrelated to the target task; the data of each data domain under the preset attributes are obtained at least in part by dividing the sample image into data domains based on a multimodal model.

[0156] According to one or more embodiments of the present disclosure, there is provided an image processing apparatus, further comprising:

[0157] A model training module, configured to extract a first feature of the sample image through the target model;

[0158] predicting a first data domain of the sample image under the preset attribute according to the first feature;

[0159] determining a domain partition loss based on the first data domain and a second data domain of the sample image under the preset attribute determined by the multimodal model;

[0160] The target model is trained with the goal of increasing the domain division loss, so that the target model aligns the first features of the sample images under each data domain.

[0161] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also encompasses other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in the present disclosure.

[0162] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0163] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.

Claims

1. An image processing method, include: Input the image to be processed into the target model; Processing the image to be processed by the target model to obtain a processing result of the image to be processed under the target task; The training process of the target model includes a feature alignment process for data in each data domain under preset attributes; The preset attributes include attributes that are unrelated to the target task; the data of each data domain under the preset attributes is obtained by dividing the data domain of the sample image at least partially based on a multimodal model.

2. The method according to claim 1, in, The feature alignment process includes: Extracting a first feature of the sample image by using the target model; Predicting a first data domain of the sample image under the preset attribute according to the first feature; Determine a domain partition loss according to the first data domain and a second data domain of the sample image under the preset attribute determined by the multimodal model; The target model is trained with the goal of increasing the domain division loss, so that the target model aligns the first features of the sample images under each data domain.

3. The method according to claim 2, in, The multimodal model includes an image encoder, a text encoder and a cross-modal feature matching module; Correspondingly, the step of determining the second data domain includes: Encoding the sample image by the image encoder to obtain image features; The description text of each data field under the preset attribute is encoded by the text encoder to obtain each text feature; Determining, by a cross-modal feature matching module, a target text feature that matches the image feature from among the text features; The data domain corresponding to the target text feature is used as the second data domain corresponding to the sample image.

4. The method according to claim 3, in, The description text of each data field is updated as the preset attribute is updated.

5. The method according to claim 2, in, The target model is trained with the goal of increasing the domain partition loss, including: With the goal of reducing the domain partition loss, determining an optimization gradient for predicting a first feature of the first data domain; The optimized gradient is reversed to obtain a reverse gradient of the first feature, and the target model is iterated according to the reverse gradient.

6. The method according to any one of claims 1 to 5, in, The target model includes a living body detection model, and the preset attributes include at least one of the following: image brightness, image sharpness, image color temperature, image saturation and image clarity.

7. An image processing device, include: An input module, used for inputting the image to be processed into the target model; An output module, used to process the image to be processed through the target model to obtain a processing result of the image to be processed under the target task; The training process of the target model includes a feature alignment process for data in each data domain under preset attributes; The preset attributes include attributes that are unrelated to the target task; the data of each data domain under the preset attributes is obtained by dividing the data domain of the sample image at least partially based on a multimodal model.

8. The device according to claim 7, in, Also includes: A model training module, used for extracting the first feature of the sample image through the target model; Predicting a first data domain of the sample image under the preset attribute according to the first feature; Determine a domain partition loss according to the first data domain and a second data domain of the sample image under the preset attribute determined by the multimodal model; The target model is trained with the goal of increasing the domain division loss, so that the target model aligns the first features of the sample images under each data domain.

9. An electronic device, include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the image processing method as described in any one of claims 1 to 6.

10. A storage medium comprising computer executable instructions, wherein the computer executable instructions are used to perform the image processing method according to any one of claims 1 to 6 when executed by a computer processor.

Citation Information

Patent Citations

  • Domain self-adaptive equipment operation inspection system and method

    CN112183788A

  • Model pre-training method, model training method and image processing method

    CN113435529A

  • Three-dimensional image classification method, apparatus and device, and computer readable storage medium

    CN114239560A

  • Content auditing method, training method of content auditing model and related device

    CN115565038A

  • Domain adaptation

    US20220067433A1