Image processing method and device, electronic equipment and storage medium

During the training process of the deep learning model, multi-modal models are used for feature alignment and data domain division, which solves the problem of irrelevant attribute data domain division and improves the model's generalization and image processing effects.

CN118628854APending Publication Date: 2024-09-10BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310238233.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-07
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

Existing technologies are difficult to achieve flexible and low-cost division of irrelevant attribute data domains, resulting in insufficient generalization of deep learning models.

Method used

During the training process of the target model, a multi-modal model is used to perform feature alignment under preset attributes and determine the data domain classification of sample images under irrelevant attributes, achieving flexible and low-cost data domain division of irrelevant attributes.

Benefits of technology

It improves the generalization of the model and prevents the model from learning attribute features that are irrelevant to the task, thereby improving the accuracy and efficiency of image processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628854A
    Figure CN118628854A
Patent Text Reader

Abstract

The embodiment of the invention discloses an image processing method and device, electronic equipment and a storage medium. The method comprises the steps of inputting a to-be-processed image into a target model; processing the to-be-processed image through the target model to obtain a processing result of the to-be-processed image under the target task; wherein the training process of the target model comprises a process of performing feature alignment on data of each data field under a preset attribute; the preset attributes comprise attributes irrelevant to the target task; the data of each data field under the preset attribute is obtained by performing data field division on a sample image at least partially based on a multi-modal model. In a target model training process, data field classification under irrelevant attributes is firstly performed on a sample image based on a multi-modal model, and then feature alignment is performed on the target model under different categories of data fields, so that the target model can be prevented from learning features of task irrelevant attributes, and the model generalization can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] 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

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

[0003] In the process of acquiring training data, it is expected that attributes irrelevant to the task are relatively balanced in the positive and negative training data to prevent the model from learning the features of irrelevant attributes. However, it is difficult to obtain training data that is balanced on irrelevant attributes. Whether it is to carefully design various attributes and control the collection process during data collection, or to carefully annotate the attributes of the training data, it is not flexible and the cost is high.

[0004] In the prior art, attempts are made to reduce the model's fitting of irrelevant attributes through domain adaptation in order to improve the generalization of the model. However, how to reasonably divide the data domains under irrelevant attributes has become a technical problem that needs to be solved urgently. Summary of the invention

[0005] The embodiments of the present disclosure provide an image processing method, device, electronic device and storage medium, which can achieve flexible, low-cost and reasonable data domain division of irrelevant attributes and improve the generalization of the model.

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

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

[0008] 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;

[0009] 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 that are irrelevant to the target task; the data in each data domain under the preset attributes are obtained by dividing the data domain of the sample image at least partially based on a multimodal model.

[0010] In a second aspect, the present disclosure also provides an image processing device, including:

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

[0012] 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;

[0013] 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 that are irrelevant to the target task; the data in each data domain under the preset attributes are obtained by dividing the data domain of the sample image at least partially based on a multimodal model.

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

[0015] one or more processors;

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

[0017] 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.

[0018] In a fourth aspect, the embodiments of the present disclosure further provide 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.

[0019] 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 for 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 by dividing the data domain of the sample image at least partially based on the multimodal model.

[0020] During the training of the target model, the classification of the data domain of the sample image under irrelevant attributes is determined by the cross-modal feature matching capability based on the multimodal model, which can achieve flexible, low-cost, and reasonable data domain division of irrelevant attributes. On this basis, by aligning the features of the target model under data domains of different attribute categories, it is possible to prevent the target model from learning features of attributes irrelevant to the task, thereby improving the generalization of the model. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0022] Figure 1A flowchart of an image processing method provided by an embodiment of the present disclosure;

[0023] Figure 2 A schematic diagram of a framework of a feature alignment process in an image processing method provided in an embodiment of the present disclosure;

[0024] Figure 3 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;

[0025] Figure 4 A schematic diagram of a training framework for an image processing method provided in an embodiment of the present disclosure when applied to a living body detection model;

[0026] Figure 5 A schematic diagram of the structure of an image processing device provided by an embodiment of the present disclosure;

[0027] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0028] Embodiments of the present disclosure will be described in more detail below 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 being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0029] 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.

