Voice and virtual object generation method and apparatus

By determining the target sound category features of virtual objects from object images and generating corresponding speech data, the problem of discrepancies between the speech and image of virtual objects is solved, and the rationality and consistency of speech output are achieved.

CN116778899BActive Publication Date: 2026-11-24LENOVO (BEIJING) LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310798631.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-30
Publication Date
2026-11-24
Estimated Expiration
2043-06-30

AI Technical Summary

Technical Problem

In virtual scenarios, the voice of virtual objects generated by existing technologies does not match their appearance. They usually use user-input voiceovers or fixed timbres, resulting in voice output that does not conform to the identity of the virtual object.

Method used

By obtaining the object image of the virtual object, the target sound category features are determined using an object classification model, and speech data that conforms to the sound category features is generated by combining text information. Finally, a speech synthesis model is used to synthesize the speech signal.

Benefits of technology

It achieves the matching of virtual object voice output with its image, improving the rationality and consistency of voice generation in virtual scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116778899B_ABST
    Figure CN116778899B_ABST
Patent Text Reader

Abstract

This application provides a speech generation method and apparatus. After obtaining an object image of a virtual object, the method determines the target sound category features corresponding to the virtual object based on the object image; and generates speech data that conforms to the target sound category features based on the obtained text information and the target sound category features.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a method and apparatus for generating voice and virtual objects. Background Technology

[0002] In virtual scenarios such as the metaverse, virtual anchors, and virtual reality, corresponding virtual objects can be generated according to the user's needs.

[0003] In some virtual scenarios, it is necessary to output not only virtual objects but also voice-generated audio for those virtual objects. Currently, the voice-generated audio for virtual objects is usually user-inputted voiceover or a fixed-timbre voice, resulting in the output audio not matching the appearance of the virtual object. Summary of the Invention

[0004] On the one hand, this application provides a speech generation method, including:

[0005] Obtain the object image of the virtual object;

[0006] Based on the object image, determine the target sound category features corresponding to the virtual object;

[0007] Obtain text information, which describes the speech content that the virtual object needs to output;

[0008] Based on the text information and the target sound category features, speech data that conforms to the target sound category features is generated.

[0009] In one possible implementation, determining the target sound category features corresponding to the virtual object based on the object image includes:

[0010] The object image is input into the object classification model to obtain the target object category features of the virtual object identified by the object classification model.

[0011] The target object category feature of the virtual object is determined as the target sound category feature corresponding to the virtual object.

[0012] In another possible implementation, the object classification model is trained using first image samples from at least one set of samples, with the training objective being that the object category features identified by the object classification model from the first image samples are the same as the sound category features identified by the sound classification model from the first sound samples corresponding to the first image samples.

[0013] The sample group includes: a first image sample and a first sound sample belonging to the same object.

[0014] In yet another possible implementation, the sample group is labeled with an actual object identifier;

[0015] The training objective further includes: the predicted object information of the first image sample determined by the object classification model matches the actual object identifier labeled in the sample group to which the first image sample belongs.

[0016] In another possible implementation, the object classification model is trained as follows:

[0017] Obtain at least one of the sample groups;

[0018] For any sample group, the first image sample in the sample group is input into the image classification model, the first sound sample in the sample group is input into the sound classification model, the sound category features identified by the sound classification model and the object category features identified by the image classification model are extracted, the feature similarity between the sound category features and the object category features corresponding to the sample group is determined, and the predicted object information corresponding to the first image sample determined by the image classification model is obtained.

[0019] If the training objective is not met based on the feature similarity, predicted object information, and actual object identifier corresponding to each sample group, the parameters of the image classification model are adjusted, and the operation of extracting the sound category features identified by the sound classification model and the object category features identified by the image classification model is returned until the training objective is met, and the image classification model is determined as the trained object classification model.

[0020] In another possible implementation, generating speech data that conforms to the target sound category features based on the text information and the target sound category features includes:

[0021] Based on the text information and target sound category features, speech data is constructed using a speech synthesis model to obtain speech data with the target sound category features.

[0022] Furthermore, this application also provides a method for generating virtual objects, including:

[0023] Obtain the object image used to construct the virtual object;

[0024] Based on the object image, determine the target sound category features corresponding to the virtual object;

[0025] Based on the object image, a virtual object associated with the target sound category features is constructed.

[0026] One possible implementation also includes:

[0027] Obtain text information, which describes the speech content that the virtual object needs to output;

[0028] Based on the text information, speech data with the target sound category features is generated for the virtual object.

[0029] In another aspect, this application also provides a speech generation apparatus, comprising:

[0030] The image acquisition unit is used to acquire the object image of the virtual object;

[0031] The feature determination unit is used to determine the target sound category features corresponding to the virtual object based on the object image;

[0032] A text acquisition unit is used to acquire text information, which describes the speech content that the virtual object needs to output;

[0033] The speech generation unit is used to generate speech data that conforms to the target sound category features based on the text information and the target sound category features.

[0034] In another aspect, this application also provides a virtual object generation apparatus, comprising:

[0035] An image acquisition unit is used to acquire object images for constructing virtual objects;

[0036] The feature determination unit is used to determine the target sound category features corresponding to the virtual object based on the object image;

[0037] An object construction unit is used to construct a virtual object associated with the target sound category features based on the object image. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0039] Figure 1 This paper illustrates a flowchart of a speech generation method provided in an embodiment of this application.

