Voiceprint recognition method, device, electronic device and readable storage medium
By generating and retrieving voiceprint vectors and calculating similarity values to determine users, the problem of low accuracy of existing voiceprint recognition technologies is solved, and higher recognition accuracy and lower environmental and physical state dependence are achieved.
Patent Information
- Application Number
- CN202111192106.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-13
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2041-10-13
AI Technical Summary
The current voiceprint recognition technology has low accuracy and is susceptible to physical condition, age, mood and environment.
By generating the voiceprint vector corresponding to the audio to be identified, the target database is retrieved to obtain the matching voiceprint vector, calculate the similarity value, and determine the user corresponding to the highest similarity value.
It improves the accuracy of voiceprint recognition and reduces dependence on the environment and physical condition.
Smart Images

Figure CN113868461B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of communication technology, and in particular, to a voiceprint recognition method, device, electronic device, and readable storage medium. Background Art
[0002] Compared with traditional identity recognition technology, the advantage of voiceprint recognition is that the voiceprint extraction process is simple, low-cost, unique, and not easy to forge or counterfeit. Therefore, voiceprint recognition can be used in criminal investigation, banking, securities, insurance and other fields for identity recognition.
[0003] Existing voiceprint recognition compares the audio to be recognized with multiple pre-stored audios by Mel-Frequency Cepstral Coefficients (MFCC), Linear Prediction Cepstrum Coefficients (LPCC) and other features to obtain voiceprint recognition results. However, the above features are easily affected by physical condition, age, emotions, etc., and are also easily affected by the environment. Therefore, the accuracy of voiceprint recognition using the above method is low. Summary of the invention
[0004] The embodiments of the present disclosure provide a voiceprint recognition method, device, electronic device, and readable storage medium to solve the problem of low accuracy of existing voiceprint recognition.
[0005] To solve the above problems, the present disclosure is implemented as follows:
[0006] In a first aspect, an embodiment of the present disclosure provides a voiceprint recognition method, including:
[0007] Generate a first voiceprint vector corresponding to the audio to be recognized;
[0008] Searching a target database to obtain N voiceprint vectors in the target database that match the first voiceprint vector, where N is an integer greater than 1;
[0009] Calculating the similarity between each voiceprint vector in the N voiceprint vectors and the first voiceprint vector to obtain N similarity values;
[0010] The user corresponding to the second voiceprint vector is determined as the user corresponding to the first voiceprint vector, and the second voiceprint vector is the voiceprint vector corresponding to the highest similarity value among the N similarity values.
[0011] In a second aspect, the present disclosure also provides a voiceprint recognition device, including:
[0012] A generating module, used to generate a first voiceprint vector corresponding to the audio to be recognized;
[0013] A retrieval module, configured to search a target database to obtain N voiceprint vectors in the target database that match the first voiceprint vector, where N is an integer greater than 1;
[0014] a calculation module, configured to calculate the similarity between each of the N voiceprint vectors and the first voiceprint vector, to obtain N similarity values;
[0015] A determination module is used to determine a user corresponding to a second voiceprint vector as the user corresponding to the first voiceprint vector, wherein the second voiceprint vector is a voiceprint vector corresponding to a highest similarity value among the N similarity values.
[0016] In a third aspect, an embodiment of the present disclosure further provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the voiceprint recognition method as described above when executed by the processor.
[0017] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the voiceprint recognition method applied to an electronic device as described above are implemented.
[0018] In the disclosed embodiment, the electronic device may first determine the voiceprint vector corresponding to the audio to be identified, import the first voiceprint vector corresponding to the audio to be identified into the target database, retrieve N voiceprint vectors matching the first voiceprint vector, and then calculate the similarity between each voiceprint vector in the N voiceprint vectors and the first voiceprint vector to obtain N similarity values, and determine the user associated with the voiceprint vector corresponding to the highest similarity value as the user associated with the audio to be identified. By using the voiceprint vector of the audio to be identified for voiceprint recognition, the accuracy of voiceprint recognition can be improved.
[0019] It is to be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 is a flow chart of a voiceprint recognition method according to an exemplary embodiment;
[0021] Figure 2 is a structural diagram of a voiceprint recognition device according to an exemplary embodiment;
[0022] Figure 3 is a structural diagram of an electronic device according to an exemplary embodiment.
[0023] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0025] The terms "first", "second", etc. in this disclosure are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. 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 apparatus that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or apparatuses.
[0026] The voiceprint recognition method of the embodiment of the present disclosure is described below.
[0027] See also Figure 1 , Figure 1 1 is a flow chart of a voiceprint recognition method according to an exemplary embodiment. The voiceprint recognition method of the disclosed embodiment is applied to an electronic device. In practical applications, the electronic device may be a mobile phone, a computer, a television, a wearable device, or a vehicle-mounted device.
[0028] like Figure 1 As shown, the voiceprint recognition method may include the following steps:
[0029] In step 101, a first voiceprint vector corresponding to the audio to be recognized is generated.
[0030] In a specific implementation, the electronic device may generate the first voiceprint vector through a deep learning model. In implementation, the audio to be recognized may be input into the deep learning model so that the deep learning model outputs the first voiceprint vector.
[0031] In step 102, a target database is searched to obtain N voiceprint vectors in the target database that match the first voiceprint vector, where N is an integer greater than 1.
[0032] The target database may store R voiceprint vectors and R identification information corresponding to the R voiceprint vectors one by one. The identification information may be used to identify a unique user, and R is an integer greater than or equal to N. In some embodiments, optionally, the target database may be Facebook AI Similarity Search (Faiss) database, which is an open source vector search engine of Facebook. The retrieval principle of the Faiss database may refer to the description in the relevant technology and will not be described here. Faiss can solve the problem of huge time consumption of brute force vector retrieval. In this way, by using the Faiss database to retrieve voiceprint vectors, the efficiency of voiceprint recognition can be improved. Of course, in other embodiments, the target database may be any type of database, such as elasticsearch database, that is, the vector retrieval function of elasticsearch (a search engine framework) may be used to retrieve voiceprint vectors. The elasticsearch database may store the fields to be retrieved as the vectors to be retrieved.
[0033] In a specific implementation, the electronic device may import the first voiceprint vector into the target database, and retrieve N voiceprint vectors matching the first voiceprint vector through the target database. It can be understood that the N voiceprint vectors retrieved through the target database are the N voiceprint vectors in the target database that are closest to the first voiceprint vector.
[0034] It should be noted that N can be pre-set, or N can be the actual number of voiceprint vectors matching the first voiceprint vector retrieved from the target database. The specific number can be determined based on actual conditions, and the embodiments of the present disclosure do not limit this.
[0035] In step 103, the similarity between each of the N voiceprint vectors and the first voiceprint vector is calculated to obtain N similarity values.
[0036] The higher the similarity value between two voiceprint vectors, the more likely the audio corresponding to the two voiceprint vectors is the voice of the same user, and vice versa. Therefore, in the embodiment of the present disclosure, after the electronic device retrieves the N voiceprint vectors obtained through the target database, it can calculate the similarity between each voiceprint vector in the N voiceprint vectors and the first voiceprint vector to obtain N similarity values. It can be understood that the N similarity values correspond to the N voiceprint vectors one by one.
[0037] In step 104, the user corresponding to the second voiceprint vector is determined as the user corresponding to the first voiceprint vector, and the second voiceprint vector is the voiceprint vector corresponding to the highest similarity value among the N similarity values.
[0038] From the foregoing content, it can be seen that each voiceprint vector corresponds to an identification information, and each identification information is used to identify a unique user. Therefore, the electronic device can determine the user identified by the identification information corresponding to the second voiceprint vector as the user corresponding to the first voiceprint vector, that is, the user corresponding to the audio to be identified.
[0039] In the voiceprint recognition method of the disclosed embodiment, the electronic device may first determine the voiceprint vector corresponding to the audio to be recognized, import the first voiceprint vector corresponding to the audio to be recognized into the target database, retrieve N voiceprint vectors matching the first voiceprint vector, and then calculate the similarity between each voiceprint vector in the N voiceprint vectors and the first voiceprint vector to obtain N similarity values, and determine the user associated with the voiceprint vector corresponding to the highest similarity value as the user associated with the audio to be recognized. By using the voiceprint vector of the audio to be recognized for voiceprint recognition, the accuracy of voiceprint recognition can be improved.
[0040] In the embodiment of the present disclosure, optionally, calculating the similarity between each voiceprint vector of the N voiceprint vectors and the first voiceprint vector includes:
[0041] Calculating the cosine distance between each voiceprint vector in the N voiceprint vectors and the first voiceprint vector to obtain N cosine distance values;
[0042] The N similarity values are the N cosine distance values.
[0043] In this optional implementation, the similarity value can be represented by a cosine distance value. The calculation method of the pre-distance value can refer to the description in the relevant technology and will not be described here.
[0044] It should be noted that, in other implementations, the similarity value may also be represented by other parameters, such as the Euclidean distance value, etc. Any parameter that can reflect the similarity value may fall within the protection scope of the embodiments of the present disclosure.
[0045] In the embodiment of the present disclosure, the electronic device may store at least one target database. In the case where the electronic device stores two or more target databases, the electronic device may implement step 102 in a certain manner.
[0046] Method 1
[0047] Optionally, there are P target databases, the P target databases correspond one-to-one to the P regions, and P is an integer greater than 1;
[0048] The searching a target database to obtain N voiceprint vectors in the target database that match the first voiceprint vector includes:
[0049] Acquire Q regions corresponding to the audio to be recognized, where Q is a positive integer less than or equal to P;
[0050] At least one of the Q target databases is retrieved to obtain N voiceprint vectors matching the first voiceprint vector, wherein the Q target databases correspond one-to-one to the Q regions.
[0051] In the first approach, considering that users in different regions have different accents, in order to further improve the voiceprint recognition rate, the voiceprint vectors of users in different regions can be stored in different target databases to obtain the P target databases. The regional division can be provincial division or municipal division, etc., which can be determined according to actual conditions and is not limited in the embodiments of the present disclosure.
[0052] In specific implementation, the Q regions corresponding to the audio to be recognized can be determined by an administrator, or by a model or device. In implementation, after playing the audio to be recognized, the administrator can determine the Q regions closest to the accent based on the accent in the audio to be recognized, and determine Q target databases corresponding to the Q regions one by one. Afterwards, at least one of the Q target databases is retrieved, that is, part or all of the Q target databases are retrieved to obtain the N voiceprint vectors.
[0053] As can be seen from the foregoing, N can be preset, or N can be the actual number of voiceprint vectors that match the first voiceprint vector and are retrieved from the target database.
[0054] When N is preset, the electronic device can search the Q target databases in a preset order, and after obtaining N voiceprint vectors, the search of the remaining target databases can be stopped. Therefore, it can be understood that in this case, the at least one target database may include part or all of the Q target databases.
[0055] When N is the actual number of voiceprint vectors matching the first voiceprint vector retrieved through the target database, the electronic device can search each of the Q target databases separately until all the Q target databases are retrieved. Therefore, it can be understood that, in this case, the at least one target database is the Q target databases.
[0056] Through the above method, the electronic device can only retrieve part of the target databases whose voiceprint vectors have accents closest to the audio to be recognized in the P target databases, thereby further improving the efficiency of voiceprint retrieval while ensuring the accuracy of voiceprint vector recognition.
[0057] Optionally, the retrieving at least one target database among the Q target databases corresponding one-to-one to the Q regions includes:
[0058] Obtaining the search priorities of the Q regions;
[0059] The Q target databases are searched in descending order of the search priorities of the Q regions until any one of the following items is satisfied: the search of the Q target databases is completed; the number of voiceprint vectors matching the first voiceprint vector reaches N.
[0060] In this optional implementation, the Q regions all have a retrieval priority. The retrieval priority of a region may be positively correlated with the correlation between the regional accent and the accent of the audio to be recognized, that is, the higher the correlation between the regional accent and the accent of the audio to be recognized, the higher the retrieval priority of the region, and vice versa.
[0061] In specific implementation, the electronic device can search the Q target databases in descending order of the search priority of the Q regions. When N voiceprint vectors are retrieved or the search of the Q target databases is completed, the electronic device can stop searching the target database, thereby reducing the terminal operation burden.
[0062] Method 2
[0063] Optionally, the number of the target databases is K, and the K target databases correspond one-to-one to K preset levels, where K is an integer greater than 1;
[0064] The searching a target database to obtain N voiceprint vectors in the target database that match the first voiceprint vector includes:
[0065] The K target databases are searched in descending order of the K preset levels until any one of the following items is satisfied: the search of the K target databases is completed; the number of voiceprint vectors determined to match the first voiceprint vector reaches N.
[0066] In the second method, the K target databases all have preset levels. The preset levels of the databases may be positively correlated with the importance of the user corresponding to the voiceprint vector stored in the database, that is, the higher the importance of the user corresponding to the voiceprint vector stored in the database, the higher the preset level of the database, and vice versa.
[0067] In specific implementation, the electronic device can search the K target databases in the order of the K preset levels from high to low. When N voiceprint vectors are retrieved or the retrieval of the K target databases is completed, the electronic device can stop the retrieval of the target database, thereby reducing the terminal operation burden.
[0068] Through the above method, the electronic device can search the target database in sequence based on the preset level of the target database, so as to further improve the efficiency of voiceprint retrieval on the basis of ensuring the accuracy of voiceprint vector recognition.
[0069] Method 3
[0070] Optionally, the searching a target database to obtain N voiceprint vectors in the target database that match the first voiceprint vector includes:
[0071] Determining whether the audio to be recognized meets a first condition;
[0072] In the case where the audio to be recognized satisfies the first condition, multiple regions corresponding to the audio to be recognized are obtained, and multiple target databases corresponding to the multiple regions are searched one by one in order of the search priorities of the multiple regions from high to low, until any of the following items is met: the search of multiple target databases corresponding to the multiple regions is completed; the number of voiceprint vectors matching the first voiceprint vector reaches N;
[0073] When the audio to be identified does not satisfy the first condition, multiple target databases corresponding to the multiple preset levels are retrieved in order from high to low until any one of the following items is met: the retrieval of multiple target databases corresponding to the multiple preset levels is completed; the number of voiceprint vectors determined to match the first voiceprint vector reaches N.
[0074] In the third method, the electronic device may first determine whether the audio to be identified meets a preset condition, namely the first condition. Then, based on different determination results, different methods may be used to retrieve the voiceprint vector, thereby improving the richness and flexibility of the voiceprint vector retrieval.
[0075] Specifically, when the audio to be identified meets the first condition, the method for retrieving the voiceprint vector is similar to the method for retrieving the voiceprint vector in the above-mentioned method 1. For details, please refer to the above-mentioned related instructions, which will not be repeated here.
[0076] In the case where the audio to be identified does not meet the first condition, the voiceprint vector is retrieved in a similar manner to the voiceprint vector in the second method. For details, please refer to the above-mentioned related instructions, which will not be repeated here. It should be noted that in this case, the target database corresponding to the preset level may include part or all of the target database stored in the electronic device, which can be determined according to actual conditions, and the embodiments of the present disclosure do not limit this.
[0077] In implementation, the first condition may include, but is not limited to: the area corresponding to the audio to be identified can be identified. If the area corresponding to the audio to be identified can be identified, N voiceprint vectors matching the first voiceprint vector can be determined by searching the target database corresponding to the area; if the area corresponding to the audio to be identified cannot be identified, N voiceprint vectors matching the first voiceprint vector can be determined by searching the target database corresponding to the preset level. In this way, the rate of voiceprint vector retrieval can be improved.
[0078] It should be noted that the various optional implementations introduced in the embodiments of the present disclosure may be implemented in combination with each other or may be implemented separately if they do not conflict with each other, and the embodiments of the present disclosure are not limited to this.
[0079] For ease of understanding, the following examples are provided:
[0080] In this example, the voiceprint recognition method may include the following steps:
[0081] Step 1: Generate a voiceprint vector for the audio. This process uses a deep learning model to directly generate the corresponding voiceprint vector through the audio.
[0082] Step 2: Import the voiceprint vector into Faiss, which is an open-source vector search engine from Facebook. It solves the time-consuming problem of brute-force vector search. Faiss saves the voiceprint ID index and the actual voiceprint vector.
[0083] Step 3: The n closest voiceprint vectors will be obtained from the Faiss query. In order to make the result more accurate, the cosine distance between the n vectors queried by Faiss and the current vector will be calculated and re-sorted to obtain the closest voiceprint vector and return it.
[0084] In this example, when there is an audio that needs to be identified, the audio is first converted into a vector through step one, then retrieved through step two, and then reordered through step three. The ID of the best result is returned and associated with the person information of the corresponding ID in the database to obtain specific person information.
[0085] To further speed up the search you can optionally also include:
[0086] When forming the voiceprint database, the voiceprints are divided by region. The id index in the voiceprint database also includes the region identifier. The user can enter the region where the voiceprint is more likely to appear when using it. For example, when the user listens to the audio information and thinks it may be a Sichuan accent, he can enter the "Sichuan" region. At this time, when performing voiceprint retrieval, all Sichuan voiceprints are first found from the voiceprint database according to the index ID and prioritized for retrieval. If it is not detected, or the detection similarity does not reach the threshold, then the region with a higher accent similarity to the "Sichuan" region is searched again (here it can be the order of Sichuan-Chongqing-Hunan-Hubei...pre-set by the user according to the accent similarity), for example, Chongqing, until all searches are completed and multiple results with high similarity are obtained. This method combines the user's prior knowledge and further speeds up the search speed.
[0087] See also Figure 2 , Figure 2 FIG. 1 is a structural diagram of a voiceprint recognition device according to an exemplary embodiment. Figure 2 As shown, the voiceprint recognition device 200 includes:
[0088] A generating module 201, configured to generate a first voiceprint vector corresponding to the audio to be recognized;
[0089] A retrieval module 202 is used to search a target database to obtain N voiceprint vectors in the target database that match the first voiceprint vector, where N is an integer greater than 1;
[0090] A calculation module 203 is used to calculate the similarity between each voiceprint vector in the N voiceprint vectors and the first voiceprint vector to obtain N similarity values;
[0091] The determination module 204 is configured to determine the user corresponding to the second voiceprint vector as the user corresponding to the first voiceprint vector, wherein the second voiceprint vector is the voiceprint vector corresponding to the highest similarity value among the N similarity values.
[0092] Optionally, there are P target databases, the P target databases correspond one-to-one to the P regions, and P is an integer greater than 1;
[0093] The retrieval module 202 includes:
[0094] An acquisition submodule, used to acquire Q regions corresponding to the audio to be recognized, where Q is a positive integer less than or equal to P;
[0095] The retrieval submodule is used to retrieve at least one of the Q target databases to obtain N voiceprint vectors matching the first voiceprint vector, and the Q target databases correspond to the Q regions one by one.
[0096] Optionally, the retrieval submodule includes:
[0097] An acquiring unit, used for acquiring the search priorities of the Q regions;
[0098] The retrieval unit searches the Q target databases in descending order of the retrieval priorities of the Q regions until any one of the following is satisfied: the retrieval of the Q target databases is completed; the number of voiceprint vectors matching the first voiceprint vector reaches N.
[0099] Optionally, the number of the target databases is K, and the K target databases correspond one-to-one to K preset levels, where K is an integer greater than 1;
[0100] The retrieval module 202 is specifically used for:
[0101] The K target databases are searched in descending order of the K preset levels until any one of the following items is satisfied: the search of the K target databases is completed; the number of voiceprint vectors determined to match the first voiceprint vector reaches N.
[0102] Optionally, the retrieval module 202 is specifically configured to:
[0103] Determining whether the audio to be recognized meets a first condition;
[0104] In the case where the audio to be recognized satisfies the first condition, multiple regions corresponding to the audio to be recognized are obtained, and multiple target databases corresponding to the multiple regions are searched one by one in order of the search priorities of the multiple regions from high to low, until any of the following items is met: the search of multiple target databases corresponding to the multiple regions is completed; the number of voiceprint vectors matching the first voiceprint vector reaches N;
[0105] When the audio to be identified does not satisfy the first condition, multiple target databases corresponding to the multiple preset levels are retrieved in order from high to low until any one of the following items is met: the retrieval of multiple target databases corresponding to the multiple preset levels is completed; the number of voiceprint vectors determined to match the first voiceprint vector reaches N.
[0106] Optionally, the calculation module 203 is specifically used to: calculate the cosine distance between each voiceprint vector in the N voiceprint vectors and the first voiceprint vector to obtain N cosine distance values;
[0107] The N similarity values are the N cosine distance values.
[0108] The voiceprint recognition device 200 can implement each process in the embodiment of the method disclosed herein and achieve the same beneficial effects. To avoid repetition, it will not be described again here.
[0109] See also Figure 3 , Figure 3 FIG. 1 is a structural diagram of an electronic device according to an exemplary embodiment. Figure 3 As shown, the electronic device 300 includes: a processor 301, a memory 302, a user interface 303, a transceiver 304 and a bus interface.
[0110] In the embodiment of the present disclosure, the electronic device 300 further includes: a computer program stored in the memory 302 and executable on the processor 301, and when the computer program is executed by the processor 301, the following steps are implemented:
[0111] Generate a first voiceprint vector corresponding to the audio to be recognized;
[0112] Searching a target database to obtain N voiceprint vectors in the target database that match the first voiceprint vector, where N is an integer greater than 1;
[0113] Calculating the similarity between each voiceprint vector in the N voiceprint vectors and the first voiceprint vector to obtain N similarity values;
[0114] The user corresponding to the second voiceprint vector is determined as the user corresponding to the first voiceprint vector, and the second voiceprint vector is the voiceprint vector corresponding to the highest similarity value among the N similarity values.
[0115] Optionally, there are P target databases, the P target databases correspond one-to-one to the P regions, and P is an integer greater than 1;
[0116] When the computer program is executed by the processor 301, the following steps are implemented:
[0117] Acquire Q regions corresponding to the audio to be recognized, where Q is a positive integer less than or equal to P;
[0118] At least one of the Q target databases is retrieved to obtain N voiceprint vectors matching the first voiceprint vector, wherein the Q target databases correspond one-to-one to the Q regions.
[0119] Optionally, when the computer program is executed by the processor 301, the following steps are implemented:
[0120] Obtaining the search priorities of the Q regions;
[0121] At least one of the Q target databases is searched in sequence according to the retrieval priority of the Q regions from high to low until any one of the following items is met: the retrieval of the Q target databases is completed; the number of voiceprint vectors matching the first voiceprint vector reaches N.
[0122] Optionally, the number of the target databases is K, and the K target databases correspond one-to-one to K preset levels, where K is an integer greater than 1;
[0123] When the computer program is executed by the processor 301, the following steps are implemented:
[0124] The K target databases are searched in descending order of the K preset levels until any one of the following items is satisfied: the search of the K target databases is completed; the number of voiceprint vectors determined to match the first voiceprint vector reaches N.
[0125] Optionally, the number of the target databases is T, and the T target databases include P target databases and K target databases, the P target databases correspond one-to-one to the P regions, the K target databases correspond one-to-one to the K preset levels, P and K are both integers greater than 1, and T is greater than or equal to P+K;
[0126] When the computer program is executed by the processor 301, the following steps are implemented:
[0127] Determining whether the audio to be recognized meets a first condition;
[0128] In the case where the audio to be recognized satisfies the first condition, multiple regions corresponding to the audio to be recognized are obtained, and multiple target databases corresponding to the multiple regions are searched one by one in order of the search priorities of the multiple regions from high to low, until any of the following items is met: the search of multiple target databases corresponding to the multiple regions is completed; the number of voiceprint vectors matching the first voiceprint vector reaches N;
[0129] When the audio to be identified does not satisfy the first condition, multiple target databases corresponding to the multiple preset levels are retrieved in order from high to low until any one of the following items is met: the retrieval of multiple target databases corresponding to the multiple preset levels is completed; the number of voiceprint vectors determined to match the first voiceprint vector reaches N.
[0130] Optionally, when the computer program is executed by the processor 301, the following steps are implemented:
[0131] Calculating the cosine distance between each voiceprint vector in the N voiceprint vectors and the first voiceprint vector to obtain N cosine distance values;
[0132] The N similarity values are the N cosine distance values.
[0133] exist Figure 3 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically one or more processors represented by processor 301 and various circuits of memory represented by memory 302 are linked together. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver 304 may be a plurality of components, namely, a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission medium. For different user devices, the user interface 303 may also be an interface capable of externally and internally connecting required devices, and the connected devices include but are not limited to a keypad, a display, a speaker, a microphone, a joystick, and the like.
[0134] The processor 301 is responsible for managing the bus architecture and general processing, and the memory 302 can store data used by the processor 2601 when performing operations.
[0135] The electronic device 300 can implement each process in the above method embodiment, and will not be described again here to avoid repetition.
[0136] The embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each process of the above-mentioned voiceprint recognition method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0137] The embodiments of the present disclosure are described above in conjunction with the accompanying drawings, but the present disclosure is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present disclosure, ordinary technicians in this field can also make many forms without departing from the scope of protection of the purpose of the present disclosure and the claims, all of which are within the protection of the present disclosure.
Claims
1. A voiceprint recognition method, characterized in that: include: Generate a first voiceprint vector corresponding to the audio to be recognized; Searching a target database to obtain N voiceprint vectors in the target database that match the first voiceprint vector, where N is an integer greater than 1; Calculating the similarity between each voiceprint vector in the N voiceprint vectors and the first voiceprint vector to obtain N similarity values; Determine the user corresponding to the second voiceprint vector as the user corresponding to the first voiceprint vector, the second voiceprint vector being the voiceprint vector corresponding to the highest similarity value among the N similarity values; The searching a target database to obtain N voiceprint vectors in the target database that match the first voiceprint vector includes: Determining whether the audio to be recognized meets a first condition; In the case where the audio to be recognized satisfies the first condition, multiple regions corresponding to the audio to be recognized are obtained, and multiple target databases corresponding to the multiple regions are searched one by one in order of the search priorities of the multiple regions from high to low, until any of the following items is met: the search of multiple target databases corresponding to the multiple regions is completed; the number of voiceprint vectors matching the first voiceprint vector reaches N; When the audio to be identified does not satisfy the first condition, multiple target databases corresponding to the multiple preset levels are retrieved in order from high to low until any one of the following items is met: the retrieval of multiple target databases corresponding to the multiple preset levels is completed; the number of voiceprint vectors determined to match the first voiceprint vector reaches N.
2. The method according to claim 1, characterized in that: There are P target databases, and the P target databases correspond to the P regions one by one, where P is an integer greater than 1; The searching a target database to obtain N voiceprint vectors in the target database that match the first voiceprint vector includes: Acquire Q regions corresponding to the audio to be recognized, where Q is a positive integer less than or equal to P; At least one of the Q target databases is retrieved to obtain N voiceprint vectors matching the first voiceprint vector, wherein the Q target databases correspond one-to-one to the Q regions.
3. The method according to claim 2, characterized in that The retrieving at least one target database among the Q target databases corresponding one-to-one to the Q regions comprises: Obtaining the search priorities of the Q regions; The Q target databases are searched in descending order of the search priorities of the Q regions until any one of the following items is satisfied: the search of the Q target databases is completed; the number of voiceprint vectors matching the first voiceprint vector reaches N.
4. The method according to claim 1, characterized in that The number of the target databases is K, and the K target databases correspond to the K preset levels one by one, where K is an integer greater than 1; The searching a target database to obtain N voiceprint vectors in the target database that match the first voiceprint vector includes: The K target databases are searched in descending order of the K preset levels until any one of the following items is satisfied: the search of the K target databases is completed; the number of voiceprint vectors determined to match the first voiceprint vector reaches N.
5. The method according to any one of claims 1 to 4, characterized in that The calculating the similarity between each voiceprint vector of the N voiceprint vectors and the first voiceprint vector includes: Calculating the cosine distance between each voiceprint vector in the N voiceprint vectors and the first voiceprint vector to obtain N cosine distance values; The N similarity values are the N cosine distance values.
6. The method according to any one of claims 1 to 4, characterized in that The target database is the Faiss database.
7. A voiceprint recognition device, applied to electronic equipment, characterized in that: include: A generating module, used to generate a first voiceprint vector corresponding to the audio to be recognized; A retrieval module, configured to search a target database to obtain N voiceprint vectors in the target database that match the first voiceprint vector, where N is an integer greater than 1; a calculation module, configured to calculate the similarity between each of the N voiceprint vectors and the first voiceprint vector, to obtain N similarity values; a determination module, configured to determine a user corresponding to a second voiceprint vector as the user corresponding to the first voiceprint vector, wherein the second voiceprint vector is a voiceprint vector corresponding to a highest similarity value among the N similarity values; The search module is also used to: Determining whether the audio to be recognized meets a first condition; In the case where the audio to be recognized satisfies the first condition, multiple regions corresponding to the audio to be recognized are obtained, and multiple target databases corresponding to the multiple regions are searched one by one in order of the search priorities of the multiple regions from high to low, until any of the following items is met: the search of multiple target databases corresponding to the multiple regions is completed; the number of voiceprint vectors matching the first voiceprint vector reaches N; When the audio to be identified does not satisfy the first condition, multiple target databases corresponding to the multiple preset levels are retrieved in order from high to low until any one of the following items is met: the retrieval of multiple target databases corresponding to the multiple preset levels is completed; the number of voiceprint vectors determined to match the first voiceprint vector reaches N.
8. An electronic device, characterized in that: The method comprises a processor, a memory and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the voiceprint recognition method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the voiceprint recognition method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Identification method based on voice search and tutoring machine
CN108920541A
Voiceprint authentication method and apparatus, computer device, and storage medium
CN109243465A