基于PaddlePaddle实现的声纹识别系统

news/2024/11/25 23:34:59/

前言

本项目使用了EcapaTdnn、ResNetSE、ERes2Net、CAM++等多种先进的声纹识别模型,不排除以后会支持更多模型,同时本项目也支持了MelSpectrogram、Spectrogram、MFCC、Fbank等多种数据预处理方法,使用了ArcFace Loss,ArcFace loss:Additive Angular Margin Loss(加性角度间隔损失函数),对应项目中的AAMLoss,对特征向量和权重归一化,对θ加上角度间隔m,角度间隔比余弦间隔在对角度的影响更加直接,除此之外,还支持AMLoss、ARMLoss、CELoss等多种损失函数。

源码地址:VoiceprintRecognition-PaddlePaddle

使用环境:

  • Anaconda 3
  • Python 3.8
  • PaddlePaddle 2.4.1
  • Windows 10 or Ubuntu 18.04

项目特性

  1. 支持模型:EcapaTdnn、TDNN、Res2Net、ResNetSE、ERes2Net、CAM++
  2. 支持池化层:AttentiveStatsPool(ASP)、SelfAttentivePooling(SAP)、TemporalStatisticsPooling(TSP)、TemporalAveragePooling(TAP)、TemporalStatsPool(TSTP)
  3. 支持损失函数:AAMLoss、AMLoss、ARMLoss、CELoss
  4. 支持预处理方法:MelSpectrogram、Spectrogram、MFCC、Fbank

模型论文:

  • EcapaTdnn:ECAPA-TDNN: Emphasized Channel Attention, Propagation and Aggregation in TDNN Based Speaker Verification
  • TDNN:Prediction of speech intelligibility with DNN-based performance measures
  • Res2Net:Res2Net: A New Multi-scale Backbone Architecture
  • ResNetSE:Squeeze-and-Excitation Networks
  • CAMPPlus:CAM++: A Fast and Efficient Network for Speaker Verification Using Context-Aware Masking
  • ERes2Net:An Enhanced Res2Net with Local and Global Feature Fusion for Speaker Verification

模型下载

模型Params(M)预处理方法数据集train speakersthresholdEERMinDCF
CAM++7.5FbankCN-Celeb27960.250.094850.56214
ERes2Net8.2FbankCN-Celeb27960.220.096370.52627
ResNetSE10.7FbankCN-Celeb2796
EcapaTdnn6.7FbankCN-Celeb27960.250.104650.58521
TDNN3.2FbankCN-Celeb27960.230.118040.61070
Res2Net7.2FbankCN-Celeb27960.180.141260.68511
ERes2Net8.2Fbank其他数据集20W0.360.029390.18355
CAM++7.5Flank其他数据集20W0.290.047680.31429

说明:

  1. 评估的测试集为CN-Celeb的测试集,包含196个说话人。

安装环境

  • 首先安装的是PaddlePaddle的GPU版本,如果已经安装过了,请跳过。
conda install paddlepaddle-gpu==2.4.1 cudatoolkit=10.2 --channel https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/Paddle/
  • 安装ppvector库。

使用pip安装,命令如下:

python -m pip install ppvector -U -i https://pypi.tuna.tsinghua.edu.cn/simple

建议源码安装,源码安装能保证使用最新代码。

git clone https://github.com/yeyupiaoling/VoiceprintRecognition_PaddlePaddle.git
cd VoiceprintRecognition_PaddlePaddle/
python setup.py install

修改预处理方法

配置文件中默认使用的是Fbank预处理方法,如果要使用其他预处理方法,可以修改配置文件中的安装下面方式修改,具体的值可以根据自己情况修改。如果不清楚如何设置参数,可以直接删除该部分,直接使用默认值。

# 数据预处理参数
preprocess_conf:# 音频预处理方法,支持:LogMelSpectrogram、MelSpectrogram、Spectrogram、MFCC、Fbankfeature_method: 'Fbank'# 设置API参数,更参数查看对应API,不清楚的可以直接删除该部分,直接使用默认值method_args:sr: 16000n_mels: 80

训练模型