[0040] Figure 2 This illustration shows another flowchart of the speech generation method provided in an embodiment of this application;

[0041] Figure 3 This illustration shows a schematic diagram of the principle of training an object classification model in an embodiment of this application;

[0042] Figure 4 This paper illustrates a flowchart of a training object classification model in an embodiment of this application.

[0043] Figure 5 This illustrates another principle diagram of the training object classification model in an embodiment of this application;

[0044] Figure 6 This illustration shows a schematic diagram of the principle of training an object classification model in an application scenario according to an embodiment of this application;

[0045] Figure 7 This illustration shows a schematic diagram of a principle for generating speech data based on text information and the sound category features of virtual objects in an embodiment of this application;

[0046] Figure 8 This paper illustrates a flowchart of a virtual object generation method provided in an embodiment of this application.

[0047] Figure 9 This paper shows a schematic diagram of the composition structure of a speech generation device provided in an embodiment of this application;

[0048] Figure 10 This illustration shows a schematic diagram of the composition structure of a virtual object generation apparatus provided in an embodiment of this application;

[0049] Figure 11 A schematic diagram of the component architecture of an electronic device provided in an embodiment of this application is shown. Detailed Implementation

[0050] The solution in this application embodiment can be applied to scenarios where virtual objects are generated and voice is generated and output for virtual objects in virtual scenes such as metaverse, virtual anchors, and virtual reality.

[0051] For example, taking virtual anchors as an example, two-dimensional or three-dimensional virtual characters can be constructed as needed, and voice signals can be output based on the anchor's content as the voice content broadcast by the virtual character, so as to realize online live broadcasting or recorded broadcasting. For example, on some e-commerce platforms or some news live broadcasting platforms, the generated virtual characters can be used as anchors, and by outputting voice, the virtual characters can introduce products on e-commerce platforms or broadcast news.

[0052] Of course, depending on the application scenario, the virtual objects to be generated and the output voice content will vary, and this application does not impose any restrictions on this.

[0053] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0054] like Figure 1 As shown, it illustrates a flowchart of a speech generation method provided in an embodiment of this application. The method of this embodiment can be applied to any electronic device. The electronic device can be an independent electronic device, such as a server, or a node device in a cloud platform, cluster system, or distributed system, etc., without any limitation.

[0055] The method in this application embodiment may include:

[0056] S101, Obtain the object image of the virtual object.

[0057] The object image includes an image of the virtual object, which reflects the external characteristics of the virtual object. This includes the object category, outward personality traits, and appearance. For example, if the virtual object is a virtual character, the object image can reflect the character's gender, age group, clothing features, facial features, and other characteristics. These features can then reflect the character's traits, such as personality and emotions.

[0058] In this embodiment, the object image of the virtual object can be an object image of a virtual object that has already been constructed. When obtaining the object image, the virtual object can be either already output to the virtual scene or yet to be output to the virtual scene; there is no limitation in this regard. For example, if a three-dimensional virtual object is constructed and output in a virtual scene, then the object image of that three-dimensional virtual object can be obtained. For instance, in a live broadcast or metaverse scene, a three-dimensional virtual character can be constructed, and then the image of the constructed three-dimensional virtual character can be obtained.

[0059] The object image of a virtual object can also be an object image used to construct the virtual object within a virtual scene. For example, taking the construction of a virtual 3D character as an example, the object image can be a face image used to construct the virtual 3D task, or an object image containing a face. Based on this, this case allows for the simultaneous generation of the audio data that the virtual object needs to output during the construction process.

[0060] S102, Based on the object image, determine the target sound category features corresponding to the virtual object.

[0061] The target sound category feature is used to characterize the sound type or category to which the sound emitted by the virtual object belongs. The method of sound category classification will vary depending on the specific scenario.

[0062] Since different sound categories can differ in timbre, pitch, and loudness, the target sound category features can reflect the timbre, pitch, and loudness of the sound emitted by the virtual object.

[0063] It is understandable that since the object image of a virtual object can reflect the external appearance characteristics of the virtual object, and different virtual objects have different sound types that they possess or are suitable for, the target sound category characteristics of the virtual object can be determined by combining the object image of the virtual object.

[0064] For example:

[0065] Take, for example, a virtual character that needs to be output in a virtual scene. Considering that in real life, users of different genders, ages, heights, and physical characteristics will have very different voice types, the virtual character's voice type will also differ depending on its gender, age, height, and physical characteristics.

[0066] For example, tall and strong men generally produce deep, loud, and powerful voices. Slender men, while also producing somewhat deep voices, tend to have a more moderate volume. Delicate women, on the other hand, typically produce gentler voices, speak more slowly, and have a moderate volume.

[0067] Similarly, for virtual characters, combining the object image of the virtual task can determine the voice category features corresponding to the external features of the virtual character.

[0068] It is understandable that after determining the target sound category characteristics of the virtual object, if the virtual object to be output in the virtual scene does not change, it is not necessary to repeatedly determine the target sound category characteristics of the virtual object.

[0069] Of course, if the facial expressions or emotions of the same virtual object may also change, the operation of determining the target sound category of the virtual object can be performed after the virtual object or the virtual object's expression and posture change, without any limitation.

[0070] S103, obtain text information.

[0071] The text information describes the speech content that the virtual object needs to output. In other words, the text information is the text-based information corresponding to the speech signals that the virtual object needs to emit in the virtual scene.

