Three-dimensional model construction method and device, electronic equipment and storage medium

By using the three-dimensional construction coefficients and lightweight network models trained for multiple iterations in the neural network model, the problem of insufficient personality recognition in the construction of three-dimensional face models in the existing technology is solved, and more accurate and efficient three-dimensional face construction is achieved. .

CN118570360APending Publication Date: 2024-08-30DOUYIN VISION CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310183823.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-28
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

When constructing a three-dimensional face model using existing technology, it is difficult to fully identify the individuality of facial features, making it difficult to construct a three-dimensional face that corresponds to a real face.

Method used

By obtaining the target image and inputting it into the neural network model, the target three-dimensional construction coefficient is obtained, and the three-dimensional construction coefficient obtained by multiple iterative training is used to construct a three-dimensional face model. A lightweight network model such as MobileNet is used, combined with a convolutional neural network and a fully connected layer. , trained using L1 constraints of coefficients and 3D feature point constraints.

Benefits of technology

It achieves a full reflection of the personality of the target image, improves the accuracy and efficiency of building a three-dimensional face model, and can more accurately construct a three-dimensional face corresponding to the target image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570360A
    Figure CN118570360A
Patent Text Reader

Abstract

The invention discloses a three-dimensional model construction method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining a target image which comprises a target object; inputting the target image into a neural network model, and obtaining a target three-dimensional construction coefficient output by the neural network model; constructing a three-dimensional model of the target object based on the target three-dimensional construction coefficient; wherein the neural network model is a model obtained by training a plurality of pieces of sample data, the sample data comprises a sample image and a three-dimensional construction coefficient corresponding to the sample image, the sample image comprises the target object, and the three-dimensional construction coefficient corresponds to the sample image. The three-dimensional construction coefficient is obtained by performing multiple iterative training based on the sample image and the initialized three-dimensional construction coefficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of image processing technology, and in particular to a three-dimensional model construction method, device, electronic device and storage medium. Background Art

[0002] Three-dimensional model construction, for example, three-dimensional face construction, can be summarized as constructing the three-dimensional shape and texture of the face based on a two-dimensional image. The relevant construction method is to train a regression network based on a large amount of data based on deep learning, obtain the coefficients corresponding to the network model through the regression network, and construct the shape and texture of the three-dimensional face based on the coefficients.

[0003] In this process, a larger network is generally used, such as a residual neural network (ResNet50). However, the use of a large amount of data can easily lead to the full learning of the common features of facial features while the individual features cannot be fully recognized, making it difficult to construct a three-dimensional face corresponding to a real face. Summary of the invention

[0004] The embodiments of the present application provide a three-dimensional model construction method, device, electronic device and storage medium, which can solve the problem that it is difficult to construct a three-dimensional face corresponding to a real face due to insufficient recognition of the individuality in facial features.

[0005] In order to solve the above technical problems, this application is implemented as follows:

[0006] In a first aspect, an embodiment of the present application provides a three-dimensional model construction method, the method comprising: obtaining a target image, the target image comprising a target object; inputting the target image into a neural network model to obtain a target three-dimensional construction coefficient output by the neural network model; based on the target three-dimensional construction coefficient, constructing a three-dimensional model of the target object; wherein the neural network model is a model obtained by training using a plurality of sample data, the sample data comprising a sample image and a three-dimensional construction coefficient corresponding to the sample image, the sample image comprising the target object, and the three-dimensional construction coefficient being obtained by performing multiple iterative training based on the sample image and the initialized three-dimensional construction coefficient.

[0007] In a second aspect, an embodiment of the present application provides a three-dimensional model construction device, which includes: a first acquisition module, used to acquire a target image, wherein the target image includes a target object; a second acquisition module, used to input the target image into a neural network model to acquire a target three-dimensional construction coefficient output by the neural network model; a construction module, used to construct a three-dimensional model corresponding to the target object based on the target three-dimensional construction coefficient; wherein the neural network model is a model obtained by training using multiple sample data, the sample data includes a sample image and a three-dimensional construction coefficient corresponding to the sample image, the sample image includes the target object, and the three-dimensional construction coefficient is obtained after multiple iterative training based on the sample image and the initialized three-dimensional construction coefficient.

[0008] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.

