Voiceprint recognition method and device for home environment, equipment and storage medium
By improving the ECAPA-TDNN model and using a transfer learning method fine-tuned for home scenarios, the adaptability and accuracy issues of voiceprint recognition in home environments are solved, achieving more efficient voiceprint recognition of family members.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- FOSHAN QITE TECH CO LTD
- Filing Date
- 2025-12-26
- Publication Date
- 2026-05-01
AI Technical Summary
Existing voiceprint recognition technologies suffer from problems in home environments, such as poor adaptability of fixed-size convolutional kernels, a single attention mechanism, lack of priority in feature aggregation, and limited feature storage, resulting in insufficient accuracy in recognizing subtle voiceprint differences among family members.
We employ a transfer learning strategy that combines general data pre-training with fine-tuning for home scenarios. Through the improved ECAPA-TDNN model, we introduce deformable convolution and multi-head attention mechanisms to expand the dimension of the embedded vector and perform data augmentation to improve the model's adaptability to the home environment and its recognition accuracy.
It improves the accuracy of voiceprint recognition and the model's adaptation speed in the home environment, enabling more accurate identification of subtle voiceprint differences among family members and reducing the false recognition rate.
Smart Images

Figure CN121963750A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a voiceprint recognition method, apparatus, device, and storage medium for home environments. Background Technology
[0002] Voiceprint recognition technology, also known as speaker identification technology, is a core speech processing technology that verifies identity based on the physiological and behavioral characteristics of an individual in their speech signals. This technology analyzes an individual's unique voiceprint, including physiological features such as vocal cord thickness and oral cavity morphology, as well as sound patterns determined by behavioral features such as speech rate and intonation, to achieve identity verification. The development of voiceprint recognition technology can be roughly divided into three stages: In the traditional approach phase, voiceprint recognition mainly relied on techniques such as Dynamic Time Warping (DTW) and Gaussian Mixture Model (GMM). This phase of technology primarily relied on manually designed feature extraction methods, such as Mel-frequency cepstral coefficients (MFCCs), which suffer from poor adaptability to complex scenarios. In the early stages of deep learning, deep neural networks (DNN, CNN) began to replace traditional models, achieving end-to-end feature extraction; the introduction of embedding vector techniques such as i-vector and d-vector marked an initial improvement in the robustness of voiceprint recognition technology. As deep models matured, Temporal Delay Neural Networks (TDNNs) became the mainstream architecture due to their excellent ability to model the temporal characteristics of speech. ECAPA-TDNN (Enhanced Convolutional Attention TDNN) further improved its performance in noisy and channel-varying environments by introducing channel attention mechanisms and data augmentation techniques.
[0003] Nevertheless, in specific scenarios such as the home, voiceprint recognition technology still needs further optimization and improvement. Specifically, in a stable home environment with low noise levels, but where it is necessary to accurately distinguish subtle differences in voiceprints among family members, the original ECAPA-TDNN model has the following problems: 1. Fixed-size convolutional kernels are poorly adapted to acoustic features at different speech rates (e.g., compact features generated by fast speech and sparse features generated by slow speech), and are prone to missing key details such as labial and dental sounds, which means they have insufficient feature capture capabilities. 2. SE-Res2Block relies solely on channel attention and does not consider spatial dimensions (such as differences in energy distribution within speech frames). Its attention mechanism is simplistic, resulting in incomplete feature representation. 3. Multi-layer features are directly used for classification without weighting important features (such as formants of specific vowels), which means that feature aggregation lacks priority and leads to redundant information interfering with recognition. 4. The 192-dimensional speaker embedding vector is difficult to capture the subtle differences in voiceprints among family members (such as the changes in a person's voice under different emotions), and there is a problem of limited feature storage.
[0004] It is evident that existing technologies still need improvement and enhancement. Summary of the Invention
[0005] To overcome the shortcomings of existing technologies, the present invention aims to provide a voiceprint recognition method for home environments. It adopts a transfer learning strategy that combines general data pre-training with fine-tuning for home scenarios, which can improve the accuracy of voiceprint recognition and shorten the model adaptation time.
[0006] The first aspect of this invention provides a voiceprint recognition method for home environments, comprising: constructing an improved ECAPA-TDNN model and training the improved ECAPA-TDNN model to obtain a general voiceprint recognition model; acquiring fine-tuned data of a home scene and preprocessing it to obtain a processed fine-tuned dataset; training the general voiceprint recognition model based on the processed fine-tuned dataset to obtain a specific voiceprint recognition model; acquiring real-time audio information and preprocessing it, inputting the preprocessed real-time audio information into the specific voiceprint recognition model to obtain a real-time embedded feature vector; acquiring embedded features in a registration database, and comparing the real-time embedded feature vector with the embedded features to confirm the user's identity.
[0007] Optionally, in a first implementation of the first aspect of the present invention, the improved ECAPA-TDNN model includes an input layer, a feature extraction layer, an attention aggregation layer, and an output layer connected in sequence; the input layer is used to perform mean-variance normalization on the input features; the feature extraction layer includes an initial convolutional layer, three consecutive CBAM-Res2Block layers, and an integrated convolutional layer connected in sequence, wherein the CBAM-Res2Block layer incorporates deformable convolutions; the attention aggregation layer includes a multi-head attention mechanism layer and a pooling normalization layer connected in sequence; and the output layer is used to generate and output a 512-dimensional speaker embedding vector.
[0008] Optionally, in a second implementation of the first aspect of the present invention, training the improved ECAPA-TDNN model to obtain a general voiceprint recognition model includes: acquiring a general dataset covering multiple languages, multiple speech rates, and multiple noise scenarios; performing preprocessing, feature extraction, and feature concatenation on each speech in the general dataset to obtain a processed dataset, the processed dataset including an 80-dimensional voiceprint feature vector corresponding to each speech; dividing the processed dataset according to a preset division ratio to obtain a general training set and a general test set; randomly initializing the constructed improved ECAPA-TDNN model, setting the model's general training parameters, and selecting ArcFace as the model's loss function; and training and testing the randomly initialized improved ECAPA-TDNN model using the general training set and the general test set to obtain a general voiceprint recognition model.
[0009] Optionally, in a third implementation of the first aspect of the present invention, the step of acquiring and preprocessing the family scene fine-tuning data to obtain a processed fine-tuning dataset includes: acquiring family scene fine-tuning data, wherein the family scene fine-tuning data includes diverse speech of all family members, and the diverse speech includes different states and slight noise; performing noise addition processing, speech rate adjustment processing, and volume perturbation processing on the family scene fine-tuning data respectively to obtain enhanced fine-tuning data; performing feature extraction processing on each speech in the enhanced fine-tuning data, and concatenating the extracted voiceprint features into an 80-dimensional voiceprint feature vector to form a processed fine-tuning dataset.
[0010] Optionally, in the fourth implementation of the first aspect of the present invention, the step of training the general voiceprint recognition model based on the processed fine-tuned dataset to obtain a specific voiceprint recognition model includes: dividing the processed fine-tuned dataset into a specific training set and a specific test set based on a preset division ratio; loading the general voiceprint recognition model and freezing the initial convolutional layer and the first CBAM-Res2Block layer in the feature extraction layer; setting the fine-tuning training parameters of the general voiceprint recognition model and selecting ArcFace as the loss function of the general recognition model; and using the specific training set and the specific test set to train and test the remaining two CBAM-Res2Block layers, the integrated convolutional layer, the attention aggregation layer, and the output layer in the general voiceprint recognition model respectively to obtain a specific voiceprint recognition model.
[0011] Optionally, in the fifth implementation of the first aspect of the present invention, the step of acquiring real-time audio information and preprocessing it, and inputting the preprocessed real-time audio information into a specific voiceprint recognition model to obtain a real-time embedded feature vector, includes: acquiring real-time audio information; performing length adjustment processing on the real-time audio information to make the real-time audio information meet a preset speech length; sequentially performing feature extraction processing and feature concatenation processing on the length-adjusted real-time audio information to obtain an 80-dimensional real-time voiceprint feature vector; and inputting the 80-dimensional real-time voiceprint feature vector into a specific voiceprint recognition model to obtain a 512-dimensional real-time embedded feature vector.
[0012] Optionally, in a sixth implementation of the first aspect of the present invention, the step of obtaining the embedded features in the registration database and comparing the real-time embedded feature vector with the embedded features to confirm the user's identity includes: obtaining the embedded features in the registration database and obtaining a preset similarity threshold; calculating the vector similarity between the real-time embedded features and the embedded features in the registration database; if the calculated vector similarity is ≥ the preset similarity threshold, the user's identity is confirmed, indicating successful authentication; if the calculated vector similarity is < the preset similarity threshold, the process returns to obtaining real-time audio information and performing preprocessing.
[0013] A second aspect of the present invention provides a voiceprint recognition device for a home environment, comprising: a general training module for constructing an improved ECAPA-TDNN model and training the improved ECAPA-TDNN model to obtain a general voiceprint recognition model; a first processing module for acquiring and preprocessing fine-tuned data of a home scene to obtain a processed fine-tuned dataset; a specific training module for training the general voiceprint recognition model based on the processed fine-tuned dataset to obtain a specific voiceprint recognition model; a second processing module for acquiring and preprocessing real-time audio information and inputting the preprocessed real-time audio information into the specific voiceprint recognition model to obtain a real-time embedded feature vector; and a comparison module for acquiring embedded features in a registration database and comparing the real-time embedded feature vector with the embedded features to confirm the user's identity.
[0014] A third aspect of the present invention provides a voiceprint recognition device for a home environment, the voiceprint recognition device for a home environment comprising: a memory and at least one processor, the memory storing instructions; at least one processor calling the instructions in the memory to cause the voiceprint recognition device for a home environment to perform the various steps of the voiceprint recognition method for a home environment described in any of the preceding claims.
[0015] A fourth aspect of the present invention provides a computer-readable storage medium storing instructions that, when executed by a processor, implement the steps of the voiceprint recognition method for home environments described in any of the preceding claims.
[0016] In the technical solution of this invention, a transfer learning method is adopted, which uses a general dataset for pre-training and combines it with fine-tuning in a home setting. In the pre-training stage, the extensiveness of the general dataset enables the model to learn voiceprint features under various language and noise conditions, thus exhibiting stronger generalization ability when facing different users and environments. In the fine-tuning stage, the application of data augmentation technology further enhances the model's sensitivity to specific noise and speech characteristics in the home environment, enabling the model to more accurately identify the voiceprints of family members. That is, through the transfer learning method, not only is the accuracy of voiceprint recognition improved, but the adaptation time of the model in new environments is also significantly shortened. Attached Figure Description
[0017] Figure 1 A flowchart illustrating the voiceprint recognition method provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the voiceprint recognition device provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of the voiceprint recognition device provided in an embodiment of the present invention. Detailed Implementation
[0018] This invention provides a voiceprint recognition method, apparatus, device, and storage medium for home environments. In this invention, the terms "first," "second," "third," "fourth," etc. (if applicable) in the specification, claims, and accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" or "having" and any variations thereof are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0019] This application discloses a voiceprint recognition method for home environments. For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 One embodiment of the voiceprint recognition method for home environments in this invention includes: 101. Construct an improved ECAPA-TDNN model and train the improved ECAPA-TDNN model to obtain a general voiceprint recognition model; In this embodiment, the original ECAPA-TDNN model was structurally optimized to address the characteristics of a family setting where "members are fixed, the environment is stable, but subtle differences in voiceprints need to be accurately distinguished." The optimization measures include introducing deformable convolution, replacing the CBAM attention module, adding a multi-head attention mechanism, and expanding the embedding vector dimension to 512 dimensions. These improvements aim to address the shortcomings of the traditional ECAPA-TDNN model in adapting to changes in speech rate and the incompleteness of feature representation, thereby enhancing its resistance to common interference factors in the family environment (such as speech rate fluctuations and slight background noise) and significantly reducing the false rejection rate, i.e., the situation where family members are misidentified.
[0020] 102. Obtain and preprocess the fine-tuning data of the home scene to obtain the processed fine-tuning dataset; In this embodiment, the home scene fine-tuning data aims to personalize the data according to the unique voice characteristics of family members, including their pronunciation habits and intonation characteristics, in order to improve the adaptability of a specific voiceprint recognition model in a home scene.
[0021] 103. Train the general voiceprint recognition model based on the processed fine-tuned dataset to obtain a specific voiceprint recognition model; 104. Acquire real-time audio information and preprocess it. Input the preprocessed real-time audio information into a specific voiceprint recognition model to obtain a real-time embedded feature vector. In this embodiment, the real-time audio information is preprocessed to ensure that it is consistent with the input features input to the feature voiceprint recognition model during the training phase, thereby ensuring feature distribution matching.
[0022] 105. Obtain the embedded features from the registration database, compare the real-time embedded feature vector with the embedded features to confirm the user's identity; In this embodiment, efficient authentication is achieved through similarity comparison and threshold judgment, and the fault tolerance is improved by cyclically collecting data when the authentication fails. Through the real-time recognition process, both efficiency and accuracy can be taken into account, meeting the real-time response requirements of home smart devices, such as smart door locks.
[0023] This application discloses a voiceprint recognition method for home environments, employing a transfer learning approach that combines pre-training on a general dataset with fine-tuning in a home setting. During pre-training, the breadth of the general dataset enables the model to learn voiceprint features under various language and noise conditions, resulting in stronger generalization capabilities when facing different users and environments. In the fine-tuning stage, the application of data augmentation techniques further enhances the model's sensitivity to specific noise and speech characteristics within the home environment, enabling the model to more accurately identify the voiceprints of family members. In other words, by combining a hierarchical strategy of general training with home fine-tuning, the accuracy of voiceprint recognition in stable home environments can be improved, especially in identifying subtle voiceprint differences among family members (such as differences in tone between sisters), where the recognition accuracy is significantly enhanced, and the model's adaptation period in new environments is greatly reduced.
[0024] Furthermore, in this embodiment of the invention, the improved ECAPA-TDNN model includes an input layer, a feature extraction layer, an attention aggregation layer, and an output layer connected in sequence; the input layer is used to perform mean-variance normalization on the input features; the feature extraction layer includes an initial convolutional layer, three consecutive CBAM-Res2Block layers, and an integrated convolutional layer connected in sequence, wherein the CBAM-Res2Block layer incorporates deformable convolutions; the attention aggregation layer includes a multi-head attention mechanism layer and a pooling normalization layer connected in sequence; and the output layer is used to generate and output a 512-dimensional speaker embedding vector.
[0025] In this embodiment, the input layer is responsible for performing mean-variance normalization on the input features, which aims to eliminate the differences in volume and frequency response caused by different pickup devices, ensure the stability of feature distribution, and provide a unified input basis for subsequent processing layers.
[0026] The initial convolutional layer uses a 5×1 convolutional kernel to extract local short-term features of speech, laying the foundation for deep processing.
[0027] In the three consecutive CBAM-Res2Block layers, each Block layer embeds a deformable convolution mechanism that can dynamically adjust the sampling position to adapt to feature scale changes at different speech rates, such as compact features at fast speech rates and sparse features at slow speech rates. This enhances the ability to extract compact / sparse features and solves the problem that traditional fixed convolution kernels may miss detailed features such as labial and dental sounds. At the same time, the integration of the CBAM module can focus on key frequency bands in the channel dimension and capture the energy distribution differences within speech frames through a spatial attention mechanism, achieving dual screening of effective features and forming a more complete feature representation. This overcomes the limitation of traditional SE modules that only focus on the channel dimension.
[0028] The convolutional layer integrates multi-scale features into 512 dimensions, increasing the feature dimension to carry richer voiceprint information. Compared with the traditional 192-dimensional features, it can more effectively distinguish subtle differences among family members, such as formant changes caused by emotional fluctuations.
[0029] In the multi-head attention mechanism layer, eight attention heads are used to perform frame-level weighting on the 512×T dimensional features, giving higher weights to stressed frames and vowel frames to capture long-distance intonation change patterns, such as the sentence ending intonation unique to family members. By using a multi-head attention mechanism in the attention aggregation layer, the spliced multi-layer features can be weighted to strengthen important features, such as the weight ratio of specific vowel formants, thereby improving the effectiveness of feature aggregation.
[0030] The pooling normalization layer compresses variable-length features into fixed-length features through adaptive statistical pooling, which calculates the mean and standard deviation, while preserving global statistical features, such as the energy distribution features of the entire speech segment. At the same time, the pooling normalization layer further stabilizes the feature distribution and reduces the interference of redundant information. By combining the multi-head attention mechanism with the pooling normalization layer, redundant information in family speech is effectively filtered out, the weight of key features is increased, and the feature representation is made more focused.
[0031] The output layer is used to generate 512-dimensional speaker embedding vectors, which can store more detailed features, such as breathing rhythm and pronunciation habits, compared to traditional 192-dimensional vectors, thus improving the stability of recognition of the same member in different states, such as when they have a cold or when they are in a mood change.
[0032] Furthermore, in this embodiment of the invention, training the improved ECAPA-TDNN model to obtain a general voiceprint recognition model includes: 201. Obtain a general dataset that covers multiple languages, multiple speech rates, and multiple noise scenarios; In this embodiment, the general dataset adopts the VoxCeleb1 dataset, which covers multiple languages (such as Chinese, English, and Japanese), multiple speaking speeds (0.8-1.5x speed), and multiple noise scenarios (office, street, and quiet indoor environment). This ensures that the general features learned by the model have broad adaptability, enabling the model to have basic voiceprint recognition capabilities across scenarios. This lays the foundation for subsequent fine-tuning in the home scenario and can reduce the training cost of subsequent fine-tuning.
[0033] 202. Perform preprocessing, feature extraction, and feature concatenation on each speech in the general dataset to obtain a processed dataset, wherein the processed dataset includes an 80-dimensional voiceprint feature vector corresponding to each speech; In this embodiment, firstly, noise reduction processing is performed on each speech segment, and its format is uniformly adjusted to a sampling frequency of 16kHz. Next, voiceprint features are extracted from the processed speech. The extracted voiceprint features include spectrogram, Mel-frequency cepstral coefficients, linearly predicted cepstral coefficients, spectral centroid, spectral bandwidth, spectral roll-off point, spectral entropy, short-time zero-crossing rate, and root mean square energy. The extracted voiceprint features are integrated to form an 80-dimensional voiceprint feature vector. This vector comprehensively considers the physiological characteristics of speech, such as formants, as well as behavioral characteristics, such as speech rate. It is both information-rich and has appropriate dimensions, which helps to avoid model overfitting. Compared with a single feature, the model's ability to identify complex speech features is enhanced, providing sufficient feature support for the identification of subtle differences in home scenarios.
[0034] 203. Divide the processed dataset according to the preset partitioning ratio to obtain a general training set and a general test set; 204. Randomly initialize the constructed improved ECAPA-TDNN model, set the general training parameters of the model, and select ArcFace as the loss function of the model; 205. Using a universal training set and a universal test set, the improved ECAPA-TDNN model after random initialization is trained and tested respectively to obtain a universal voiceprint recognition model; In this embodiment, the processed dataset is divided into a general training set and a general test set in a 7:3 ratio. Based on the random initialization of model parameters, ArcFace is selected as the loss function, and the batch size is set to 32 and the learning rate is 0.001. 50 iterations are performed to ensure that the model can converge stably. By applying the ArcFace loss function, the distance between features of different speakers is significantly increased, while the volatility of features of the same speaker is reduced, thereby making the general voiceprint recognition model perform better in terms of intra-class cohesion and inter-class discriminability.
[0035] Furthermore, in this embodiment of the invention, the step of acquiring and preprocessing the home scene fine-tuning data to obtain the processed fine-tuning dataset includes: 301. Obtain fine-tuning data of family scene, wherein the fine-tuning data of family scene includes the diverse voices of all family members, and the diverse voices include different states and slight noise; In this embodiment, taking into account the characteristics of fixed family members and stable environment, diverse voices of each family member are collected, including daily instructions, emotional voices, and voices in different health states, to ensure that the data covers possible voice changes in the family.
[0036] 302. Noise addition, speech rate adjustment, and volume perturbation processing are applied to the fine-tuning data of the home scene to obtain enhanced fine-tuning data; In this embodiment, the noise addition process involves superimposing subtle noises specific to the home environment, such as the sound of tableware clattering or background music from a television, and controlling the signal-to-noise ratio between 20-30 dB to simulate sound interference in a real home environment. The speech rate adjustment process uses upsampling or downsampling techniques to achieve a speech rate variation of 0.9-1.1 times to adapt to fluctuations in speech rate during daily communication among family members, such as children speaking quickly or the elderly speaking slowly. The volume perturbation process adjusts the volume within a range of ±3 dB to simulate changes in the distance between family members and the sound pickup device, such as close-range conversations or shouting from a distance. Compared to the home scene fine-tuning data, the enhanced fine-tuning data expands the data volume to five times that of the original data, effectively alleviating the overfitting problem caused by the small amount of home data, improving the generalization ability of the specific voiceprint recognition model in home scenes, and reducing misidentification of scenes not seen in actual applications.
[0037] 303. Perform feature extraction processing on each speech in the enhanced fine-tuning data, and concatenate the extracted voiceprint features into an 80-dimensional voiceprint feature vector to form the processed fine-tuning dataset. In this embodiment, consistent with the general training phase, an 80-dimensional voiceprint feature vector is extracted to ensure that the feature distribution matches the model's expectations during fine-tuning, avoiding accuracy loss caused by distribution shift and ensuring fine-tuning efficiency.
[0038] Furthermore, in this embodiment of the invention, training the general voiceprint recognition model based on the processed fine-tuned dataset to obtain a specific voiceprint recognition model includes: 401. Based on a preset partitioning ratio, the processed fine-tuning dataset is divided into a specific training set and a specific test set; In this embodiment, the processed fine-tuned dataset is divided into a specific training set and a specific test set in a 7:3 ratio to ensure that the risk of overfitting the model in the home scenario is controllable.
[0039] 402. Load the general voiceprint recognition model and freeze the initial convolutional layer and the first CBAM-Res2Block layer in the feature extraction layer; In this embodiment, the initial convolutional layer and the first CBAM-Res2Block layer of the feature extraction layer are frozen. These two layers have learned basic acoustic features, such as short-time energy and basic spectral structure of speech, during general training. Freezing them can preserve the general feature extraction capability and avoid overfitting under small amounts of data.
[0040] 403. Set the fine-tuning training parameters for the general voiceprint recognition model, and select ArcFace as the loss function for the general recognition model; In this embodiment, a batch size of 16 is used to accommodate the characteristics of small family datasets. Simultaneously, the learning rate is set to 0.0001, which is only one-tenth of the learning rate in general training scenarios. This combination of a small learning rate and small batch size avoids overfitting caused by small family datasets. Furthermore, the parameters of the unfrozen layers are updated slowly. These unfrozen layers include the remaining two CBAM-Res2Block layers, the multi-head attention mechanism, and the output layer. Through this layered freezing strategy, the model can gradually learn the unique voiceprint features of family members while maintaining its general performance. For example, the father's low-pitched formants and the child's high-frequency overtones effectively distinguish similar voiceprints and improve the accuracy of specific voiceprint recognition models in identifying family members.
[0041] 404. Using a specific training set and a specific test set, train and test the remaining two CBAM-Res2Block layers, the fusion convolutional layer, the attention aggregation layer, and the output layer in the general voiceprint recognition model to obtain a specific voiceprint recognition model.
[0042] Furthermore, in this embodiment of the invention, the step of acquiring real-time audio information and preprocessing it, then inputting the preprocessed real-time audio information into a specific voiceprint recognition model to obtain a real-time embedded feature vector, includes: 501. Obtain real-time audio information and perform length adjustment processing on the real-time audio information to make the real-time audio information meet the preset voice length. In this embodiment, the real-time audio is automatically truncated or padded with zeros to a fixed length of 3 seconds to avoid feature fluctuations caused by differences in speech duration, such as incomplete features in short sentences or redundancy in long sentences, thus ensuring the feature stability of the input model.
[0043] 502. The real-time audio information after length adjustment is subjected to feature extraction and feature concatenation processes in sequence to obtain an 80-dimensional real-time voiceprint feature vector. In this embodiment, the same feature extraction method as in the training phase is used, which significantly reduces the difference between real-time recognition accuracy and that during training and testing, ensuring the reliability of the recognition results.
[0044] 503. Input the 80-dimensional real-time voiceprint feature vector into a specific voiceprint recognition model to obtain a 512-dimensional real-time embedded feature vector.
[0045] Furthermore, in this embodiment of the invention, obtaining the embedded features from the registration database and comparing the real-time embedded feature vector with the embedded features to confirm the user's identity includes: 601. Obtain the embedded features from the registration database and obtain the preset similarity threshold; In this embodiment, when a family member uses the device for the first time, they record 3-5 voice messages to generate a 512-dimensional embedding vector. The average value of these vectors is taken as the member's registration feature and saved in the registration database. The preset similarity threshold can be 95%.
[0046] 602. Calculate the vector similarity between the real-time embedded features and the embedded features in the registration database; In this embodiment, a cosine similarity algorithm can be used to calculate the similarity between the real-time embedded vector and the registered features. This algorithm is insensitive to changes in the scale of the vector and can effectively evaluate the directional consistency of voiceprint features, such as the trend of the same person's intonation, to improve the accuracy of the calculated vector similarity.
[0047] 603. If the calculated vector similarity is greater than or equal to the preset similarity threshold, the user's identity is confirmed, indicating successful authentication. 604. If the calculated vector similarity is less than the preset similarity threshold, then return to execute the process of obtaining real-time audio information and performing preprocessing. In this embodiment, if the calculated vector similarity is lower than 0.95, real-time audio information is automatically re-acquired. The acquisition process can be repeated up to three times to reduce false rejections caused by poor single voice quality, such as coughing or background noise. By setting a similarity threshold of 0.95 and combining it with a three-acquisition loop mechanism, the system's security is ensured, and the false rejection rate during normal use by family members is greatly reduced, achieving a balance between security and ease of use.
[0048] The above describes the voiceprint recognition method for a home environment in the embodiments of the present invention. The following describes the voiceprint recognition device for a home environment in the embodiments of the present invention. Please refer to [link / reference]. Figure 2 One embodiment of the voiceprint recognition device for home environments in this invention includes: The general training module 701 is used to construct an improved ECAPA-TDNN model and train the improved ECAPA-TDNN model to obtain a general voiceprint recognition model. The first processing module 702 is used to acquire and preprocess the home scene fine-tuning data to obtain the processed fine-tuning dataset. A specific training module 703 is used to train the general voiceprint recognition model based on the processed fine-tuned dataset to obtain a specific voiceprint recognition model. The second processing module 704 is used to acquire real-time audio information and perform preprocessing, and input the preprocessed real-time audio information into a specific voiceprint recognition model to obtain a real-time embedded feature vector. The comparison module 705 is used to obtain the embedded features in the registration database, compare the real-time embedded feature vector with the embedded features, and confirm the user's identity.
[0049] Based on the same ideas as the methods in the above embodiments, the apparatus provided in this application can implement the methods in the above embodiments.
[0050] above Figure 2 The voiceprint recognition device for home environment in this embodiment of the invention is described in detail from the perspective of modular functional entities. The voiceprint recognition device for home environment in this embodiment of the invention is described in detail from the perspective of hardware processing.
[0051] Figure 3 This is a schematic diagram of the structure of a voiceprint recognition device 800 for a home environment provided by an embodiment of the present invention. The voiceprint recognition device 800 for a home environment can vary considerably due to different configurations or performance. It may include one or more central processing units (CPUs) 810 and memory 820, and one or more storage media 830 (e.g., one or more mass storage devices) for storing application programs 833 or data 832. The memory 820 and storage media 830 can be temporary or persistent storage. The program stored in the storage media 830 may include one or more modules (not shown in the diagram), each module may include a series of instruction operations on the voiceprint recognition device 800 for a home environment. Furthermore, the processor 810 may be configured to communicate with the storage media 830 and execute a series of instruction operations in the storage media 830 on the voiceprint recognition device 800 for a home environment to implement the steps of the voiceprint recognition method for a home environment provided in the above-described method embodiments.
[0052] The voiceprint recognition device 800 for home environments may also include one or more power supplies 840, one or more wired or wireless network interfaces 850, one or more input / output interfaces 860, and / or one or more operating systems 831, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 3 The illustrated structure of a voiceprint recognition device for a home environment does not constitute a limitation on voiceprint recognition devices for a home environment. It may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.
[0053] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the steps of a voiceprint recognition method for a home environment.
[0054] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system, device, or unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0055] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0056] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A voiceprint recognition method for home environments, characterized in that, include: An improved ECAPA-TDNN model was constructed and trained to obtain a general voiceprint recognition model. Acquire fine-tuning data for home scenarios and preprocess it to obtain the processed fine-tuning dataset; The general voiceprint recognition model is trained based on the processed fine-tuned dataset to obtain a specific voiceprint recognition model. Real-time audio information is acquired and preprocessed. The preprocessed real-time audio information is then input into a specific voiceprint recognition model to obtain a real-time embedded feature vector. Retrieve embedded features from the registration database, compare the real-time embedded feature vector with the embedded features to confirm the user's identity.
2. The voiceprint recognition method for home environments according to claim 1, characterized in that, The improved ECAPA-TDNN model comprises an input layer, a feature extraction layer, an attention aggregation layer, and an output layer connected in sequence. The input layer is used to perform mean-variance normalization on the input features. The feature extraction layer comprises an initial convolutional layer, three consecutive CBAM-Res2Block layers, and an integrated convolutional layer connected in sequence, wherein the CBAM-Res2Block layer incorporates deformable convolutions. The attention aggregation layer comprises a multi-head attention mechanism layer and a pooling normalization layer connected in sequence. The output layer is used to generate and output a 512-dimensional speaker embedding vector.
3. The voiceprint recognition method for home environments according to claim 2, characterized in that, The improved ECAPA-TDNN model is trained to obtain a general voiceprint recognition model, including: Obtain a general dataset that covers multiple languages, multiple speech rates, and multiple noise scenarios; Each speech in the general dataset is preprocessed, feature extracted, and feature concatenated to obtain a processed dataset, which includes an 80-dimensional voiceprint feature vector corresponding to each speech. The processed dataset is divided according to a preset division ratio to obtain a general training set and a general test set. The improved ECAPA-TDNN model was randomly initialized, and the general training parameters of the model were set, and ArcFace was selected as the loss function of the model. Using a universal training set and a universal test set, the improved ECAPA-TDNN model after random initialization was trained and tested respectively to obtain a universal voiceprint recognition model.
4. The voiceprint recognition method for home environments according to claim 2, characterized in that, The process of acquiring and preprocessing home scene fine-tuning data to obtain a processed fine-tuning dataset includes: Acquire fine-tuning data of a family scene, which includes diverse voices of all family members, including different states and slight noise; The home scene fine-tuning data was subjected to noise addition, speech rate adjustment and volume perturbation processing to obtain enhanced fine-tuning data. Feature extraction is performed on each speech in the enhanced fine-tuning data, and the extracted voiceprint features are concatenated into an 80-dimensional voiceprint feature vector to form the processed fine-tuning dataset.
5. The voiceprint recognition method for home environments according to claim 4, characterized in that, The process of training the general voiceprint recognition model based on the processed, fine-tuned dataset to obtain a specific voiceprint recognition model includes: Based on a preset partitioning ratio, the processed fine-tuned dataset is divided into a specific training set and a specific test set. Load the general voiceprint recognition model and freeze the initial convolutional layer and the first CBAM-Res2Block layer in the feature extraction layer; Set the fine-tuning training parameters for the general voiceprint recognition model and select ArcFace as the loss function for the general recognition model; Using specific training and testing sets, the remaining two CBAM-Res2Block layers, the ensemble convolutional layer, the attention aggregation layer, and the output layer in the general voiceprint recognition model are trained and tested respectively to obtain a specific voiceprint recognition model.
6. The voiceprint recognition method for home environments according to claim 1, characterized in that, The process of acquiring and preprocessing real-time audio information, and then inputting the preprocessed real-time audio information into a specific voiceprint recognition model to obtain a real-time embedded feature vector, includes: Acquire real-time audio information and perform length adjustment processing on the real-time audio information to make the real-time audio information meet the preset voice length; The real-time audio information after length adjustment is subjected to feature extraction and feature concatenation processes in sequence to obtain an 80-dimensional real-time voiceprint feature vector. By inputting the 80-dimensional real-time voiceprint feature vector into a specific voiceprint recognition model, a 512-dimensional real-time embedded feature vector is obtained.
7. The voiceprint recognition method for home environments according to claim 1, characterized in that, The step of obtaining embedded features from the registration database and comparing the real-time embedded feature vector with the embedded features to confirm the user's identity includes: Obtain the embedded features from the registration database and obtain the preset similarity threshold; Calculate the vector similarity between the real-time embedded features and the embedded features in the registration database; If the calculated vector similarity is greater than or equal to the preset similarity threshold, the user's identity is confirmed, indicating successful authentication. If the calculated vector similarity is less than the preset similarity threshold, then return to execute the process of obtaining real-time audio information and performing preprocessing.
8. A voiceprint recognition device for home environments, characterized in that, include: A general training module is used to build an improved ECAPA-TDNN model and train the improved ECAPA-TDNN model to obtain a general voiceprint recognition model. The first processing module is used to acquire and preprocess the home scene fine-tuning data to obtain the processed fine-tuning dataset. A specific training module is used to train the general voiceprint recognition model based on the processed fine-tuned dataset to obtain a specific voiceprint recognition model. The second processing module is used to acquire real-time audio information and perform preprocessing. The preprocessed real-time audio information is then input into a specific voiceprint recognition model to obtain a real-time embedded feature vector. The comparison module is used to obtain embedded features from the registration database, compare the real-time embedded feature vector with the embedded features, and confirm the user's identity.
9. A voiceprint recognition device for home environments, characterized in that, The voiceprint recognition device for home environments includes: a memory and at least one processor, wherein the memory stores instructions; At least one of the processors invokes the instructions in the memory to cause the home-oriented voiceprint recognition device to perform the steps of the home-oriented voiceprint recognition method as claimed in any one of claims 1-7.
10. A computer-readable storage medium storing instructions thereon, characterized in that, When the instructions are executed by the processor, they implement the steps of the voiceprint recognition method for home environments as described in any one of claims 1-7.