[0072] For example, if you want a virtual object to broadcast a news item, then the text information could be the text information of the news item that the virtual object needs to broadcast.

[0073] The text information can be pre-generated or input by the user based on the content that the virtual scene and virtual object need to send. This application does not restrict the specific method of obtaining the text information.

[0074] S104. Based on the text information and the target sound category features, generate speech data that conforms to the target sound category features.

[0075] For example, by combining the characteristics of the target sound category, text information can be converted into a speech signal with the characteristics of that target sound category.

[0076] There are multiple ways to generate speech data that conforms to the characteristics of the target sound category by combining text information, and there are no restrictions on this.

[0077] In this application, when generating voice data for a virtual object, the target sound category characteristics of the virtual object are taken into account, so that the voice data generated for the virtual object is more consistent with the image presented by the virtual object itself.

[0078] It is understood that after generating the speech data, this application can also output the speech data into the virtual scene, so that while presenting the virtual object in the virtual scene, it can also simultaneously output speech data that is suitable for the target sound category characteristics of the virtual object.

[0079] For example, when the operation of this embodiment is performed using an electronic device that controls or outputs a virtual scene, the voice signal can be directly output to the virtual scene; when the voice data is generated by an electronic device other than the electronic device that outputs the virtual scene, the voice data can be sent to the target electronic device that outputs the virtual scene so that the voice data can be output to the virtual scene through the target electronic device.

[0080] In this embodiment, the target sound category features of the virtual object can be determined based on the object image of the virtual object, so that the determined target sound category features match the external image features of the virtual object, accurately reflecting the suitable sound features of the virtual object. Based on this, this application combines the text information corresponding to the speech content to be emitted by the virtual object to generate speech data with the target sound category features for the virtual object, thus achieving a more reasonable generation of speech signals for the virtual object, making the sound features of the speech signals emitted by the virtual object in the virtual scene more consistent with the identity or image of the virtual object.

[0081] In this application, there are various ways to determine the target sound category features of a virtual object by combining the object image of the virtual object, and no limitation is imposed on this.

[0082] The following section uses an example of a method for determining the target sound category features of a virtual object to introduce the speech generation method of this application.

[0083] like Figure 2 As shown, it illustrates another flowchart of the speech generation method provided in this application embodiment. The method of this embodiment may include:

[0084] S201, Obtain the object image of the virtual object.

[0085] S202, input the object image into the object classification model to obtain the target object category features of the virtual object identified by the object classification model.

[0086] Among them, the object classification model is a classification model that classifies objects based on object images (such as physical objects or virtual objects).

[0087] For example, taking a user as the object (this also applies to virtual characters), by combining the user's image, an object classification model can be used to identify which user the user is.

[0088] For example, if the object is a vehicle (e.g., a virtual vehicle), then by combining the vehicle image with an object classification model, the vehicle category can be identified.

[0089] Of course, this is just an example. The object classification model will classify objects differently for different objects or virtual objects, and there are no restrictions on this.

[0090] The target object category feature is a feature identified by the object classification model from the object image of the virtual object, which characterizes the classification result of the virtual object. This classification result can be a specific category or an object category. Accordingly, the target object category feature can reflect the object category or classification to which the virtual object belongs.

[0091] For example, if the virtual object is a virtual character, the object classification model can determine the classification result based on the object image of the virtual character, which can be the character type category of the virtual task or the different characters to which it belongs.

[0092] If the virtual object is not a virtual character, the object classification model can identify one of the predefined categories that virtual objects can be divided into. For example, an object classification model for animal species can identify the animal category to which the object belongs.

[0093] Understandably, object classification models extract object category features from object images (which can be virtual objects) before outputting object classification results, and then determine the object classification result based on these features. This application, however, only needs to extract the object category features identified by the object classification model from the object image.

[0094] For example, considering that the final output of an object classification model is a classification result, this application can obtain the object category features output by the layer preceding the output layer in the object classification model. For instance, taking a convolutional neural network model as an example, the features output by the convolutional layer closest to the output layer can be extracted and used as the object category features. Of course, this is merely an example; if the object classification model is another network model or another type of model, then only the features extracted from the last layer before the output layer need to be extracted, which will not be elaborated further.

[0095] For ease of differentiation, the object category features identified by the object classification model from the object image of the virtual object are called target object category features.

[0096] S203, the target object category feature of the virtual object is determined as the target sound category feature corresponding to the virtual object.

[0097] As discussed above, the sound category characteristics of a virtual object are closely related to its external appearance characteristics. The target object category characteristics of a virtual object actually reflect the category characteristics of its external appearance. Therefore, the target object category characteristics of a virtual object can be used as the sound category characteristics that characterize the sound category of the virtual object.

[0098] For ease of distinction, this application refers to the sound category features of virtual objects as target sound category features.

[0099] S204, Obtain text information.

[0100] The text information is used to describe the voice content that the virtual object needs to output.

[0101] S205, Based on text information and target sound category features, generate speech data that conforms to the target sound category features.

[0102] The above steps S204 and S205 can be found in the relevant descriptions of the previous embodiments, and will not be repeated here.

[0103] In this embodiment, the object category features of the virtual object are analyzed using the object image of the virtual object. Considering that object category features can reflect the category features related to the external image of the virtual object, and that the sound category features of the virtual object are also closely related to the external image of the virtual object, the target object category features determined based on the object image of the virtual object are used as the sound category features of the virtual object. This not only allows for a more accurate determination of the sound category features of the virtual object using the object image, but also allows for a more efficient determination of the sound category features of the virtual object using image classification technology, thereby generating speech data that conforms to the sound classification features of the virtual object in a more reasonable way.