[0009] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0010] In an embodiment of the present application, a target image is obtained, the target image is input into a neural network model, and a target three-dimensional construction coefficient output by the neural network model is obtained; based on the target three-dimensional construction coefficient, a three-dimensional face corresponding to the target image is constructed, wherein the neural network model used is trained by a sample image and a three-dimensional construction coefficient corresponding to the sample image, and the three-dimensional construction coefficient is obtained in advance after multiple iterations based on the sample image and the initialized three-dimensional construction coefficient. Based on this, the target image is input into the neural network model to obtain a target three-dimensional construction coefficient that fully reflects the personality of the target object, and then a three-dimensional face corresponding to the target image can be constructed based on the three-dimensional construction coefficient. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0012] Figure 1 It is a flowchart of a three-dimensional model construction method provided in an embodiment of the present application;

[0013] Figure 2 It is a flow chart of a method for obtaining sample data provided in an embodiment of the present application;

[0014] Figure 3 It is a structural schematic diagram of a three-dimensional model building device provided in an embodiment of the present application;

[0015] Figure 4 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

[0017] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0018] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0019] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0020] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0021] Figure 1 A schematic diagram of a process of constructing a three-dimensional model provided in an embodiment of the present application is shown. The method can be executed by an electronic device, and the electronic device may include: a server and / or a terminal device. Figure 1 , the method may include the following steps:

[0022] Step 101: Acquire a target image, where the target image includes a target object.

[0023] The target object may include a person and / or a face.

[0024] Step 102: Input the target image into a neural network model to obtain target three-dimensional construction coefficients output by the neural network model.

[0025] In an embodiment of the present application, the neural network model is a model obtained by training using multiple sample data, the sample data includes a sample image and a three-dimensional construction coefficient corresponding to the sample image, the sample image includes the target object, and the three-dimensional construction coefficient is obtained after multiple iterative training based on the sample image and the initialized three-dimensional construction coefficient.

[0026] The target three-dimensional construction coefficient is used to construct a three-dimensional model corresponding to the target object based on the target image. Optionally, the target three-dimensional construction coefficient includes: a target identity coefficient, a target expression coefficient and a target texture coefficient.

[0027] For example, when the target object is a human face, the target three-dimensional construction coefficient may include: a human face identity coefficient α (alpha), a human face expression coefficient β (beta), and a texture coefficient δ (theta). Based on these parameters, the shape S and texture T of the three-dimensional face may be obtained in the following manner:

[0028]

[0029] in, represents the average face shape, B id and B exp are face identity and facial expression vector basis respectively.

[0030]

[0031] in, represents the average face texture, B t Vector basis for face texture.

[0032] Therefore, based on the shape S and texture T of the three-dimensional face, a three-dimensional model of the face, namely the three-dimensional face, is constructed.

[0033] Step 103: constructing a three-dimensional model corresponding to the target object based on the target three-dimensional construction coefficient.

[0034] By acquiring a target image, inputting the target image into a neural network model, and acquiring a target three-dimensional construction coefficient output by the neural network model; based on the target three-dimensional construction coefficient, constructing a three-dimensional face corresponding to the target image, wherein the neural network model used is trained by a sample image and a three-dimensional construction coefficient corresponding to the sample image, and the three-dimensional construction coefficient is obtained in advance after multiple iterations based on the sample image and the initialized three-dimensional construction coefficient. Based on this, inputting the target image into the neural network model can obtain a target three-dimensional construction coefficient that fully reflects the personality of the target object, and then the three-dimensional face corresponding to the target image can be constructed based on the three-dimensional construction coefficient.

[0035] In one implementation, the following steps are included before step 101:

[0036] Step 1011: Acquire a plurality of sample data;

[0037] Step 1012: For each of the sample data, use the sample image in the sample data as the input of the neural network model, use the three-dimensional construction coefficient in the sample data as the output of the neural network model, and train the neural network model.

[0038] In the embodiment of the present application, by inputting a sample image into a neural network model and continuously training it, the trained neural network model can recognize the target object in the input image and obtain the three-dimensional construction coefficient of the target object.

[0039] In the technical solution provided in the embodiment of the present application, the model training is divided into two stages. In the first stage, a single sample image is iteratively fitted using a gradient descent method. The parameters are no longer network outputs, but after initialization, the parameters corresponding to the single image are optimized and fitted. Because the parameters are continuously iterated for a single sample image, the effect is better than direct network output in expressing the corresponding features. After obtaining a large number of unsupervised fitting sample images and the three-dimensional construction coefficients of the sample images, after data screening, the second stage is carried out using better data to train a supervised model, namely the above-mentioned neural network model.