[0030] The term "including" and its variations used herein are open inclusions, 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"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0031] It should be noted that the concepts such as "first" and "second" mentioned in the present 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.

[0032] It should be noted that the modifications of "one" and "plurality" 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, it should be understood as "one or more".

[0033] 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.

[0034] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present 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.

[0035] 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) shall comply with the requirements of relevant laws, regulations and relevant provisions.

[0036] Figure 1 This is a flow chart of an image processing method provided by an embodiment of the present disclosure. The embodiment of the present disclosure is applicable to image processing, for example, to liveness detection based on facial images. The method can be executed by an image processing device, which can be implemented in the form of software and / or hardware, and can be configured in an electronic device, such as a mobile phone, a computer, or other device.

[0037] like Figure 1 As shown, the image processing method provided in this embodiment may include:

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

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

[0040] 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 that are irrelevant to the target task; the data in each data domain under the preset attributes are obtained by dividing the data domain of the sample image at least partially based on the multimodal model.

[0041] In the disclosed embodiment, the target model completed through training can be used to execute the target task for the processed image. During the training process of the target model, it is expected that the model can learn the logical relationship between the characteristics of the attributes related to the execution of the target task and the execution result, 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 characteristics of the attributes irrelevant to the target task and the execution result, so as to avoid the characteristics of the irrelevant attributes affecting the execution result.

[0042] In the embodiments of the present disclosure, at least one attribute that is not related to the target task can be pre-set based on the specific target task according to experience or experiments, 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 may include, for each preset attribute, a feature alignment process for the data of each data domain contained therein.

[0043] Among them, feature alignment of data in each data domain can be considered to make the features of data in each data domain reach a higher preset similarity. In the disclosed embodiment, based on the existing domain adaptation method, the target model can gradually have the ability to align features of data in each data domain during the training process 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 (Domain-AdversarialNeural Network, DANN), a domain adaptation method based on meta-learning (Meta-Learning) simulating domain offset, etc., which are not exhaustive here. Therefore, 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.

[0044] 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 disclosed embodiment, the multimodal model can be pre-trained based on large-scale, multimodal general sample data to obtain the ability to extract data features of at least image modality and text modality and the ability to match cross-modal features including at least image-text feature matching capabilities, that is, the multimodal pre-trained model can be used to process data of at least image modality and 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.

[0045] Before dividing the data domain based on the multimodal model, a corresponding description text can be constructed for each data domain under each preset attribute. In addition, the description text of each data domain is updated as the preset attribute is updated. That is, for a certain target task, when the corresponding preset attribute is updated (for example, added, deleted, or modified), each data domain under the updated preset attribute can also be updated accordingly, and the description text under each data domain can also be updated accordingly.

[0046] The description text is used to describe the category represented by each data domain, and can be considered as the explanatory text of each data domain. For example, Table 1 shows the description texts corresponding to the two data domain classes of bright and dark when the preset attribute is the image brightness attribute. It can be understood that the description texts corresponding to the two data domain classes of bright and dark can be constructed based on experience or experiments, and are not limited to the description texts in Table 1.

[0047] Table 1

[0048]

[0049] On this basis, the multimodal model can extract the features of the sample image and the features of the description text of each data domain under the current preset attribute based on the feature extraction capability of multimodal data; and can determine the description text matching the sample image based on the image-text feature matching capability, so that the data domain corresponding to the matching description text can be used as the data domain of the sample image, thereby realizing the data domain division of the sample image under the current preset attribute. Correspondingly, the target model can perform feature alignment on the data of each data domain (i.e., the sample image) contained therein for the current preset attribute.

[0050] After the target model has the ability to align the features of each data domain under the current preset attribute, it can also select the next preset attribute as the current preset attribute and obtain the description text corresponding to each data domain under the current preset attribute again. Correspondingly, the multimodal model can perform domain division of the sample image based on the description text obtained again; the target model can perform feature alignment on the data of each data domain based on the sample image after the domain division again. In this way, the target model can be prevented from learning the logical relationship between the features and execution results of multiple irrelevant attributes, which can improve the generalization of the model.