[0104] In this embodiment, the object classification model can be based on an existing classification model. For example, taking virtual objects as virtual characters, the object classification model can be a user classification model based on images.

[0105] To improve the accuracy of the object classification model in determining the classification results, this application can also pre-train an image classification model using multiple image samples labeled with object identifiers, and use the trained image classification model as the object classification model. The object identifier can be an object category, object name, or object unique identifier. For example, using multiple image samples labeled with object identifiers, a convolutional neural network model can be trained using supervised training, and the trained convolutional neural network model can be used as the object classification model.

[0106] In one possible implementation, considering that the object classification model is based on the object image of the virtual object, if only a general image-based object classification model is used to extract object category features, the extracted object category features may be more inclined to the object's category features in the image, and there may be some discrepancies with the object's category features in the sound.

[0107] Based on this, in order to more accurately extract features that reflect the sound category of virtual objects from the object images of virtual objects using an object classification model, and to make the target object category features and the sound category features of virtual objects as consistent as possible, in this application, the object classification model is trained using a first image sample from at least one set of samples, with the training objective being that the object category features identified by the object classification model from the first image sample are the same as the sound category features identified by the sound classification model from the first sound sample corresponding to the first image sample.

[0108] The sample group includes a first image sample and a first sound sample belonging to the same object. The first sound sample corresponding to the first image sample is a first sound sample belonging to the same sample group or the same object as the first image sample.

[0109] The sound classification model can be any general-purpose sound classification model, or it can be a pre-trained sound classification model. For example, a sound classification model can be trained using multiple audio samples labeled with object identifiers. Alternatively, a neural network model or an open-source sound classification model can be trained using multiple audio samples labeled with object identifiers to obtain the final trained sound classification model; there are no restrictions on this.

[0110] Building upon the above, by continuously training the object classification model, the object category features identified by the object classification model from the first image sample are made infinitely close to the sound category features identified by the sound classification model from the first sound sample belonging to the same sample group as the first image sample. Therefore, after training the object classification model in this way, the target object category features extracted from the virtual object using the object classification model can accurately reflect the sound category features of the virtual object, thus determining the target object category features as the target sound category features of the virtual object.

[0111] Furthermore, considering the differences in the sounds of different objects, in order to identify individual differences, during the training of the object classification model, in addition to ensuring that the object category features extracted by the model are as similar as possible to the sound category features extracted by the sound classification model, it is also necessary to ensure that the object category features fully and accurately reflect the characteristics of different individual objects. Based on this, the training objective of the object classification model in this application may also include: the predicted object information of the first image sample determined by the object classification model is consistent with the actual object identifier labeled in the sample group to which the first image sample belongs.

[0112] The predicted object information of the first image sample determined by the object classification model is the classification result of the object predicted by the object classification model based on the first image sample. For example, the first image sample contains (or belongs to) an object, or the object category to which the object in the first image sample belongs, etc. The specifics are as described above and will not be repeated here.

[0113] The object identifier in the sample group label is used to indicate the object from which the sample group originates or the category to which the object from which the sample group originates belongs.

[0114] Correspondingly, if the predicted object information matches the actual object identifier labeled in the sample group corresponding to the first image sample, it indicates that the prediction accuracy of the object classification model meets the requirements, and the object information predicted by the object classification model is consistent with the actual object information corresponding to the first image sample.

[0115] Based on this, this application can use supervised training to train the object classification model, and continuously optimize the object classification model in combination with the above training objectives, thus completing the training of the object classification model.

[0116] It is understandable that the sound classification model can be trained simultaneously during the training of the object classification model. In one alternative approach, to ensure that the object classification features identified by the object classification model are more accurate and better reflect the user's characteristics in the sound category, the internal parameters of the sound classification model can be kept unchanged during the training of the object classification model, while only the parameters of the object classification model are adjusted.

[0117] like Figure 3 The diagram illustrates one implementation principle of the training object classification model in an embodiment of this application.

[0118] Depend on Figure 3 As can be seen, the sample set for training the object classification model in this application includes a first image sample and a first sound sample, and the sample set is labeled with the actual object identifier. Each time, the first image sample and the first sound sample from the same sample set need to be input into the object classification model and the sound classification model respectively.

[0119] Based on this, for each sample group, it is necessary to determine the similarity between the object category features identified by the object classification model from the first image sample and the sound classification features identified by the sound classification model from the first sound sample.

[0120] While calculating the value of the first loss function based on similarity, it is also necessary to calculate the value of the second loss function by combining the object prediction information determined by the object classification model based on the first image samples with the object identifiers labeled in the sample group. Based on this, this application needs to combine the function values ​​of the first and second loss functions to determine whether the training objectives are met, ensuring that the training of the object classification model satisfies two objectives: that the object category features and sound classification features are as similar as possible, and that the object prediction information matches the object identifiers labeled in the sample group.

[0121] For ease of understanding, combined with Figure 3 The following explanation uses a specific implementation of a training object classification model as an example.

[0122] like Figure 4 This illustrates a flowchart of a training object classification model in an embodiment of this application. The method in this embodiment may include:

[0123] S401, obtain at least one sample group.

[0124] As mentioned above, each sample group includes a first image sample and a first sound sample belonging to the same object, and the sample group is labeled with the actual object identifier corresponding to the actual object to which the sample group belongs.