[0040] In one implementation, since the sample data includes sample images and three-dimensional construction coefficients, with the coefficients as direct supervision and constraints, the neural network model may include a convolutional neural network CNN extractor and an N-dimensional FC fully connected layer, where N is a preset value, for example, N is 256. In this implementation, the neural network model may be a lightweight network model, for example, a MobileNet model. The neural network model can remove the more time-consuming module of differentiable rendering in its overall structure, and only uses the L1 constraint of the coefficient and the training of the 3D landmark constraint.

[0041] For example, the L1 constraint on the coefficients can be:

[0042] L 1_supervise =w α (a second -a first )+w β (β second -β first )+w δ (δ second -δ first ),

[0043] Among them, w α is the face identity coefficient weight, α second is the face identity coefficient after the current training, α first is the face identity coefficient before the current training, w β is the facial expression coefficient weight, β second is the facial expression coefficient after the current training, β first is the facial expression coefficient before the current training, w δ is the face texture coefficient weight, δ second is the face texture coefficient after the current training, δ first is the face texture coefficient before the current training.

[0044] For example, a 3D feature point constraint can be:

[0045] Among them, N = 124, which means 124 key points on the face, q n is the 3D key point of the face detected before the current training, q′ n is the key point corresponding to the current training, w n is the weight of each key point.

[0046] In an embodiment of the present application, a lightweight network model (for example, MobileNet) can be used for training to streamline the neural network model and improve the efficiency of building the neural network model.

[0047] In a possible implementation, the three-dimensional construction parameters corresponding to the sample image can be obtained by iterating the sample image. In this possible implementation, the three-dimensional construction coefficients corresponding to the sample image are determined by the following steps:

[0048] Step 1, based on the initialized three-dimensional construction coefficients of the sample image, obtain a rendered image corresponding to the initialized three-dimensional construction coefficients. For example, a three-dimensional sample model of the sample image can be constructed based on the initialized three-dimensional construction coefficients, and then the three-dimensional sample model can be rendered in a differentiable manner to obtain a rendered image corresponding to the initialized three-dimensional construction coefficients.

[0049] Step 2: updating the three-dimensional construction coefficient of the sample image based on the difference between the rendered image and the sample image.

[0050] For example, the three-dimensional construction coefficient of the sample image may be updated based on the difference between the rendered image and the sample image, so that the difference between the rendered image obtained based on the updated three-dimensional construction coefficient and the sample image becomes smaller.

[0051] Step 3: Based on the updated three-dimensional construction coefficients, obtain a rendered image corresponding to the updated three-dimensional construction coefficients, and then based on the difference between the rendered image and the sample image, update the three-dimensional construction coefficients of the sample image until the iteration converges, and use the three-dimensional construction coefficients obtained when the iteration converges as the three-dimensional construction coefficients corresponding to the sample image.

[0052] In this step, a three-dimensional image of the sample image can be constructed based on the updated three-dimensional construction coefficients, and then the three-dimensional image is subjected to differentiable rendering to obtain a rendered image corresponding to the updated three-dimensional construction coefficients, and then the three-dimensional construction coefficients of the sample image are updated based on the difference between the rendered image and the sample image until the iteration converges. Thus, the three-dimensional image constructed based on the finally obtained three-dimensional construction coefficients can be close to the real three-dimensional image of the sample image.

[0053] Take the target object as a human face as an example. Figure 2 A flow chart of a method for obtaining sample data in one implementation is shown. Figure 2 As shown, the method may include the following steps:

[0054] Step 201: Obtain a sample face image.

[0055] Step 202: constructing a three-dimensional sample face image of the sample face image based on the initialized three-dimensional construction coefficients.

[0056] Among them, the three-dimensional construction coefficient is initialized so that the three-dimensional sample face constructed initially does not include individual features, so that it is continuously corrected in the subsequent process to continuously conform to the features of the sample image, and a three-dimensional sample face image corresponding to the sample face image can be constructed.

[0057] Optionally, the initialized three-dimensional construction coefficient may be 0.