使用train.py训练模型,本项目支持多个音频预处理方式,通过configs/ecapa_tdnn.yml配置文件的参数preprocess_conf.feature_method可以指定,MelSpectrogram为梅尔频谱,Spectrogram为语谱图,MFCC梅尔频谱倒谱系数。通过参数augment_conf_path可以指定数据增强方式。训练过程中,会使用VisualDL保存训练日志,通过启动VisualDL可以随时查看训练结果,启动命令visualdl --logdir=log --host 0.0.0.0

# 单卡训练
CUDA_VISIBLE_DEVICES=0 python train.py
# 多卡训练
python -m paddle.distributed.launch --gpus '0,1' train.py

训练输出日志:

[2023-08-05 09:52:06.497988 INFO   ] utils:print_arguments:13 - ----------- 额外配置参数 -----------
[2023-08-05 09:52:06.498094 INFO   ] utils:print_arguments:15 - configs: configs/ecapa_tdnn.yml
[2023-08-05 09:52:06.498149 INFO   ] utils:print_arguments:15 - do_eval: True
[2023-08-05 09:52:06.498191 INFO   ] utils:print_arguments:15 - local_rank: 0
[2023-08-05 09:52:06.498230 INFO   ] utils:print_arguments:15 - pretrained_model: None
[2023-08-05 09:52:06.498269 INFO   ] utils:print_arguments:15 - resume_model: None
[2023-08-05 09:52:06.498306 INFO   ] utils:print_arguments:15 - save_model_path: models/
[2023-08-05 09:52:06.498342 INFO   ] utils:print_arguments:15 - use_gpu: True
[2023-08-05 09:52:06.498378 INFO   ] utils:print_arguments:16 - ------------------------------------------------
[2023-08-05 09:52:06.513761 INFO   ] utils:print_arguments:18 - ----------- 配置文件参数 -----------
[2023-08-05 09:52:06.513906 INFO   ] utils:print_arguments:21 - dataset_conf:
[2023-08-05 09:52:06.513957 INFO   ] utils:print_arguments:24 -         dataLoader:
[2023-08-05 09:52:06.513995 INFO   ] utils:print_arguments:26 -                 batch_size: 64
[2023-08-05 09:52:06.514031 INFO   ] utils:print_arguments:26 -                 num_workers: 4
[2023-08-05 09:52:06.514066 INFO   ] utils:print_arguments:28 -         do_vad: False
[2023-08-05 09:52:06.514101 INFO   ] utils:print_arguments:28 -         enroll_list: dataset/enroll_list.txt
[2023-08-05 09:52:06.514135 INFO   ] utils:print_arguments:24 -         eval_conf:
[2023-08-05 09:52:06.514169 INFO   ] utils:print_arguments:26 -                 batch_size: 1
[2023-08-05 09:52:06.514203 INFO   ] utils:print_arguments:26 -                 max_duration: 20
[2023-08-05 09:52:06.514237 INFO   ] utils:print_arguments:28 -         max_duration: 3
[2023-08-05 09:52:06.514274 INFO   ] utils:print_arguments:28 -         min_duration: 0.5
[2023-08-05 09:52:06.514308 INFO   ] utils:print_arguments:28 -         noise_aug_prob: 0.2
[2023-08-05 09:52:06.514342 INFO   ] utils:print_arguments:28 -         noise_dir: dataset/noise
[2023-08-05 09:52:06.514374 INFO   ] utils:print_arguments:28 -         num_speakers: 3242
[2023-08-05 09:52:06.514408 INFO   ] utils:print_arguments:28 -         sample_rate: 16000
[2023-08-05 09:52:06.514441 INFO   ] utils:print_arguments:28 -         speed_perturb: True
[2023-08-05 09:52:06.514475 INFO   ] utils:print_arguments:28 -         target_dB: -20
[2023-08-05 09:52:06.514508 INFO   ] utils:print_arguments:28 -         train_list: dataset/train_list.txt
[2023-08-05 09:52:06.514542 INFO   ] utils:print_arguments:28 -         trials_list: dataset/trials_list.txt
[2023-08-05 09:52:06.514575 INFO   ] utils:print_arguments:28 -         use_dB_normalization: True
[2023-08-05 09:52:06.514609 INFO   ] utils:print_arguments:21 - loss_conf:
[2023-08-05 09:52:06.514643 INFO   ] utils:print_arguments:24 -         args:
[2023-08-05 09:52:06.514678 INFO   ] utils:print_arguments:26 -                 easy_margin: False
[2023-08-05 09:52:06.514713 INFO   ] utils:print_arguments:26 -                 margin: 0.2
[2023-08-05 09:52:06.514746 INFO   ] utils:print_arguments:26 -                 scale: 32
[2023-08-05 09:52:06.514779 INFO   ] utils:print_arguments:24 -         margin_scheduler_args:
[2023-08-05 09:52:06.514814 INFO   ] utils:print_arguments:26 -                 final_margin: 0.3
[2023-08-05 09:52:06.514848 INFO   ] utils:print_arguments:28 -         use_loss: AAMLoss
[2023-08-05 09:52:06.514882 INFO   ] utils:print_arguments:28 -         use_margin_scheduler: True
[2023-08-05 09:52:06.514915 INFO   ] utils:print_arguments:21 - model_conf:
[2023-08-05 09:52:06.514950 INFO   ] utils:print_arguments:24 -         backbone:
[2023-08-05 09:52:06.514984 INFO   ] utils:print_arguments:26 -                 embd_dim: 192
[2023-08-05 09:52:06.515017 INFO   ] utils:print_arguments:26 -                 pooling_type: ASP
[2023-08-05 09:52:06.515050 INFO   ] utils:print_arguments:24 -         classifier:
[2023-08-05 09:52:06.515084 INFO   ] utils:print_arguments:26 -                 num_blocks: 0
[2023-08-05 09:52:06.515118 INFO   ] utils:print_arguments:21 - optimizer_conf:
[2023-08-05 09:52:06.515154 INFO   ] utils:print_arguments:28 -         learning_rate: 0.001
[2023-08-05 09:52:06.515188 INFO   ] utils:print_arguments:28 -         optimizer: Adam
[2023-08-05 09:52:06.515221 INFO   ] utils:print_arguments:28 -         scheduler: CosineAnnealingLR
[2023-08-05 09:52:06.515254 INFO   ] utils:print_arguments:28 -         scheduler_args: None
[2023-08-05 09:52:06.515289 INFO   ] utils:print_arguments:28 -         weight_decay: 1e-06
[2023-08-05 09:52:06.515323 INFO   ] utils:print_arguments:21 - preprocess_conf:
[2023-08-05 09:52:06.515357 INFO   ] utils:print_arguments:28 -         feature_method: MelSpectrogram
[2023-08-05 09:52:06.515390 INFO   ] utils:print_arguments:24 -         method_args:
[2023-08-05 09:52:06.515426 INFO   ] utils:print_arguments:26 -                 f_max: 14000.0
[2023-08-05 09:52:06.515460 INFO   ] utils:print_arguments:26 -                 f_min: 50.0
[2023-08-05 09:52:06.515493 INFO   ] utils:print_arguments:26 -                 hop_length: 320
[2023-08-05 09:52:06.515527 INFO   ] utils:print_arguments:26 -                 n_fft: 1024
[2023-08-05 09:52:06.515560 INFO   ] utils:print_arguments:26 -                 n_mels: 64
[2023-08-05 09:52:06.515593 INFO   ] utils:print_arguments:26 -                 sample_rate: 16000
[2023-08-05 09:52:06.515626 INFO   ] utils:print_arguments:26 -                 win_length: 1024
[2023-08-05 09:52:06.515660 INFO   ] utils:print_arguments:21 - train_conf:
[2023-08-05 09:52:06.515694 INFO   ] utils:print_arguments:28 -         log_interval: 100
[2023-08-05 09:52:06.515728 INFO   ] utils:print_arguments:28 -         max_epoch: 30
[2023-08-05 09:52:06.515761 INFO   ] utils:print_arguments:30 - use_model: EcapaTdnn
[2023-08-05 09:52:06.515794 INFO   ] utils:print_arguments:31 - ------------------------------------------------
----------------------------------------------------------------------------------------Layer (type)             Input Shape          Output Shape         Param #    
========================================================================================Conv1D-2              [[1, 64, 102]]        [1, 512, 98]         164,352    Conv1d-1              [[1, 64, 98]]         [1, 512, 98]            0       ReLU-1               [[1, 512, 98]]        [1, 512, 98]            0       BatchNorm1D-2            [[1, 512, 98]]        [1, 512, 98]          2,048     BatchNorm1d-1            [[1, 512, 98]]        [1, 512, 98]            0       TDNNBlock-1             [[1, 64, 98]]         [1, 512, 98]            0       Conv1D-4              [[1, 512, 98]]        [1, 512, 98]         262,656    Conv1d-3              [[1, 512, 98]]        [1, 512, 98]            0       ReLU-2               [[1, 512, 98]]        [1, 512, 98]            0       BatchNorm1D-4            [[1, 512, 98]]        [1, 512, 98]          2,048     BatchNorm1d-3            [[1, 512, 98]]        [1, 512, 98]            0       TDNNBlock-2             [[1, 512, 98]]        [1, 512, 98]            0       
··········································SEBlock-3           [[1, 512, 98], None]     [1, 512, 98]            0       SERes2NetBlock-3          [[1, 512, 98]]        [1, 512, 98]            0       Conv1D-70             [[1, 1536, 98]]       [1, 1536, 98]        2,360,832   Conv1d-69             [[1, 1536, 98]]       [1, 1536, 98]            0       ReLU-32              [[1, 1536, 98]]       [1, 1536, 98]            0       BatchNorm1D-58          [[1, 1536, 98]]       [1, 1536, 98]          6,144     BatchNorm1d-57          [[1, 1536, 98]]       [1, 1536, 98]            0       TDNNBlock-29           [[1, 1536, 98]]       [1, 1536, 98]            0       Conv1D-72             [[1, 4608, 98]]        [1, 128, 98]         589,952    Conv1d-71             [[1, 4608, 98]]        [1, 128, 98]            0       ReLU-33               [[1, 128, 98]]        [1, 128, 98]            0       BatchNorm1D-60           [[1, 128, 98]]        [1, 128, 98]           512      BatchNorm1d-59           [[1, 128, 98]]        [1, 128, 98]            0       TDNNBlock-30           [[1, 4608, 98]]        [1, 128, 98]            0       Tanh-1               [[1, 128, 98]]        [1, 128, 98]            0       Conv1D-74              [[1, 128, 98]]       [1, 1536, 98]         198,144    Conv1d-73              [[1, 128, 98]]       [1, 1536, 98]            0       
AttentiveStatisticsPooling-1   [[1, 1536, 98]]        [1, 3072, 1]            0       BatchNorm1D-62           [[1, 3072, 1]]        [1, 3072, 1]         12,288     BatchNorm1d-61           [[1, 3072, 1]]        [1, 3072, 1]            0       Conv1D-76              [[1, 3072, 1]]        [1, 192, 1]          590,016    Conv1d-75              [[1, 3072, 1]]        [1, 192, 1]             0       EcapaTdnn-1             [[1, 98, 64]]           [1, 192]              0       SpeakerIdentification-1         [[1, 192]]           [1, 9726]          1,867,392   
========================================================================================
Total params: 8,039,808
Trainable params: 8,020,480
Non-trainable params: 19,328
----------------------------------------------------------------------------------------
Input size (MB): 0.02
Forward/backward pass size (MB): 35.60
Params size (MB): 30.67
Estimated Total Size (MB): 66.30
----------------------------------------------------------------------------------------
[2023-08-05 09:52:08.084231 INFO   ] trainer:train:388 - 训练数据:874175
[2023-08-05 09:52:09.186542 INFO   ] trainer:__train_epoch:334 - Train epoch: [1/30], batch: [0/13659], loss: 11.95824, accuracy: 0.00000, learning rate: 0.00100000, speed: 58.09 data/sec, eta: 5 days, 5:24:08
[2023-08-05 09:52:22.477905 INFO   ] trainer:__train_epoch:334 - Train epoch: [1/30], batch: [100/13659], loss: 10.35675, accuracy: 0.00278, learning rate: 0.00100000, speed: 481.65 data/sec, eta: 15:07:15
[2023-08-05 09:52:35.948581 INFO   ] trainer:__train_epoch:334 - Train epoch: [1/30], batch: [200/13659], loss: 10.22089, accuracy: 0.00505, learning rate: 0.00100000, speed: 475.27 data/sec, eta: 15:19:12
[2023-08-05 09:52:49.249098 INFO   ] trainer:__train_epoch:334 - Train epoch: [1/30], batch: [300/13659], loss: 10.00268, accuracy: 0.00706, learning rate: 0.00100000, speed: 481.45 data/sec, eta: 15:07:11
[2023-08-05 09:53:03.716015 INFO   ] trainer:__train_epoch:334 - Train epoch: [1/30], batch: [400/13659], loss: 9.76052, accuracy: 0.00830, learning rate: 0.00100000, speed: 442.74 data/sec, eta: 16:26:16
[2023-08-05 09:53:18.258807 INFO   ] trainer:__train_epoch:334 - Train epoch: [1/30], batch: [500/13659], loss: 9.50189, accuracy: 0.01060, learning rate: 0.00100000, speed: 440.46 data/sec, eta: 16:31:08
[2023-08-05 09:53:31.618354 INFO   ] trainer:__train_epoch:334 - Train epoch: [1/30], batch: [600/13659], loss: 9.26083, accuracy: 0.01256, learning rate: 0.00100000, speed: 479.50 data/sec, eta: 15:10:12
[2023-08-05 09:53:45.439642 INFO   ] trainer:__train_epoch:334 - Train epoch: [1/30], batch: [700/13659], loss: 9.03548, accuracy: 0.01449, learning rate: 0.00099999, speed: 463.63 data/sec, eta: 15:41:08