[0125] S402, for any sample group, input the first image sample in the sample group into the image classification model, input the first sound sample in the sample group into the sound classification model, extract the sound category features identified by the sound classification model and the object category features identified by the image classification model, and obtain the predicted object information corresponding to the first image sample determined by the image classification model.

[0126] In this application, training can be performed based on an image classification model, and the model will be utilized... Figure 4 The image classification model trained in the example is determined to be an object classification model. The image classification model can identify the predicted object information of image samples (or object images) containing objects. This predicted object information is essentially the object classification result mentioned above. This test object information can characterize the object or object category to which the image sample (or object image) belongs.

[0127] Object category features can be extracted from the output layer of an image classification model to determine the predicted object information. For example, if an image classification model consists of multiple convolutional layers and an output layer that outputs predicted object information, then the features output by the last convolutional layer can be extracted; these features are the object category features.

[0128] Similarly, sound category features are extracted from the output layer of a sound classification model, which identifies features that have not yet been input into the output layer to predict sound categories.

[0129] In this embodiment, during the training of the object classification model, the parameters within the sound category model can be fixed, thus eliminating the need to focus on the sound category output by the sound category model.

[0130] In order for the trained object classification model to accurately identify the classification result of the object from the object image, this application also needs to obtain the predicted object information corresponding to the first image sample determined by the image classification model, so as to compare it with the actual object identifier labeled in the sample group to which the first image sample belongs.

[0131] S403, For each sample group, determine the feature similarity between the sound category features and the object category features corresponding to that sample group.

[0132] There are several ways to determine the similarity of this feature, such as calculating the cosine similarity between the sound category feature and the object category feature, or the Euclidean distance, etc., without any restrictions.

[0133] S404. Based on the feature similarity, predicted object information and actual object identifier of each sample group, determine whether the training objective is met. If yes, determine the trained object classification model of the image classification model; otherwise, proceed to step S405.

[0134] The training objective is that the object category features identified by the object classification model (which can be considered as the image classification model) from the first image sample are the same as the sound category features identified by the sound classification model from the first sound sample corresponding to the first image sample, and the predicted object information of the first image sample determined by the object classification model (which can be considered as the image classification model) matches the actual object identifier labeled in the sample group to which the first image sample belongs.

[0135] In practical applications, there are multiple ways to determine whether the training objective is met based on the feature similarity, predicted object information, and actual object identifier of each sample group.

[0136] For example, combining Figure 3The explanation is as follows: A first loss function value is calculated by combining the feature similarity of each sample group with a preset first loss function. The higher the feature similarity between sample groups, the smaller the first loss function value. Simultaneously, a second loss function value is calculated by combining the consistency between the predicted object information and the actual object identifier for each sample group, and a second loss function. The more instances of consistency between the predicted object information and the actual object identifier for each sample group, the smaller the second loss function value. Based on this, if the first and second loss function values ​​converge, or the combined loss function value determined by combining the first and second loss function values ​​converges, or the target number of training iterations is reached, the training objective can be confirmed as satisfied.

[0137] certainly, Figure 3 This is just one example. Given a defined training objective, there are other ways to determine whether the training objective is met by combining the feature similarity of each sample group, the predicted object information, and the actual object identifier. There are no restrictions on this.

[0138] S405, adjust the parameters of the image classification model, and return to the operation of extracting the sound category features identified by the sound classification model and the object category features identified by the image classification model in step S402.

[0139] In practical applications, after each adjustment of the parameters of the image classification model, you can directly return to step S402. Of course, the image samples or sound samples in the image classification model and the object classification model can also be input once without repeated input. In that case, you can directly extract the sound category features and object category features obtained after adjusting the parameters of the image classification model.

[0140] Understandably, in Figure 4 During the training process, the image classification model and the sound classification model can use existing classification models, such as some general or open-source image classification models and sound classification models.

[0141] Considering that in practical applications, the sample pairs consisting of image samples and sound samples belonging to the same object are relatively few, in order to ensure that the object category features extracted from the object image by the trained object classification model can accurately represent the features of the sound category with a relatively small number of sample groups, it is necessary to ensure the classification accuracy of the image classification model and the sound classification model used to train the object classification model.

[0142] Based on this, in one possible implementation, before step S402 of this embodiment, the sound classification model can be trained using multiple second audio samples labeled with object identifiers, and the image classification model can be trained using multiple second image samples labeled with object identifiers. The specific training method can be any supervised training method, and there are no restrictions on it.

[0143] For example, a neural network model or an initial audio classification model can be trained using multiple second audio samples labeled with object identifiers to obtain a trained sound classification model.

[0144] The trained image classification model is obtained by training a neural network model or an open-source image classification model using multiple second image samples labeled with object identifiers.

[0145] Among them, multiple second audio samples can come from different objects, and the object identifiers labeled on the second audio samples can represent the object to which the second audio samples belong or the object category of the object.

[0146] Multiple second audio samples can be completely different from multiple first audio samples, or multiple second audio samples can include part or all of the first audio samples. Moreover, in general, the number of second audio samples can be greater than the number of first audio samples.

[0147] The object identifier of the second image sample can represent the object to which the second image sample belongs or the object category of the object.

[0148] The second image sample can be completely different from the first image sample, or the first image sample can be part of the second image sample. Generally, the number of second image samples can be more than the number of first image samples, and there is no restriction on this.