[0058] For example, the three-dimensional construction coefficients may include a face identity coefficient α (alpha), a face expression coefficient β (beta), and a texture coefficient δ (theta). Based on these parameters, the shape S and texture T of the three-dimensional sample face can be obtained according to the above formulas 1 and 2. The dimensions of α, β, and δ can be determined according to the specific application, for example, they can be set to 256 dimensions. During initialization, α, β, and δ can all be set to 0.

[0059] Step 203: performing differentiable rendering on the three-dimensional sample face image to obtain a rendered image;

[0060] The three-dimensional sample face image is transformed from three-dimensional features to two-dimensional features through differentiable rendering, and then projected onto the sample face image to obtain a rendered image.

[0061] For example, a rendered image of the three-dimensional sample face image is obtained by a differentiable renderer, and the rendered image is a two-dimensional image.

[0062] Step 204: updating the three-dimensional construction coefficient according to the difference between the rendered image and the sample face image;

[0063] Among them, the two-dimensional rendered image can be compared with the original two-dimensional sample face image to obtain the difference between the rendered image and the sample face image. Through the difference, the three-dimensional construction coefficient is optimized to make the rendered image as close as possible to the sample face image.

[0064] Step 205: construct a three-dimensional sample face image corresponding to the sample face image based on the updated three-dimensional construction coefficient, and then return to step 203 to perform differentiable rendering on the three-dimensional sample face image until the iteration converges.

[0065] In the above method, a three-dimensional sample face image is continuously constructed based on the optimized three-dimensional construction coefficient, and then differentiable rendering is performed. The difference between the rendered face image after differentiable rendering and the original sample face image is compared, and the three-dimensional construction coefficient is optimized again. This process is repeated until the iterative convergence condition is met, and the three-dimensional construction coefficient of the sample face image is obtained.

[0066] In one implementation, iterative convergence includes: the number of iterations reaches a preset value; or the difference between the rendered face image and the sample image satisfies a preset condition.

[0067] In this implementation, determining whether the iteration converges includes: setting the number of iterations to a preset value, and when the number of iterations reaches the preset value, the iteration is considered to have converged, and the iteration is stopped, for example, the iteration is 500 times. Alternatively, determining whether the difference between the rendered image and the sample image meets a preset condition, and when the difference meets the preset condition, the iteration is considered to have converged, and the iteration is stopped, and the three-dimensional construction coefficient of the sample image at this time is determined as the constraint value of the second stage training, and the second stage training is performed again, so as to obtain a three-dimensional construction coefficient that can better reflect the characteristics of the target image.

[0068] In one implementation, the difference between the rendered image and the sample image satisfies a preset condition, including at least one of the following:

[0069] The pixel level loss value is less than a first preset value;

[0070] The key point loss value is less than a second preset value;

[0071] The identity consistency loss value is less than a third preset value;

[0072] The regulation loss value is less than a fourth preset value.

[0073] Among them, by calculating the pixel-level loss value, key point loss value, identity consistency loss value, and adjustment loss value during the iteration process, when at least one of them is less than the respective preset value, the iteration is considered to have converged, and the three-dimensional construction coefficient at this time can be used, and the iteration is stopped. That is, the three-dimensional construction coefficient corresponding to the better sample image is obtained, which can be used as the constraint value for the second stage of training.

[0074] Step 206: Using the three-dimensional construction coefficients after iterative convergence as the three-dimensional construction coefficients corresponding to the sample image.

[0075] Among them, the iteratively converged three-dimensional construction coefficient has the characteristic of being able to fully express the characteristics of the sample image, and can be used as a constraint value for the subsequent acquisition of the target three-dimensional construction coefficient for constructing the target three-dimensional face, thereby improving the accuracy of constructing the three-dimensional face.

[0076] In a specific application, the above method can be used for each sample image to obtain the three-dimensional construction coefficient corresponding to each sample image, thereby obtaining a plurality of sample data.

[0077] Based on the three-dimensional construction coefficients obtained above that can fully express the characteristics of the sample image, the target image is input into the neural network model to obtain the target three-dimensional construction coefficients. The target three-dimensional construction coefficients have the advantage of fully expressing the characteristics of the target image, thereby being able to construct a three-dimensional face corresponding to the target image with high similarity.