[0051] In some implementations, the target model can also perform feature alignment on the data of each data domain under at least two preset attributes at the same time to improve the efficiency of optimizing the generalization of the model. 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 (e.g., bright or dark) under the brightness attribute, and the second data domain B (e.g., 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.

[0052] Different from the traditional method of obtaining balanced training data on irrelevant attributes during data collection or data annotation, or dividing data domains based on experiments or experience, the technical solution of the disclosed embodiment can rely on the cross-modal feature matching capability of a large-scale multimodal preset model, and achieve data domain division of sample images under different preset attributes by updating the description text of each data domain under different preset attributes, thereby achieving flexible, universal, low-cost, and explicit domain division. Among them, the displayed domain division can be understood as the classification basis of the domain division is known.

[0053] 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 for 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 by dividing the data domain of the sample image at least partially based on the multimodal model.

[0054] During the training of the target model, the classification of the data domain of the sample image under irrelevant attributes is determined by the cross-modal feature matching capability based on the multimodal model, which can achieve flexible, low-cost, and reasonable data domain division of irrelevant attributes. On this basis, by aligning the features of the target model under data domains of different attribute categories, it is possible to prevent the target model from learning features of attributes irrelevant to the task, thereby improving the generalization of the model.

[0055] 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. 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 that is difficult to predict the accuracy of each sample image based on the first feature as the target, 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.

[0056] For example, Figure 2 FIG. 1 is a schematic diagram of a feature alignment process in an image processing method provided by an embodiment of the present disclosure. Figure 2 As shown, in the image processing method provided in this embodiment, the feature alignment process in the training process of the target model may include:

[0057] First, the first feature of the sample image is extracted through the 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.

[0058] Then, the first data domain of the sample image under the 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.

[0059] 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 attribute determined by the multimodal model. Wherein, while extracting the first feature and predicting the first data domain, the second data domain of each of the sample images mentioned above 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.

[0060] Finally, the target model is trained with the goal of increasing the domain partition loss so that the target model can align 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 attribute, if the domain partition loss is larger, it can be considered that it is more difficult to predict the accurate data domain of each sample image based on the first feature. By training the target model with this as the goal, the first features extracted by the target model under different data domains can achieve a higher similarity, that is, the first features have been aligned in different data domains for these task-irrelevant attributes, and the 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, and has greater generalization.

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

[0062] 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 may simultaneously determine its second data domain A (e.g., bright or dark) under the brightness attribute, and the second data domain B (e.g., high or low) under the clarity attribute. The first data domain C (e.g., bright or dark) under the brightness attribute and the first data domain D (e.g., 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 may 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 may be determined based on the second data domain B and the first data domain D; and then the final domain division loss may be determined based on the domain division sub-loss 1 and the domain division sub-loss 2.

[0063] Among them, the weighted loss of each domain partitioning sub-loss can be used as the final domain partitioning loss. For example, domain partitioning sub-loss 1 and 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), it will cause the irrelevant brightness attribute to affect the image processing results more. 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 capability under the brightness attribute.

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

[0065] See again Figure 2, 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 into 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 the preset attributes. In the stage where the trained target model performs the target task on the processed image, the second network structure may not play a role.

[0066] In these optional implementations, gradient inversion can enable the first features extracted by the target model in different data domains to achieve a higher similarity, so as to achieve domain adaptation of the target model.

[0067] In some optional implementations, the multimodal model may include an image encoder, a text encoder, and a cross-modal feature matching module. Figure 3 FIG. 1 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. Figure 3 As shown, in these optional implementations, the step of determining the second data field may include:

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

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

[0070] Next, the target text feature that matches the image feature is determined from each text feature through the cross-modal feature matching module. For example, the similarity between the image feature and each text feature can be calculated through the cross-modal feature matching module, and the text feature with the highest similarity can be selected as the target text feature that matches the image feature.

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

[0072] 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.

[0073] The technical solution of the disclosed 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 that 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, which means that the target model has the ability to align the features of each data domain under preset attributes.

[0074] 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 public concept. The 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.

[0075] 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 the present 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.

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

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

[0078] Then, the first data domain of the sample image under the preset attribute is predicted according to the first feature. Here, the current preset attribute can be selected from each preset attribute in turn, and the first data domain of the sample image under the current preset attribute is predicted.

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

[0080] Among them, 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 through the image encoder to obtain image features; encoding the description text of each data domain under the current preset attribute through the text encoder to obtain each text feature; determining the target text feature that matches the image feature from each text feature through 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.

[0081] 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.

[0082] Among them, training the target model with the goal of increasing the domain partition loss can include: determining the optimization gradient for predicting the first feature of the first data domain with the goal of reducing the domain partition loss; reversing the optimization gradient to obtain the reversed gradient of the first feature, and iterating the target model according to the reversed gradient.

[0083] Among them, after the liveness detection model has the feature alignment capability of each data domain under the current preset attribute, the next preset attribute can be selected as the current preset attribute, and the above steps can be repeated until the liveness detection model has the feature alignment capability of each data domain under each preset attribute. In addition, the target model can also perform feature alignment on the data of each data domain under at least two preset attributes at the same time to improve the efficiency of optimizing the generalization of the model.

[0084] In addition, in addition to the above-mentioned attributes related to image quality such as brightness and clarity, the preset attributes may also include other attributes, such as image content attributes, etc. The image content attributes, such as whether the image contains a preset object, whether the preset object in the image is a preset action, etc., are not exhaustively listed here.

[0085] 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. 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 each irrelevant attribute and the execution result, thereby improving the detection accuracy.

[0086] 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 public concept. The 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.

[0087] Figure 5 The image processing device provided in this embodiment is applicable to image processing, for example, to liveness detection based on facial images.

[0088] like Figure 5 As shown, the image processing device provided by the embodiment of the present disclosure may include:

[0089] An input module 510 is used to input the image to be processed into the target model;

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

[0091] 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 that are irrelevant to the target task; the data in each data domain under the preset attributes are obtained by dividing the data domain of the sample image at least partially based on the multimodal model.

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

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

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

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

[0096] Determining a domain partition loss according to the first data domain and a second data domain of a sample image under a preset attribute determined by the multimodal model;

[0097] 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.

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

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

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

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

[0102] Determine the target text features that match the image features from each text feature through a cross-modal feature matching module;

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

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

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

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

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

[0108] 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.

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

[0110] 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.

[0111] Reference below Figure 6 , which shows an electronic device (eg, Figure 6 The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0112] like Figure 6 As shown, 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 to a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. 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.

[0113] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, 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 Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0114] 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 contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a 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 executed.