[0149] After training a sound classification model using the second audio samples and an image classification model using the second image samples, multiple sample groups can be used, and the sound classification model can be used to further train the image classification model to obtain an object classification model.

[0150] For easier understanding, please refer to Figure 5 As shown, comparison Figure 3 and Figure 5 It can be seen that in the process of training the object classification model, the sound classification model used is a sound classification model pre-trained using the second audio samples. Furthermore, before training the object classification model, an image classification model is pre-trained using the first image samples. This image classification model is then used as the object classification model to be trained, and multiple sample groups are combined. Figure 3The image classification model is trained in a manner that continues until an object classification model that meets the training objectives is obtained.

[0151] To facilitate understanding, a simple explanation will be provided below using an application scenario as an example, where a 3D virtual character needs to be output in a virtual scene. In this case, in order to output a voice suitable for the virtual character based on its gender and appearance, an object classification model can be pre-trained to identify the character's category features by combining the character image (which includes at least the face image of the virtual object) with the character image.

[0152] In this application scenario, the principle and process of training an object classification model can be found in [reference needed]. Figure 6 As shown.

[0153] Depend on Figure 6 It can be seen that, in this application scenario, the training process for the sound classification model is similar to that described earlier. Figures 3 to 5 The process in the embodiments is similar.

[0154] The image classification model can be a face classification model. Before training the face classification model using sample groups, the face classification model can be trained using multiple second face image samples labeled with user identifiers to obtain a face classification model that can accurately identify the user or user category to which the face image belongs.

[0155] Based on this, the face classification model trained using the second face image sample will be used as the object classification model to be trained.

[0156] Each sample group used for training the face classification model and the voice classification model includes a first voice sample and a first face image sample belonging to the same user (i.e., originating from the same user). Based on this, the training objective for the face classification model is to ensure that the face category features identified by the face classification model from the first face image sample are the same as the voice category features (i.e., speaker voice category features) identified by the voice classification model from the first voice sample, and that the user to which the first face image sample belongs, as identified by the face classification model, matches the user labeled on the first face image sample.

[0157] Based on this, this application can obtain the image of a virtual character in a virtual scene (or the facial image used to construct the virtual character), identify the user category features of the image using a trained facial classification model, and determine the user category features as the voice category features of the virtual character. Furthermore, if it is necessary to generate a voice for the virtual character in the virtual scene, text information can be used to synthesize the character's speech with the voice category features, which can then be output to the virtual scene, enabling the virtual character in the presented virtual scene to emit a voice matching the virtual character's image.

[0158] In the above embodiments of this application, there may be various specific implementation methods for generating speech data that conforms to the characteristics of the target sound category based on text information, and this application does not impose any restrictions on them.

[0159] In one possible implementation, a speech synthesis model can be used to generate speech data. Specifically, based on text information and target sound category features, a speech synthesis model is used to construct speech data, resulting in speech data with the features of that target sound category.

[0160] For example, after vector encoding the text information, the vector encoding of the text information and the target sound category features are input into the speech synthesis model to obtain the speech data output by the speech synthesis model.

[0161] The speech synthesis model can be a model that synthesizes speech signals based on given text information. This speech synthesis model can be a currently used speech synthesis model, an open-source speech synthesis model, or a neural network model trained as needed.

[0162] Furthermore, to enable the speech synthesis model to more accurately synthesize speech data with target sound category features, this application can first train the speech synthesis model using at least one pair of information samples labeled with speech signals. This information sample pair includes: mutually matching text information samples and sound category feature samples. For example, any supervised training method can be used to train the speech synthesis model, so that through continuous training, the speech data generated by the speech synthesis model based on the information sample pair matches the speech signal labeled with that information sample pair. There are no restrictions on the specific training process.

[0163] The specific structural form of the speech synthesis model in this application can be varied. For example, the speech synthesis model can be a natural language synthesis model such as FastSpeech2, and there is no limitation on this.

[0164] To facilitate understanding, we will take one structural form as an example to briefly introduce the process of synthesizing speech data using a speech synthesis model.

[0165] like Figure 7 As shown, after the text information is converted into a text embedding vector, the position encoding vector is encoded together with the text embedding vector, and then input into the transform adaptation layer along with the sound category features. This transform adaptation layer is used to predict pauses between phonemes, and also incorporates pitch and volume predictions to better grasp audio features. Based on this, the features output by the transform adaptation layer are combined with the text position encoding and then decoded to obtain the decoded speech data.

[0166] certainly, Figure 7 This is just a simple example. In practical applications, different speech synthesis models will result in different processes for synthesizing speech data based on text information and speech category features. This application does not impose any restrictions on this.

[0167] In this application, the sound category characteristics of the virtual object can be determined before constructing or outputting the virtual object, and then speech data can be generated based on the sound category characteristics of the virtual object according to actual needs.

[0168] like Figure 8 The diagram illustrates a flowchart of a virtual object generation method provided in this embodiment. The method of this embodiment may include:

[0169] S801, Obtain the object image used to construct the virtual object.

[0170] The virtual object can be a three-dimensional virtual object, or it can be a two-dimensional virtual object; there are no restrictions on this.

[0171] Among them, the object image used to construct the virtual object is the object image required to synthesize the virtual object.

[0172] For example, taking a three-dimensional virtual character as an example, the object image used to construct the virtual object can be a human face image.

[0173] Of course, for other virtual scenes, the virtual objects are different, and the object images required to construct the virtual objects will also be different. This application does not impose any restrictions on this.

