Voice processing method and device, electronic equipment and storage medium
By extracting the spectrum and transitional features of the target voice in the voiceprint identification technology, and matching them with the sample voiceprint features, the problem of low accuracy of voiceprint identification in the existing technology is solved, and higher identity verification accuracy and stability.
Patent Information
- Application Number
- CN202410617267.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-17
- Publication Date
- 2024-09-10
Smart Images

Figure CN118629426A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of voiceprint identification, and more specifically, to a voice processing method, device, electronic device and storage medium. Background Art
[0002] In the voiceprint identification business, spectrum analysis is a very important means. The main object of spectrum analysis is syllables. For Chinese, a syllable is the complete pronunciation of a Chinese character, which includes initial consonants and finals. The spectrum features of speech mainly refer to the distribution, trend, strength, and bandwidth of the center frequency of the resonance peak of the syllable and final part. In related technologies, the spectrum features are generally compared to achieve voiceprint identification, but there is still a problem of low accuracy of voiceprint identification. Summary of the invention
[0003] The present application proposes a speech processing method, device, electronic device and storage medium to improve the above-mentioned defects.
[0004] In a first aspect, an embodiment of the present application provides a speech processing method, the method comprising: obtaining a target speech to be processed; extracting voiceprint features of the target speech as target voiceprint features, the target voiceprint features comprising target graph features corresponding to the target speech and target transition features between all adjacent syllables in the target speech; matching the target voiceprint features with sample voiceprint features to perform identity matching and recognition based on the matching results, the sample voiceprint features comprising sample graph features corresponding to the sample speech and sample transition features between all adjacent syllables in the sample speech.
[0005] In a second aspect, an embodiment of the present application provides a speech processing device, comprising: a speech acquisition module, used to acquire a target speech to be processed; a feature extraction module, used to extract voiceprint features of the target speech as target voiceprint features, wherein the target voiceprint features include target graph features corresponding to the target speech and target transition features between all adjacent syllables in the target speech; a voiceprint matching module, used to match the target voiceprint features with sample voiceprint features to perform identity matching and recognition based on the matching results, wherein the sample voiceprint features include sample graph features corresponding to the sample speech and sample transition features between all adjacent syllables in the sample speech.
[0006] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: one or more processors; a memory; one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the above-mentioned method.
[0007] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, in which a program code is stored, and the program code can be called by a processor to execute the above method.
[0008] In the solution provided by the present application, the target speech to be processed is obtained; the voiceprint features of the target speech are extracted as the target voiceprint features, the target voiceprint features include the target graph features corresponding to the target speech, and the target transition features between all adjacent syllables in the target speech; the target voiceprint features are matched with the sample voiceprint features to perform identity matching and recognition based on the matching results, the sample voiceprint features include the sample graph features corresponding to the sample speech, and the sample transition features between all adjacent syllables in the sample speech. In other words, the target voiceprint features of the target speech and the sample voiceprint features of the sample speech are matched to effectively realize voiceprint identity authentication of the speech; and the target voiceprint features include not only the graph features, but also the transition features between adjacent syllables, and the transition features can more accurately reflect the characteristics of the individual speech, thereby further improving the accuracy and stability of voiceprint identity authentication. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0010] Figure 1 A flow chart of a speech processing method provided in an embodiment of the present application is shown.
[0011] Figure 2 A flow chart of a speech processing method provided in another embodiment of the present application is shown.
[0012] Figure 3 Shows Figure 2 FIG. 2 is a flow chart of sub-steps of step S204 in one implementation manner.
[0013] Figure 4 Shows Figure 2 FIG. 2 is a flow chart of sub-steps of step S206 in one implementation manner.
[0014] Figure 5 It is a block diagram of a speech processing device provided according to an embodiment of the present application.
[0015] Figure 6 It is a block diagram of an electronic device according to an embodiment of the present application for executing the speech processing method according to an embodiment of the present application.
[0016] Figure 7 It is a storage unit of an embodiment of the present application for storing or carrying program codes for implementing the speech processing method according to an embodiment of the present application. DETAILED DESCRIPTION
[0017] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0018] It should be noted that in some processes described in the specification, claims and the above-mentioned drawings of the present application, multiple operations that appear in a specific order are included, and these operations may not be executed or executed in parallel in the order in which they appear in this article. The sequence numbers of operations such as S110, S120, etc. are only used to distinguish different operations, and the sequence numbers themselves do not represent any execution order. In addition, these processes may include more or less operations, and these operations may be executed in sequence or in parallel. And, the terms "first", "second", etc. in the specification, claims and the above-mentioned drawings of the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or server that includes a series of steps or sub-modules is not necessarily limited to those steps or sub-modules explicitly listed, but may include other steps or sub-modules that are not explicitly listed or that are inherent to these processes, methods, products, or devices.
[0019] The inventor proposes a speech processing method, device, electronic device and storage medium. The speech processing method provided in the embodiment of the present application is described in detail below.
[0020] Please refer to Figure 1 , Figure 1 A flow chart of a speech processing method provided in an embodiment of the present application. Figure 1 The speech processing method provided in the embodiment of the present application is described in detail. The speech processing method may include the following steps:
[0021] Step S110: Acquire the target speech to be processed.
[0022] In this embodiment, the target voice to be processed can be understood as a voice that requires voiceprint identity authentication. The target voice can be collected by the microphone of the electronic device itself, or it can be a voice that requires voiceprint identity authentication sent to the electronic device by other devices, or it can be a voice that requires voiceprint identity authentication downloaded from the Internet.
[0023] For example, in the judicial field, the target voice may be the voice of a suspect, so the target voice can be authenticated by voiceprint authentication to determine the suspect's identity. For another example, in the terminal application field, the target voice may be the unlocking voice of a user on a terminal device, so the target voice can be authenticated by voiceprint authentication to determine whether the user has the identity to unlock the terminal device. For another example, in the smart home field, the target voice may be the control voice of a user on a smart home, so the target voice can be authenticated by voiceprint authentication to determine whether the user has the identity to control the smart home.
[0024] Step S120: extracting the voiceprint features of the target speech as target voiceprint features, wherein the target voiceprint features include target graph features corresponding to the target speech and target transition features between all adjacent syllables in the target speech.
[0025] Specifically, the spectral features and frequency spectrum features of the target speech are extracted as target spectrogram features. The spectral features are extracted based on the spectrogram of the target speech, the horizontal axis of the spectrogram is time, the vertical axis is frequency, and the coordinate points reflect the energy of the speech signal; the frequency spectrum features are extracted based on the spectrum graph, the horizontal axis of the spectrum graph is frequency, the vertical axis is amplitude, and the coordinate points reflect the relationship between the frequency and energy of the speech signal. In other words, the target spectrogram features contain information such as the distribution, trend, strength, and bandwidth of the center frequency of the resonance peak of the complete syllable in the target speech.
[0026] In addition, the transition features between all adjacent syllables in the target speech are extracted to obtain the target transition features. Among them, the target transition features include at least the pronunciation duration transition information between adjacent syllables and the syllable energy transition information between adjacent syllables; in other words, the target transition features can be used to reflect the speech speed transition and stress transition between adjacent syllables, that is, to reflect a person's speaking style, such as intonation, emphasis, and other personality characteristics. It should be noted that for Chinese, a syllable is the complete pronunciation of a Chinese character, which includes the pronunciation of the initial consonant and the pronunciation of the final consonant; the target transition features between adjacent syllables mentioned above can also be understood as target transition features between adjacent Chinese characters.
[0027] For example, the target speech content is "I am going to travel to Beijing during the summer vacation". First, the target speech is converted into text using automatic speech recognition (ASR) technology to obtain the text content corresponding to the target speech; wherein the text content includes the Chinese characters, pinyin and tone of each syllable, and each syllable is added with the corresponding timestamp in the target speech, that is, the initial consonant and final vowel of each syllable are added with the timestamp. Further, the text content is segmented to obtain all adjacent syllables in the target speech. That is, all adjacent syllables in the target speech mentioned above include {wo3shu3}, {summer vacation (shu3jia4)}, {vacation (jia4yao4)}, {want to go (yao4qu4)}, {go to the north (qu4bei3)}, {Beijing (bei3jing1)}, {Beijing travel (jing1lv3)}, {travel (lv3you2)}, a total of eight adjacent syllables. It should be noted that the above-mentioned word segmentation is not word segmentation from a grammatical perspective, but word segmentation in a broad sense, that is, dividing the smallest syllable group, that is, dividing all adjacent syllables.
[0028] Step S130: Match the target voiceprint features with the sample voiceprint features to perform identity matching and recognition based on the matching results, wherein the sample voiceprint features include sample graph features corresponding to the sample speech and sample transition features between all adjacent syllables in the sample speech.
[0029] The sample voice is recorded for a sample user with a known identity. It is understandable that after the sample voice is pre-recorded, the sample voiceprint features of the sample voice also need to be extracted. The method of extracting the sample graph features and sample transition features in the sample voiceprint features is similar to the method of extracting the target graph features and target transition features mentioned above, and can refer to the above content, which will not be repeated here.
[0030] Optionally, the speech contents in the target speech and the sample speech may be the same or different, which is not limited in this embodiment.
[0031] In some embodiments, the target voiceprint feature is matched with the sample voiceprint feature, specifically, the first similarity can be obtained by obtaining the similarity between the target graph feature and the sample graph feature; and the second similarity can be obtained by obtaining the similarity between the target transition feature and the sample transition feature. Optionally, if the first similarity is greater than a first preset threshold, and the second similarity is greater than a second preset threshold, it is determined that the target voiceprint feature matches the sample voiceprint feature, that is, it is determined that the target voiceprint feature and the sample voiceprint feature are users of the same identity. Optionally, if the first similarity is less than or equal to the first preset threshold, and / or the second similarity is less than or equal to the second preset threshold, it is determined that the target voiceprint feature does not match the sample voiceprint feature, that is, it is determined that the target voiceprint feature and the sample voiceprint feature are users of different identities.
[0032] In other embodiments, the target voiceprint feature is matched with the sample voiceprint feature, specifically, the first similarity can be obtained by obtaining the similarity between the target graph feature and the sample graph feature; the second similarity can be obtained by obtaining the similarity between the target transition feature and the sample transition feature; the first similarity and the second similarity are weighted to obtain the target similarity. If the target similarity is greater than a preset threshold, it is determined that the target voiceprint feature and the sample voiceprint feature are voiceprint features of the same user; if the target similarity is less than or equal to the preset threshold, it is determined that the target voiceprint feature and the sample voiceprint feature are voiceprint features of different users.
[0033] In this embodiment, the target voiceprint features of the target speech and the sample voiceprint features of the sample speech are matched to effectively realize the voiceprint identity authentication of the speech; and the target voiceprint features include not only the graph features but also the transition features between adjacent syllables. The transition features can more accurately reflect the characteristics of individual speech, thereby further improving the accuracy and stability of voiceprint identity authentication.
[0034] Please refer to Figure 2 , Figure 2 A flow chart of a speech processing method provided in another embodiment of the present application. Figure 2 The speech processing method provided in the embodiment of the present application is described in detail. The speech processing method may include the following steps:
[0035] Step S201: Acquire target speech to be processed.
[0036] Step S202: extracting the spectral features and frequency spectrum features of the target speech as the target spectral features.
[0037] In this embodiment, the specific implementation of step S201 to step S202 can refer to the content of the above-mentioned embodiment, which will not be repeated here.
[0038] Step S203: for any two adjacent syllables in the target speech, obtain the pronunciation duration of each syllable in the adjacent syllables and the syllable energy of each syllable.
[0039] For the convenience of subsequent description, the pronunciation duration of the first syllable in any two adjacent syllables is represented by T1, the pronunciation duration of the second syllable is represented by T2, the syllable energy of the first syllable is represented by E1, and the syllable energy of the second syllable is represented by E2. Specifically, E1 and E2 can be represented by the following formula:
[0040]
[0041] Among them, x1 is the sampling value sequence of the previous syllable, l1 is the length of the sampling value sequence of the previous syllable, x2 is the sampling value sequence of the following syllable, and l2 is the length of the sampling value sequence of the following syllable.
[0042] It should be noted that the pronunciation duration of each syllable in adjacent syllables is determined based on the timestamps corresponding to the initial consonants and finals of each syllable.
[0043] Step S204: for any two adjacent syllables in the target speech, determine duration transition information and energy transition information based on the pronunciation duration of each syllable in the adjacent syllables and the syllable energy of each syllable.
[0044] In some embodiments, see Figure 3 , step S204 may include the following contents from step S2041 to step S2042:
[0045] Step S2041: For any two adjacent syllables in the target speech, based on the pronunciation duration of each syllable in the adjacent syllables, obtain the duration ratio of the pronunciation duration of the target syllable to the total pronunciation duration of the adjacent syllables as the duration transition information, and the target syllable is any syllable in the adjacent syllables.
[0046] Taking the target syllable as the front syllable as an example, the duration transition information du_rate can be expressed by the following formula:
[0047]
[0048] Step S2042: For any two adjacent syllables in the target speech, based on the syllable energy of each syllable in the adjacent syllables, obtain the energy ratio of the syllable energy of the target syllable to the total syllable energy of the adjacent syllables as the energy transition information.
[0049] Taking the target syllable as the front syllable as an example, the energy transition information en_rate can be expressed by the following formula:
[0050]
[0051] In this way, the duration transition information and energy transition information obtained in this manner are both values less than 1, which in disguise realizes normalization to facilitate subsequent calculations.
[0052] In other embodiments, for any two adjacent syllables in the target speech, based on the pronunciation duration of each syllable in the adjacent syllables, a duration ratio of the pronunciation durations of the adjacent syllables is obtained as duration transition information; and, for any two adjacent syllables in the target speech, based on the syllable energy of each syllable in the adjacent syllables, an energy ratio of the syllable energies of the adjacent syllables is obtained as energy transition information.
[0053] Exemplarily, in this manner, the duration transition information du_rate and the energy transition information en_rate may be expressed by the following formula:
[0054]
[0055]
[0056] Step S205: Acquire the target transition feature according to the duration transition information and the energy transition information.
[0057] It can be understood that the aforementioned acquired duration transition information can be used to reflect the transition of speech speed between adjacent syllables. The greater the syllable energy, the greater the vibration intensity and the louder the volume. Therefore, the energy transition information can also be used to reflect the stress transition between adjacent syllables. Based on this, the target transition feature can be obtained based on the duration transition information and the energy transition information. Specifically, the target transition feature can be expressed by the following formula:
[0058] tonal_feat=(a*du_rate,b*en_rate)
[0059] Where a and b are weight parameters, 0≤a≤1, 0≤b≤1, and the parameter value of the weight parameter can be the optimal weight obtained through model training.
[0060] In practical applications, there are 4 tones in Chinese characters, and the tone combinations of adjacent syllables can include a total of 16 types. Based on this, in some embodiments, after obtaining the target transition features of each adjacent syllable, all adjacent syllables can be further grouped to obtain a plurality of first syllable groups, and the tone combinations of the adjacent syllables included in each first syllable group are the same; for each of the first syllable groups, the average value of the feature values of the target transition features of all adjacent syllables in each first syllable group is obtained as the average transition feature of each first syllable group, and the average transition feature tonal_feat_mean of each first syllable group can be represented by the following formula:
[0061]
[0062] where N is the number of adjacent syllables included in each first syllable group.
[0063] Exemplarily, taking the speech content of the target speech as "I will travel to Beijing during the summer vacation" as an example, all adjacent syllables of the target speech include {我暑(wo3shu3)}, {暑假(shu3jia4)}, {假要(jia4yao4)}, {要去(yao4qu4)}, {去北(qu4bei3)}, {北京(bei3jing1)}, {京旅(jing1lv3)}, {旅游(lv3you2)}, a total of eight adjacent syllables. Based on this, 7 first syllable groups can be obtained. {假要(jia4yao4)} and {要去(yao4qu4)} are both adjacent syllables with a four-four tone combination. Therefore, these two adjacent syllables are divided into the same first syllable group; the tone combinations of the remaining 6 adjacent syllables are all different, so they are each divided into different first syllable groups, resulting in 6 first syllable groups. Taking the first syllable group where {假要(jia4yao4)} and {要去(yao4qu4)} are located as an example, this first syllable group contains two adjacent syllables. Therefore, N in the average transition feature formula of this first syllable group is 2.
[0064] In this way, the target transition features of adjacent syllables with the same tone combination are fused to obtain the average transition feature of this same tone combination; that is to say, the average transition features of various tone combinations in the target speech can be obtained, and this average transition feature can effectively reflect a person's speaking characteristics of the prosody and intonation when speaking adjacent syllables with different tone combinations.
[0065] In some other embodiments, after obtaining the average transition features of different tone combinations (i.e., different first syllable groups), the stability of the target transition features in different tone combinations can be further obtained. Based on this, for each first syllable group, the variance of the target transition features can be obtained, and the variance can be used to characterize the stability between the target transition features within the first syllable group. Among them, the tonal_feat_var can be expressed by the following formula:
[0066]
[0067] In this way, in addition to obtaining the average transition features of various tone combinations in the target speech, the variance that can be used to characterize the stability between the target transition features under different tone combinations will also be further obtained, so as to subsequently determine the speech features of a person's speech stability based on the variance.
[0068] Step S206: Determine the target voiceprint feature based on the target spectrogram feature and the target transition feature.
[0069] In some embodiments, the target spectrogram feature and the target transition feature can be used as the target voiceprint feature of the target speech.
[0070] In some other embodiments, please refer to Figure 4 , Step S206 may include the content of the following steps S2061 to S2064:
[0071] Step S2061: If there are target adjacent syllables with the same pinyin and the same tone in the target speech, the speech segment within the preset transition time period between the target adjacent syllables is frequency-divided to obtain multiple sub-bands corresponding to the target adjacent syllables.
[0072] Among them, the target adjacent syllables are adjacent syllables with the same pinyin and the same tone for the previous syllable and the next syllable. Taking the target speech of "惺惺相惜,空空如也,步步为营,星星点灯" as an example, among them, {惺惺(xing1xing1)}, {空空(kong1kong1)}, {步步(bu4bu4)}, {星星(xing1xing1)} these four adjacent syllables are all target adjacent speeches.
[0073] That is to say, in the case where there are target adjacent syllables with the same pinyin and the same tone in the target speech, the energy transition distribution features of the target adjacent syllables are further extracted, so as to know a person's speech habit when speaking adjacent syllables with the same pinyin and the same tone. Specifically, the speech segment within the preset transition time period between the target adjacent syllables can be frequency-divided to obtain multiple sub-bands corresponding to the target adjacent syllables.
[0074] The preset transition time period may be a pre-set time period, for example, the preset transition time period may be a time period consisting of a front transition time period and a rear transition time period. Optionally, the front transition time period may be the last first percentage time period of the pronunciation duration of the front syllable in the target adjacent syllable, and the rear transition time period may be the first second percentage time period of the pronunciation duration of the rear syllable in the target adjacent syllable. Optionally, the front transition time period may also be the pronunciation time period of the vowel of the front syllable in the target adjacent syllable, and the rear transition time period may be the pronunciation time period of the initial consonant of the rear syllable in the target adjacent syllable.
[0075] Optionally, the full frequency band of the speech segment within the aforementioned preset transition time period can be divided into a set number of frequency bands to obtain multiple sub-frequency bands corresponding to the above-mentioned target adjacent syllables. The frequency range of the full frequency band is 0 Hz to Fs / 2, where Fs is the sampling frequency of the target speech; the set number can be a preset value, such as 4, and of course, the value can also be modified according to different actual needs.
[0076] Step S2062: Obtain the frequency band energy of each of the sub-frequency bands in the target adjacent syllables.
[0077] Step S2063: Based on the frequency band energy of each of the sub-frequency bands, determine the energy transition distribution characteristics of the target adjacent syllables.
[0078] That is, the frequency band energy of each sub-band obtained by division is sampled and acquired, and based on the frequency band energy of each sub-band, the energy transition distribution characteristics of the target adjacent syllables are determined. In other words, the energy transition distribution characteristics of the target adjacent syllables can be regarded as a multidimensional feature vector, the dimension of which is the same as the number of frequency bands of the multiple sub-bands, that is, the frequency band energy value of each sub-band corresponds to the vector parameter value of one dimension in the multidimensional feature vector.
[0079] In some embodiments, the sample voiceprint feature further includes a plurality of preset average transition features, and the plurality of preset average transition features correspond one to one to a plurality of second preset syllable groups, and the adjacent syllables contained in each second preset syllable group have the same tone and pinyin. If there are target adjacent syllables with the same pinyin and tone in the target speech, all target adjacent syllables are grouped to obtain a plurality of second syllable groups, and the adjacent syllables contained in each second syllable group have the same tone and pinyin; for each second syllable group, the average value of the characteristic values of the energy transition distribution features of all adjacent syllables in each second syllable group is obtained as the average transition feature of each second syllable group.
[0080] Among them, the average transition feature of each second syllable group is freq_en_dist_mean jand the preset average transition feature freq_en_dist_mean of the second preset syllable group y can be expressed by the following formulas respectively:
[0081]
[0082]
[0083] where M is the number of target adjacent syllables with the same pinyin and tone in the second syllable group, and N is the number of preset adjacent syllables with the same pinyin and tone in the second preset syllable group. Exemplarily, if the second syllable group includes two target adjacent syllables {惺惺(xing1xing1)} and {星星(xing1xing1)}, then M takes the value of 2. It should be noted that M and N are not necessarily equal; understandably, in order to ensure the accuracy and stability of voiceprint comparison, N is often set to be larger, so as to obtain a more stable and accurate preset average transition feature of the second preset syllable group.
[0084] Step S2064: Determine the target voiceprint feature based on the target spectrogram feature, the target transition feature, and the energy transition distribution feature of the target adjacent syllables.
[0085] In this way, the target spectrogram feature, the target transition feature, and the energy transition distribution feature of the target adjacent syllables can all be used as the target voiceprint feature of the target speech.
[0086] Step S207: Obtain the similarity between the target spectrogram feature and the sample spectrogram feature to get the first similarity.
[0087] Step S208: Obtain the similarity between the target transition feature and the sample transition feature to get the second similarity.
[0088] In some embodiments, the sample transition feature includes multiple preset transition features, and the multiple preset transition features correspond to multiple first preset syllable groups one by one. The tone combinations of the adjacent syllables included in each first preset syllable group are the same.
[0089] In this way, obtain the similarity between the average transition feature of each first syllable group and the preset transition feature of the first preset syllable group with the same tone combination as it as the first sub-similarity corresponding to each first syllable group; weight the first sub-similarities corresponding to each first syllable group to obtain the second similarity. Among them, obtaining the first sub-similarity S_tonal jy can be expressed by the following formula:
[0090] S_tonal jy=1-(∑|tonal_feat_mean j -tonal_feat_mean y |) / 2
[0091] Among them, tonal_feat_mean j is the average transition feature of the first syllable group of the target speech, tonal_feat_mean y is the preset transition feature of the first preset syllable group in the sample speech. Wherein, the average transition feature and the preset transition feature are both two-dimensional vectors, where (∑|tonal_feat_mean j -tonal_feat_mean y |) / 2 can be understood as first obtaining the absolute value of the difference between the average transition feature and the feature values of each dimension of the preset transition feature, then summing the absolute values of the differences in different dimensions to obtain the sum of the differences, and obtaining the average value of the sum of the differences to obtain the difference degree value between the average transition feature and the preset transition feature; finally, obtaining the difference between 1 and the difference degree value to obtain the above-mentioned second similarity. It should be noted that for any first syllable group, the first sub-similarity can be calculated by the above formula.
[0092] In other embodiments, the sample transition feature includes multiple preset transition features and multiple preset variances, the multiple preset transition features correspond one-to-one to multiple first preset syllable groups, the multiple preset variances correspond one-to-one to multiple first preset syllable groups, and the tone combination of adjacent syllables contained in each first preset syllable group is the same.
[0093] In this manner, the similarity between the average transition feature of each first syllable group and the preset transition feature of the first preset syllable group with the same tone combination is obtained as the first sub-similarity corresponding to each first syllable group; the similarity between the variance of each first syllable group and the preset variance of the first preset syllable group with the same tone combination is obtained as the second sub-similarity corresponding to each first syllable group; the first sub-similarity and the second sub-similarity corresponding to each first syllable group are weighted to obtain the target similarity corresponding to each first syllable group; the target similarity corresponding to each first syllable group is weighted to obtain the second similarity. Among them, the target similarity S_tonal jy It can be expressed by the following formula:
[0094] S_tonal jy =1-a(∑|tonal_feat_mean j -tonal_feat_mean y |) / 2
[0095] -b(∑|tonal_feat_var j -tonal_feat_var y |) / 2
[0096] Among them, tonal_feat_mean j is the average transition feature of the first syllable group of the target speech, tonal_feat_mean y is the preset transition feature of the first preset syllable group in the sample speech, tonal_feat_var j is the variance of the first syllable group of the target speech, tonal_feat_var y is the preset variance of the first preset syllable group of the sample speech; a and b are weighted weight parameters, and the parameter values of the weighted weight parameters can be the optimal weights obtained based on model training. It should be noted that the summation method of the summation symbol in the formula is similar to that mentioned above, which is to add the vector parameter values of different dimensions in the multidimensional vector to finally obtain a sum value.
[0097] In some other embodiments, the sample voiceprint feature also includes a plurality of preset average transition features, and the plurality of preset average transition features correspond one to one to a plurality of second preset syllable groups, and the adjacent syllables contained in each second preset syllable group have the same tone and pinyin. After the average transition feature of each second syllable group is obtained, the similarity between the average transition feature of each second syllable group and the preset average transition feature of the second preset syllable group with the same tone and pinyin can be obtained as the second sub-similarity corresponding to each second syllable group. Among them, the second sub-similarity S_freq corresponding to each second syllable group jy It can be expressed by the following formula:
[0098] S_freq jy =1-(∑|freq_en_dist_mean j -freq_en_dist_mean y |) / L
[0099] Wherein, L is the number of frequency bands from 1 to 10 sub-bands mentioned above. It should be noted that the summation symbol in this formula has the same function as the summation symbol in the above formula, which is to add the vector parameter values of different dimensions in the multidimensional vector to finally obtain a sum value.
[0100] Furthermore, the first sub-similarity corresponding to each of the first syllable groups and the second sub-similarity corresponding to each of the second syllable groups are weighted to obtain the second similarity. Specifically, the second similarity can be expressed by the following formula:
[0101]
[0102] Wherein, a and b are the similarity weights of the transition features of the same tone combination (i.e., the first syllable group) and the transition features of the same pinyin and the same tone combination (i.e., the second syllable group), respectively, and w_tonal(i) and w_syll(i) are the similarity weights of the transition feature groups in the same tone combination (i.e., the first syllable group) and the same pinyin and the same tone group (i.e., the second syllable group). It should be noted that the similarity weight can be set according to the quantitative distribution of the same tone combination or syllable combination in the target speech and the sample speech. For example, the number of adjacent syllables contained in the same tone combination A is 3, and the number of adjacent syllables contained in the same tone combination B is 13. At this time, w_tonal(i) corresponding to the same tone combination B can be set larger, so as to help obtain a more accurate similarity; of course, the optimal weight can also be obtained by model training, which is not limited in this embodiment. P is the number of identical tone combinations contained in both the target speech and the sample speech, and Q is the number of identical pinyin and tone combinations contained in both the target speech and the sample speech.
[0103] Step S209: determining a target similarity based on the first similarity and the second similarity.
[0104] Step S210: If the target similarity is greater than a preset threshold, it is determined that the target voiceprint feature and the sample voiceprint feature are voiceprint features of the same user.
[0105] Step S211: If the target similarity is less than or equal to the preset threshold, it is determined that the target voiceprint feature and the sample voiceprint feature are voiceprint features of different users.
[0106] In this embodiment, the specific implementation of steps S209 to S211 can refer to the contents of the aforementioned embodiments and will not be described in detail here.
[0107] In this embodiment, the target voiceprint features of the target speech and the sample voiceprint features of the sample speech are matched to effectively realize voiceprint identity authentication of the speech; and the target voiceprint features include not only the spectral features, but also the transition features between adjacent syllables. The transition features can more accurately reflect the characteristics of individual speech, thereby further improving the accuracy and stability of voiceprint identity authentication. Among them, the transition features are quantitatively analyzed by time and energy for the transition features and similarity of words with the same tone combination, and by frequency domain energy distribution for the transition features and similarity of words with the same syllable combination. Finally, the local and overall transition feature similarity is calculated by weighted summation to improve the accuracy of similarity calculation, thereby improving the accuracy of voiceprint identity authentication.
[0108] Please refer to Figure 5 , which shows a structural block diagram of a speech processing device 300 provided in an embodiment of the present application. The device 300 may include: a speech acquisition module 310, a feature extraction module 320 and a voiceprint matching module 330.
[0109] The speech acquisition module 310 is used to acquire the target speech to be processed.
[0110] The feature extraction module 320 is used to extract the voiceprint features of the target speech as target voiceprint features, and the target voiceprint features include target graph features corresponding to the target speech and target transition features between all adjacent syllables in the target speech.
[0111] The voiceprint matching module 330 is used to match the target voiceprint features with the sample voiceprint features to perform identity matching and recognition based on the matching results. The sample voiceprint features include sample graph features corresponding to the sample speech and sample transition features between all adjacent syllables in the sample speech.
[0112] In some embodiments, the feature extraction module 320 may include: a graph extraction unit, a transition feature extraction unit, and a voiceprint feature determination unit. Among them, the graph extraction unit can be used to extract the spectral features and frequency spectrum features of the target speech as the target graph features. The transition feature extraction unit can be used to obtain the pronunciation duration of each syllable in the adjacent syllables and the syllable energy of each syllable for any two adjacent syllables in the target speech; for any two adjacent syllables in the target speech, based on the pronunciation duration of each syllable in the adjacent syllables and the syllable energy of each syllable, determine the duration transition information and energy transition information; according to the duration transition information and the energy transition information, obtain the target transition feature. The voiceprint feature determination unit can be used to determine the target voiceprint feature based on the target graph feature and the target transition feature.
[0113] In this manner, the transition feature extraction unit can be specifically used for: for any two adjacent syllables in the target speech, based on the pronunciation duration of each syllable in the adjacent syllables, obtaining the duration ratio of the pronunciation duration of the target syllable to the total pronunciation duration of the adjacent syllables as the duration transition information, wherein the target syllable is any syllable in the adjacent syllables; for any two adjacent syllables in the target speech, based on the syllable energy of each syllable in the adjacent syllables, obtaining the energy ratio of the syllable energy of the target syllable to the total syllable energy of the adjacent syllables as the energy transition information.
[0114] In this manner, the voiceprint feature determination unit can be specifically used for: if there are target adjacent syllables with the same pinyin and the same tone in the target speech, then frequency-dividing the speech segment within a preset transition time period between the target adjacent syllables to obtain a plurality of sub-frequency bands corresponding to the target adjacent syllables; obtaining the frequency band energy of each of the sub-frequency bands in the target adjacent syllables; determining the energy transition distribution characteristics of the target adjacent syllables based on the frequency band energy of each of the sub-frequency bands; and determining the target voiceprint features based on the target spectrum features, the target transition features and the energy transition distribution characteristics of the target adjacent syllables.
[0115] In some embodiments, the voiceprint matching module 330 may include: a graph matching unit, a transition feature matching unit, a target similarity acquisition unit, and a voiceprint verification unit. Among them, the graph matching unit can be used to obtain the similarity between the target graph feature and the sample graph feature to obtain a first similarity. The transition feature matching unit can be used to obtain the similarity between the target transition feature and the sample transition feature to obtain a second similarity. The target similarity acquisition unit can be used to determine the target similarity based on the first similarity and the second similarity. The voiceprint verification unit can be used to determine that the target voiceprint feature and the sample voiceprint feature are the voiceprint features of the same user if the target similarity is greater than a preset threshold; if the target similarity is less than or equal to the preset threshold, determine that the target voiceprint feature and the sample voiceprint feature are the voiceprint features of different users.
[0116] In some embodiments, the speech processing device 300 may further include: an average feature acquisition module. The average feature acquisition module may be specifically used to group all adjacent syllables to obtain a plurality of first syllable groups before obtaining the similarity between the target transition feature and the sample transition feature to obtain the second similarity, wherein the tone combination of the adjacent syllables contained in each first syllable group is the same; for each first syllable group, obtain the average value of the feature values of the target transition features of all adjacent syllables in each first syllable group as the average transition feature of each first syllable group.
[0117] In this manner, the sample transition feature includes a plurality of preset transition features, the plurality of preset transition features correspond one-to-one to a plurality of first preset syllable groups, the tone combination of adjacent syllables contained in each first preset syllable group is the same, and the similarity between the target transition feature and the sample transition feature is obtained to obtain the second similarity. The transition feature matching unit can be specifically used to obtain the similarity between the average transition feature of each first syllable group and the preset transition feature of the first preset syllable group with the same tone combination as the first sub-similarity corresponding to each first syllable group; and weight the first sub-similarity corresponding to each first syllable group to obtain the second similarity.
[0118] In other embodiments, the sample voiceprint feature also includes a plurality of preset average transition features, and the plurality of preset average transition features correspond to a plurality of second preset syllable groups one by one, and the adjacent syllables contained in each second preset syllable group have the same tone and pinyin. The speech processing device 300 may also include: an average transition feature acquisition module. The average transition feature can be used to perform weighted processing on the first sub-similarity corresponding to each first syllable group to obtain the second similarity. If there are target adjacent syllables with the same pinyin and tone in the target speech, all target adjacent syllables are grouped to obtain a plurality of second syllable groups, and the adjacent syllables contained in each second syllable group have the same tone and pinyin; for each second syllable group, the average value of the characteristic values of the energy transition distribution characteristics of all adjacent syllables in each second syllable group is obtained as the average transition feature of each second syllable group; the similarity between the average transition feature of each second syllable group and the preset average transition feature of the second preset syllable group with the same tone and pinyin is obtained as the second sub-similarity corresponding to each second syllable group. In this manner, the transition feature matching unit may be used to weight the first sub-similarity corresponding to each of the first syllable groups and the second sub-similarity corresponding to each of the second syllable groups to obtain the second similarity.
[0119] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0120] In several embodiments provided in the present application, the coupling between modules may be electrical, mechanical or other forms of coupling.
[0121] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.
[0122] In summary, the target speech to be processed is obtained; the voiceprint features of the target speech are extracted as the target voiceprint features, the target voiceprint features include the target graph features corresponding to the target speech, and the target transition features between all adjacent syllables in the target speech; the target voiceprint features are matched with the sample voiceprint features to perform identity matching and recognition based on the matching results, the sample voiceprint features include the sample graph features corresponding to the sample speech, and the sample transition features between all adjacent syllables in the sample speech. In other words, the target voiceprint features of the target speech and the sample voiceprint features of the sample speech are matched to effectively realize the voiceprint identity authentication of the speech; and the target voiceprint features include not only the graph features, but also the transition features between adjacent syllables, and the transition features can more accurately reflect the characteristics of the individual speech, thereby further improving the accuracy and stability of the voiceprint identity authentication.
[0123] The following will be combined Figure 6 An electronic device provided by the present application is described.
[0124] Reference Figure 6 , Figure 6 The structural block diagram of an electronic device 400 provided in an embodiment of the present application is shown, and the above method provided in an embodiment of the present application can be executed by the electronic device 400. The electronic device can be an electronic terminal with a data processing function, and the electronic terminal includes but is not limited to a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart watch, an e-book reader, an MP3 (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Group Audio Layer 3) player, and an MP4 (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Group Audio Layer 4) player, etc.
[0125] The electronic device 400 in the embodiment of the present application may include one or more of the following components: a processor 401, a memory 402, and one or more applications, wherein the one or more applications may be stored in the memory 402 and configured to be executed by one or more processors 401, and the one or more programs are configured to execute the method as described in the aforementioned method embodiment.
[0126] The processor 401 may include one or more processing cores. The processor 401 uses various interfaces and lines to connect the various parts of the entire electronic device 400, and executes various functions and processes data of the computer device 400 by running or executing instructions, programs, code sets or instruction sets stored in the memory 402, and calling data stored in the memory 402. Optionally, the processor 401 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 701 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem can also be integrated into the processor 401 and implemented separately through a communication chip.
[0127] The memory 402 may include a random access memory (RAM) or a read-only memory (ROM). The memory 402 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 402 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as the various corresponding relationships described above) created by the computer device 400 during use.
[0128] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0129] In several embodiments provided in the present application, the coupling or direct coupling or communication connection between the modules shown or discussed may be an indirect coupling or communication connection through some interfaces, devices or modules, which may be electrical, mechanical or other forms.
[0130] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.
[0131] Please refer to Figure 7 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 500 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.
[0132] The computer readable storage medium 500 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 500 includes a non-transitory computer-readable storage medium. The computer readable storage medium 500 has storage space for program code 510 that performs any method step of the above method. These program codes can be read from or written to one or more computer program products. The program code 510 can be compressed, for example, in an appropriate form.
[0133] In some embodiments, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device performs the steps in the above-mentioned method embodiments.
[0134] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A speech processing method, It is characterized in that The method comprises: Obtain the target speech to be processed; Extracting voiceprint features of the target speech as target voiceprint features, wherein the target voiceprint features include target atlas features corresponding to the target speech and target transition features between all adjacent syllables in the target speech; The target voiceprint feature is matched with the sample voiceprint feature to perform identity matching and recognition based on the matching result, wherein the sample voiceprint feature includes a sample graph feature corresponding to the sample speech and a sample transition feature between all adjacent syllables in the sample speech.
2. The method according to claim 1, It is characterized in that The extracting the voiceprint feature of the target speech as the target voiceprint feature includes: Extracting the spectral features and frequency spectrum features of the target speech as the target spectral features; For any two adjacent syllables in the target speech, obtaining the pronunciation duration of each syllable in the adjacent syllables and the syllable energy of each syllable; For any two adjacent syllables in the target speech, determining duration transition information and energy transition information based on the pronunciation duration of each syllable in the adjacent syllables and the syllable energy of each syllable; Acquire the target transition feature according to the duration transition information and the energy transition information; The target voiceprint feature is determined based on the target graph feature and the target transition feature.
3. The method according to claim 2, It is characterized in that The method of acquiring duration transition information and energy transition information for any two adjacent syllables in the target speech based on the pronunciation duration of each syllable in the adjacent syllables and the syllable energy of each syllable comprises: For any two adjacent syllables in the target speech, based on the pronunciation duration of each syllable in the adjacent syllables, obtaining the duration ratio of the pronunciation duration of the target syllable to the total pronunciation duration of the adjacent syllables as the duration transition information, wherein the target syllable is any syllable in the adjacent syllables; For any two adjacent syllables in the target speech, based on the syllable energy of each syllable in the adjacent syllables, an energy ratio of the syllable energy of the target syllable to the total syllable energy of the adjacent syllables is obtained as the energy transition information.
4. The method according to claim 2, It is characterized in that The determining the target voiceprint feature based on the target graph feature and the target transition feature includes: If there are target adjacent syllables with the same pinyin and the same tone in the target speech, frequency division is performed on the speech segment within the preset transition time period between the target adjacent syllables to obtain a plurality of sub-frequency bands corresponding to the target adjacent syllables; Acquire the frequency band energy of each of the sub-frequency bands in the target adjacent syllables; Determining energy transition distribution characteristics of the target adjacent syllables based on the frequency band energy of each of the sub-frequency bands; The target voiceprint feature is determined based on the target atlas feature, the target transition feature and the energy transition distribution feature of the target adjacent syllables.
5. The method according to any one of claims 1 to 4, It is characterized in that The matching of the target voiceprint feature with the sample voiceprint feature to perform identity matching and identification based on the matching result includes: Obtaining the similarity between the target graph feature and the sample graph feature to obtain a first similarity; Acquire the similarity between the target transition feature and the sample transition feature to obtain a second similarity; Determining a target similarity based on the first similarity and the second similarity; If the target similarity is greater than a preset threshold, it is determined that the target voiceprint feature and the sample voiceprint feature are voiceprint features of the same user; If the target similarity is less than or equal to the preset threshold, it is determined that the target voiceprint feature and the sample voiceprint feature are voiceprint features of different users.
6. The method according to claim 5, It is characterized in that Before obtaining the similarity between the target transition feature and the sample transition feature to obtain the second similarity, the method further includes: Grouping all adjacent syllables to obtain a plurality of first syllable groups, wherein the tone combinations of the adjacent syllables included in each first syllable group are the same; For each of the first syllable groups, obtaining an average value of feature values of target transition features of all adjacent syllables in each of the first syllable groups as an average transition feature of each of the first syllable groups; The sample transition feature includes a plurality of preset transition features, the plurality of preset transition features correspond to a plurality of first preset syllable groups one by one, the tone combination of adjacent syllables included in each first preset syllable group is the same, and the obtaining of the similarity between the target transition feature and the sample transition feature to obtain the second similarity includes: Obtaining a similarity between an average transition feature of each of the first syllable groups and a preset transition feature of a first preset syllable group having the same tone combination as a first sub-similarity corresponding to each of the first syllable groups; The first sub-similarity corresponding to each of the first syllable groups is weighted to obtain the second similarity.
7. The method according to claim 6, It is characterized in that The sample voiceprint features further include a plurality of preset average transition features, the plurality of preset average transition features corresponding one to one with a plurality of second preset syllable groups, and the adjacent syllables contained in each second preset syllable group have the same tone and pinyin; Before performing weighted processing on the first sub-similarity corresponding to each of the first syllable groups to obtain the second similarity, the method further includes: If there are target adjacent syllables with the same pinyin and the same tone in the target speech, group all the target adjacent syllables to obtain a plurality of second syllable groups, and the adjacent syllables contained in each of the second syllable groups have the same tone and pinyin; For each of the second syllable groups, obtaining an average value of characteristic values of energy transition distribution characteristics of all adjacent syllables in each of the second syllable groups as an average transition characteristic of each of the second syllable groups; Obtaining the similarity between the average transition feature of each of the second syllable groups and the preset average transition feature of the second preset syllable group having the same tone and pinyin as the second sub-similarity corresponding to each of the second syllable groups; The step of performing weighted processing on the multiple sub-similarity corresponding to each of the first syllable groups to obtain the second similarity includes: The first sub-similarity corresponding to each of the first syllable groups and the second sub-similarity corresponding to each of the second syllable groups are weighted to obtain the second similarity.
8. A speech processing device, It is characterized in that The device comprises: A speech acquisition module, used to acquire the target speech to be processed; A feature extraction module, used to extract voiceprint features of the target speech as target voiceprint features, wherein the target voiceprint features include target atlas features corresponding to the target speech and target transition features between all adjacent syllables in the target speech; The voiceprint matching module is used to match the target voiceprint features with the sample voiceprint features to perform identity matching and recognition based on the matching results. The sample voiceprint features include sample graph features corresponding to the sample speech and sample transition features between all adjacent syllables in the sample speech.
9. An electronic device, It is characterized in that The electronic device comprises: one or more processors; Memory; One or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores program code, which can be called by a processor to execute the method according to any one of claims 1 to 7.