[0078] In an embodiment of the present application, the initialized three-dimensional construction coefficients are iteratively optimized multiple times until the difference between the acquired sample image and the rendered image meets a preset condition or the number of iterations reaches a preset value, and the iteratively optimized three-dimensional construction coefficients are obtained. Then, the target image is passed through a neural network model including the three-dimensional construction coefficients to obtain target three-dimensional construction coefficients that can fully express the characteristics of the target image, thereby constructing a three-dimensional face corresponding to the target image and with a high degree of similarity.

[0079] In one implementation, in the above step 204, the three-dimensional construction coefficients may be updated by the following steps:

[0080] Step 301: Obtain a pixel-level loss value of the rendered image relative to the sample image; wherein the pixel-level loss value is used to indicate the difference between the pixel value of each pixel of the rendered image and the pixel value of the corresponding pixel of the sample image. Through the pixel-level loss value (pixel loss), optimization can be performed based on the pixel value difference, and the lighting parameters such as the environment color, direction, distance and color of the light source can be optimized, which helps to improve the restoration of texture features.

[0081] Step 302: Obtain key point loss values ​​of the rendered image relative to the sample image; wherein the key point loss values ​​are used to indicate the difference between each key point of the rendered image and the corresponding key point of the sample image.

[0082] Step 303: Obtain an identity consistency loss value of the rendered image relative to the sample image; wherein the identity consistency loss value is used to indicate the probability of whether the rendered image and the sample image belong to the same person.

[0083] Step 304: Obtain the adjustment loss value for constructing the 3D sample image, that is, obtain the adjustment loss value for constructing the 3D sample image based on the 3D construction coefficient. The adjustment loss value is used to indicate the loss when constructing the 3D sample image based on the 3D construction coefficient of the sample image.

[0084] Step 305: Update the three-dimensional construction coefficient based on the acquired pixel-level loss value, key point loss value, identity consistency loss value and the adjustment loss value.

[0085] In an embodiment of the present application, by obtaining the pixel-level loss value, key point loss value, identity consistency loss value and the adjustment loss value in the neural network model, and comparing them with the preset value, it is determined whether it is necessary to continue to optimize the three-dimensional construction coefficient, and the pixel-level loss value, key point loss value, identity consistency loss value and the adjustment loss value are used as constraints to adjust and optimize the three-dimensional construction coefficient.

[0086] In one implementation, the pixel-level loss value of the rendered image relative to the sample image may be obtained based on the target area corresponding to the target object and the difference between the sample image and the rendered image. For example, the pixel-level loss value L is obtained by the following formula: pixel :

[0087] L pixel =mask*(I input -I render ), where mask is the target area. For example, if the target object is a face, the target area is the face area. input is the sample image, I render for said rendered image.

[0088] In one implementation, the key point loss value of the rendered image relative to the sample image can be obtained based on the number of preset key points, the preset weights, the first key points detected in the sample image, and the second key points detected on the target image and corresponding to the first key points. For example, the key point loss value L can be obtained by the following formula: lan :

[0089] Among them, N is the number of preset key points, q n is the key point obtained by pre-detection of the sample image, q′ n is the key point obtained by corresponding detection of the three-dimensional image constructed by the three-dimensional construction coefficient projected on the sample image, w n is the weight of each key point.

[0090] As an example, N is 124, which means 124 key points on the face, such as the eye head, the middle point of the lower eyelid, and the eye tail; detect each key point q of the face in the sample image n , and then detect the key points q′ corresponding to the face projected in the sample image by the three-dimensional face constructed by the three-dimensional construction coefficient n , assign each key point a corresponding weight w n , the key point loss value L is obtained through the above formula lan .

[0091] In one implementation, the identity consistency loss value of the rendered image relative to the sample image may be obtained based on the target object recognition network, the sample image, and the rendered image. For example, the identity consistency loss value L may be obtained by the following formula: arcface :

[0092] Among them, arcface is the target object (e.g., face) recognition network, I input is the sample image, I render for said rendered image.

[0093] In one implementation, in order to prevent the three-dimensional construction coefficient from being abnormal, for example, exceeding a preset value, resulting in an abnormality in the constructed three-dimensional model when the three-dimensional model is constructed according to the three-dimensional construction coefficient, a regular constraint can be performed using the following formula: Among them, i is the number of three-dimensional construction coefficients, x i is the three-dimensional construction coefficient, w i is the weight corresponding to the three-dimensional construction coefficient, and η is the fifth preset value.