[0174] S802, Based on the image of the object, determine the target sound category features corresponding to the virtual object.

[0175] For example, an object image is input into an object classification model to obtain the target object category features of the virtual object identified by the model; these target object category features are then used to determine the target sound category features corresponding to the virtual object. A detailed description of this object classification model can be found in the previous section on speech generation methods.

[0176] This step is the same as the process of determining the target sound category features of the virtual object in the previous speech generation method embodiment. For details, please refer to the relevant description in the previous embodiment, which will not be repeated here.

[0177] S803, Based on the object image, construct a virtual object associated with the characteristics of the target sound category.

[0178] The process of constructing virtual objects based on object images can employ technologies such as virtual reality to generate objects in virtual scenes. This application does not impose any restrictions on how the virtual objects are constructed.

[0179] Unlike existing synthetic virtual objects, this application associates the synthetic virtual object with the target sound category features of the virtual object, and the characteristics of the sound emitted by the virtual object can be reflected based on the target sound category features.

[0180] In this embodiment, the target sound category features of the virtual object can be determined based on the object image used to construct the virtual object, so that the determined target sound category features match the external image of the virtual object and can accurately reflect the suitable sound features of the virtual object. Based on this, associating the virtual object with its target sound category features can help to reasonably generate a sound suitable for the virtual object.

[0181] Understandably, in Figure 8 In this embodiment, after the virtual object is constructed, text information can also be obtained. This text information is used to describe the speech content that the virtual object needs to output. For example, when it is necessary to simulate the virtual object emitting a sound in a virtual scene, text information corresponding to the sound information to be emitted by the virtual object, either configured or input by the user, can be obtained.

[0182] Based on this, and using text information, speech data with the characteristics of the target sound category can be generated for the virtual 3D object. The process of generating speech data with the characteristics of the target sound category for the virtual object can be found in the previous introduction and will not be repeated here.

[0183] Corresponding to the first speech generation method provided in the embodiments of this application, the embodiments of this application also provide a speech generation apparatus. For example... Figure 9 The diagram illustrates the structural composition of the speech generation apparatus provided in this embodiment. The apparatus in this embodiment may include:

[0184] Image acquisition unit 901 is used to acquire the object image of the virtual object;

[0185] The feature determination unit 902 is used to determine the target sound category features corresponding to the virtual object based on the object image;

[0186] The text acquisition unit 903 is used to acquire text information, which describes the voice content that needs to be output by the virtual object;

[0187] The speech generation unit 904 is used to generate speech data that conforms to the target sound category features based on the text information and the target sound category features.

[0188] In one possible implementation, the feature determining unit includes:

[0189] An object feature determination unit is used to input the object image into an object classification model to obtain the target object category features of the virtual object identified by the object classification model.

[0190] The sound feature determination unit is used to determine the target object category feature of the virtual object as the target sound category feature corresponding to the virtual object.

[0191] In another possible implementation, the object feature determination unit uses an object classification model that utilizes a first image sample from at least one set of samples, and trains the model with the object category features identified by the object classification model from the first image sample being the same as the sound category features identified by the sound classification model from the first sound sample corresponding to the first image sample.

[0192] The sample group includes: a first image sample and a first sound sample belonging to the same object.

[0193] In another possible implementation, the sample groups used by the object classification model in the training object feature determination unit are labeled with actual object identifiers;

[0194] The training objective of the object classification model also includes: the predicted object information of the first image sample determined by the object classification model matches the actual object identifier labeled in the sample group to which the first image sample belongs.

[0195] Furthermore, the device also includes a model training unit for training the object classification model in the following manner:

[0196] Obtain at least one of the sample groups;

[0197] For any sample group, the first image sample in the sample group is input into the image classification model, the first sound sample in the sample group is input into the sound classification model, the sound category features identified by the sound classification model and the object category features identified by the image classification model are extracted, the feature similarity between the sound category features and the object category features corresponding to the sample group is determined, and the predicted object information corresponding to the first image sample determined by the image classification model is obtained.

[0198] If the training objective is not met based on the feature similarity, predicted object information, and actual object identifier corresponding to each sample group, the parameters of the image classification model are adjusted, and the operation of extracting the sound category features identified by the sound classification model and the object category features identified by the image classification model is returned until the training objective is met, and the image classification model is determined as the trained object classification model.

[0199] In yet another possible implementation, the speech generation unit may include:

[0200] The speech generation subunit is used to construct speech data based on the text information and target sound category features using a speech synthesis model, thereby obtaining speech data with the target sound category features.

[0201] Corresponding to the virtual object generation method provided in the embodiments of this application, the embodiments of this application also provide a virtual object generation apparatus. For example... Figure 10 The diagram illustrates the structural composition of the virtual object generation apparatus provided in this embodiment. The apparatus in this embodiment may include:

[0202] Image acquisition unit 1001 is used to acquire an object image for constructing a virtual object;

[0203] The feature determination unit 1002 is used to determine the target sound category features corresponding to the virtual object based on the object image;

[0204] The object construction unit 1003 is used to construct a virtual object associated with the target sound category features based on the object image.

[0205] In one possible implementation, the device further includes:

[0206] Obtain text information, which describes the speech content that the virtual object needs to output;

[0207] Based on the text information, speech data with the target sound category features is generated for the virtual object.