VisualDL页面:
VisualDL页面

评估模型

训练结束之后会保存预测模型,我们用预测模型来预测测试集中的音频特征,然后使用音频特征进行两两对比,计算EER和MinDCF。

python eval.py

输出类似如下:

······
------------------------------------------------
W0425 08:27:32.057426 17654 device_context.cc:447] Please NOTE: device: 0, GPU Compute Capability: 7.5, Driver API Version: 11.6, Runtime API Version: 10.2
W0425 08:27:32.065165 17654 device_context.cc:465] device: 0, cuDNN Version: 7.6.
[2023-03-16 20:20:47.195908 INFO   ] trainer:evaluate:341 - 成功加载模型:models/EcapaTdnn_Fbank/best_model/model.pth
100%|███████████████████████████| 84/84 [00:28<00:00,  2.95it/s]
开始两两对比音频特征...
100%|███████████████████████████| 5332/5332 [00:05<00:00, 1027.83it/s]
评估消耗时间:65s,threshold:0.26,EER: 0.14739, MinDCF: 0.41999

声纹对比

下面开始实现声纹对比,创建infer_contrast.py程序,编写infer()函数,在编写模型的时候,模型是有两个输出的,第一个是模型的分类输出,第二个是音频特征输出。所以在这里要输出的是音频的特征值,有了音频的特征值就可以做声纹识别了。我们输入两个语音,通过预测函数获取他们的特征数据,使用这个特征数据可以求他们的对角余弦值,得到的结果可以作为他们相识度。对于这个相识度的阈值threshold,读者可以根据自己项目的准确度要求进行修改。