[0094] The embodiment of the present application obtains three-dimensional construction coefficients based on pre-iterative optimization, inputs the target image into a neural network model, obtains target three-dimensional construction coefficients through regularization constraints, and constructs a three-dimensional model corresponding to the target object according to the target three-dimensional construction coefficients; the three-dimensional construction coefficients obtained by pre-iterative optimization are constrained by pixel-level loss values, key point loss values, identity consistency loss values ​​and the adjustment loss values, as well as regularization constraints on the target three-dimensional construction coefficients, thereby achieving full expression of the target object characteristics by the target three-dimensional construction coefficients and being able to more accurately construct a three-dimensional model according to the target three-dimensional construction coefficients.

[0095] Figure 3 Schematic diagram of a three-dimensional model building device according to an embodiment of the present invention. Figure 3 As shown, the device 300 includes: a first acquisition module 310 , a second acquisition module 320 and a construction module 330 .

[0096] The first acquisition module 310 is used to acquire a target image, wherein the target image includes a target object; the second acquisition module 320 is used to input the target image into a neural network model to acquire a target three-dimensional construction coefficient output by the neural network model; the construction module 330 is used to construct a three-dimensional model corresponding to the target object based on the target three-dimensional construction coefficient; wherein the neural network model is a model trained using a plurality of sample data, wherein the sample data includes a sample image and a three-dimensional construction coefficient corresponding to the sample image, wherein the sample image includes the target object, and the three-dimensional construction coefficient is obtained after multiple iterative training based on the sample image and the initialized three-dimensional construction coefficient.

[0097] In one implementation, the device also includes: a model training module 340, which is used to obtain multiple sample data; for each sample data, the sample image in the sample data is used as the input of the neural network model, and the three-dimensional construction coefficient in the sample data is used as the output of the neural network model to train the neural network model.

[0098] In one implementation, the three-dimensional construction coefficients corresponding to the sample image are determined in the following manner: based on the initialized three-dimensional construction coefficients of the sample image, a rendered image corresponding to the initialized three-dimensional construction coefficients is obtained; based on the difference between the rendered image and the sample image, the three-dimensional construction coefficients of the sample image are updated; based on the updated three-dimensional construction coefficients, a rendered image corresponding to the updated three-dimensional construction coefficients is obtained, and based on the difference between the rendered image and the sample image, the three-dimensional construction coefficients of the sample image are updated until the iteration converges, and the three-dimensional construction coefficients obtained when the iteration converges are used as the three-dimensional construction coefficients corresponding to the sample image.

[0099] In one implementation, based on the difference between the rendered image and the sample image, the three-dimensional construction coefficient of the sample image is updated, including: obtaining a pixel-level loss value, a key point loss value, and an identity consistency loss value of the rendered image relative to the sample image; obtaining an adjustment loss value for constructing a three-dimensional sample image, wherein the three-dimensional sample image is a three-dimensional sample image corresponding to the sample image constructed based on the three-dimensional construction coefficient, and the rendered image is obtained by performing differentiable rendering on the three-dimensional sample image; based on the obtained pixel-level loss value, key point loss value, identity consistency loss value, and the adjustment loss value, the three-dimensional construction coefficient of the sample image is updated.

[0100] In one implementation, obtaining a pixel-level loss value, a key point loss value n, and an identity consistency loss value of the rendered image relative to the sample image includes:

[0101] Acquire the pixel-level loss value based on a target area corresponding to the target object and a difference between the sample image and the rendered image;

[0102] Based on the number of preset key points, the preset weights, each first key point detected in the sample image, and second key points detected on a target image and corresponding to each first key point, the key point loss value is obtained, wherein the target image is an image obtained by projecting a three-dimensional sample image constructed by three-dimensional construction coefficients onto the sample image;

[0103] The identity consistency loss value is obtained based on the target object recognition network, the sample image and the rendered image.

[0104] In one implementation, the pixel-level loss value L is obtained by the following formula: pixel :

[0105] L pixel =mask*(I input -I render ), where mask is the target area, I input is the sample image, I render for said rendering image;

[0106] The key point loss value L is obtained by the following formula lan :

[0107] Among them, N is the number of preset key points, q n is the key point obtained by pre-detection of the sample image, q′ n w is the key point obtained by projecting the three-dimensional sample image constructed by the three-dimensional construction coefficient onto the sample image for corresponding detection, n is the weight of each key point;