[0115] 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. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0116] The embodiments of the present disclosure provide a computer storage medium on which a computer program is stored. When the program is executed by a processor, the image processing method provided by the above embodiments is implemented.

[0117] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above 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 device, 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 a 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, which may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a 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 of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate, or transmit programs 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 of the above.

[0118] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (Hyper Text Transfer Protocol), and may 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 future developed network.

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

[0120] 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 for 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 by dividing the data domain of the sample image at least partially based on the multimodal model.

[0121] 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 separate 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 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).

[0122] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square 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 square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0123] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the names of the units and modules do not, in some cases, limit the units and modules themselves.

[0124] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, 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), etc.

[0125] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may 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 may 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.

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

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

[0128] 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;

[0129] 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 that are irrelevant to the target task; the data in each data domain under the preset attributes are obtained by dividing the data domain of the sample image at least partially based on a multimodal model.

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

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

[0132] Extracting a first feature of the sample image by using the target model;

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

[0134] Determining a domain partition loss according to the first data domain and a second data domain of the sample image under a preset attribute determined by the multimodal model;

[0135] 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.

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

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

[0138] Correspondingly, the step of determining the second data domain includes:

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

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

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

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

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

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

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

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

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

[0148] 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.

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

[0150] 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.

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

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

[0153] 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;

[0154] 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 that are irrelevant to the target task; the data in each data domain under the preset attributes are obtained by dividing the data domain of the sample image at least partially based on a multimodal model.

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

[0156] A model training module, used for extracting the first feature of the sample image through the target model;

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

[0158] Determining 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;

[0159] 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.

[0160] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. 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 a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0161] 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 are 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.

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

Claims

1. An image processing method, It is characterized in that 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, It is characterized in that 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, It is characterized in that 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, It is characterized in that The description text of each data field is updated as the preset attribute is updated.

5. The method according to claim 2, It is characterized in that 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, It is characterized in that 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, It is characterized in that 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, It is characterized in that 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, It is characterized in that The electronic device comprises: 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.