python infer_contrast.py --audio_path1=audio/a_1.wav --audio_path2=audio/b_2.wav

输出类似如下:

[2023-04-02 18:30:48.009149 INFO   ] utils:print_arguments:13 - ----------- 额外配置参数 -----------
[2023-04-02 18:30:48.009149 INFO   ] utils:print_arguments:15 - audio_path1: dataset/a_1.wav
[2023-04-02 18:30:48.009149 INFO   ] utils:print_arguments:15 - audio_path2: dataset/b_2.wav
[2023-04-02 18:30:48.009149 INFO   ] utils:print_arguments:15 - configs: configs/ecapa_tdnn.yml
[2023-04-02 18:30:48.009149 INFO   ] utils:print_arguments:15 - model_path: models/EcapaTdnn_Fbank/best_model/
[2023-04-02 18:30:48.009149 INFO   ] utils:print_arguments:15 - threshold: 0.6
[2023-04-02 18:30:48.009149 INFO   ] utils:print_arguments:15 - use_gpu: True
[2023-04-02 18:30:48.009149 INFO   ] utils:print_arguments:16 - ------------------------------------------------
······································································
W0425 08:29:10.006249 21121 device_context.cc:447] Please NOTE: device: 0, GPU Compute Capability: 7.5, Driver API Version: 11.6, Runtime API Version: 10.2
W0425 08:29:10.008555 21121 device_context.cc:465] device: 0, cuDNN Version: 7.6.
成功加载模型参数和优化方法参数:models/ecapa_tdnn/model.pdparams
audio/a_1.wav 和 audio/b_2.wav 不是同一个人,相似度为:-0.09565544128417969

