CN112732637B - Bayesian resampling-based FPGA hardware implementation method and device for particle filtering, and target tracking method - Google Patents
Bayesian resampling-based FPGA hardware implementation method and device for particle filtering, and target tracking method Download PDFInfo
- Publication number
- CN112732637B CN112732637B CN202110085423.8A CN202110085423A CN112732637B CN 112732637 B CN112732637 B CN 112732637B CN 202110085423 A CN202110085423 A CN 202110085423A CN 112732637 B CN112732637 B CN 112732637B
- Authority
- CN
- China
- Prior art keywords
- particle
- resampling
- weight
- cache blocks
- bayesian
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F15/00—Digital computers in general; Data processing equipment in general
- G06F15/76—Architectures of general purpose stored program computers
- G06F15/78—Architectures of general purpose stored program computers comprising a single central processing unit
- G06F15/7867—Architectures of general purpose stored program computers comprising a single central processing unit with reconfigurable architecture
- G06F15/7871—Reconfiguration support, e.g. configuration loading, configuration switching, or hardware OS
Landscapes
- Engineering & Computer Science (AREA)
- Computer Hardware Design (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Complex Calculations (AREA)
Abstract
The invention discloses a Bayesian resampling-based FPGA hardware implementation method and device for particle filtering, and a target tracking method, wherein the FPGA implementation method comprises the following steps: the particle sampling unit reads old particles from the particle cache block, receives random numbers from the random number generator and performs sampling updating on the read old particles in parallel; the weight updating unit reads the observed value, performs weight calculation on the updated particles in parallel, and stores the generated weight into a weight cache block; the Bayes resampling unit adopts a Bayes resampling method, resampling is carried out in parallel according to the ownership weight values in the weight cache blocks, and the index output values are stored back to the corresponding index cache blocks; the pseudo-random arrangement generator reads the address of a new particle from the index cache block, and randomly distributes the new particle to each particle cache block to realize the exchange in the parallel computation of the particles; and circularly executing the steps until all time steps are iterated, and finishing the state estimation of the system. The invention can improve the calculation speed of the particle filter system.
Description
Technical Field
The invention belongs to the field of nonlinear filtering of electronic technology, and particularly relates to a Bayesian resampling-based FPGA hardware implementation method and device and a target tracking method for particle filtering.
Background
Particle Filter (PF: Particle Filter), also known as Sequential Monte Carlo method (SMC: Sequential Monte Carlo), is a Bayesian sampling estimation-based sequence significant sampling nonlinear filtering method, which adopts a random sampling point set of a posterior probability density function and corresponding weight values to represent the change of state vectors. Therefore, the method breaks through the theoretical framework of Kalman filtering and the limitation of a Gaussian system, and can be applied to State-Space models of any form. The particle filtering algorithm can solve almost any nonlinear filtering problem and is widely applied to scientific and industrial fields of economic statistics, modern signal processing, global positioning of robots, machine learning and the like.
The particle filter algorithm consists of four steps: sampling, weight estimation, resampling and output estimation. As shown in code 1 and fig. 1. And in the resampling step, all the particles are resampled according to the weight, namely, the particles with small weight are discarded, and the particles with large weight are copied, so that the problem of particle degradation in particle filtering is solved, and the calculated amount is concentrated on the effective particles. And is therefore crucial to the effect of particle filtering.
The conventional resampling method commonly used in the current particle filter algorithm includes: polynomial Resampling (multinominal Resampling), multi-layer Resampling (structured Resampling), Systematic Resampling (Systematic Resampling), and Residual Resampling (Residual Resampling), which are visualized as shown in fig. 2, are discrete sampling of probability density functions of weights directly, so that the cumulative sum of weights needs to be calculated.
However, the particle filter algorithm has a large operation amount, and the traditional resampling algorithm needs to calculate the weight value sum or the accumulated sum, so that on one hand, the parallel implementation of the particle filter algorithm on a computing device of an FPGA is limited, the speed of the particle filter algorithm is limited, the real-time performance of the particle filter is poor, and the practical application of the particle filter algorithm is limited; on the other hand, the accumulation calculation brings about the problem of unstable numerical value, and influences the effect of particle filtering.
The hardware acceleration of the particle filter algorithm mainly comprises three platforms of a multi-core CPU, a GPU and an FPGA. The multi-core CPU has low parallelism and is not suitable for the highly intensive calculation task of particle filtering; most of the time of the existing particle filter accelerator based on the GPU is wasted on a resampling step, and the particle filter needs to generate a large amount of random numbers and a large amount of branch structures, so that the particle filter accelerator is not suitable for GPU operation, and the acceleration ratio is very limited; the FPGA can simultaneously have pipeline parallelism and data parallelism, and can design a highly customized hardware architecture, thereby being very suitable for accelerating a particle filter algorithm. However, the existing particle filter accelerator based on the FPGA mostly focuses on the traditional resampling algorithm and simplifies the algorithm, which may affect the particle filter effect and is not suitable for the application scenario with a large number of particles.
Disclosure of Invention
The invention provides a Bayesian resampling-based FPGA hardware implementation method and device for particle filtering and a target tracking method.
In order to achieve the technical purpose, the invention adopts the following technical scheme:
a method for realizing FPGA hardware of particle filtering based on Bayesian resampling is characterized in that the FPGA comprises: the device comprises a calculation module, a pseudo-random arrangement generator, n random number generators, n particle cache blocks, n weight cache blocks, n index cache blocks and an observation value cache block, wherein the calculation module comprises n particle sampling units, n weight updating units and n Bayesian resampling units which are in one-to-one correspondence with input and output; the FPGA hardware implementation method comprises the following steps:
step S1, n particle sampling units respectively read old particles from n particle cache blocks, respectively receive random numbers from n random number generators, parallelly sample and update the read old particles, and then transmit the updated particles to corresponding weight updating units;
step S2, the n weight updating units read the observation values from the observation value cache blocks, perform weight calculation on the updated particles in parallel, and store the generated weights into the corresponding weight cache blocks respectively;
step S3, the n Bayes resampling units adopt a Bayes resampling method, resampling is carried out in parallel according to the weight values in the n weight cache blocks, and the index output values obtained by resampling are stored back to the corresponding index cache blocks; wherein the index output value is the address of the new particle obtained by resampling;
step S4, the pseudo random arrangement generator reads the address of the new particle from the n index buffer blocks, distributes the new particle to the n particle buffer blocks according to the average number and the random, and replaces the existing particle in the particle buffer block;
and step S5, circularly executing the step S1 to the step S4 until all time steps are finished, and finishing the state estimation of the particle filter application system according to all the particles in the n particle cache blocks.
Further, the bayesian resampling method specifically adopts Metropolis resampling or refusal resampling.
A FPGA hardware realization device of particle filtering based on Bayesian resampling comprises a calculation module, a pseudo-random arrangement generator, n random number generators, n particle cache blocks, n weight cache blocks, n index cache blocks and an observed value cache block, wherein the calculation module comprises n particle sampling units, n weight updating units and n Bayesian resampling units which are in one-to-one correspondence with input and output; the computing module and the pseudo-random permutation generator are used for realizing the FPGA hardware realization method in any technical scheme.
A target tracking method based on particle filtering uses particles to represent the position, the speed and the acceleration of a target, the target position is used as a state value of each particle in the particle filtering, a distance sensor is used for collecting data to be used as an observed value of the particle filtering, and the position of the target is tracked by adopting the particle filtering method; the particle filtering method adopts the FPGA hardware realization method of the particle filtering based on the Bayesian resampling in any technical scheme.
Advantageous effects
1. According to the invention, Bayesian resampling is adopted, and particle weight summation calculation is not needed, so that parallel resampling can be performed in each Bayesian resampling unit, and therefore, the sampling, weight and resampling processes of particle filtering can be all performed in parallel in the calculating unit, and meanwhile, the exchange of particles after resampling among calculating modules is realized by using a simplified pseudo Random Permutation Generator (RPG), so that the sufficiency and diversity of particle exchange are ensured, the parallel execution of the whole particle filtering system is maintained, the calculating speed of the particle filtering system is improved, and the power consumption of the system is reduced;
2. compared with the implementation mode that the particle filtering adopts the traditional resampling method, the method has the advantages that the input particles and the output particles use the same particle cache block, and one time of storage resources are saved;
3. the invention has the advantages that each unit in the calculation module supports the realization of fixed point number, and the Bayesian resampling does not need to sum the weights, so the problem of unstable numerical value caused by summation can be avoided, compared with the realization of using floating point number, the invention can save calculation resources, increase the calculation parallelism, and simultaneously improve the clock frequency, thereby improving the calculation speed of the system and reducing the power consumption of the system.
Drawings
FIG. 1 is a visual demonstration of the steps of a particle filtering algorithm;
FIG. 2 is a pictorial representation of a conventional polynomial resampling multinominal, multi-layer resampling and Systematic resampling for particle filtering;
FIG. 3 is an illustration of two manners of Metropolis resampling and Rejection resampling that may be used for Bayesian resampling according to an embodiment of the present invention;
fig. 4 is a diagram of a distributed architecture of an FPGA hardware implementation according to an embodiment of the present invention.
Detailed Description
The following describes embodiments of the present invention in detail, which are developed based on the technical solutions of the present invention, and give detailed implementation manners and specific operation procedures to further explain the technical solutions of the present invention.
The embodiment of the invention provides a Bayesian resampling-based FPGA hardware implementation method for particle filtering, wherein an FPGA is shown in FIG. 4 and comprises the following steps: the device comprises a calculation module, a pseudo-random arrangement generator, n random number generators, n particle cache blocks, n weight cache blocks, n index cache blocks and an observation value cache block, wherein the calculation module comprises n particle sampling units, n weight updating units and n Bayesian resampling units which are in one-to-one correspondence with input and output; the FPGA hardware implementation method specifically comprises the following steps:
step S1, n particle sampling units respectively read old particles from n particle cache blocks, respectively receive random numbers from n random number generators, parallelly sample and update the read old particles, and then transmit the updated particles to corresponding weight updating units;
step S2, the n weight updating units read the observation values from the observation value cache blocks, perform weight calculation on the updated particles in parallel, and store the generated weights into the corresponding weight cache blocks respectively;
step S3, the n Bayes resampling units adopt a Bayes resampling method, resampling is carried out in parallel according to the weight values in the n weight cache blocks, and the index output values obtained by resampling are stored back to the corresponding index cache blocks; wherein the index output value is the address of the new particle obtained by resampling;
the Bayesian resampling method is adopted, and the accumulated sum of the weight of each particle is not required, so that no association exists among the weights, namely, no data dependency exists, and the resampling step can be simultaneously calculated in parallel. The bayesian resampling specifically can adopt a Metropolis resampling method and a resampling rejection method, wherein the two resampling methods are visualized and displayed as shown in fig. 3, and the implementation procedure is shown in the following code 1 and code 2:
metropolis resampling: firstly, setting a parameter B, determining the number of iterations, then randomly taking a weight value w (j) from all weight cache blocks, solving a ratio w (j)/w (k) with the currently calculated weight value w (k), comparing the ratio w (j)/w (k) with a following machine number u, keeping the current weight index k unchanged if the ratio w (j)/w (k) is greater than the random number u, and replacing the current weight index k with an index j if the ratio w (j)/w (k) is not greater than the random number u; and after the operation is circulated for B times, the final index value of the resampling is obtained.
Refusing resampling: knowing or setting the upper bound sup w of the weight set in advance, and when the index of the current weight w (j) is calculated and updated: when the generated random number u is larger than the ratio w (j)/sup w of the current weight and the upper bound, the index of the current weight is replaced by the new index which is randomly extracted, the ratio of the random number to the new weight and the upper bound is compared again until the random number is smaller than the ratio, the iteration is terminated, and the current index is the final index value of the resampling.
Step S4, the pseudo random arrangement generator (RPG) reads the address of the new particle from the n index buffer blocks, distributes the new particle to the n particle buffer blocks according to the number average and random, and replaces the existing particle in the particle buffer block;
for example, each particle cache block has 5 particles with the same number, and after resampling, the number of particles in each index cache block may be different, in this step, all particles in the index cache block may be re-distributed to each particle cache block again according to the number average by the pseudo-random permutation generator, so that each particle cache block still maintains the number of particles as 5, and then the next round of particle filtering is performed.
And step S5, circularly executing the step S1 to the step S4 until all time steps are finished, and finishing the state estimation of the particle filter application system according to all the particles in the n particle cache blocks.
When all time steps are iterated to the end, namely when the target time is iterated, all particles in the current particle cache block are used for estimating and outputting the particle state.
The invention also provides an FPGA accelerating device of particle filtering based on Bayesian resampling, which comprises a computing module, a pseudo-random arrangement generator, n random number generators, n particle cache blocks, n weight cache blocks, n index cache blocks and an observed value cache block, wherein the computing module comprises n particle sampling units, n weight updating units and n Bayesian resampling units which are in one-to-one correspondence with input and output; the computing module and the pseudo-random permutation generator are used for realizing the FPGA hardware implementation method in the embodiment.
The invention also provides a target tracking method based on particle filtering, which uses particles to represent the position, the speed and the acceleration of a target, takes the target position as the state value of each particle in the particle filtering, uses the data collected by a distance sensor as the observed value of the particle filtering, and adopts the particle filtering method to track the position of the target; the particle filtering method adopts the FPGA hardware realization method based on the Bayesian resampling particle filtering described in the embodiment.
Taking robot tracking as an example, a plurality of indoor sensors measure the distance between the robot and the sensors at the moment t, and the distance information is a system observation value; each particle is used for representing the possible position of the robot, and the position coordinate is the state value of the corresponding particle; the values that the system needs to estimate or output may be the actual position, velocity, acceleration, etc. of the robot at time t or the motion trajectory of the robot (positions at times 0-t). The working process of the particle filter is as follows:
the working principle of the particle filter is as follows:
initialization: when T is 0, the particle state is initialized, that is, N particles are randomly generated, and represent the position, speed, and acceleration of the robot;
t is 1, …, time T, and respectively:
particle sampling: solving the position of each particle at the T moment according to the position and the speed of the robot at the previous moment (T-1);
calculating a weight value: according to the system observation value at the time T, namely the distance between the robot and the sensor, the weight of each particle can be calculated;
resampling the particles according to the weights; the resampled particles have the same weight; the resampled particles are a new particle set;
and (3) calculating the position, speed, acceleration and the like of the robot after resampling: and after resampling, the weights are the same, and the values of all the particles are summed to obtain an average value.
The above embodiments are preferred embodiments of the present application, and those skilled in the art can make various changes or modifications without departing from the general concept of the present application, and such changes or modifications should fall within the scope of the claims of the present application.
Claims (5)
1. A FPGA hardware realization method of particle filtering based on Bayesian resampling is characterized in that an FPGA unit circuit comprises: the device comprises a calculation module, a pseudo-random arrangement generator, n random number generators, n particle cache blocks, n weight cache blocks, n index cache blocks and an observation value cache block, wherein the calculation module comprises n particle sampling units, n weight updating units and n Bayesian resampling units which are in one-to-one correspondence with input and output; the FPGA hardware implementation method comprises the following steps:
step S1, n particle sampling units respectively read old particles from n particle cache blocks, respectively receive random numbers from n random number generators, parallelly sample and update the read old particles, and then transmit the updated particles to corresponding weight updating units;
step S2, the n weight updating units read the observation values from the observation value cache blocks, perform weight calculation on the updated particles in parallel, and store the generated weights into the corresponding weight cache blocks respectively;
step S3, the n Bayes resampling units adopt a Bayes resampling method, resampling is carried out in parallel according to the weight values in the n weight cache blocks, and the index output values obtained by resampling are stored back to the corresponding index cache blocks; wherein the index output value is the address of the new particle obtained by resampling;
step S4, the pseudo random arrangement generator reads the address of the new particle from the n index buffer blocks, distributes the new particle to the n particle buffer blocks according to the average number and the random, and replaces the existing particle in the particle buffer block;
and step S5, circularly executing the step S1 to the step S4 until all time steps are finished, and finishing the state estimation of the particle filter application system according to all the particles in the n particle cache blocks.
2. The FPGA hardware implementation method of claim 1, wherein the Bayesian resampling method specifically employs Metropolis resampling.
3. The FPGA hardware implementation method of claim 1, wherein the Bayesian resampling method specifically employs a rejection resampling.
4. An FPGA hardware implementation device of particle filtering based on Bayesian resampling is characterized by comprising a calculation module, a pseudo-random arrangement generator, n random number generators, n particle cache blocks, n weight cache blocks, n index cache blocks and an observed value cache block, wherein the calculation module comprises n particle sampling units, n weight updating units and n Bayesian resampling units which are in one-to-one correspondence with input and output; the computing module and the pseudo-random permutation generator are used for realizing the FPGA hardware realization method of any one of claims 1-3.
5. A target tracking method based on particle filtering is characterized in that particles are used for representing the position, the speed and the acceleration of a target, the target position is used as a state value of each particle in the particle filtering, a distance sensor is used for collecting data to be used as an observed value of the particle filtering, and the position of the target is tracked by adopting the particle filtering method; the particle filtering method adopts the FPGA hardware realization method of the particle filtering based on the Bayesian resampling as claimed in any one of claims 1-3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110085423.8A CN112732637B (en) | 2021-01-22 | 2021-01-22 | Bayesian resampling-based FPGA hardware implementation method and device for particle filtering, and target tracking method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110085423.8A CN112732637B (en) | 2021-01-22 | 2021-01-22 | Bayesian resampling-based FPGA hardware implementation method and device for particle filtering, and target tracking method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112732637A CN112732637A (en) | 2021-04-30 |
CN112732637B true CN112732637B (en) | 2022-03-25 |
Family
ID=75593670
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110085423.8A Active CN112732637B (en) | 2021-01-22 | 2021-01-22 | Bayesian resampling-based FPGA hardware implementation method and device for particle filtering, and target tracking method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112732637B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113436232B (en) * | 2021-06-29 | 2023-03-24 | 上海律信信息科技有限公司 | Hardware acceleration method based on tracking algorithm |
CN114820630B (en) * | 2022-07-04 | 2022-09-06 | 国网浙江省电力有限公司电力科学研究院 | Target tracking algorithm model pipeline acceleration method and circuit based on FPGA |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101662433A (en) * | 2009-06-23 | 2010-03-03 | 中山大学 | Channel prediction method based on particle filtration correction |
CN102542149A (en) * | 2011-10-11 | 2012-07-04 | 江苏科技大学 | Hardware realization method of fissile bootstrap particle filtering algorithm based on FPGA (Field Programmable Gate Array) |
CN104009733A (en) * | 2014-05-19 | 2014-08-27 | 江苏科技大学 | Sample importance resample particle filter hardware implementation method based on FPGA |
CN111761583A (en) * | 2020-07-08 | 2020-10-13 | 温州大学 | Intelligent robot motion positioning method and system |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070021947A1 (en) * | 2005-07-22 | 2007-01-25 | Honeywell International Inc. | Model tuning system |
US20180189229A1 (en) * | 2017-01-04 | 2018-07-05 | Stmicroelectronics S.R.L. | Deep convolutional network heterogeneous architecture |
CN110187335B (en) * | 2019-06-25 | 2021-03-16 | 电子科技大学 | Particle filter tracking-before-detection method for target with discontinuous characteristic |
-
2021
- 2021-01-22 CN CN202110085423.8A patent/CN112732637B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101662433A (en) * | 2009-06-23 | 2010-03-03 | 中山大学 | Channel prediction method based on particle filtration correction |
CN102542149A (en) * | 2011-10-11 | 2012-07-04 | 江苏科技大学 | Hardware realization method of fissile bootstrap particle filtering algorithm based on FPGA (Field Programmable Gate Array) |
CN104009733A (en) * | 2014-05-19 | 2014-08-27 | 江苏科技大学 | Sample importance resample particle filter hardware implementation method based on FPGA |
CN111761583A (en) * | 2020-07-08 | 2020-10-13 | 温州大学 | Intelligent robot motion positioning method and system |
Non-Patent Citations (3)
Title |
---|
Generic hardware architectures for sampling and resampling in particle filters;A.Athalye;《EURASIP Journal on Advances in Signal Processing》;20051023;第2888-2902页 * |
Optimizing FPGA-Based CNN Accelerator Using Differentiable Neural Architecture Search;Hongxiang Fan;《2020 IEEE 38th International Conference on Computer Design (ICCD)》;20201221;第1-4页 * |
Parallel resampling for particle filters on FPGAs;Shuanglong Liu;《2014 International Conference on Field-Programmable Technology(FPT)》;20150409;第1-8页 * |
Also Published As
Publication number | Publication date |
---|---|
CN112732637A (en) | 2021-04-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112732637B (en) | Bayesian resampling-based FPGA hardware implementation method and device for particle filtering, and target tracking method | |
CN108305275B (en) | Active tracking method, device and system | |
CN104376581B (en) | A kind of Gaussian Mixture using adaptive resampling is without mark particle filter algorithm | |
Pan et al. | Real-time collision detection and distance computation on point cloud sensor data | |
Chitchian et al. | Distributed computation particle filters on GPU architectures for real-time control applications | |
Pan et al. | Video tracking based on sequential particle filtering on graphs | |
Allen et al. | Learning rigid dynamics with face interaction graph networks | |
CN113673565B (en) | Multi-sensor GM-PHD self-adaptive sequential fusion multi-target tracking method | |
CN111185909B (en) | Robot operation condition acquisition method and device, robot and storage medium | |
Zachmann | Optimizing the collision detection pipeline | |
CN113516750A (en) | Three-dimensional point cloud map construction method and system, electronic equipment and storage medium | |
CN111707262A (en) | Point cloud matching method, medium, terminal and device based on closest point vector projection | |
CN111325776A (en) | PHD multi-target tracking method based on variational Bayesian T distribution Kalman filtering | |
CN111426322B (en) | Adaptive target tracking filtering method and system for simultaneously estimating state and input | |
Li et al. | Hardware/software co-design of particle filter and its application in object tracking | |
CN112182042A (en) | Point cloud feature matching method and system based on FPGA and path planning system | |
Rymut et al. | GPU-accelerated human motion tracking using particle filter combined with PSO | |
CN116608859A (en) | Navigation method, storage medium and device of self-adaptive unscented Kalman filtering based on threshold processing | |
Bao et al. | Mixed constrained image filter design using particle swarm optimization | |
Morsi et al. | Efficient hardware implementation of PSO-based object tracking system | |
Schwiegelshohn et al. | A resampling method for parallel particle filter architectures | |
CN112257259B (en) | Method and system for estimating whole-course trajectory of ballistic missile based on improved autonomous multiple models | |
CN113030945B (en) | Phased array radar target tracking method based on linear sequential filtering | |
Bahrpeyma et al. | Application of Reinforcement Learning to UR10 Positioning for Prioritized Multi-Step Inspection in NVIDIA Omniverse | |
CN114677284A (en) | Map construction method and device, electronic equipment and storage medium |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |