The embodiment of the invention provides a ray-based three-dimensional face optimization method, a device and an electronic device, the method comprising: obtaining a target picture and judging whether a face image in the target picture is in a non-uniform light condition; If the human face image is in non-uniform light condition, inputting the human face image to a pre-trained image generation model to obtain an optimized human face image after light adjustment of the human face image; processing the optimized face image based on a pre-trained convolution neural network model to obtain parameter information of a first three-dimensional face model; processing a three-dimensional average face model according to the first three-dimensional face model parameter information to obtain a three-dimensional face image corresponding to the face image. Face images taken in poor illumination environment are optimized to get clear face. At the same time, only a single picture is needed to generatea three-dimensional human face, thereby reducing the cost.
Ray-based three-dimensional human face optimization method, device and electronic device