声纹识别

在上面的声纹对比的基础上,我们创建infer_recognition.py实现声纹识别。同样是使用上面声纹对比的infer()预测函数,通过这两个同样获取语音的特征数据。 不同的是笔者增加了load_audio_db()register(),以及recognition(),第一个函数是加载声纹库中的语音数据,这些音频就是相当于已经注册的用户,他们注册的语音数据会存放在这里,如果有用户需要通过声纹登录,就需要拿到用户的语音和语音库中的语音进行声纹对比,如果对比成功,那就相当于登录成功并且获取用户注册时的信息数据。第二个函数register()其实就是把录音保存在声纹库中,同时获取该音频的特征添加到待对比的数据特征中。最后recognition()函数中,这个函数就是将输入的语音和语音库中的语音一一对比。
有了上面的声纹识别的函数,读者可以根据自己项目的需求完成声纹识别的方式,例如笔者下面提供的是通过录音来完成声纹识别。首先必须要加载语音库中的语音,语音库文件夹为audio_db,然后用户回车后录音3秒钟,然后程序会自动录音,并使用录音到的音频进行声纹识别,去匹配语音库中的语音,获取用户的信息。通过这样方式,读者也可以修改成通过服务请求的方式完成声纹识别,例如提供一个API供APP调用,用户在APP上通过声纹登录时,把录音到的语音发送到后端完成声纹识别,再把结果返回给APP,前提是用户已经使用语音注册,并成功把语音数据存放在audio_db文件夹中。