[0208] Furthermore, this application also provides an electronic device, such as Figure 11 As shown, it illustrates a schematic diagram of the composition structure of the electronic device. The electronic device can be any type of electronic device, and the electronic device includes at least a processor 1101 and a memory 1102.

[0209] The processor 1101 is used to execute a speech generation method or a virtual object generation method as described in any of the above embodiments.

[0210] The memory 1102 is used to store the programs required for the processor to perform operations.

[0211] It is understood that the electronic device may also include a display unit 1103 and an input unit 1104.

[0212] Of course, the electronic device can also have more than Figure 11 There are no restrictions on the number of components, whether more or fewer.

[0213] On the other hand, this application also provides a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement a speech generation method or a virtual object generation method as described in any of the above embodiments.

[0214] This application also proposes a computer program comprising computer instructions stored in a computer-readable storage medium. When executed on an electronic device, the computer program performs a speech generation method or a virtual object generation method as described in any of the above embodiments.

[0215] It is understood that in this application, the terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings are used to distinguish similar parts and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that illustrated herein.

[0216] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. Furthermore, the features described in the various embodiments of this specification can be substituted or combined with each other, enabling those skilled in the art to implement or use this application. For apparatus embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0217] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.

[0218] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

[0219] The above are merely preferred embodiments of this application. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A speech generation method, comprising: Obtain the object image of the virtual object; The object image is input into the object classification model to obtain the target object category features of the virtual object identified by the object classification model. The target object category feature of the virtual object is determined as the target sound category feature corresponding to the virtual object; Obtain text information, which describes the speech content that the virtual object needs to output; Based on the text information and target sound category features, generate speech data that conforms to the target sound category features; The object classification model is trained using first image samples from at least one set of samples, with the training objective being that the object category features identified by the object classification model from the first image samples are the same as the sound category features identified by the sound classification model from the first sound samples corresponding to the first image samples. The sample group includes: a first image sample and a first sound sample belonging to the same object.

2. The method according to claim 1, wherein the sample group is labeled with an actual object identifier; The training objectives also include: The predicted object information of the first image sample determined by the object classification model matches the actual object identifier labeled in the sample group to which the first image sample belongs.

3. The method according to claim 2, wherein the object classification model is trained in the following manner: Obtain at least one of the sample groups; For any sample group, the first image sample in the sample group is input into the image classification model, the first sound sample in the sample group is input into the sound classification model, the sound category features identified by the sound classification model and the object category features identified by the image classification model are extracted, the feature similarity between the sound category features and the object category features corresponding to the sample group is determined, and the predicted object information corresponding to the first image sample determined by the image classification model is obtained. If the training objective is not met based on the feature similarity, predicted object information, and actual object identifier corresponding to each sample group, the parameters of the image classification model are adjusted, and the operation of extracting the sound category features identified by the sound classification model and the object category features identified by the image classification model is returned until the training objective is met, and the image classification model is determined as the trained object classification model.

4. The method according to any one of claims 1 to 2, wherein generating speech data conforming to the target sound category features based on the text information and the target sound category features comprises: Based on the text information and target sound category features, speech data is constructed using a speech synthesis model to obtain speech data with the target sound category features.

5. A method for generating virtual objects, comprising: Obtain the object image used to construct the virtual object; The object image is input into the object classification model to obtain the target object category features of the virtual object identified by the object classification model. The target object category feature of the virtual object is determined as the target sound category feature corresponding to the virtual object; Based on the object image, a virtual object associated with the target sound category features is constructed; The object classification model is trained using first image samples from at least one set of samples, with the training objective being that the object category features identified by the object classification model from the first image samples are the same as the sound category features identified by the sound classification model from the first sound samples corresponding to the first image samples. The sample group includes: a first image sample and a first sound sample belonging to the same object.

6. The method according to claim 5, further comprising: Obtain text information, which describes the speech content that the virtual object needs to output; Based on the text information, speech data with the target sound category features is generated for the virtual object.

7. A speech generation apparatus, comprising: The image acquisition unit is used to acquire the object image of the virtual object; The feature determination unit is used to input the object image into the object classification model to obtain the target object category features of the virtual object identified by the object classification model; and to determine the target object category features of the virtual object as the target sound category features corresponding to the virtual object. A text acquisition unit is used to acquire text information, which describes the speech content that the virtual object needs to output; The speech generation unit is used to generate speech data that conforms to the target sound category features based on the text information and the target sound category features; The object classification model is trained using first image samples from at least one set of samples, with the training objective being that the object category features identified by the object classification model from the first image samples are the same as the sound category features identified by the sound classification model from the first sound samples corresponding to the first image samples. The sample group includes: a first image sample and a first sound sample belonging to the same object.

8. A virtual object generation apparatus, comprising: An image acquisition unit is used to acquire object images for constructing virtual objects; The feature determination unit is used to input the object image into the object classification model to obtain the target object category features of the virtual object identified by the object classification model; and to determine the target object category features of the virtual object as the target sound category features corresponding to the virtual object. An object construction unit is used to construct a virtual object associated with the target sound category features based on the object image; The object classification model is trained using first image samples from at least one set of samples, with the training objective being that the object category features identified by the object classification model from the first image samples are the same as the sound category features identified by the sound classification model from the first sound samples corresponding to the first image samples. The sample group includes: a first image sample and a first sound sample belonging to the same object.

Citation Information

Patent Citations

  • Speech synthesis method, model training method and device, computer equipment and vehicle

    CN114596836A