CN109949825A - Noise classification method based on FPGA-accelerated PCNN algorithm - Google Patents
Noise classification method based on FPGA-accelerated PCNN algorithm Download PDFInfo
- Publication number
- CN109949825A CN109949825A CN201910166349.5A CN201910166349A CN109949825A CN 109949825 A CN109949825 A CN 109949825A CN 201910166349 A CN201910166349 A CN 201910166349A CN 109949825 A CN109949825 A CN 109949825A
- Authority
- CN
- China
- Prior art keywords
- noise
- fpga
- time series
- pcnn
- module
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 34
- 230000001133 acceleration Effects 0.000 claims abstract description 15
- 238000012360 testing method Methods 0.000 claims abstract description 15
- 238000012804 iterative process Methods 0.000 claims abstract description 14
- 238000000605 extraction Methods 0.000 claims abstract description 12
- 238000012549 training Methods 0.000 claims abstract description 12
- 238000004364 calculation method Methods 0.000 claims description 56
- 230000008569 process Effects 0.000 claims description 13
- 238000012545 processing Methods 0.000 claims description 9
- 238000006243 chemical reaction Methods 0.000 claims description 5
- 238000009432 framing Methods 0.000 claims description 4
- 210000002569 neuron Anatomy 0.000 description 13
- 239000011159 matrix material Substances 0.000 description 12
- 238000013461 design Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 230000006378 damage Effects 0.000 description 4
- 230000007704 transition Effects 0.000 description 4
- 238000013528 artificial neural network Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 238000011160 research Methods 0.000 description 3
- 239000000872 buffer Substances 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 241000282326 Felis catus Species 0.000 description 1
- 241000124008 Mammalia Species 0.000 description 1
- 241001465754 Metazoa Species 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000000711 cancerogenic effect Effects 0.000 description 1
- 231100000315 carcinogenic Toxicity 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000002498 deadly effect Effects 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 201000010099 disease Diseases 0.000 description 1
- 208000037265 diseases, disorders, signs and symptoms Diseases 0.000 description 1
- 239000003344 environmental pollutant Substances 0.000 description 1
- 230000005284 excitation Effects 0.000 description 1
- 230000036541 health Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000001537 neural effect Effects 0.000 description 1
- 210000002856 peripheral neuron Anatomy 0.000 description 1
- 231100000719 pollutant Toxicity 0.000 description 1
- 230000002265 prevention Effects 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
- 238000001228 spectrum Methods 0.000 description 1
- 210000000225 synapse Anatomy 0.000 description 1
- 238000013519 translation Methods 0.000 description 1
- 210000000857 visual cortex Anatomy 0.000 description 1
Landscapes
- Image Processing (AREA)
Abstract
本发明为基于FPGA加速的PCNN算法的噪声分类方法,该方法包括下述步骤:步骤1,用录音设备采集噪声样本,并剪辑成音频文件;步骤2,音频文件进行时‑频转换;步骤3,特征提取:将噪声频谱图转换为灰度图,将灰度值作为PCNN模型的输入,通过FPGA实现PCNN算法迭代过程的加速,并输出时间序列作为不同类别噪声的特征提取;步骤4,将噪声样本中每一种噪声经步骤3处理迭代50‑200次输出时间序列后分为训练集和测试集;步骤5,将训练集每次迭代的时间序列求平均作为参考模板,计算测试集的时间序列与参考模板的时间序列之间的欧式距离,当欧氏距离小于噪声类别阈值时判别为同一种噪声,并输出识别结果。该方法缩短了特征提取时间,节约了时间成本。
The present invention is a noise classification method based on an FPGA-accelerated PCNN algorithm. The method includes the following steps: Step 1, use a recording device to collect noise samples, and edit them into audio files; Step 2, the audio files are time-frequency converted; Step 3 , feature extraction: convert the noise spectrogram into a grayscale image, use the grayscale value as the input of the PCNN model, realize the acceleration of the iterative process of the PCNN algorithm through FPGA, and output the time series as the feature extraction of different types of noise; step 4, the Each noise in the noise sample is divided into a training set and a test set after being processed and iterated 50-200 times in step 3 to output the time series; in step 5, the time series of each iteration of the training set are averaged as a reference template, and the The Euclidean distance between the time series and the time series of the reference template. When the Euclidean distance is less than the noise category threshold, it is determined to be the same noise, and the recognition result is output. This method shortens the feature extraction time and saves time cost.
Description
技术领域technical field
本发明涉及噪声分类技术领域,具体是一种基于FPGA加速的PCNN算法的噪声分类方法。The invention relates to the technical field of noise classification, in particular to a noise classification method based on an FPGA-accelerated PCNN algorithm.
背景技术Background technique
噪声污染问题给人类社会甚至整个生态环境都带来了严重的危害。但噪声污染性质非常特殊,看不见摸不着,不会产生污染物,污染源分布的范围广,类型多,具有实时性。噪声污染对人、动物、仪器仪表以及建筑物均能构成危害,噪声不仅会对听力造成损伤,还能诱发多种致癌致命的疾病。而中国人口密集,居住环境复杂,普通居民对噪声污染的危害意识薄弱,在当今时代噪声污染对人民的影响已经很严重了。城市噪声的分类已经和现代人民的生活质量提高密不可分,噪声的分类不仅利于改善噪声污染情况提高人民身体健康,还利于人民利用合法的手段维护自身的权益,减轻噪声污染情况。但是我国目前对于噪声污染的注意和防治系统还不够完善,需要一种高效、准确度高、利于硬件实现噪声分类方法。Noise pollution has brought serious harm to human society and even the entire ecological environment. However, the nature of noise pollution is very special. It cannot be seen or touched, and no pollutants will be produced. The distribution of pollution sources is wide, with many types, and it is real-time. Noise pollution can cause harm to people, animals, instruments and buildings. Noise can not only cause hearing damage, but also induce a variety of carcinogenic and deadly diseases. In China, the population is dense, the living environment is complex, and the ordinary residents have weak awareness of the harm of noise pollution. In today's era, the impact of noise pollution on the people has been very serious. The classification of urban noise has been inseparable from the improvement of the quality of life of modern people. The classification of noise is not only conducive to improving noise pollution and improving people's health, but also helping people to use legal means to protect their rights and reduce noise pollution. However, my country's current attention and prevention system for noise pollution is not perfect, and an efficient, high-accuracy, and hardware-friendly noise classification method is needed.
90年代以来对猫等小型哺乳动物视觉皮层的研究促使了脉冲耦合神经网络(PCNN)的产生和发展,在数字图像识别领域有着广泛应用。Since the 1990s, the research on the visual cortex of small mammals such as cats has prompted the generation and development of Pulse Coupled Neural Networks (PCNNs), which are widely used in the field of digital image recognition.
但是基于PCNN对于声音分类识别的成果不多,只有一些应用于语音识别,从现在的成果和文献来看,在方法、参数选择的合适的情况下,对于语音识别有较高的识别率。如张晓俊、陶智等(张晓俊,陶智,顾济华,et al.基于PCNN和DTW的语音识别系统设计[J].通信技术,2007(4):60-62.)的基于PCNN和DTW的语音识别系统设计,利用改进后的PCNN提取语图谱图像特征作为提取后的特征序列,之后通过动态时间规整(DTW)进行语音的分类识别。刘琨,金文标等(刘琨,金文标.基于PCNN和RBF的孤立词语音识别研究[J].计算机工程与设计,2008,29(24):6298-6301.)的基于PCNN和RBF的孤立词语音识别研究提出了一种利用简化后的PCNN提取语图谱的时间序列辅以传统的径向基函数RBF神经网络实现了孤立语音的识别。但是以上的几种方法时间代价比较大,主要是PCNN网络迭代的过程耗时比较大,而且据现有文献几乎没有涉及到分类器的硬件实现。However, there are not many achievements in voice classification and recognition based on PCNN, and only some are applied to voice recognition. From the current results and literature, it has a high recognition rate for voice recognition when the method and parameter selection are appropriate. Such as Zhang Xiaojun, Tao Zhi, etc. (Zhang Xiaojun, Tao Zhi, Gu Jihua, et al. Design of speech recognition system based on PCNN and DTW [J]. Communication Technology, 2007(4): 60-62.) Speech based on PCNN and DTW In the design of the recognition system, the improved PCNN is used to extract the features of the language map and images as the extracted feature sequence, and then the classification and recognition of speech is performed by dynamic time warping (DTW). Liu Kun, Jin Wenbiao, etc. (Liu Kun, Jin Wenbiao. Research on isolated word speech recognition based on PCNN and RBF [J]. Computer Engineering and Design, 2008, 29(24): 6298-6301.) Isolated word based on PCNN and RBF In the speech recognition research, a simplified PCNN is used to extract the time series of the language map and the traditional radial basis function RBF neural network is used to realize the isolated speech recognition. However, the time cost of the above methods is relatively high, mainly because the iterative process of the PCNN network is relatively time-consuming, and according to the existing literature, the hardware implementation of the classifier is hardly involved.
发明内容SUMMARY OF THE INVENTION
针对现有技术的不足,本发明主要解决的技术问题是,提供一种基于FPGA加速的PCNN算法的噪声分类方法。利用PCNN算法提取时间序列作为噪声频谱图的特征序列,通过FPGA加速迭代的过程,使特征提取时间大大缩短,节约了时间成本。Aiming at the deficiencies of the prior art, the main technical problem to be solved by the present invention is to provide a noise classification method based on the FPGA-accelerated PCNN algorithm. The PCNN algorithm is used to extract the time series as the feature sequence of the noise spectrogram, and the iterative process is accelerated by FPGA, which greatly shortens the feature extraction time and saves the time cost.
本发明解决所述技术问题采用的技术方案是:提供一种基于FPGA加速的PCNN算法的噪声分类方法,该方法包括下述步骤:The technical solution adopted by the present invention to solve the technical problem is to provide a noise classification method based on an FPGA-accelerated PCNN algorithm, the method comprising the following steps:
步骤1,用录音设备采集噪声样本,并剪辑成300ms-10s以内的音频文件;Step 1, use a recording device to collect noise samples, and edit them into audio files within 300ms-10s;
步骤2,音频文件进行时-频转换:对音频文件进行短时傅里叶变换,得到噪声频谱图;Step 2, time-frequency conversion is performed on the audio file: short-time Fourier transform is performed on the audio file to obtain a noise spectrogram;
步骤3,特征提取:将噪声频谱图转换为灰度图,将灰度值作为PCNN模型的输入,通过FPGA实现PCNN算法迭代过程的加速,并输出时间序列作为不同类别噪声的特征提取;Step 3, feature extraction: convert the noise spectrogram into a grayscale image, use the grayscale value as the input of the PCNN model, realize the acceleration of the iterative process of the PCNN algorithm through FPGA, and output the time series as the feature extraction of different types of noise;
所述通过FPGA实现PCNN算法迭代过程的加速的具体过程是:The specific process of realizing the acceleration of the iterative process of the PCNN algorithm through the FPGA is:
1)FPGA电路处于空闲状态,当复位信号有效时,FPGA电路所有变量复位,复位信号拉高后进入初始化状态,对各个变量进行初始化;1) The FPGA circuit is in an idle state. When the reset signal is valid, all variables of the FPGA circuit are reset. After the reset signal is pulled high, it enters the initialization state and initializes each variable;
2)初始化之后,跳转到FPGA内的计算模块,计算模块实现的是PCNN模型的迭代过程,在计算模块内灰度值作为输入进行迭代加速,直到达到提前设定的迭代次数,跳转回空闲状态,完成迭代加速过程;2) After initialization, jump to the calculation module in the FPGA. The calculation module implements the iterative process of the PCNN model. The gray value in the calculation module is used as the input for iterative acceleration until the number of iterations set in advance is reached. Jump back In idle state, complete the iterative acceleration process;
步骤4,将噪声样本中每一种噪声经步骤3处理迭代50-200次输出时间序列后分为训练集和测试集;Step 4: Divide each noise in the noise samples into a training set and a test set after processing and iterating the output time series for 50-200 times in Step 3;
步骤5,将训练集每次迭代的时间序列求平均作为参考模板,计算测试集的时间序列与参考模板的时间序列之间的欧式距离,当欧氏距离小于噪声类别阈值时判别为同一种噪声,并输出识别结果。Step 5: Average the time series of each iteration of the training set as a reference template, and calculate the Euclidean distance between the time series of the test set and the time series of the reference template. When the Euclidean distance is less than the noise category threshold, it is determined to be the same noise. , and output the recognition result.
与现有技术相比,本发明的有益效果是:Compared with the prior art, the beneficial effects of the present invention are:
本发明通过对噪声样本的预处理,并且通过短时傅里叶变换将处理后的噪声音频转换为噪声频谱图,将噪声频谱图转换为灰度图,将灰度值作为PCNN模型的输入,通过FPGA实现的脉冲耦合神经算法进行迭代加速处理,输出时间序列作为提取的特征。通过50-200次迭代输出的时间序列作为特征,分为测试集和训练集,通过训练集确定参考模板,测试集输入PCNN模型,输出测试集的时间序列,计算测试集的时间序列与参考模板的时间序列的欧式距离(Euclidean Distance),输出识别结果。通过PCNN算法之后输出的时间序列作为分类声音的特征,具有时间、尺度等不变形,可以实现噪声的分类,并且通过FPGA加速了PCNN算法的迭代过程。基于FPGA实现的PCNN算法处理128*128灰度为8位的图像,迭代100次大约需要16ms,大大节约了时间成本。本发明不仅保证了分类的准确度也提高了分类的速度,更适合硬件分类器的实现。In the present invention, the noise samples are preprocessed, and the processed noise audio is converted into a noise spectrogram through short-time Fourier transform, the noise spectrogram is converted into a grayscale image, and the grayscale value is used as the input of the PCNN model, The pulse coupled neural algorithm implemented by FPGA performs iterative acceleration processing, and outputs the time series as the extracted features. The time series output through 50-200 iterations is used as a feature, which is divided into a test set and a training set. The reference template is determined through the training set, the test set is input to the PCNN model, the time series of the test set is output, and the time series of the test set and the reference template are calculated. The Euclidean Distance of the time series, and output the recognition result. The time series output after the PCNN algorithm is used as the feature of the classified sound, which has no deformation in time and scale, and can realize the classification of noise, and the iterative process of the PCNN algorithm is accelerated by FPGA. The PCNN algorithm implemented based on FPGA processes 128*128 grayscale images with 8 bits, and it takes about 16ms to iterate 100 times, which greatly saves time and cost. The invention not only ensures the accuracy of classification but also improves the speed of classification, and is more suitable for the realization of hardware classifiers.
附图说明Description of drawings
下面结合附图对本发明的方法具体说明。The method of the present invention will be described in detail below with reference to the accompanying drawings.
图1为FPGA电路模块化设计图。Figure 1 shows the modular design of the FPGA circuit.
图2为PCNN算法单个神经元模型图。Figure 2 is a diagram of a single neuron model of the PCNN algorithm.
图3为FPGA电路状态转换图。Figure 3 is a state transition diagram of the FPGA circuit.
图4为谱图灰度值矩阵卷积计算过程示意图。FIG. 4 is a schematic diagram of a convolution calculation process of a gray value matrix of a spectrogram.
图5为FPGA加速的PCNN算法噪声分类方法的整体框图。Figure 5 is the overall block diagram of the FPGA-accelerated PCNN algorithm noise classification method.
具体实施方式Detailed ways
下面结合实施例对本发明作进一步说明,但并不以此作为对本申请保护范围的限定。The present invention will be further described below with reference to the examples, but this is not intended to limit the protection scope of the present application.
本发明基于FPGA加速的PCNN算法的噪声分类方法,该方法包括下述步骤:The present invention is based on the noise classification method of the PCNN algorithm accelerated by FPGA, and the method comprises the following steps:
步骤1,用录音设备采集噪声样本,并剪辑成300ms-10s以内的音频文件;Step 1, use a recording device to collect noise samples, and edit them into audio files within 300ms-10s;
步骤2,音频文件进行时-频转换:对音频文件进行短时傅里叶变换,得到噪声频谱图;Step 2, time-frequency conversion is performed on the audio file: short-time Fourier transform is performed on the audio file to obtain a noise spectrogram;
步骤3,特征提取:将噪声频谱图转换为灰度图,将灰度值作为PCNN模型的输入,通过FPGA实现PCNN算法迭代过程的加速,并输出时间序列作为不同类别噪声的特征提取;Step 3, feature extraction: convert the noise spectrogram into a grayscale image, use the grayscale value as the input of the PCNN model, realize the acceleration of the iterative process of the PCNN algorithm through FPGA, and output the time series as the feature extraction of different types of noise;
所述通过FPGA实现PCNN算法迭代过程的加速的具体过程是:The specific process of realizing the acceleration of the iterative process of the PCNN algorithm through the FPGA is:
1)FPGA电路处于空闲状态,当复位信号有效时,FPGA电路所有变量复位,复位信号拉高后进入初始化状态,对各个变量进行初始化;1) The FPGA circuit is in an idle state. When the reset signal is valid, all variables of the FPGA circuit are reset. After the reset signal is pulled high, it enters the initialization state and initializes each variable;
2)初始化之后,跳转到FPGA内的计算模块,计算模块实现的是PCNN模型的迭代过程,在计算模块内灰度值作为输入进行迭代加速,直到达到提前设定的迭代次数(这里的迭代次数可以根据准确度和时间的要求确定,迭代次数越大耗时越大分类的效果更好准确度更高),跳转回空闲状态,完成迭代加速过程;2) After initialization, jump to the calculation module in the FPGA. The calculation module implements the iterative process of the PCNN model. The gray value in the calculation module is used as the input for iterative acceleration until the number of iterations set in advance (the iteration here is reached). The number of times can be determined according to the requirements of accuracy and time, the larger the number of iterations, the more time-consuming the classification, the better the classification effect and the higher the accuracy), jump back to the idle state, and complete the iterative acceleration process;
步骤4,将噪声样本中每一种噪声经步骤3处理迭代50-200次输出时间序列后分为训练集和测试集,能保证有效的提取时间序列并能减少时间成本。Step 4: Divide each noise in the noise samples into a training set and a test set after processing and iterating the output time series for 50-200 times in step 3, which can ensure the effective extraction of time series and reduce the time cost.
步骤5,将训练集每次迭代的时间序列求平均作为参考模板,计算测试集的时间序列与参考模板的时间序列之间的欧式距离,当欧氏距离小于噪声类别阈值时判别为同一种噪声,并输出识别结果。Step 5: Average the time series of each iteration of the training set as a reference template, and calculate the Euclidean distance between the time series of the test set and the time series of the reference template. When the Euclidean distance is less than the noise category threshold, it is determined to be the same noise. , and output the recognition result.
上述PCNN模型的建立过程可以采用现有技术。The establishment process of the above-mentioned PCNN model can adopt the existing technology.
大部分不同的图像通过PCNN算法迭代提取的时间序列都不相同,故可以通过此算法进行噪声的识别与分类,并且有较高的准确率。本发明先将噪音样本进行时-频转换,将噪声频谱图的灰度值作为PCNN算法的输入。噪声频谱图通过PCNN算法的迭代输出图像的时间序列作为特征,并结合FPGA实现PCNN算法迭代的加速处理。将迭代后提取的时间序列通过计算与参考模板之间的欧氏距离进行分类,并且输出可靠性结果。The time series extracted by the iteratively extracted PCNN algorithm for most different images are different, so this algorithm can be used to identify and classify noise with high accuracy. The present invention firstly performs time-frequency conversion on the noise samples, and uses the gray value of the noise spectrogram as the input of the PCNN algorithm. The noise spectrogram is characterized by the time series of the iterative output image of the PCNN algorithm, and combined with the FPGA to realize the accelerated processing of the PCNN algorithm iteration. The time series extracted after iteration is classified by calculating the Euclidean distance from the reference template, and the reliability result is output.
实施例Example
本实施例以windows 8系统作为程序开发软件环境,使用Vivado 2014.4和MATLABR2010a作为程序开发平台,通过麦克风录制城市噪声作为实验数据。In this embodiment, the Windows 8 system is used as the software environment for program development, Vivado 2014.4 and MATLABR2010a are used as the program development platform, and urban noise is recorded through a microphone as experimental data.
本实施例基于FPGA加速的PCNN算法的噪声分类方法包括下述步骤:The noise classification method based on the FPGA-accelerated PCNN algorithm in this embodiment includes the following steps:
用麦克风等录音设备,采集噪声样本,进行初步剪辑,剪辑为300ms-10s以内的音频文件。Use recording equipment such as a microphone to collect noise samples and perform preliminary editing, which is an audio file within 300ms-10s.
将剪辑后的音频文件,进行时-频转换,即进行短时傅里叶变换。首先对噪声音频文件分帧,噪声音频一般为时变的非平稳信号,故而分帧长度可选取为10ms-30ms之间,可根据噪声音频长度选取;下一步对分帧之后的噪声音频进行加窗,采用汉宁窗,窗长等于帧长。最后对每一帧进行傅里叶变换,即完成了对噪声音频的短时傅里叶变换,得到噪声频谱图。The clipped audio file is subjected to time-frequency conversion, that is, short-time Fourier transform. First, the noise audio file is divided into frames. The noise audio is generally a time-varying non-stationary signal, so the frame length can be selected between 10ms and 30ms, which can be selected according to the length of the noise audio; the next step is to add the noise audio after framing. Window, using Hanning window, the window length is equal to the frame length. Finally, Fourier transform is performed on each frame, that is, the short-time Fourier transform of the noise audio is completed, and the noise spectrogram is obtained.
通过MATLAB将噪声频谱图转换为灰度图片,输出图片灰度值,存储后,作为PCNN算法的输入。通过FPGA实现PCNN算法迭代过程的加速的具体过程是:Convert the noise spectrogram to a grayscale image through MATLAB, output the grayscale value of the image, and store it as the input of the PCNN algorithm. The specific process of accelerating the iterative process of the PCNN algorithm through FPGA is as follows:
FPGA电路分为控制模块、计算模块和存储模块这三个模块;控制模块负责协调整个电路的正常工作,计算模块完成PCNN算法的迭代功能,计算中产生的数据存储于存储模块;控制模块与串口接收模块双向通信,同时控制模块直接与存储模块连接,负责协调FPGA整个电路的正常工作,串口接收模块连接计算模块及存储模块,计算模块与存储模块双向通信。PC机通过串口接收模块将图片灰度值输入FPGA电路计算时间序列,即控制模块给出串口接收模块指令将图片灰度值通过串口接收模块给到计算模块,当计算模块计算完成时,控制模块会发送控制信号通过串口接收模块控制计算模块调用存储模块,同时计算模块将计算产生的数据存储于存储模块;FPGA电路又通过控制模块控制存储模块将计算输出的时间序列通过串口接收模块上传给PC机,如图1。The FPGA circuit is divided into three modules: control module, calculation module and storage module; the control module is responsible for coordinating the normal operation of the entire circuit, the calculation module completes the iterative function of the PCNN algorithm, and the data generated in the calculation is stored in the storage module; the control module and the serial port The receiving module communicates in two directions, and the control module is directly connected with the storage module, which is responsible for coordinating the normal operation of the entire circuit of the FPGA. The serial receiving module connects the computing module and the storage module, and the computing module and the storage module communicate in two directions. The PC inputs the image gray value into the FPGA circuit through the serial port receiving module to calculate the time series, that is, the control module gives the serial port receiving module instruction to send the image gray value to the calculation module through the serial port receiving module. When the calculation module completes the calculation, the control module It will send a control signal through the serial port receiving module to control the calculation module to call the storage module, and the calculation module will store the data generated by the calculation in the storage module; the FPGA circuit controls the storage module through the control module to upload the time series of the calculation output to the PC through the serial port receiving module machine, as shown in Figure 1.
PCNN算法的原始模型的计算公式如下:The calculation formula of the original model of the PCNN algorithm is as follows:
Uij[n]=Fij[n](1+βLij[n])U ij [n]=F ij [n](1+βL ij [n])
式中,Fij[n]是对应的第(i,j)个神经元的反馈输入;n为迭代的次数;Sij对应图像中的第(i,j)个像素的灰度值;M和W为链接加权系数矩阵,也称之为卷积核,表示中心神经元与其邻近的周围神经元相互影响的大小;αF和αL为神经元F通道和L通道时间指数衰减常数;k,l对应周围神经元的坐标;β为突触之间的连接强度常数;L为线性输入项;VF和VL分别为Fij[n]和Lij[n]的固有电势;Tij[n]是能否激发脉冲产生所需的动态门限;Yij[n]是PCNN脉冲输出,Yij[n]的值为0或1,0表示无脉冲输出,1表示有脉冲输出。In the formula, F ij [n] is the feedback input of the corresponding (i, j)th neuron; n is the number of iterations; S ij corresponds to the gray value of the (i, j)th pixel in the image; M and W are the link weighting coefficient matrix, also known as the convolution kernel, indicating the magnitude of the interaction between the central neuron and its adjacent peripheral neurons; α F and α L are the time exponential decay constants of the neuron F channel and L channel; k , l corresponds to the coordinates of surrounding neurons; β is the connection strength constant between synapses; L is the linear input term; V F and VL are the intrinsic potentials of F ij [n] and L ij [n], respectively; T ij [n] is the dynamic threshold required for excitation pulse generation; Y ij [n] is the PCNN pulse output, and the value of Y ij [n] is 0 or 1, 0 means no pulse output, 1 means there is pulse output.
将PCNN模型每次迭代后的二值脉冲转化为单一向量,定义Convert the binary pulse after each iteration of the PCNN model into a single vector, define
为“时间序列”。for "time series".
由此公式看出,时间序列统计了一幅图像在每次经PCNN模型处理后点火像素点的总个数,并且该序列具有旋转、镜像、平移及尺度不变性,可以表征灰度图像的特征,实现灰度图像分类与特征匹配。故可以以时间序列作为噪声谱图的特征,实现噪声的分类。From this formula, it can be seen that the time series counts the total number of ignition pixels in an image after each processing by the PCNN model, and the sequence has rotation, mirroring, translation and scale invariance, which can characterize the characteristics of grayscale images. , to achieve grayscale image classification and feature matching. Therefore, the time series can be used as the characteristics of the noise spectrum to realize the classification of noise.
PCNN网络也是由单个神经元组合而成,单个神经元接受周围神经元的反馈,神经元之间相互作用构成网络。单个PCNN算法神经元模型如图2,分为三部分,输入部分,连接输入,脉冲发生器。输入部分由图像中的第(i,j)个像素的灰度值即Sij和周围神经元的影响Yij组成,图像中的每一个像素对应神经网络的每一个神经元。连接输入部分模拟的是神经元内部的活动。脉冲发生器部分主要通过阈值判断器进行判断,决定是否输出脉冲,Y输出为1时表示有脉冲输出。The PCNN network is also composed of a single neuron. A single neuron receives feedback from surrounding neurons, and the interaction between neurons constitutes a network. The neuron model of a single PCNN algorithm is shown in Figure 2, which is divided into three parts, the input part, the connection input, and the pulse generator. The input part consists of the gray value of the (i,j)th pixel in the image, namely S ij and the influence of surrounding neurons Y ij , and each pixel in the image corresponds to each neuron of the neural network. The connected input part simulates the activity inside the neuron. The pulse generator part is mainly judged by the threshold judger to decide whether to output pulses. When the Y output is 1, it means that there is pulse output.
基于PCNN算法原始模型的计算公式设计FPGA电路的计算模块,定义矩阵卷积计算为K,线性输入项为L,判决输入为U,动态门限为T,反馈输入为F,脉冲输出为Y,时间序列输出为S(n),输入为DM。Based on the calculation formula of the original model of the PCNN algorithm, the calculation module of the FPGA circuit is designed. The matrix convolution calculation is defined as K, the linear input is L, the decision input is U, the dynamic threshold is T, the feedback input is F, the pulse output is Y, and the time The sequence output is S(n) and the input is DM.
由于电路设计的需要,需要将PCNN原始模型的计算公式转换成计算机计算的语言,由MATLAB代码的形式给出。Due to the needs of circuit design, it is necessary to convert the calculation formula of the original PCNN model into a computer calculation language, which is given in the form of MATLAB code.
1、矩阵卷积计算:K=conv2(Y,W,'same');1. Matrix convolution calculation: K=conv2(Y,W,'same');
2、线性输入项:L=exp(-alpha_L)*L+vL*K;2. Linear input item: L=exp(-alpha_L)*L+vL*K;
3、判决输入:U=F.*(1+beta*L);3. Judgment input: U=F.*(1+beta*L);
4、动态门限:T=exp(-alpha_T)*T+vT*Y;4. Dynamic threshold: T=exp(-alpha_T)*T+vT*Y;
5、脉冲输出:Y=im2double(U>T);5. Pulse output: Y=im2double(U>T);
6、反馈输入:F=exp(-alpha_F)*F+vF*K+DM;6. Feedback input: F=exp(-alpha_F)*F+vF*K+DM;
7、时间序列输出:S(n)=sum(sum(Y));7. Time series output: S(n)=sum(sum(Y));
为了得到时间序列输出,以上计算步骤需要重复进行。In order to obtain the time series output, the above calculation steps need to be repeated.
其中计算模块所需要存储到存储模块的常量为alpha_L,alpha_Theta,alpha_F,beta,W,vL,vF,vTheta,exp(-alpha_L),exp(-alpha_Theta),exp(-alpha_F)。输入的噪声样本谱图灰度值为8bit,除了vTheat为16bit整数外,其他常量都用8bit二进制小数表示、存储。The constants that the calculation module needs to store in the storage module are alpha_L, alpha_Theta, alpha_F, beta, W, vL, vF, vTheta, exp(-alpha_L), exp(-alpha_Theta), exp(-alpha_F). The grayscale value of the input noise sample spectrogram is 8 bits. Except for vTheat, which is a 16-bit integer, other constants are represented and stored by 8-bit binary decimals.
需要存储到存储模块的变量有K,L,U,T,Y,F,存储空间的大小为输入图像的大小。K、L为16bit(8位整数8位小数),U、T、F为24bit(16位整数8位小数),Y和DM为8bit(8位整数)。The variables that need to be stored in the storage module are K, L, U, T, Y, F, and the size of the storage space is the size of the input image. K and L are 16 bits (8-bit integers with 8 decimals), U, T, and F are 24 bits (16-bit integers with 8 decimals), and Y and DM are 8 bits (8-bit integers).
整个电路分为四个状态,空闲状态,初始化状态,计算状态,输出状态。The whole circuit is divided into four states, idle state, initialization state, calculation state, and output state.
FPGA电路的状态转换,当电路处于空闲状态,复位信号有效时,所有变量复位为0,复位信号无效时跳转到初始化状态。The state transition of the FPGA circuit, when the circuit is in an idle state and the reset signal is valid, all variables are reset to 0, and jump to the initialization state when the reset signal is invalid.
初始化状态,给变量附初值,迭代次数初始化为0,当写使能有效时,跳转到计算状态。In the initialization state, the initial value is attached to the variable, and the number of iterations is initialized to 0. When the write enable is valid, it jumps to the calculation state.
计算状态,计算状态主要由计算模块实现。将噪声频谱图的灰度值输入计算模块,计算模块主要包含矩阵卷积计算K和其他的矩阵的线性计算L、T、F。状态转换如图3。Calculation state, the calculation state is mainly realized by the calculation module. Input the gray value of the noise spectrogram into the calculation module. The calculation module mainly includes the matrix convolution calculation K and the linear calculation L, T, and F of other matrices. The state transition is shown in Figure 3.
计算模块中矩阵卷积计算K,K=conv2(Y,W,'same')。由控制模块输出信号控制三个行缓冲器和两个计数器共同实现矩阵卷积计算K的功能,其中一个计数器用于计算灰度矩阵已经卷积过的行数,另一个计数器产生行缓冲器地址。噪声频谱图灰度值是三行数据同时进入矩阵进行矩阵的卷积计算,但处理第一行,第二行的灰度值时为了得到正确的结果,由控制模块输出相应的信号将矩阵相应行全都设为零,同理第一列和第二列数据处理时也做相应操作。具体如图4。Matrix convolution calculation K, K=conv2(Y,W,'same') in the calculation module. Three line buffers and two counters are controlled by the output signal of the control module to realize the function of matrix convolution calculation K. One of the counters is used to calculate the number of lines that have been convoluted by the grayscale matrix, and the other counter generates the line buffer address. . The gray value of the noise spectrogram is that three lines of data enter the matrix at the same time to perform the convolution calculation of the matrix, but in order to obtain the correct result when processing the gray value of the first line and the second line, the control module outputs the corresponding signal to make the matrix corresponding. All rows are set to zero, and corresponding operations are also performed when processing the data in the first and second columns. Specifically as shown in Figure 4.
计算模块中还包括矩阵的线性计算输入L、T、F。这些矩阵的线性计算过程都是类似的。以计算线性输入项L为例。The calculation module also includes linear calculation inputs L, T, F of the matrix. The linear calculation process for these matrices is similar. Take computing the linear input term L as an example.
以计算线性输入项L为例,L=exp(-alpha_L)*L+vL*K;则需要两个乘法器和一个加法器完成计算工作。需要注意的是数的表示方式以及乘法器和加法器输出截位问题。L是16位整数,exp_alpha_L是8位小数,输出L是16位整数。则乘法结果保留高16位,即只保留整数。为提高计算精度,可以在加法器输出部分完成截位操作。Taking the calculation of the linear input item L as an example, L=exp(-alpha_L)*L+vL*K; then two multipliers and one adder are required to complete the calculation. Note the way the numbers are represented and the truncation of the outputs of the multipliers and adders. L is a 16-bit integer, exp_alpha_L is an 8-bit decimal, and the output L is a 16-bit integer. Then the multiplication result retains the upper 16 bits, that is, only integers are retained. In order to improve the calculation accuracy, the truncation operation can be done in the output part of the adder.
当计算模块完成变量的计算,通过计数器给出地址将变量存储到存储模块。When the calculation module completes the calculation of the variable, the address is given by the counter to store the variable in the storage module.
存储模块由RAM组成负责存储常量值及变量值。The storage module is composed of RAM and is responsible for storing constant values and variable values.
控制模块主要由计数器和状态机组成,负责输出控制信号,计数器完成存储器的地址生成工作(计数器的输出即为存储器的地址),状态机控制存储器的读写以及计算模块的使能。使计算模块和存储模块能够正常工作完成PCNN算法迭代加速过程。状态机的其他状态转换由计数器溢出信号的控制完成,计数器的模为图像的像素点个数,计数溢出表示完成了一幅图像所有像素点的计算或处理任务。The control module is mainly composed of a counter and a state machine, which is responsible for outputting control signals. The counter completes the address generation of the memory (the output of the counter is the address of the memory), and the state machine controls the reading and writing of the memory and the enabling of the calculation module. The computing module and the storage module can work normally to complete the iterative acceleration process of the PCNN algorithm. Other state transitions of the state machine are completed by the control of the counter overflow signal, the modulo of the counter is the number of pixels of the image, and the overflow of the count indicates that the calculation or processing task of all pixels of an image has been completed.
时间序列即为灰度图像每次迭代后的点火数的总和,在计算脉冲输出Y的情况下,点火脉冲计数器计数,Y的计算结果为1也就是图像的一个像素点点火,点火脉冲计数器加一。即每迭代一次,点火脉冲计数器输出本次迭代点火脉冲数,为时间序列中的一个值。每完成一次迭代迭代计数器加一,直到达到预定的最大迭代次数后,完成了整个时间序列的输出。The time series is the sum of the ignition numbers after each iteration of the grayscale image. In the case of calculating the pulse output Y, the ignition pulse counter counts, and the calculation result of Y is 1, that is, a pixel of the image is ignited, and the ignition pulse counter is added. one. That is, for each iteration, the ignition pulse counter outputs the number of ignition pulses in this iteration, which is a value in the time series. After each iteration is completed, the iteration counter is incremented by one until the predetermined maximum number of iterations is reached, and the output of the entire time series is completed.
将50-200次迭代后输出的时间序列作为噪声图谱的特征。完成噪声图谱的特征提取。The time series output after 50-200 iterations is used as the feature of the noise map. Complete the feature extraction of the noise map.
将提取后的特征序列分为训练集和测试集,将训练集每次迭代的时间序列求平均作为参考模板,计算测试集的时间序列与参考模板的时间序列之间的欧式距离(EuclideanDistance,ED)定义为:Divide the extracted feature sequence into a training set and a test set, average the time series of each iteration of the training set as a reference template, and calculate the Euclidean Distance (Euclidean Distance, ED) between the time series of the test set and the time series of the reference template. )defined as:
其中,n为迭代次数;Ea为参考模板的时间序列;Eb为测试集的时间序列。Among them, n is the number of iterations; E a is the time series of the reference template; E b is the time series of the test set.
当欧氏距离小于阈值时判别为同一种噪声,并输出识别结果。When the Euclidean distance is less than the threshold, it is determined to be the same noise, and the recognition result is output.
识别决策就是与阈值比较的结果,计算测试集的时间序列与各种噪声的参考模板之间的欧氏距离,如果小于噪声类别阈值判别为同一类噪声,输出分类的结果。The identification decision is the result of comparison with the threshold, and the Euclidean distance between the time series of the test set and the reference templates of various noises is calculated. If it is smaller than the noise category threshold, it is judged as the same type of noise, and the classification result is output.
系统整体框图如图5。The overall block diagram of the system is shown in Figure 5.
本发明中噪声类别阈值是前期通过大数据统计出的各种类别噪声的分界数值。In the present invention, the noise category threshold is the demarcation value of various categories of noises calculated through big data in the early stage.
本发明未尽事宜为公知技术。Matters not addressed in the present invention are known in the art.
Claims (3)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910166349.5A CN109949825A (en) | 2019-03-06 | 2019-03-06 | Noise classification method based on FPGA-accelerated PCNN algorithm |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910166349.5A CN109949825A (en) | 2019-03-06 | 2019-03-06 | Noise classification method based on FPGA-accelerated PCNN algorithm |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109949825A true CN109949825A (en) | 2019-06-28 |
Family
ID=67008495
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910166349.5A Pending CN109949825A (en) | 2019-03-06 | 2019-03-06 | Noise classification method based on FPGA-accelerated PCNN algorithm |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109949825A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111445423A (en) * | 2020-04-20 | 2020-07-24 | 哈尔滨理工大学 | Forest fire image denoising and segmenting method based on simplified PCNN algorithm |
CN111626976A (en) * | 2019-11-01 | 2020-09-04 | 东莞灵虎智能科技有限公司 | Steel rail surface damage detection method based on pulse coupling neural network |
CN113032116A (en) * | 2021-03-05 | 2021-06-25 | 广州虎牙科技有限公司 | Training method of task time prediction model, task scheduling method and related device |
CN117275491A (en) * | 2023-11-17 | 2023-12-22 | 青岛科技大学 | A call classification method based on audio conversion and time graph neural network |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2016176887A1 (en) * | 2015-05-06 | 2016-11-10 | 福州大学 | Animal sound identification method based on double spectrogram features |
CN107845390A (en) * | 2017-09-21 | 2018-03-27 | 太原理工大学 | A kind of Emotional speech recognition system based on PCNN sound spectrograph Fusion Features |
CN108122562A (en) * | 2018-01-16 | 2018-06-05 | 四川大学 | A kind of audio frequency classification method based on convolutional neural networks and random forest |
-
2019
- 2019-03-06 CN CN201910166349.5A patent/CN109949825A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2016176887A1 (en) * | 2015-05-06 | 2016-11-10 | 福州大学 | Animal sound identification method based on double spectrogram features |
CN107845390A (en) * | 2017-09-21 | 2018-03-27 | 太原理工大学 | A kind of Emotional speech recognition system based on PCNN sound spectrograph Fusion Features |
CN108122562A (en) * | 2018-01-16 | 2018-06-05 | 四川大学 | A kind of audio frequency classification method based on convolutional neural networks and random forest |
Non-Patent Citations (5)
Title |
---|
XINZHE ZANG ET AL.: "《FPGA Implementation of Pulse Coupled Neural Network on for Time Series of an Image》", 《INTERNATIONAL CONFERENCE ON ELECTRONICS AND ELECTRICAL ENGINEERING TECHNOLOGY(EEET)》 * |
何佳若等: "《声信号的可视化特征提取方法》", 《电声技术》 * |
王中卫: "《基于FPGA的脉冲耦合神经网络的硬件实现》", 《电子设计工程》 * |
白明等: "《基于PCNN的图像最佳二值分割实现》", 《河北工业大学学报》 * |
阮柏尧: "《脉冲耦合神经网络(PCNN)在基于语谱图的说话人识别中的应用》", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111626976A (en) * | 2019-11-01 | 2020-09-04 | 东莞灵虎智能科技有限公司 | Steel rail surface damage detection method based on pulse coupling neural network |
CN111445423A (en) * | 2020-04-20 | 2020-07-24 | 哈尔滨理工大学 | Forest fire image denoising and segmenting method based on simplified PCNN algorithm |
CN113032116A (en) * | 2021-03-05 | 2021-06-25 | 广州虎牙科技有限公司 | Training method of task time prediction model, task scheduling method and related device |
CN113032116B (en) * | 2021-03-05 | 2024-03-05 | 广州虎牙科技有限公司 | Training method of task time prediction model, task scheduling method and related devices |
CN117275491A (en) * | 2023-11-17 | 2023-12-22 | 青岛科技大学 | A call classification method based on audio conversion and time graph neural network |
CN117275491B (en) * | 2023-11-17 | 2024-01-30 | 青岛科技大学 | Sound classification method based on audio conversion and time attention seeking neural network |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109949825A (en) | Noise classification method based on FPGA-accelerated PCNN algorithm | |
CN110335587B (en) | Speech synthesis method, system, terminal device and readable storage medium | |
CN114863938B (en) | Method and system for identifying bird language based on attention residual error and feature fusion | |
CN106952649A (en) | Speaker Recognition Method Based on Convolutional Neural Network and Spectrogram | |
CN112216271A (en) | An Audiovisual Bimodal Speech Recognition Method Based on Convolutional Block Attention Mechanism | |
CN110853663A (en) | Speech enhancement method based on artificial intelligence, server and storage medium | |
CN112331232B (en) | A Speech Emotion Recognition Method Combining CGAN Spectrogram Denoising and Bilateral Filtering Spectrogram Enhancement | |
CN113724740B (en) | Audio event detection model training method and device | |
CN112633420B (en) | Image similarity determination and model training method, device, equipment and medium | |
CN110634476B (en) | Method and system for rapidly building robust acoustic model | |
WO2021143020A1 (en) | Bad term recognition method and device, electronic device, and storage medium | |
CN113903349B (en) | A training method for a denoising model, a denoising method, a device and a storage medium | |
CN108805833A (en) | Miscellaneous minimizing technology of copybook binaryzation ambient noise of network is fought based on condition | |
CN114937454A (en) | Method, device and storage medium for preventing voice synthesis attack by voiceprint recognition | |
CN116578945A (en) | Multi-source data fusion method based on aircraft, electronic equipment and storage medium | |
CN113658607A (en) | Ambient sound classification method based on data augmentation and convolutional recurrent neural network | |
CN115311595A (en) | Video feature extraction method, device and electronic device | |
CN116913325A (en) | Noise event detection method and device | |
CN115440240A (en) | Speech noise reduction training method, speech noise reduction system and speech noise reduction method | |
CN113823271B (en) | Training method and device for voice classification model, computer equipment and storage medium | |
CN112598020A (en) | Target identification method and system | |
CN117975994A (en) | Method, device and computer equipment for quality classification of voice data | |
Govindu et al. | Deepfake audio detection and justification with Explainable Artificial Intelligence (XAI) | |
CN113808604A (en) | Acoustic scene classification method based on gamma pass spectral separation | |
CN116982111A (en) | Audio characteristic compensation method, audio identification method and related products |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190628 |
|
RJ01 | Rejection of invention patent application after publication |