python infer_recognition.py

输出类似如下:

[2023-04-02 18:31:20.521040 INFO   ] utils:print_arguments:13 - ----------- 额外配置参数 -----------
[2023-04-02 18:31:20.521040 INFO   ] utils:print_arguments:15 - audio_db_path: audio_db/
[2023-04-02 18:31:20.521040 INFO   ] utils:print_arguments:15 - configs: configs/ecapa_tdnn.yml
[2023-04-02 18:31:20.521040 INFO   ] utils:print_arguments:15 - model_path: models/EcapaTdnn_Fbank/best_model/
[2023-04-02 18:31:20.521040 INFO   ] utils:print_arguments:15 - record_seconds: 3
[2023-04-02 18:31:20.521040 INFO   ] utils:print_arguments:15 - threshold: 0.6
[2023-04-02 18:31:20.521040 INFO   ] utils:print_arguments:15 - use_gpu: True
[2023-04-02 18:31:20.521040 INFO   ] utils:print_arguments:16 - ------------------------------------------------
······································································
W0425 08:30:13.257884 23889 device_context.cc:447] Please NOTE: device: 0, GPU Compute Capability: 7.5, Driver API Version: 11.6, Runtime API Version: 10.2
W0425 08:30:13.260191 23889 device_context.cc:465] device: 0, cuDNN Version: 7.6.
成功加载模型参数和优化方法参数:models/ecapa_tdnn/model.pdparams
Loaded 沙瑞金 audio.
Loaded 李达康 audio.
请选择功能,0为注册音频到声纹库,1为执行声纹识别:0
按下回车键开机录音,录音3秒中:
开始录音......
录音已结束!
请输入该音频用户的名称:夜雨飘零
请选择功能,0为注册音频到声纹库,1为执行声纹识别:1
按下回车键开机录音,录音3秒中:
开始录音......
录音已结束!
识别说话的为:夜雨飘零,相似度为:0.920434