[0108] The identity consistency loss value L is obtained by the following formula arcface :

[0109] Among them, arcface is a face recognition network, I input is the sample image, I render for said rendered image.

[0110] In one implementation, the iterative convergence includes: the number of iterations reaches a preset value; or the difference between the rendered image and the sample image satisfies a preset condition.

[0111] In one implementation, the difference between the rendered image and the sample image satisfies a preset condition, including at least one of the following:

[0112] The pixel level loss value is less than a first preset value;

[0113] The key point loss value is less than a second preset value;

[0114] The identity consistency loss value is less than a third preset value;

[0115] The regulation loss value is less than a fourth preset value.

[0116] In one implementation, the target three-dimensional construction coefficients include: a target identity coefficient, a target expression coefficient, and a target texture coefficient.

[0117] In one implementation, the target object includes a person and / or a face.

[0118] In one implementation, the neural network model includes: a convolutional neural network (CNN) extractor and an N-dimensional FC fully connected layer, where N is a preset value.

[0119] The three-dimensional model building device in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and the non-mobile electronic device can be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0120] The three-dimensional model construction device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0121] The three-dimensional model building device provided in the embodiment of the present application can achieve Figure 1 to Figure 2 To avoid repetition, the various processes implemented in the method embodiment are not described here.

[0122] Based on the same technical concept, an embodiment of the present application further provides an electronic device, which is used to execute the above-mentioned three-dimensional model construction method. Figure 4 A schematic diagram of the structure of an electronic device for implementing each embodiment of the present application. The electronic device may have relatively large differences due to different configurations or performances, and may include a processor 410, a communication interface 420, a memory 430, and a communication bus 440, wherein the processor 410, the communication interface 420, and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call a computer program stored in the memory 430 and run on the processor 410 to perform the following steps: obtaining a target image, wherein the target image includes a target object; inputting the target image into a neural network model to obtain a target three-dimensional construction coefficient output by the neural network model; based on the target three-dimensional construction coefficient, constructing a three-dimensional model of the target object; wherein the neural network model is a model obtained by training using multiple sample data, wherein the sample data includes a sample image and a three-dimensional construction coefficient corresponding to the sample image, wherein the sample image includes the target object, and the three-dimensional construction coefficient is obtained by performing multiple iterations of training based on the sample image and the initialized three-dimensional construction coefficient.

[0123] The specific execution steps can refer to the various steps of the above-mentioned three-dimensional model construction method embodiment, and can achieve the same technical effect. To avoid repetition, they will not be repeated here.

[0124] It should be noted that the electronic devices in the embodiments of the present application include: servers, terminals, or other devices except terminals.

[0125] The above electronic device structure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. For example, the input unit may include a graphics processing unit (GPU) and a microphone, and the display unit may be configured with a display panel in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit includes a touch panel and at least one of other input devices. The touch panel is also called a touch screen. Other input devices may include, but are not limited to, a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0126] The memory can be used to store software programs and various data. The memory may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory may include a volatile memory or a non-volatile memory, or the memory may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DRRAM).

[0127] The processor may include one or more processing units; optionally, the processor integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to the operating system, user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor.

[0128] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned three-dimensional model construction method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0129] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0130] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0131] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0132] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A three-dimensional model construction method, characterized in that: include: Acquire a target image, wherein the target image includes a target object; Inputting the target image into a neural network model to obtain a target three-dimensional construction coefficient output by the neural network model; constructing a three-dimensional model of the target object based on the target three-dimensional construction coefficient; Among them, the neural network model is a model obtained by training using multiple sample data, the sample data includes a sample image and a three-dimensional construction coefficient corresponding to the sample image, the sample image includes the target object, and the three-dimensional construction coefficient is obtained after multiple iterative training based on the sample image and the initialized three-dimensional construction coefficient.

2. The method according to claim 1, characterized in that The three-dimensional construction coefficient corresponding to the sample image is determined in the following way: Based on the initialized three-dimensional construction coefficients of the sample image, obtaining a rendered image corresponding to the initialized three-dimensional construction coefficients; Based on the difference between the rendered image and the sample image, updating the three-dimensional construction coefficient of the sample image; Based on the updated three-dimensional construction coefficients, a rendering image corresponding to the updated three-dimensional construction coefficients is obtained, and then based on the difference between the rendering image and the sample image, the three-dimensional construction coefficients of the sample image are updated until the iteration converges, and the three-dimensional construction coefficients obtained when the iteration converges are used as the three-dimensional construction coefficients corresponding to the sample image.