其他版本

  • Tensorflow:VoiceprintRecognition-Tensorflow
  • Pytorch:VoiceprintRecognition-Pytorch
  • Keras:VoiceprintRecognition-Keras

参考资料

  1. https://github.com/PaddlePaddle/PaddleSpeech
  2. https://github.com/yeyupiaoling/PaddlePaddle-MobileFaceNets
  3. https://github.com/yeyupiaoling/PPASR

http://www.ppmy.cn/news/1050326.html

相关文章

软考高级系统架构设计师(一)计算机硬件

【原文链接】软考高级系统架构设计师&#xff08;一&#xff09;计算机硬件 1.1 计算机硬件组成 1.1.1 计算机的基本硬件组成 运算器控制器存储器输入设备输出设备 1.1.2 中央处理单元&#xff08;CPU&#xff09; 中央处理单元&#xff08;CPU&#xff09;的组成 运算器…

在服务器上部署 Nginx 并设置图片服务器

当您在服务器上部署 Nginx 并设置图片服务器时&#xff0c;以下是大致的步骤&#xff1a; 1. **安装 Nginx**&#xff1a;使用适用于您的操作系统的包管理器安装 Nginx。 2. **编辑 Nginx 配置文件**&#xff1a;找到 Nginx 的配置文件&#xff0c;通常位于 /etc/nginx/nginx…

数学建模及数据分析 || 4. 深度学习应用案例分享

PyTorch 深度学习全连接网络分类 文章目录 PyTorch 深度学习全连接网络分类1. 非线性二分类2. 泰坦尼克号数据分类2.1 数据的准备工作2.2 全连接网络的搭建2.3 结果的可视化 1. 非线性二分类 import sklearn.datasets #数据集 import numpy as np import matplotlib.pyplot as…

CentOS7安装部署MySQL80

文章目录 CentOS7安装部署MySQL80一、前言二、正文1.安装部署1&#xff09;卸载 mariadb2&#xff09;MySQL安装3&#xff09;启动4&#xff09;首次登录 2.允许所有主机连接3.修改密码4.my.cnf配置文件5.开启binlog6.密码校验策略7.密码过期8.表名大小写敏感9.最大连接数10.导…

现代企业数据泄露的原因分析与建议

近年来&#xff0c;随着信息技术的飞速发展&#xff0c;数据已经成为现代企业不可或缺的发展资源。然而&#xff0c;随之而来的数据泄露危机&#xff0c;给个人、企业甚至整个社会带来了巨大的风险与威胁。本文将综合探讨企业数据泄露的主要途径和原因&#xff0c;并提出防护建…

苍穹外卖 day2 反向代理和负载均衡

一 前端发送的请求&#xff0c;是如何请求到后端服务 前端请求地址&#xff1a;http://localhost/api/employee/login 路径并不匹配 后端接口地址&#xff1a;http://localhost:8080/admin/employee/login 二 查找前端接口 在这个页面上点击f12 后转到networ验证&#xff0…

嵌入式系统常用的开发板

今天&#xff0c;了解一下常用的开发板&#xff0c;像stm32是最近了解的&#xff0c;esp8266系列是之前大三下上物联网导论课程时候接触的&#xff0c;一些树莓派&#xff0c;Arduino听说过&#xff0c;但了解不多。

无人机精细化巡检方案制定:提高效率与准确性的关键

在当前技术日新月异的时代&#xff0c;无人机在多个领域的应用已成为行业标配。但如何制定出一套有效、细致的无人机巡检方案&#xff0c;确保其最大效能&#xff0c;成为许多组织与公司的核心议题。其中&#xff0c;复亚智能在此领域已展现出了卓越的实力与深入的见解。 1. 精…