3. The method according to claim 2, characterized in that Based on the difference between the rendered image and the sample image, updating the three-dimensional construction coefficient of the sample image includes: Obtaining a pixel-level loss value, a key point loss value, and an identity consistency loss value of the rendered image relative to the sample image; Acquire an adjustment loss value for constructing a three-dimensional sample image, wherein the three-dimensional sample image is a three-dimensional sample image corresponding to the sample image and constructed based on the three-dimensional construction coefficient, and the rendered image is obtained by performing differentiable rendering on the three-dimensional sample image; Based on the acquired pixel-level loss value, key point loss value, identity consistency loss value and the adjustment loss value, the three-dimensional construction coefficient of the sample image is updated.

4. The method according to claim 3, characterized in that: Obtaining a pixel-level loss value, a key point loss value, and an identity consistency loss value of the rendered image relative to the sample image, including: Acquire the pixel-level loss value based on a target area corresponding to the target object and a difference between the sample image and the rendered image; Based on the number of preset key points, the preset weights, each first key point detected in the sample image, and second key points detected on a target image and corresponding to each first key point, the key point loss value is obtained, wherein the target image is an image obtained by projecting a three-dimensional sample image constructed by three-dimensional construction coefficients onto the sample image; The identity consistency loss value is obtained based on the target object recognition network, the sample image and the rendered image.

5. The method according to claim 4, characterized in that Based on the target area corresponding to the target object and the difference between the sample image and the rendered image, the pixel-level loss value is obtained, including: obtaining the pixel-level loss value L by the following formula pixel : L pixel =mask*(I input -I render ), where mask is the target area, I input is the sample image, I render for said rendering image; Based on the number of preset key points, the preset weights, the first key points detected in the sample image, and the second key points detected on the target image and corresponding to the first key points, the key point loss value is obtained, including: obtaining the key point loss value L by the following formula: lan : Among them, N is the number of preset key points, q n is the first key point, q′ n is the second key point corresponding to the first key point, w n is the weight of each key point; Based on the target object recognition network, the sample image and the rendered image, the identity consistency loss value is obtained, including: obtaining the identity consistency loss value L by the following formula arcface : Among them, arcface is the target object recognition network, I input is the sample image, I render for said rendered image.

6. The method according to claim 4, characterized in that The iterative convergence includes: The number of iterations reaches the preset value; or, The difference between the rendered image and the sample image satisfies a preset condition.

7. The method according to claim 6, characterized in that The difference between the rendered image and the sample image satisfies a preset condition, including at least one of the following: The pixel level loss value is less than a first preset value; The key point loss value is less than a second preset value; The identity consistency loss value is less than a third preset value; The regulation loss value is less than a fourth preset value.

8. The method according to any one of claims 1 to 7, wherein the neural network model comprises: A convolutional neural network (CNN) extractor and an N-dimensional FC fully connected layer, where N is a preset value.

9. The method according to any one of claims 1 to 7, characterized in that: The target three-dimensional construction coefficients include: target identity coefficients, target expression coefficients and target texture coefficients.

10. The method according to any one of claims 1 to 7, wherein the target object comprises a person and / or a face.

11. A three-dimensional model building device, characterized in that: include: A first acquisition module, used to acquire a target image, wherein the target image includes a target object; A second acquisition module is used to input the target image into the neural network model to obtain the target three-dimensional construction coefficient output by the neural network model; A construction module, used to construct a three-dimensional model corresponding to the target object based on the target three-dimensional construction coefficient; Among them, the neural network model is a model obtained by training using multiple sample data, the sample data includes a sample image and a three-dimensional construction coefficient corresponding to the sample image, the sample image includes the target object, and the three-dimensional construction coefficient is obtained after multiple iterative training based on the sample image and the initialized three-dimensional construction coefficient.

12. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the three-dimensional model construction method as described in any one of claims 1 to 10 are implemented.

13. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the steps of the three-dimensional model construction method according to any one of claims 1 to 10 are implemented.

Citation Information

Cited By

  • Three-dimensional reconstruction model training method, blood vessel three-dimensional reconstruction method and device

    CN121392139A