Target Tracking Method Based on Improved PID Search Algorithm and Particle Filter
By improving the PID search algorithm to optimize particle filtering, and utilizing chaotic mapping and zero-output condition factors, the problem of heuristic optimization algorithms easily getting trapped in local optima is solved, achieving higher accuracy in video target tracking and filtering precision.
Patent Information
- Application Number
- CN202411803012.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2044-12-09
AI Technical Summary
Existing heuristic optimization algorithms are prone to getting stuck in local optima in video target tracking, leading to reduced tracking accuracy, and their parameter settings are complex and rely on human experience.
An improved PID search algorithm is used to optimize particle filtering. The population is initialized by introducing a chaotic mapping strategy, and the zero-output condition factor of the improved PID search algorithm is combined to optimize particle position updates, retain the effective particle set, and prevent the algorithm from getting trapped in local optima.
It improves the accuracy and filtering precision of video target tracking, reduces estimation errors, and enhances the robustness and adaptability of the algorithm.
Smart Images

Figure CN119741336B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of video target tracking technology, and more specifically, to a target tracking method based on an improved PID search algorithm for optimizing particle filtering, a target tracking device based on an improved PID search algorithm for optimizing particle filtering, a computer-readable storage medium, and a computer program product. Background Technology
[0002] Video target tracking is a popular research topic in computer vision, referring to the technique of detecting and locating the motion state of a target based on contextual information from a video or image sequence. Video target tracking algorithms are mainly divided into correlation filtering-based algorithms and deep learning-based algorithms. Filtering algorithms are commonly used tracking algorithms, among which particle filtering does not require the target's motion model to be linear and the noise to follow a Gaussian distribution. It performs better in both linear and nonlinear system state estimation and is the most widely used. However, with continuous algorithm iteration, particle degradation becomes increasingly serious, leading to increased computational costs and a significant decrease in estimation accuracy. In recent years, the development of swarm intelligence optimization algorithms has provided new ideas for improving particle diversity. By treating particles as individuals in a population, the particle distribution tends to be optimal by simulating the motion patterns of these individuals.
[0003] In recent years, with the development of intelligent optimization algorithms, swarm intelligence optimization has become a new direction for particle filtering. This approach iteratively optimizes particle distribution using swarm intelligence optimization algorithms, treating particles in particle filtering as individuals within a swarm, and simulating the motion patterns of a swarm to make particle distribution more reasonable. Existing technical methods are as follows: Patent application CN 110264501A discloses a CNN-based adaptive particle filtering video target tracking method and system, constructing a convolutional neural network to learn image features and using particle swarm optimization particle filtering for feature tracking. Patent application CN 118115537A discloses a target tracking method, system, and medium based on improved quantum particle swarm optimization particle filtering, iteratively optimizing a low-weight particle set using quantum particle swarm optimization, and introducing the predicted positions of effective particles into the quantum particle swarm's position update formula and particle objective function. Patent application CN 116227533A discloses an improved particle filtering target tracking method based on particle swarm optimization, adaptively adjusting both inertial weights and learning factors in the particle filtering algorithm to improve its accuracy. Classic swarm optimization algorithms, including particle swarm optimization, genetic algorithms, and ant colony optimization, rely solely on measured values for their fitness functions during iteration. However, when bimodal or multimodal functions emerge, the algorithm cannot guarantee that particles will move to the optimal position, leading to a decrease in filtering accuracy. Existing filtering algorithms, such as the Kalman filter, are less effective at solving non-Gaussian nonlinear filtering problems. With continuous improvement, particle filter algorithms have become increasingly complex in their resampling strategies, requiring more parameters to be set and relying heavily on human experience. Existing heuristic optimization algorithms suffer from complex structures, numerous parameter updates, and a tendency to get trapped in local optima. Summary of the Invention
[0004] The main objective of this application is to provide a target tracking method based on an improved PID search algorithm optimized particle filter, a target tracking device based on an improved PID search algorithm optimized particle filter, a computer-readable storage medium, and a computer program product, so as to at least solve the problem that existing heuristic optimization algorithms in the prior art have complex structures and are prone to getting trapped in local optima due to many updated parameters, which leads to a decrease in the accuracy of target tracking.
[0005] To achieve the above objectives, according to one aspect of this application, a target tracking method based on an improved PID search algorithm and optimized particle filtering is provided, comprising: a reading step, reading a current video frame and selecting a tracking target from the current video frame; an initialization step, initializing the algorithm parameters of the particle filtering algorithm and the improved PID search algorithm, and initializing the population using a chaotic mapping strategy to generate a chaotic initial population, wherein the algorithm parameters include at least the sampling period, measurement noise variance, process noise, maximum number of iterations, and population size, and the improved PID search algorithm is a PID search algorithm improved by adding a zero-output condition factor to the output regulation value of PID regulation, and the particles in the chaotic initial population represent all states of the tracking target; a first calculation step, using the particle filtering algorithm to calculate the importance weight and fitness value of the particles in the chaotic initial population, and simultaneously using the improved PID search algorithm... The algorithm calculates the output regulation value of the PID controller; in the update step, under the condition that the regulation condition is met, the positions of all particles in the chaotic initial population are updated according to the output regulation value and the zero output condition factor, where the regulation condition is that the zero output condition factor is greater than zero; in the second calculation step, it is determined whether to enter the resampling stage according to the resampling condition, and if the resampling stage is not required, the state estimate and variance estimate are calculated based on the importance weights, where the resampling condition is that the number of effective particles is greater than or equal to the lower limit of the number of effective particles, the resampling stage is the stage of resampling the particles, and the effective particles are particles whose fitness value is greater than a set fitness value; in the tracking step, the target state of the tracking target is estimated according to the state estimate and variance estimate to track the tracking target in real time, where the target state includes at least the position information and velocity information of the tracking target.
[0006] Optionally, a chaotic mapping strategy is used to initialize the population and generate a chaotic initial population, including: determining the chaotic mapping strategy, wherein the chaotic mapping strategy is at least one of the following: Logistic chaotic mapping strategy, Circle chaotic mapping strategy, Sing chaotic mapping strategy, and Singer chaotic mapping strategy; performing the initialization operation on the population according to the chaotic mapping strategy to generate the particle positions of the chaotic initial population, wherein the expression for the particle positions is x. ij =L i (u j -l j )+l j x ij To initialize the chaotic population, the current position of particle i in dimension j, u j Let l be the upper bound of the decision variable in dimension j. j L is the lower bound of the decision variable in dimension j.i The population is defined by the chaotic mapping strategy, where i = 1, 2, ..., n, n represents the total number of particles, j = 1, 2, ..., d, d represents the total number of decision variables, which are the parameters to be optimized in the particle filtering algorithm and the improved PID search algorithm. The population is expressed as x. ij =(u j -l j )·r1+l j r1 is a random number from 0 to 1; determine the target state transition model of the tracked target, the expression of the target state transition model is: S xk S represents the x-axis position information of the tracked target at time k. yk This represents the information of the tracked target on the y-axis at time k. This represents the x-axis velocity information of the tracked target at time k. This represents the y-axis velocity information of the tracked target at time k, where T is the sampling period; a particle state set of the population is generated according to the state transition model; the particle state set is sampled based on the importance density function to form the chaotic initial population at the initial time, where the importance density function is... z k This represents the measurement value of all the particles at time k.
[0007] Optionally, the particle filtering algorithm is used to calculate the importance weights and fitness values of particles in the chaotic initial population, including: calculating the importance weight of each particle according to the weight calculation formula, wherein the weight calculation formula is as follows: Let represent the importance weight of the i-th particle at time k. R represents the importance weight of the i-th particle at time k-1. k The variance of the measurement noise, z k This represents the measurement value of the sampled particle at time k. For the posterior probability density, The predicted measurement value is represented; the fitness value of each particle is calculated according to the fitness formula, which is: Let φ represent the fitness value of the i-th particle at time k, where φ is the adaptive parameter. This indicates the predicted position of the effective particle.
[0008] Optionally, calculating the output regulation value of the PID control using the improved PID search algorithm includes: calculating the current system deviation according to a first formula, where the first formula is e k (t)=x b(t-1)-x(t-1), e k (t) represents the current system deviation, x b Let represent the individual with the best historical value in the population, and x represent the position of the individual in the current iteration; calculate the output regulation value of the PID control according to the second formula, which is Δu(t) = K. p ·r2[e k (t)-e k-1 (t)]+K i ·r3·e k (t)+K d ·r4·[e k (t)-2e k-1 (t)+e k-2 [t], where r2, r3, and r4 are all random numbers in the matrix rand(n, 1), and K p K is the coefficient of the proportional factor in the PID control process. i K is the coefficient of the integral factor in the PID control process. d Here, Δu(t) represents the coefficient of the differential factor in the PID control process, and e represents the output adjustment value at iteration number t. k-1 (t) represents the systematic deviation at time k-1 when the iteration number is t, and e k-1 (t)=e k (t-1)+x b (t)-x b (t-1), e k-2 (t) represents the system deviation at time k-2 when the iteration number is t.
[0009] Optionally, under the condition of satisfying the adjustment condition, updating the positions of all particles in the initial chaotic population according to the output adjustment value and the zero output condition factor includes: updating the positions of all particles in the initial chaotic population according to the population individual update formula, the population individual update formula being x(t+1)=x(t)+η·Δu(t)+(1-η)·o(t), where x(t) is the position of the particle at the t-th iteration, x(t+1) is the position of the particle at the (t+1)-th iteration, Δu(t) is the output adjustment value, and o(t) is the zero output condition factor, where o(t)=(cos(1-t / T)) max )+λr5·L)·e k (t), r5 is a random number in the matrix rand(n, d), T max For the maximum number of iterations, λ = [ln(T)] max -t+2) / ln(T max )] 2 e k(t) represents the system bias, L is the Lévy flight function, and η = r6cos(t / T) max r6 is a random number generated by the matrix rand(0,1).
[0010] Optionally, after updating the positions of all particles in the chaotic initial population according to the output adjustment value when the adjustment conditions are met, the method further includes: normalizing the importance weight of each particle to obtain a normalized weight; and updating the importance weight of the particle according to the normalized weight.
[0011] Optionally, after calculating the state estimate and variance estimate based on the importance weights, the method further includes: if the number of iterations has not reached the maximum number of iterations, sequentially repeating the first calculation step, the update step, and the second calculation step at least once until the number of iterations reaches the maximum number of iterations; if the number of iterations reaches the maximum number of iterations, updating the next video frame of the current video frame to the current video frame, and sequentially repeating the reading step, the initialization step, the first calculation step, the update step, the second calculation step, and the tracking step at least once until all video frames have completed target tracking analysis.
[0012] According to another aspect of this application, a target tracking device based on an improved PID search algorithm and optimized particle filtering is provided. The device includes: a reading unit for performing a reading step, reading a current video frame and selecting a tracking target from the current video frame; an initialization unit for performing an initialization step, initializing the algorithm parameters of the particle filtering algorithm and the improved PID search algorithm, and initializing the population using a chaotic mapping strategy to generate a chaotic initial population. The algorithm parameters include at least the sampling period, measurement noise variance, process noise, maximum number of iterations, and population size. The improved PID search algorithm is a PID search algorithm improved by adding a zero-output condition factor to the output adjustment value of a PID controller. The particles in the chaotic initial population represent all states of the tracking target; and a first calculation unit for performing a first calculation step, using the particle filtering algorithm to calculate the importance weights and fitness values of the particles in the chaotic initial population, and simultaneously using the improved PID search algorithm to calculate... The system comprises: a PID control output adjustment value; a first update unit, configured to execute an update step, updating the positions of all particles in the chaotic initial population based on the output adjustment value and the zero output condition factor, provided that the control condition is met, wherein the zero output condition factor is greater than zero; a second calculation unit, configured to execute a second calculation step, determining whether to enter a resampling stage based on a resampling condition, and calculating a state estimate and a variance estimate based on the importance weights if the resampling stage is not required, wherein the resampling condition is that the number of effective particles is greater than or equal to a lower limit of the number of effective particles, and the resampling stage is a stage for resampling the particles, wherein the effective particles are particles whose fitness values are greater than a set fitness value; and a tracking unit, configured to execute a tracking step, estimating the target state of the tracking target based on the state estimate and the variance estimate to perform real-time tracking of the tracking target, wherein the target state includes at least the position information and velocity information of the tracking target.
[0013] According to another aspect of this application, a computer-readable storage medium is provided, the computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the device on which the computer-readable storage medium is located to perform any of the methods described.
[0014] According to another aspect of this application, a computer program product is provided, including computer instructions that, when executed by a processor, implement any of the methods described.
[0015] By applying the technical solution of this application, in the target tracking method based on an improved PID search algorithm and optimized particle filtering, an improved PID search algorithm is introduced and combined with particle filtering. To prevent the algorithm from getting trapped in local optima, a zero-output conditional factor is added to the output value of the original PID search algorithm. This factor optimizes and iterates invalid particles while retaining the effective particle set, thereby reducing estimation errors and improving filtering accuracy. This application solves the problem that existing heuristic optimization algorithms suffer from complex structures, numerous parameter updates, and a tendency to get trapped in local optima, leading to reduced target tracking accuracy. Attached Figure Description
[0016] Figure 1 A hardware structure block diagram of a mobile terminal that performs a target tracking method based on an improved PID search algorithm-optimized particle filter, according to an embodiment of this application, is shown.
[0017] Figure 2 A flowchart illustrating a target tracking method based on an improved PID search algorithm for optimizing particle filtering, according to an embodiment of this application, is shown.
[0018] Figure 3 A flowchart illustrating a target tracking method based on an improved PID search algorithm for optimizing particle filtering, according to an embodiment of this application, is shown.
[0019] Figure 4 A structural block diagram of a target tracking device based on an improved PID search algorithm for optimizing particle filtering is shown according to an embodiment of this application.
[0020] The above figures include the following reference numerals:
[0021] 102. Processor; 104. Memory; 106. Transmission device; 108. Input / output device. Detailed Implementation
[0022] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0023] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0024] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0025] As described in the background section, existing filtering algorithms, such as the Kalman filter, are less effective at solving non-Gaussian nonlinear filtering problems. With continuous improvements, particle filter algorithms have become increasingly complex in their resampling strategies, requiring more parameters to be set and relying heavily on human experience. Existing heuristic optimization algorithms suffer from complex structures, numerous parameter updates, and a tendency to get trapped in local optima. To address the problem of reduced target tracking accuracy caused by the complex structures, numerous parameter updates, and tendency to get trapped in local optima in existing heuristic optimization algorithms, embodiments of this application provide a target tracking method based on an improved PID search algorithm optimized particle filter, a target tracking device based on an improved PID search algorithm optimized particle filter, a computer-readable storage medium, and a computer program product.
[0026] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0027] The methods and embodiments provided in this application can be executed on a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure block diagram of a mobile terminal based on an improved PID search algorithm to optimize particle filtering for target tracking, according to an embodiment of the present invention. Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1The different configurations shown.
[0028] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the target tracking method based on the improved PID search algorithm for optimizing particle filtering in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. The transmission device 106 is used to receive or send data via a network. Specific examples of the aforementioned networks may include wireless networks provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0029] This embodiment provides a target tracking method based on an improved PID search algorithm optimized particle filter that runs on a mobile terminal, computer terminal, or similar computing device. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Also, although the logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0030] Figure 2 This is a flowchart of a target tracking method based on an improved PID search algorithm for optimizing particle filtering, according to an embodiment of this application. Figure 2 As shown, the method includes the following steps:
[0031] Step S201, Reading Step: Read the current video frame and select the tracking target from the current video frame.
[0032] Specifically, the system reads the current video frame from the video stream. Within this frame, the system uses specific algorithms (such as feature matching and color tracking) to identify and select the tracking target. This ensures the system can acquire video data in real time and extract information about the tracking target, providing input for subsequent tracking algorithms.
[0033] Step S202, initialization step, initialize the algorithm parameters of the particle filter algorithm and the improved PID search algorithm, and use the chaotic mapping strategy to initialize the population to generate a chaotic initial population. The algorithm parameters include at least the sampling period, measurement noise variance, process noise, maximum number of iterations and population size. The improved PID search algorithm is a PID search algorithm improved by adding a zero output condition factor to the output regulation value of PID regulation. The particles in the chaotic initial population represent all states of the tracking target.
[0034] Specifically, the parameters of the particle filter algorithm and the improved PID search algorithm are initialized, such as the sampling period, measurement noise variance, process noise, maximum number of iterations, and population size, and the system's state equation and measurement equation are generated as follows: State equation x k =f k (x k-1 ,k)+w k-1 Measurement equation In the formula, w k and v k The mean is 0 and the variance is Q, respectively. k and R k Gaussian noise was introduced. A chaotic mapping strategy was used to initialize the population, generating a chaotic initial population. Chaotic mapping can increase population diversity and improve search efficiency. An improved PID search algorithm was developed by adding a zero-output condition factor to the traditional PID control output value to prevent the algorithm from getting trapped in local optima, thus adapting to different tracking scenarios.
[0035] It should be noted that particle filtering is an approximate Bayesian filtering algorithm. The main idea is to use some discrete random sampling points to approximate the probability density function of the system's random variables, and to use the expectation of the particles in the sample space to replace the integral to calculate the system's state variables, thereby obtaining the minimum variance estimate. Particle filtering is mainly divided into two parts: sequential importance sampling and resampling. In order to slow down particle degradation and reduce filter divergence, the predicted value and the error of the predicted value are used to compensate for the particles in the sequential importance sampling process, and the covariance matrix of the particles is calculated to assist in the generation of new particle swarms. The particle generation steps of this algorithm are as follows: (1) Particle prediction: in, Let W represent the state of particle i at time k, and W be the corresponding weight. (2) Weight calculation: In the formula, Z represents the weight of particle i at time k; k (3) Gain calculation: Calculate the gain matrix of the particle based on the predicted and measured values. In the formula, The predicted value of the particle at time k. (4) Particle update: The particle is updated using the calculated gain and the measured value. (5) Covariance calculation: Calculate the covariance matrix of the particles. Where K, R, and Z represent particle filter gain, measurement noise, and measurement data, respectively.
[0036] Step S203, the first calculation step, uses the above-mentioned particle filtering algorithm to calculate the importance weight and fitness value of the particles in the above-mentioned chaotic initial population, and at the same time uses the above-mentioned improved PID search algorithm to calculate the output regulation value of PID regulation.
[0037] Specifically, a particle filter algorithm is used to calculate the importance weight and fitness value of each particle in the initial chaotic population. An improved PID search algorithm is used to calculate the output regulation value of the PID control. The particle filter algorithm evaluates the reliability of each particle by calculating the weights and fitness values, providing a basis for subsequent updates and resampling. The improved PID search algorithm provides a dynamic adjustment mechanism, making tracking more flexible and accurate.
[0038] It should be noted that the purpose of PID control is to effectively adjust the deviation of the controlled object so that the system reaches a stable state. The PID-based search algorithm (PSA) simulates the adjustment process of PID, abstracting the historical best value of the group as the target value and each individual value as the true value, continuously correcting the deviation of each individual value relative to the best value, so that the whole system reaches a better state.
[0039] Step S204, update step: Under the condition of satisfying the adjustment condition, update the position of all particles in the chaotic initial population according to the above output adjustment value and the above zero output condition factor. The above adjustment condition is that the above zero output condition factor is greater than zero.
[0040] Specifically, under the condition that the adjustment condition (zero output condition factor greater than zero) is met, the positions of all particles in the initial chaotic population are updated according to the output adjustment value and the zero output condition factor, causing the particles to continuously move closer to the true state. Updating the particle positions allows the population to better approximate the true state of the tracked target. The introduction of the zero output condition factor reduces unnecessary adjustment actions and improves the stability and efficiency of tracking.
[0041] Step S205, the second calculation step, determines whether to enter the resampling stage based on the resampling conditions. If it is not necessary to enter the resampling stage, calculate the state estimate and variance estimate based on the importance weights. The resampling condition is that the number of effective particles is greater than or equal to the lower limit of the number of effective particles. The resampling stage is the stage of resampling the particles. The effective particles are the particles whose fitness values are greater than the set fitness values.
[0042] Specifically, the threshold value for the number of effective particles is set to N. b Effective particle number N eff The calculation formula is: If N eff <N b If the number of effective particles is high, it indicates insufficient particle count, algorithm degradation, and resampling is required; conversely, if the number of effective particles is high, resampling is not necessary. The resampling stage removes low-fit particles and retains high-fit particles, thereby improving tracking accuracy. If resampling is not required, state estimates and variance estimates are calculated based on importance weights. State estimates... and variance estimates It provides the current status information of the tracked target, providing a basis for real-time tracking. In the formula, and These represent the particles and their corresponding weights at that moment. The state estimate of the particle filter is calculated by a weighted average of a set of random samples (particles). In particle filtering, the variance estimate is used to measure the uncertainty of the state estimate. The smaller the variance, the more stable the estimate and the less uncertainty. These two values are used to measure the performance of the particle filter for video target tracking.
[0043] Step S206, tracking step, estimating the target state of the tracking target based on the above state estimate and the above variance estimate in order to track the tracking target in real time, wherein the target state includes at least the position information and velocity information of the tracking target.
[0044] Specifically, the target state, including position and velocity information, is estimated based on state and variance estimates. This information is then used for real-time tracking. The target state is updated in real-time to ensure continuous and accurate tracking. In summary, this system achieves real-time tracking of video targets by combining particle filtering and an improved PID search algorithm. Through chaotic initialization and resampling mechanisms, the system can adapt to different tracking environments, improving tracking robustness and accuracy.
[0045] In this embodiment, firstly, a reading step reads the current video frame and selects the tracking target from it; then, an initialization step initializes the algorithm parameters of the particle filter algorithm and the improved PID search algorithm, and uses a chaotic mapping strategy to initialize the population, generating a chaotic initial population. The algorithm parameters include at least the sampling period, measurement noise variance, process noise, maximum number of iterations, and population size. The improved PID search algorithm is a PID search algorithm improved by adding a zero-output condition factor to the output regulation value of the PID regulator. The particles in the chaotic initial population represent all states of the tracking target; then, a first calculation step uses the particle filter algorithm to calculate the importance weight and fitness value of the particles in the chaotic initial population, and simultaneously uses the improved PID search algorithm to calculate the output regulation value of the PID regulator; then, an update step... Under the condition that the adjustment condition is met, the positions of all particles in the initial chaotic population are updated according to the above-mentioned output adjustment value and the above-mentioned zero output condition factor. The adjustment condition is that the above-mentioned zero output condition factor is greater than zero. Then, in the second calculation step, it is determined whether to enter the resampling stage according to the resampling condition. If it is not necessary to enter the above-mentioned resampling stage, the state estimate and variance estimate are calculated based on the above-mentioned importance weights. The resampling condition is that the number of effective particles is greater than or equal to the lower limit of the number of effective particles. The resampling stage is the stage of resampling the above-mentioned particles. The above-mentioned effective particles are the particles whose fitness values are greater than the set fitness value. Finally, in the tracking step, the target state of the tracking target is estimated according to the above-mentioned state estimate and the above-mentioned variance estimate to track the tracking target in real time. The target state includes at least the position information and velocity information of the tracking target. This invention introduces an improved PID search algorithm, combining it with particle filtering. To prevent the algorithm from getting trapped in local optima, a zero-output conditional factor is added to the original PID search algorithm's output value. This factor optimizes ineffective particles iteratively, retaining the effective particle set, thereby reducing estimation errors and improving filtering accuracy. This application solves the problem that existing heuristic optimization algorithms suffer from complex structures, numerous parameter updates, and a tendency to get trapped in local optima, leading to reduced target tracking accuracy.
[0046] To enable those skilled in the art to better understand the technical solution of this application, the implementation process of the target tracking method based on the improved PID search algorithm and optimized particle filtering will be described in detail below with reference to specific embodiments.
[0047] To improve the convergence speed and solution accuracy of the algorithm, in one optional implementation, step S202 includes:
[0048] Step S2021: Determine the above-mentioned chaotic mapping strategy, wherein the above-mentioned chaotic mapping strategy is at least one of the following: Logistic chaotic mapping strategy, Circle chaotic mapping strategy, Sing chaotic mapping strategy and Singer chaotic mapping strategy;
[0049] Step S2022: Perform the above initialization operation on the population according to the above chaotic mapping strategy to generate the particle positions of the chaotic initial population. The expression for the particle positions is x. ij =L i (u j -l j )+l j x ij To initialize the current position of particle i in dimension j in the aforementioned chaotic population, u j Let l be the upper bound of the decision variable in the aforementioned dimension j. j L is the lower bound of the above decision variables in the above dimension j. i Let be the population after being mapped by the above chaotic mapping strategy, i = 1, 2, ..., n, where n represents the total number of particles, j = 1, 2, ..., d, where d represents the total number of decision variables. These decision variables are the parameters that need to be optimized in the particle filtering algorithm and the improved PID search algorithm. The expression for the population is x. ij =(u j -l j )·r1+l j r1 is a random number from 0 to 1;
[0050] Step S2023: Determine the target state transition model for the tracked target. The expression for the target state transition model is as follows: S xk S represents the x-axis position information of the tracked target at time k. yk This represents the information of the tracked target at time k on the y-axis. This represents the x-axis velocity information of the tracked target at time k. This represents the y-axis velocity information of the tracked target at time k, where T is the sampling period; the particle state set of the population is generated based on the state transition model.
[0051] Step S2024: Sample the particle state set based on the importance density function to form the initial chaotic population at the initial time. The importance density function is: z k This represents the measurement value of all the above particles at time k.
[0052] In the above embodiment, assume that the number of decision variables in the optimization problem is d, and the upper and lower bounds of the variables are u and l, respectively. The control parameters of the PSA algorithm include the maximum number of iterations T and the population size n. Then the initial population can be expressed as: x ij =(u j -l j )·r1+l j , i = 1, 2, ..., n; j = 1, 2, ..., d, where x ij Let r1 be the current position of individual i in dimension j, and r1 be a random number from 0 to 1. The quality of the initial population affects the convergence speed and solution accuracy of the algorithm. However, the PSA algorithm generates the initial population randomly, making it difficult to guarantee the diversity and uniformity of the population distribution. Therefore, this invention employs a Logistic chaotic mapping strategy to initialize the population. The mathematical expression for Logistic is: x k+1 =μx k (1-x k ), where k represents the number of iterations, x k ∈[0, 1], μ∈(0, 4], take μ=4. First from the equation x k+1 =μx k (1-x k Generate an initial population: L i =4*L i-1 (1-L i-1 ), L i The position of an individual in the chaotically initialized population after the Logistic mapping can be represented as: x ij =L i (u j -l j )+l j The state transition model reflects the target's position and motion characteristics, representing the target's actual motion process. When tracking video targets, the target's location is typically marked manually or using a detection algorithm. The mathematical model used to obtain the target's position information is the state transition model, usually employing a second-order autoregressive uniform velocity model, expressed as: X k =AX k-1 +BV k-1 +CW k-1 , where X k-1 V k-1 and W k-1 Let A, B, and C represent the position information, velocity information, and system noise information at time k-1, respectively, and let A, B, and C be parameter matrices. For a two-dimensional image plane, the target state transition model can be represented as: This represents the predicted position of the tracked target in the current video frame. Various predicted positions can be obtained based on the target state transition model, generating a particle state set. At time k=0, the sampled particles are used... This means that the initial state set is sampled based on the initial state importance density function to form the sampled particle swarm set at the initial time (i.e., the chaotic initial population mentioned above). The importance density function is: In the formula, z k This represents the measured value of the particle at time k.
[0053] To improve the estimation accuracy of the filtering algorithm, in one optional implementation, step S203 includes:
[0054] Step S2031: Calculate the importance weight of each particle according to the weight calculation formula, whereby the weight calculation formula is as follows: Let represent the importance weight of the i-th particle at time k. R represents the importance weight of the i-th particle at time k-1. k Let z represent the variance of the measurement noise mentioned above. k This represents the measurement value of the sampled particle at time k. For the posterior probability density, Indicates the predicted measurement value;
[0055] Step S2032: Calculate the fitness value of each of the above particles according to the fitness formula, whereby the fitness formula is: This represents the fitness value of the i-th particle at time k, where φ is the adaptive parameter. This indicates the predicted position of the effective particle.
[0056] In the above embodiments, according to the particle filtering algorithm, each particle is predicted and sampled using a prediction model and a sampling model to obtain the sampled measurement value. Then, based on the measurement value and the measurement noise variance, the posterior probability density of each particle is calculated; that is, particles with higher posterior probability densities have higher weights. Based on the predicted measurement value and the measurement noise variance, the fitness value of each particle is calculated. First, based on the adaptive parameters and the predicted positions of effective particles, the difference between the predicted position and the actual observation value of each particle is calculated. Then, based on the magnitude of the difference, the fitness value of each particle is calculated; that is, the larger the fitness value, the higher the matching degree between the predicted position and the actual observation value of the particle. In the particle filtering algorithm, particles are resampled according to importance weights to increase the number of effective particles, thereby improving the estimation accuracy of the filtering algorithm; while the fitness value can help filter out particles that better match the actual observation value, thereby improving the estimation accuracy of the filtering algorithm.
[0057] In order to improve the convergence speed and accuracy by continuously adjusting the system bias to converge the entire population to the optimal state, step S203 in an optional implementation further includes:
[0058] Step S2033: Calculate the current system deviation according to the first formula, where the first formula is e. k (t)=x b (t-1)-x(t-1), e k (t) represents the current system deviation mentioned above, x b represents the individual that represents the historical best value in the population, and x represents the position of the individual in the current iteration;
[0059] Step S2034: Calculate the output regulation value of the PID control according to the second formula, which is Δu(t)=K p ·r2[e k (t)-e k-1 (t)]+K i ·r3·e k (t)+K d ·r4·[e k (t)-2e k-1 (t)+e k-2 [t], where r2, r3, and r4 are all random numbers in the matrix rand(n, 1), and K p K is the coefficient of the proportional factor in the PID control process. i K represents the coefficient of the integral factor in the above PID control process. d Here, Δu(t) represents the coefficient of the differential factor in the PID control process, and e represents the output adjustment value at iteration number t. k-1 (t) represents the systematic deviation at time k-1 when the iteration number is t, and e k-1 (t)=e k (t-1)+x b (t)-x b (t-1), e k-2 (t) represents the system deviation at time k-2 when the iteration number is t.
[0060] In the above embodiment, for several iterations t, the overall deviation e at the current time is... k (t) is e k (t)=x b (t-1)-x(t-1), where x b Let represent the individual with the historical best value in the initial chaotic population, and x represent the position of that individual in the current iteration. For ease of calculation and iterative updates, when the number of iterations is t, the deviation of the population at the previous time step is represented by e. k-1 (t) indicates that the deviation between the first two time points is due to ek-2 (t) represents this. In the PSA algorithm, the optimal value after each iteration is not always the same, and in order to minimize the space complexity of the algorithm, e k-1 (t) can be represented as: e k-1 (t)=e k (t-1)+x b (t)-x b (t-1). During PID control, the proportional, integral, and derivative factors are adjusted according to different situations. When the number of iterations is t, the expression for the output regulation value Δu(t) of the PID control is, Δu(t) = K p ·r2[e k (t)-e k-1 (t)]+K i ·r3·e k (t)+K d ·r4·[ e k(t)-2e k-1 (t)+e k-2 (t)].
[0061] To prevent the algorithm from getting trapped in local optima and further improve filtering accuracy, in one optional implementation, step S204 includes:
[0062] Step S2041: Update the positions of all particles in the initial chaotic population according to the population individual update formula, which is x(t+1)=x(t)+η·Δu(t)+(1-η)·o(t), where x(t) is the position of the particle at the t-th iteration, x(t+1) is the position of the particle at the (t+1)-th iteration, Δu(t) is the output adjustment value, and o(t) is the zero output condition factor, where o(t)=(cos(1-t / T)) max )+λr5·L)·e k (t), r5 is a random number in the matrix rand(n, d), T max For the maximum number of iterations mentioned above, λ = [ln(T)] max -t+2) / ln(T max )] 2 e k (t) represents the system bias, L is the Lévy flight function, and η = r6cos(t / T) max r6 is a random number generated by the matrix rand(n, 1).
[0063] In the above embodiment, to prevent the algorithm from getting trapped in local optima, a conditional factor called zero output is added to the original output adjustment value Δu(t), defined as follows: o(t)=(cos(1-t / T)+λr5·L)·ek (t), where r5∈rand(n,d); λ is an adjustment parameter according to the following formula: λ=[ln(T-t+2) / ln(T)] 2 L is a Lévy flight function, defined as: In the formula, u and v are matrices of n rows and d columns of random numbers that follow a standard normal distribution, respectively; β is a constant set to 1.5. In summary, the update of individuals in the population is related to both Δu(t) and o(t), and the formula for updating individuals in the population is: x(t+1)=x(t)+η·Δu(t)+(1-η)·o(t), where η is an n-row, 1-column matrix, expressed as: η=r6cos(t / T), where r6 belongs to the random numbers of the matrix rand(n,1).
[0064] To improve the search efficiency and convergence of the particle swarm optimization algorithm, in an optional implementation, after step S204, the method further includes:
[0065] Step S301: Normalize the importance weight of each of the above particles to obtain normalized weights;
[0066] Step S302: Update the importance weights of the particles according to the normalized weights.
[0067] In the above embodiments, the particle weight values are normalized according to a normalization formula, which is as follows: Updating the importance weights of particles using normalized weights ensures that each particle's weight more accurately reflects its actual importance within the particle swarm. These updated importance weights can then be used in subsequent PSO operations, influencing particle motion and search direction. Updating the importance weights by normalizing the weights replaces the original weights with normalized ones. Normalization and importance weight updates make the PSO algorithm more accurate and stable. Normalization eliminates dimensional differences between particle weights, making them more comparable; while importance weight updates adjust based on a particle's actual contribution to the swarm, making the algorithm more flexible and adaptable to different problems, improving its search efficiency and convergence, and thus making it more effective in solving optimization problems.
[0068] To ensure the accuracy and efficiency of target tracking, in an optional implementation, after step S205, the method further includes:
[0069] Step S401: If the number of iterations has not reached the maximum number of iterations, the first calculation step, the update step, and the second calculation step are executed at least once in sequence until the number of iterations reaches the maximum number of iterations.
[0070] Step S402: When the number of iterations reaches the maximum number of iterations, update the next video frame of the current video frame to the current video frame, and repeat the reading step, the initialization step, the first calculation step, the update step, the second calculation step, and the tracking step at least once in sequence until all the video frames have completed target tracking analysis.
[0071] In the above embodiment, it is checked whether the current iteration count has reached the preset maximum iteration count. If the iteration count has not reached the maximum iteration count, the first calculation step, the update step, and the second calculation step will be repeated at least once until the iteration count reaches the maximum iteration count to complete the target tracking analysis of the current video frame. When the iteration count reaches the maximum iteration count, the next video frame of the current video frame is set as the current video frame. In order to reset or prepare for the next iteration cycle, the above reading step, the above initialization step, the above first calculation step, the above update step, the above second calculation step, and the above tracking step will be repeated at least once until all video frames complete the target tracking analysis. Figure 3 As shown, this process repeats until all video frames have undergone target tracking analysis. By iteratively processing and analyzing video frames, target tracking in the video is achieved, ensuring the accuracy and efficiency of target tracking.
[0072] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0073] This application also provides a target tracking device based on an improved PID search algorithm optimized particle filtering. It should be noted that this target tracking device based on an improved PID search algorithm optimized particle filtering can be used to execute the target tracking method based on an improved PID search algorithm optimized particle filtering provided in this application. This device is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0074] The following describes the target tracking device based on an improved PID search algorithm and optimized particle filtering provided in the embodiments of this application.
[0075] Figure 4This is a structural block diagram of a target tracking device based on an improved PID search algorithm for optimizing particle filtering, according to an embodiment of this application. Figure 4 As shown, the device includes:
[0076] The reading unit 10 is used to perform the reading step, read the current video frame and select the tracking target from the current video frame.
[0077] Specifically, the system reads the current video frame from the video stream. Within this frame, the system uses specific algorithms (such as feature matching and color tracking) to identify and select the tracking target. This ensures the system can acquire video data in real time and extract information about the tracking target, providing input for subsequent tracking algorithms.
[0078] The initialization unit 20 is used to perform initialization steps, initialize the algorithm parameters of the particle filter algorithm and the improved PID search algorithm, and use a chaotic mapping strategy to initialize the population to generate a chaotic initial population. The algorithm parameters include at least the sampling period, measurement noise variance, process noise, maximum number of iterations and population size. The improved PID search algorithm is a PID search algorithm improved by adding a zero output condition factor to the output regulation value of the PID regulator. The particles in the chaotic initial population represent all states of the tracked target.
[0079] Specifically, the parameters of the particle filter algorithm and the improved PID search algorithm are initialized, such as the sampling period, measurement noise variance, process noise, maximum number of iterations, and population size, and the system's state equation and measurement equation are generated as follows: State equation x k =f k (x k-1 ,k)+w k-1 Measurement equation In the formula, w k and v k The mean is 0 and the variance is Q, respectively. k and R k Gaussian noise was introduced. A chaotic mapping strategy was used to initialize the population, generating a chaotic initial population. Chaotic mapping can increase population diversity and improve search efficiency. An improved PID search algorithm was developed by adding a zero-output condition factor to the traditional PID control output value to prevent the algorithm from getting trapped in local optima, thus adapting to different tracking scenarios.
[0080] The first calculation unit 30 is used to perform the first calculation step, using the above-mentioned particle filtering algorithm to calculate the importance weight and fitness value of particles in the above-mentioned chaotic initial population, and using the above-mentioned improved PID search algorithm to calculate the output regulation value of PID regulation.
[0081] Specifically, a particle filter algorithm is used to calculate the importance weight and fitness value of each particle in the initial chaotic population. An improved PID search algorithm is used to calculate the output regulation value of the PID control. The particle filter algorithm evaluates the reliability of each particle by calculating the weights and fitness values, providing a basis for subsequent updates and resampling. The improved PID search algorithm provides a dynamic adjustment mechanism, making tracking more flexible and accurate.
[0082] The first update unit 40 is used to perform the update step. Under the condition of satisfying the adjustment condition, it updates the position of all particles in the chaotic initial population according to the above-mentioned output adjustment value and the above-mentioned zero output condition factor. The adjustment condition is that the above-mentioned zero output condition factor is greater than zero.
[0083] Specifically, under the condition that the adjustment condition (zero output condition factor greater than zero) is met, the positions of all particles in the initial chaotic population are updated according to the output adjustment value and the zero output condition factor, causing the particles to continuously move closer to the true state. Updating the particle positions allows the population to better approximate the true state of the tracked target. The introduction of the zero output condition factor reduces unnecessary adjustment actions and improves the stability and efficiency of tracking.
[0084] The second calculation unit 50 is used to execute the second calculation step, determine whether it is necessary to enter the resampling stage according to the resampling condition, and calculate the state estimate and variance estimate based on the importance weight if it is not necessary to enter the resampling stage. The resampling condition is that the number of effective particles is greater than or equal to the lower limit of the number of effective particles. The resampling stage is the stage of resampling the particles. The effective particles are the particles whose fitness value is greater than the set fitness value.
[0085] Specifically, the threshold value for the number of effective particles is set to N. b Effective particle number N eff The calculation formula is: If N eff <N b If the number of effective particles is high, it indicates insufficient particle count, algorithm degradation, and resampling is required; conversely, if the number of effective particles is high, resampling is not necessary. The resampling stage removes low-fit particles and retains high-fit particles, thereby improving tracking accuracy. If resampling is not required, state estimates and variance estimates are calculated based on importance weights. State estimates... and variance estimates It provides the current status information of the tracked target, providing a basis for real-time tracking. In the formula, and These represent the particles and their corresponding weights at that moment. The state estimate of the particle filter is calculated by a weighted average of a set of random samples (particles). In particle filtering, the variance estimate is used to measure the uncertainty of the state estimate. The smaller the variance, the more stable the estimate and the less uncertainty. These two values are used to measure the performance of the particle filter for video target tracking.
[0086] The tracking unit 60 is used to perform tracking steps, estimating the target state of the tracking target based on the aforementioned state estimate and variance estimate in order to track the tracking target in real time. The target state includes at least the position information and velocity information of the tracking target.
[0087] Specifically, the target state, including position and velocity information, is estimated based on state and variance estimates. This information is then used for real-time tracking. The target state is updated in real-time to ensure continuous and accurate tracking. In summary, this system achieves real-time tracking of video targets by combining particle filtering and an improved PID search algorithm. Through chaotic initialization and resampling mechanisms, the system can adapt to different tracking environments, improving tracking robustness and accuracy.
[0088] In this embodiment, the target tracking device based on an improved PID search algorithm and optimized particle filter includes a reading unit for performing a reading step, reading the current video frame and selecting the target to be tracked from the current video frame; an initialization unit for performing an initialization step, initializing the algorithm parameters of the particle filter algorithm and the improved PID search algorithm, and initializing the population using a chaotic mapping strategy to generate a chaotic initial population. The algorithm parameters include at least the sampling period, measurement noise variance, process noise, maximum number of iterations, and population size. The improved PID search algorithm is a PID search algorithm improved by adding a zero-output condition factor to the output regulation value of the PID regulator. The particles in the chaotic initial population represent all states of the target to be tracked; and a first calculation unit for performing a first calculation step, using the particle filter algorithm to calculate the importance weight and fitness value of the particles in the chaotic initial population, and simultaneously using the improved PID search algorithm to calculate the output regulation value of the PID regulator. The system comprises the following components: a first update unit, which performs an update step and, under the condition of satisfying the adjustment conditions, updates the positions of all particles in the initial chaotic population according to the output adjustment value and the zero output condition factor. The adjustment condition is that the zero output condition factor is greater than zero. A second calculation unit performs a second calculation step, which determines whether to enter the resampling stage according to the resampling conditions. If the resampling stage is not required, it calculates the state estimate and variance estimate based on the importance weights. The resampling condition is that the number of effective particles is greater than or equal to the lower limit of the number of effective particles. The resampling stage is a stage for resampling the particles. The effective particles are particles whose fitness values are greater than a set fitness value. A tracking unit performs a tracking step, which estimates the target state of the tracking target according to the state estimate and the variance estimate to track the tracking target in real time. The target state includes at least the position information and velocity information of the tracking target. This invention introduces an improved PID search algorithm, combining it with particle filtering. To prevent the algorithm from getting trapped in local optima, a zero-output conditional factor is added to the original PID search algorithm's output value. This factor optimizes ineffective particles iteratively, retaining the effective particle set, thereby reducing estimation errors and improving filtering accuracy. This application solves the problem that existing heuristic optimization algorithms suffer from complex structures, numerous parameter updates, and a tendency to get trapped in local optima, leading to reduced target tracking accuracy.
[0089] To improve the convergence speed and solution accuracy of the algorithm, in one optional implementation, the initialization unit includes:
[0090] The first determining module is used to determine the above-mentioned chaotic mapping strategy, wherein the above-mentioned chaotic mapping strategy is at least one of the following: Logistic chaotic mapping strategy, Circle chaotic mapping strategy, Sing chaotic mapping strategy and Singer chaotic mapping strategy;
[0091] The generation module is used to perform the above initialization operation on the above population according to the above chaotic mapping strategy, and generate the particle positions of the above chaotic initial population, wherein the expression of the particle positions is x. ij =L i (u j -l j )+l j x ij To initialize the current position of particle i in dimension j in the aforementioned chaotic population, u j Let l be the upper bound of the decision variable in the aforementioned dimension j. j L is the lower bound of the above decision variables in the above dimension j. i Let be the population after being mapped by the above chaotic mapping strategy, where i = 1, 2, ..., n, 0 represents the total number of particles, j = 1, 2, ..., d, and d represents the total number of decision variables. These decision variables are the parameters that need to be optimized in the particle filtering algorithm and the improved PID search algorithm. The expression for the population is x. ij =(u j -l j )·r1+l j r1 is a random number from 0 to 1;
[0092] The second determining module is used to determine the target state transition model of the aforementioned tracked target. The expression for the target state transition model is as follows: S xk S represents the x-axis position information of the tracked target at time k. yk This represents the information of the tracked target at time k on the y-axis. This represents the x-axis velocity information of the tracked target at time k. This represents the y-axis velocity information of the tracked target at time k, where T is the sampling period; the particle state set of the population is generated based on the state transition model.
[0093] The sampling module is used to sample the particle state set based on the importance density function to form the initial chaotic population at the initial time. The importance density function is: z k This represents the measurement value of all the above particles at time k.
[0094] In the above embodiment, assume that the number of decision variables in the optimization problem is d, and the upper and lower bounds of the variables are u and l, respectively. The control parameters of the PSA algorithm include the maximum number of iterations T and the population size n. Then the initial population can be expressed as: x ij =(u j -l j )·r1+l j , i = 1, 2, ..., n; j = 1, 2, ..., d, where x ij Let r1 be the current position of individual i in dimension j, and r1 be a random number from 0 to 1. The quality of the initial population affects the convergence speed and solution accuracy of the algorithm. However, the PSA algorithm generates the initial population randomly, making it difficult to guarantee the diversity and uniformity of the population distribution. Therefore, this invention employs a Logistic chaotic mapping strategy to initialize the population. The mathematical expression for Logistic is: x k+1 =μx k (1-x k ), where k represents the number of iterations, x k ∈[0, 1], μ∈(0, 4], take μ=4. First from the equation x k+1 =μx k (1-x k Generate an initial population: L i =4*L i-1 (1-L i-1 ), L i The position of an individual in the chaotically initialized population after the Logistic mapping can be represented as: x ij =L i (u j -l j )+l j The state transition model reflects the target's position and motion characteristics, representing the target's actual motion process. When tracking video targets, the target's location is typically marked manually or using a detection algorithm. The mathematical model used to obtain the target's position information is the state transition model, usually employing a second-order autoregressive uniform velocity model, expressed as: X k =AX k-1 +BV k-1 +CW k-1 , where X k-1 V k-1 and W k-1 Let A, B, and C represent the position information, velocity information, and system noise information at time k-1, respectively, and let A, B, and C be parameter matrices. For a two-dimensional image plane, the target state transition model can be represented as: This represents the predicted position of the tracked target in the current video frame. Various predicted positions can be obtained based on the target state transition model, generating a particle state set. At time k=0, the sampled particles are used... This means that the initial state set is sampled based on the initial state importance density function to form the sampled particle swarm set at the initial time (i.e., the chaotic initial population mentioned above). The importance density function is: In the formula, z k This represents the measured value of the particle at time k.
[0095] To improve the estimation accuracy of the filtering algorithm, in one optional implementation, the first computing unit includes:
[0096] The first calculation module is used to calculate the importance weight of each of the aforementioned particles according to the weight calculation formula, which is as follows: Let represent the importance weight of the i-th particle at time k. R represents the importance weight of the i-th particle at time k-1. k Let z represent the variance of the measurement noise mentioned above. k This represents the measurement value of the sampled particle at time k. For the posterior probability density, Indicates the predicted measurement value;
[0097] The second calculation module is used to calculate the fitness value of each of the above particles according to the fitness formula, which is as follows: This represents the fitness value of the i-th particle at time k, where φ is the adaptive parameter. This indicates the predicted position of the effective particle.
[0098] In the above embodiments, according to the particle filtering algorithm, each particle is predicted and sampled using a prediction model and a sampling model to obtain the sampled measurement value. Then, based on the measurement value and the measurement noise variance, the posterior probability density of each particle is calculated; that is, particles with higher posterior probability densities have higher weights. Based on the predicted measurement value and the measurement noise variance, the fitness value of each particle is calculated. First, based on the adaptive parameters and the predicted positions of effective particles, the difference between the predicted position and the actual observation value of each particle is calculated. Then, based on the magnitude of the difference, the fitness value of each particle is calculated; that is, the larger the fitness value, the higher the matching degree between the predicted position and the actual observation value of the particle. In the particle filtering algorithm, particles are resampled according to importance weights to increase the number of effective particles, thereby improving the estimation accuracy of the filtering algorithm; while the fitness value can help filter out particles that better match the actual observation value, thereby improving the estimation accuracy of the filtering algorithm.
[0099] In order to improve the convergence speed and accuracy by continuously adjusting the system bias to converge the entire population to the optimal state, the first computing unit further includes, in one optional implementation:
[0100] The third calculation module is used to calculate the current system deviation according to the first formula, where the first formula is e. k (t)=x b (t-1)-x(t-1), e k (t) represents the current system deviation mentioned above, x b represents the individual that represents the historical best value in the population, and x represents the position of the individual in the current iteration;
[0101] The fourth calculation module is used to calculate the output regulation value of the PID control according to the second formula, which is Δu(t) = K p ·r2[e k (t)-e k-1 (t)]+K i ·r3·e k (t)+K d ·r4·[e k (t)-2e k-1 (t)+e k-2 [t], where r2, r3, and r4 are all random numbers in the matrix rand(n, 1), and K p K is the coefficient of the proportional factor in the PID control process. i K represents the coefficient of the integral factor in the above PID control process. d Here, Δu(t) represents the coefficient of the differential factor in the PID control process, and e represents the output adjustment value at iteration number t. k-1 (t) represents the systematic deviation at time k-1 when the iteration number is t, and e k-1 (t)=e k (t-1)+x b (t)-x b (t-1), e k-2 (t) represents the system deviation at time k-2 when the iteration number is t.
[0102] In the above embodiment, for several iterations t, the overall deviation e at the current time is... k (t) is e k (t)=x b (t-1)-x(t-1), where x b Let represent the individual with the historical best value in the initial chaotic population, and x represent the position of that individual in the current iteration. For ease of calculation and iterative updates, when the number of iterations is t, the deviation of the population at the previous time step is represented by e. k-1 (t) indicates that the deviation between the first two time points is due to ek-2 (t) represents this. In the PSA algorithm, the optimal value after each iteration is not always the same, and in order to minimize the space complexity of the algorithm, e k-1 (t) can be represented as: e k-1 (t)=e k (t-1)+x b (t)-x b (t-1). During PID control, the proportional, integral, and derivative factors are adjusted according to different situations. When the number of iterations is t, the expression for the output regulation value Δu(t) of the PID control is, Δu(t) = K p ·r2[e k (t)-e k-1 (t)]+K i ·r3·e k (t)+K d ·r4·[e k (t)-2e k-1 (t)+e k-2 (t)].
[0103] To prevent the algorithm from getting trapped in local optima and further improve filtering accuracy, in one optional implementation, the first update unit includes:
[0104] The update module is used to update the positions of all particles in the initial chaotic population according to the population individual update formula, which is x(t+1)=x(t)+η·Δu(t)+(1-η)·o(t), where x(t) is the position of the particle at the t-th iteration, x(t+1) is the position of the particle at the (t+1)-th iteration, Δu(t) is the output adjustment value, and o(t) is the zero output condition factor, where o(t)=(cos(1-t / T)) max )+λr5·L)·e k (t), r5 is a random number in the matrix rand(n, d), T max For the maximum number of iterations mentioned above, λ = [ln(T)] max -t+2) / ln(T max )] 2 e k (t) represents the system bias, L is the Lévy flight function, and η = r6cos(t / T) max r6 is a random number generated by the matrix rand(n, 1).
[0105] In the above embodiment, to prevent the algorithm from getting trapped in local optima, a conditional factor called zero output is added to the original output adjustment value Δu(t), defined as follows: o(t)=(cos(1-t / T)+λr5·L)·ek (t), where r5∈rand(n,d); λ is an adjustment parameter according to the following formula: λ=[ln(T-t+2) / ln(T)] 2 L is a Lévy flight function, defined as: In the formula, u and v are matrices of random numbers in rows 0 and columns d, respectively, following a standard normal distribution; β is a constant set to 1.5. In summary, the update of individuals in the population is related to both Δu(t) and o(t), and the formula for updating individuals in the population is: x(t+1)=x(t)+η·Δu(t)+(1-η)·o(t), where η is an n-row, 1-column matrix, expressed as: η=r6cos(t / T), where r6 belongs to the random numbers of the matrix rand(n,1).
[0106] To improve the search efficiency and convergence of the particle swarm optimization algorithm, in one optional embodiment, the above-mentioned apparatus further includes:
[0107] The normalization unit is used to normalize the importance weight of each particle after updating the position of all particles in the chaotic initial population according to the above output adjustment value under the condition of satisfying the adjustment condition, so as to obtain the normalized weight.
[0108] The second update unit is used to update the importance weights of the particles according to the normalized weights.
[0109] In the above embodiments, the particle weight values are normalized according to a normalization formula, which is as follows: Updating the importance weights of particles using normalized weights ensures that each particle's weight more accurately reflects its actual importance within the particle swarm. These updated importance weights can then be used in subsequent PSO operations, influencing particle motion and search direction. Updating the importance weights by normalizing the weights replaces the original weights with normalized ones. Normalization and importance weight updates make the PSO algorithm more accurate and stable. Normalization eliminates dimensional differences between particle weights, making them more comparable; while importance weight updates adjust based on a particle's actual contribution to the swarm, making the algorithm more flexible and adaptable to different problems, improving its search efficiency and convergence, and thus making it more effective in solving optimization problems.
[0110] To ensure the accuracy and efficiency of target tracking, in one optional embodiment, the above-mentioned apparatus further includes:
[0111] The first repeating unit is used to, after calculating the state estimate and variance estimate based on the above importance weights, sequentially repeat the above first calculation step, the above update step and the above second calculation step at least once, until the above iteration number reaches the above maximum iteration number, provided that the number of iterations has not reached the maximum number of iterations.
[0112] The second repeating unit is used to update the next video frame of the current video frame to the current video frame when the number of iterations reaches the maximum number of iterations, and to sequentially repeat the reading step, the initialization step, the first calculation step, the update step, the second calculation step and the tracking step at least once, until all the video frames have completed target tracking analysis.
[0113] In the above embodiment, it is checked whether the current iteration count has reached the preset maximum iteration count. If the iteration count has not reached the maximum iteration count, the first calculation step, the update step, and the second calculation step will be repeated at least once until the iteration count reaches the maximum iteration count to complete the target tracking analysis of the current video frame. When the iteration count reaches the maximum iteration count, the next video frame is set as the current video frame. In order to reset or prepare for the next iteration cycle, the above reading step, the above initialization step, the above first calculation step, the above update step, the above second calculation step, and the above tracking step are repeated at least once until all video frames have completed the target tracking analysis. This process will continue until all video frames have completed the target tracking analysis. By iteratively processing and analyzing the video frames, the target in the video is tracked, ensuring the accuracy and efficiency of target tracking.
[0114] The aforementioned target tracking device based on an improved PID search algorithm and optimized particle filtering includes a processor and a memory. The aforementioned reading unit, initialization unit, and first calculation unit are all stored as program units in the memory, and the processor executes these program units to achieve the corresponding functions. All of the above modules reside in the same processor; alternatively, the modules may be located in different processors in any combination.
[0115] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured. By adjusting kernel parameters, the problems of reduced target tracking accuracy caused by complex structures, frequent parameter updates, and the tendency to get trapped in local optima in existing heuristic optimization algorithms can be addressed.
[0116] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0117] This invention provides a computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the device containing the computer-readable storage medium to perform the target tracking method based on the improved PID search algorithm optimized particle filtering.
[0118] Specifically, target tracking methods based on improved PID search algorithms and optimized particle filters include:
[0119] Step S201, reading step, reading the current video frame and selecting the tracking target from the current video frame;
[0120] Step S202, initialization step, initialize the algorithm parameters of the particle filter algorithm and the improved PID search algorithm, and use the chaotic mapping strategy to initialize the population to generate a chaotic initial population. The above algorithm parameters include at least the sampling period, measurement noise variance, process noise, maximum number of iterations and population size. The above improved PID search algorithm is a PID search algorithm improved by adding a zero output condition factor to the output regulation value of PID regulation. The particles in the above chaotic initial population represent all states of the above tracking target.
[0121] Step S203, the first calculation step, uses the above-mentioned particle filtering algorithm to calculate the importance weight and fitness value of the particles in the above-mentioned chaotic initial population, and uses the above-mentioned improved PID search algorithm to calculate the output regulation value of PID regulation.
[0122] Step S204, update step: Under the condition of satisfying the adjustment condition, update the position of all particles in the chaotic initial population according to the above output adjustment value and the above zero output condition factor. The adjustment condition is that the above zero output condition factor is greater than zero.
[0123] Step S205, the second calculation step, determines whether to enter the resampling stage based on the resampling conditions. If it is not necessary to enter the resampling stage, calculate the state estimate and variance estimate based on the importance weights. The resampling condition is that the number of effective particles is greater than or equal to the lower limit of the number of effective particles. The resampling stage is the stage of resampling the particles. The effective particles are the particles whose fitness values are greater than the set fitness values.
[0124] Step S206, tracking step, estimating the target state of the tracking target based on the above state estimate and the above variance estimate in order to track the tracking target in real time, wherein the target state includes at least the position information and velocity information of the tracking target.
[0125] This invention provides a processor for running a program, wherein the program executes the target tracking method based on the improved PID search algorithm optimized particle filtering.
[0126] Specifically, target tracking methods based on improved PID search algorithms and optimized particle filters include:
[0127] Step S201, reading step, reading the current video frame and selecting the tracking target from the current video frame;
[0128] Step S202, initialization step, initialize the algorithm parameters of the particle filter algorithm and the improved PID search algorithm, and use the chaotic mapping strategy to initialize the population to generate a chaotic initial population. The above algorithm parameters include at least the sampling period, measurement noise variance, process noise, maximum number of iterations and population size. The above improved PID search algorithm is a PID search algorithm improved by adding a zero output condition factor to the output regulation value of PID regulation. The particles in the above chaotic initial population represent all states of the above tracking target.
[0129] Step S203, the first calculation step, uses the above-mentioned particle filtering algorithm to calculate the importance weight and fitness value of the particles in the above-mentioned chaotic initial population, and uses the above-mentioned improved PID search algorithm to calculate the output regulation value of PID regulation.
[0130] Step S204, update step: Under the condition of satisfying the adjustment condition, update the position of all particles in the chaotic initial population according to the above output adjustment value and the above zero output condition factor. The adjustment condition is that the above zero output condition factor is greater than zero.
[0131] Step S205, the second calculation step, determines whether to enter the resampling stage based on the resampling conditions. If it is not necessary to enter the resampling stage, calculate the state estimate and variance estimate based on the importance weights. The resampling condition is that the number of effective particles is greater than or equal to the lower limit of the number of effective particles. The resampling stage is the stage of resampling the particles. The effective particles are the particles whose fitness values are greater than the set fitness values.
[0132] Step S206, tracking step, estimating the target state of the tracking target based on the above state estimate and the above variance estimate in order to track the tracking target in real time, wherein the target state includes at least the position information and velocity information of the tracking target.
[0133] This invention provides a video target tracking system, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs at least the following steps:
[0134] Step S201, reading step, reading the current video frame and selecting the tracking target from the current video frame;
[0135] Step S202, initialization step, initialize the algorithm parameters of the particle filter algorithm and the improved PID search algorithm, and use the chaotic mapping strategy to initialize the population to generate a chaotic initial population. The above algorithm parameters include at least the sampling period, measurement noise variance, process noise, maximum number of iterations and population size. The above improved PID search algorithm is a PID search algorithm improved by adding a zero output condition factor to the output regulation value of PID regulation. The particles in the above chaotic initial population represent all states of the above tracking target.
[0136] Step S203, the first calculation step, uses the above-mentioned particle filtering algorithm to calculate the importance weight and fitness value of the particles in the above-mentioned chaotic initial population, and uses the above-mentioned improved PID search algorithm to calculate the output regulation value of PID regulation.
[0137] Step S204, update step: Under the condition of satisfying the adjustment condition, update the position of all particles in the chaotic initial population according to the above output adjustment value and the above zero output condition factor. The adjustment condition is that the above zero output condition factor is greater than zero.
[0138] Step S205, the second calculation step, determines whether to enter the resampling stage based on the resampling conditions. If it is not necessary to enter the resampling stage, calculate the state estimate and variance estimate based on the importance weights. The resampling condition is that the number of effective particles is greater than or equal to the lower limit of the number of effective particles. The resampling stage is the stage of resampling the particles. The effective particles are the particles whose fitness values are greater than the set fitness values.
[0139] Step S206, tracking step, estimating the target state of the tracking target based on the above state estimate and the above variance estimate in order to track the tracking target in real time, wherein the target state includes at least the position information and velocity information of the tracking target.
[0140] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program having at least the following method steps:
[0141] Step S201, reading step, reading the current video frame and selecting the tracking target from the current video frame;
[0142] Step S202, initialization step, initialize the algorithm parameters of the particle filter algorithm and the improved PID search algorithm, and use the chaotic mapping strategy to initialize the population to generate a chaotic initial population. The above algorithm parameters include at least the sampling period, measurement noise variance, process noise, maximum number of iterations and population size. The above improved PID search algorithm is a PID search algorithm improved by adding a zero output condition factor to the output regulation value of PID regulation. The particles in the above chaotic initial population represent all states of the above tracking target.
[0143] Step S203, the first calculation step, uses the above-mentioned particle filtering algorithm to calculate the importance weight and fitness value of the particles in the above-mentioned chaotic initial population, and uses the above-mentioned improved PID search algorithm to calculate the output regulation value of PID regulation.
[0144] Step S204, update step: Under the condition of satisfying the adjustment condition, update the position of all particles in the chaotic initial population according to the above output adjustment value and the above zero output condition factor. The adjustment condition is that the above zero output condition factor is greater than zero.
[0145] Step S205, the second calculation step, determines whether to enter the resampling stage based on the resampling conditions. If it is not necessary to enter the resampling stage, calculate the state estimate and variance estimate based on the importance weights. The resampling condition is that the number of effective particles is greater than or equal to the lower limit of the number of effective particles. The resampling stage is the stage of resampling the particles. The effective particles are the particles whose fitness values are greater than the set fitness values.
[0146] Step S206, tracking step, estimating the target state of the tracking target based on the above state estimate and the above variance estimate in order to track the tracking target in real time, wherein the target state includes at least the position information and velocity information of the tracking target.
[0147] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0148] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0149] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0150] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0151] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0152] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0153] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0154] Computer-readable media include both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0155] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0156] As can be seen from the above description, the embodiments of this application achieve the following technical effects:
[0157] 1) The target tracking method based on an improved PID search algorithm and optimized particle filter of this application firstly includes a reading step, in which the current video frame is read and the target to be tracked is selected from the current video frame; then, an initialization step is performed, in which the algorithm parameters of the particle filter algorithm and the improved PID search algorithm are initialized, and a chaotic mapping strategy is used to initialize the population to generate a chaotic initial population. The algorithm parameters include at least the sampling period, measurement noise variance, process noise, maximum number of iterations, and population size. The improved PID search algorithm is a PID search algorithm improved by adding a zero-output condition factor to the output regulation value of PID regulation. The particles in the chaotic initial population represent all states of the target to be tracked; then, in a first calculation step, the importance weight and fitness value of the particles in the chaotic initial population are calculated using the particle filter algorithm, and the output of the PID regulation is calculated using the improved PID search algorithm. The process involves several steps: First, an adjustment value is set. Then, an update step is performed where, under the condition that the adjustment condition is met, the positions of all particles in the initial chaotic population are updated based on the aforementioned output adjustment value and the aforementioned zero-output condition factor. The adjustment condition is that the aforementioned zero-output condition factor is greater than zero. Next, a second calculation step is performed where, based on the resampling condition, it is determined whether a resampling phase is needed. If the resampling phase is not needed, the state estimate and variance estimate are calculated based on the aforementioned importance weights. The resampling condition is that the number of effective particles is greater than or equal to the lower limit of the number of effective particles. The resampling phase is the phase of resampling the particles. The effective particles are particles whose fitness values are greater than a set fitness value. Finally, a tracking step is performed where, based on the aforementioned state estimate and variance estimate, the target state of the target is estimated to perform real-time tracking of the target. The target state includes at least the position and velocity information of the target. This invention introduces an improved PID search algorithm, combining it with particle filtering. To prevent the algorithm from getting trapped in local optima, a zero-output conditional factor is added to the original PID search algorithm's output value. This factor optimizes ineffective particles iteratively, retaining the effective particle set, thereby reducing estimation errors and improving filtering accuracy. This application solves the problem that existing heuristic optimization algorithms suffer from complex structures, numerous parameter updates, and a tendency to get trapped in local optima, leading to reduced target tracking accuracy.
[0158] 2) The target tracking device based on an improved PID search algorithm and optimized particle filter of this application includes a reading unit for performing a reading step, reading the current video frame and selecting the target to be tracked from the current video frame; an initialization unit for performing an initialization step, initializing the algorithm parameters of the particle filter algorithm and the improved PID search algorithm, and initializing the population using a chaotic mapping strategy to generate a chaotic initial population. The algorithm parameters include at least the sampling period, measurement noise variance, process noise, maximum number of iterations, and population size. The improved PID search algorithm is a PID search algorithm improved by adding a zero-output condition factor to the output regulation value of the PID regulator. The particles in the chaotic initial population represent all states of the target to be tracked; and a first calculation unit for performing a first calculation step, using the particle filter algorithm to calculate the importance weight and fitness value of the particles in the chaotic initial population, and simultaneously using the improved PID search algorithm to calculate the output of the PID regulator. The system comprises: an adjustment value; a first update unit, configured to perform an update step, updating the positions of all particles in the initial chaotic population according to the aforementioned output adjustment value and the aforementioned zero output condition factor, provided that the adjustment condition is met; a second calculation unit, configured to perform a second calculation step, determining whether a resampling phase is required based on a resampling condition, and calculating a state estimate and a variance estimate based on the aforementioned importance weights if the resampling phase is not required; a resampling condition where the number of effective particles is greater than or equal to a lower limit of the number of effective particles; a resampling phase where the particles are resampled; and a tracking unit, configured to perform a tracking step, estimating the target state of the tracked target based on the aforementioned state estimate and the aforementioned variance estimate to perform real-time tracking of the tracked target, wherein the target state includes at least the position information and velocity information of the tracked target. This invention introduces an improved PID search algorithm, combining it with particle filtering. To prevent the algorithm from getting trapped in local optima, a zero-output conditional factor is added to the original PID search algorithm's output value. This factor optimizes ineffective particles iteratively, retaining the effective particle set, thereby reducing estimation errors and improving filtering accuracy. This application solves the problem that existing heuristic optimization algorithms suffer from complex structures, numerous parameter updates, and a tendency to get trapped in local optima, leading to reduced target tracking accuracy.
[0159] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A target tracking method based on an improved PID search algorithm and optimized particle filtering, characterized in that, include: The reading step involves reading the current video frame and selecting the tracking target from the current video frame; The initialization step involves initializing the algorithm parameters of the particle filter algorithm and the improved PID search algorithm, and using a chaotic mapping strategy to initialize the population, generating a chaotic initial population. The algorithm parameters include at least the sampling period, measurement noise variance, process noise, maximum number of iterations, and population size. The improved PID search algorithm is a PID search algorithm improved by adding a zero-output condition factor to the output regulation value of the PID regulator. The particles in the chaotic initial population represent all states of the tracking target. The first calculation step involves using the particle filtering algorithm to calculate the importance weight and fitness value of particles in the chaotic initial population, and simultaneously using the improved PID search algorithm to calculate the output regulation value of PID regulation. The update step involves updating the positions of all particles in the initial chaotic population based on the output adjustment value and the zero output condition factor, provided that the adjustment condition is met. The adjustment condition is that the zero output condition factor is greater than zero. The second calculation step is to determine whether to enter the resampling stage based on the resampling conditions. If it is not necessary to enter the resampling stage, the state estimate and variance estimate are calculated based on the importance weights. The resampling condition is that the number of effective particles is greater than or equal to the lower limit of the number of effective particles. The resampling stage is the stage of resampling the particles. The effective particles are the particles whose fitness values are greater than the set fitness values. The tracking step involves estimating the target state of the target based on the state estimate and the variance estimate to perform real-time tracking of the target. The target state includes at least the target's position and velocity information. A chaotic mapping strategy is used to initialize the population, generating a chaotic initial population, including: Determine the target state transition model of the tracked target, wherein the expression of the target state transition model is: S xk S represents the x-axis position information of the tracked target at time k. yk This represents the information of the tracked target on the y-axis at time k. This represents the x-axis velocity information of the tracked target at time k. This represents the y-axis velocity information of the tracked target at time k, where T is the sampling period; the particle state set of the population is generated according to the state transition model, W. k-1 This provides the system noise information at time k-1. The particle state set is sampled based on the importance density function to form the initial chaotic population at the initial time. The importance density function is: z k This represents the measurement values of all the aforementioned particles at time k. The particle state is concentrated in the i-th particle corresponding to time k. for Importance density function Let be the posterior probability density.
2. The method according to claim 1, characterized in that, A chaotic mapping strategy is used to initialize the population, generating a chaotic initial population, including: The chaotic mapping strategy is determined, and the chaotic mapping strategy is at least one of the following: Logistic chaotic mapping strategy, Circle chaotic mapping strategy, Sing chaotic mapping strategy and Singer chaotic mapping strategy; The initialization operation is performed on the population according to the chaotic mapping strategy to generate the particle positions of the initial chaotic population, wherein the expression for the particle positions is x. ij =L i (u j -l j )+l j x ij Let u be the current position of particle i in the initial chaotic population in dimension j. j Let l be the upper bound of the decision variable in dimension j. j L is the lower bound of the decision variable in dimension j. i The population is defined by the chaotic mapping strategy, where i = 1, 2, ..., n, n represents the total number of particles, j = 1, 2, ..., d, d represents the total number of decision variables, which are the parameters to be optimized in the particle filtering algorithm and the improved PID search algorithm. The population is expressed as X. ij =(u j -l j )·r1+l j r1 is a random number from 0 to 1.
3. The method according to claim 1, characterized in that, The particle filtering algorithm is used to calculate the importance weights and fitness values of particles in the initial chaotic population, including: The importance weight of each particle is calculated according to the weight calculation formula, which is as follows: Let represent the importance weight of the i-th particle at time k. R represents the importance weight of the i-th particle at time k-1. k The variance of the measurement noise, z k This represents the measurement value of the sampled particle at time k. For the posterior probability density, Indicates the predicted measurement value; The fitness value of each particle is calculated according to the fitness formula, which is: Let φ represent the fitness value of the i-th particle at time k, where φ is the adaptive parameter. Indicates the predicted position of the effective particle. Let be the i-th particle at time k.
4. The method according to claim 1, characterized in that, The improved PID search algorithm is used to calculate the output regulation value of the PID regulator, including: The current system deviation is calculated according to the first formula, which is e. k (t)=x b (t-1)-x(t-1), e k (t) represents the current system deviation, x b represents the individual that represents the historical best value in the population, and x represents the position of the individual in the current iteration; The output regulation value of the PID controller is calculated according to the second formula, which is Δu(t) = K. p ·r2[e k (t)-e k-1 (t)]+K i ·r3·e k (t)+K d ·r4·[e k (t)-2e k-1 (t)+e k-2 [t], where r2, r3, and r4 are all random numbers in the matrix rand(n,1), and K p K is the coefficient of the proportional factor in the PID control process. i K is the coefficient of the integral factor in the PID control process. d Here, Δu(t) represents the coefficient of the differential factor in the PID control process, and e represents the output adjustment value at iteration number t. k-1 (t) represents the systematic deviation at time k-1 when the iteration number is t, and e k-1 (t)=e k (t-1)+x b (t)-x b (t-1), e k-2 (t) represents the system deviation at time k-2 when the iteration number is t.
5. The method according to claim 1, characterized in that, Under the condition that the adjustment conditions are met, the positions of all particles in the initial chaotic population are updated according to the output adjustment value and the zero output condition factor, including: The positions of all particles in the initial chaotic population are updated according to the population individual update formula, which is x(t+1)=x(t)+η·Δu(t)+(1-η)·o(t), where x(t) is the position of the particle at the t-th iteration, x(t+1) is the position of the particle at the (t+1)-th iteration, Δu(t) is the output adjustment value, and o(t) is the zero output condition factor, where o(t)=(cos(1-t / T))·(1-η ... max )+λr5·L)·e k (t), r5 is a random number in the matrix rand(n,d), T max For the maximum number of iterations, λ = [ln(T)] max -t+2) / ln(T max )] 2 e k (t) represents the system bias, L is the Lévy flight function, and η = r6cos(t / T) max r6 is a random number generated by the matrix rand(n,1).
6. The method according to claim 1, characterized in that, After updating the positions of all particles in the initial chaotic population according to the output adjustment value, provided that the adjustment conditions are met, the method further includes: The importance weight of each particle is normalized to obtain a normalized weight. The importance weights of the particles are updated based on the normalized weights.
7. The method according to claim 1, characterized in that, After calculating the state estimate and variance estimate based on the importance weights, the method further includes: If the number of iterations has not reached the maximum number of iterations, the first calculation step, the update step, and the second calculation step are executed at least once in sequence until the number of iterations reaches the maximum number of iterations. If the number of iterations reaches the maximum number of iterations, the next video frame of the current video frame is updated to the current video frame, and the reading step, the initialization step, the first calculation step, the update step, the second calculation step and the tracking step are executed at least once in sequence until all video frames have completed target tracking analysis.
8. A target tracking device based on an improved PID search algorithm for optimizing particle filtering, characterized in that, The device includes: The reading unit is used to perform the reading step, read the current video frame, and select the tracking target from the current video frame; An initialization unit is used to perform initialization steps, initialize the algorithm parameters of the particle filter algorithm and the improved PID search algorithm, and use a chaotic mapping strategy to initialize the population to generate a chaotic initial population. The algorithm parameters include at least the sampling period, measurement noise variance, process noise, maximum number of iterations, and population size. The improved PID search algorithm is a PID search algorithm improved by adding a zero output condition factor to the output regulation value of PID regulation. The particles in the chaotic initial population represent all states of the tracking target. The first computing unit is used to perform the first computing step, using the particle filtering algorithm to calculate the importance weight and fitness value of particles in the chaotic initial population, and using the improved PID search algorithm to calculate the output regulation value of PID regulation. The first update unit is used to perform the update step, and, under the condition of satisfying the adjustment condition, updates the position of all particles in the chaotic initial population according to the output adjustment value and the zero output condition factor. The adjustment condition is that the zero output condition factor is greater than zero. The second calculation unit is used to execute the second calculation step, determine whether it is necessary to enter the resampling stage according to the resampling condition, and calculate the state estimate and variance estimate based on the importance weight if it is not necessary to enter the resampling stage. The resampling condition is that the number of effective particles is greater than or equal to the lower limit of the number of effective particles. The resampling stage is the stage of resampling the particles. The effective particles are the particles whose fitness value is greater than the set fitness value. A tracking unit is used to perform tracking steps, estimating the target state of the target based on the state estimate and the variance estimate to track the target in real time. The target state includes at least the position information and velocity information of the target. The initialization unit includes: The first determining module is used to determine the target state transition model of the tracked target, wherein the expression of the target state transition model is: S xk S represents the x-axis position information of the tracked target at time k. yk This represents the information of the tracked target on the y-axis at time k. This represents the x-axis velocity information of the tracked target at time k. This represents the y-axis velocity information of the tracked target at time k, where T is the sampling period; the particle state set of the population is generated according to the state transition model, W. k-1 This provides the system noise information at time k-1. The sampling module is used to sample the particle state set based on the importance density function to form the initial chaotic population at the initial time, wherein the importance density function is: z k This represents the measurement values of all the aforementioned particles at time k. The particle state is concentrated in the i-th particle corresponding to time k. for Importance density function Let be the posterior probability density.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein, when the program is executed, it controls the device on which the computer-readable storage medium is located to perform the method according to any one of claims 1 to 7.
10. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the method described in any one of claims 1 to 7.
Citation Information
Patent Citations
CNN-based adaptive particle filter video target tracking method and system
CN110264501A
Improved particle filter target tracking method based on particle swarm
CN116227533A
Target tracking method and system based on improved quantum particle swarm optimization particle filter, and medium
CN118115537A
Air cylinder piston sealing groove intelligent optimization method based on novel improved particle swarm optimization
CN115268268A
Hydraulic mechanical arm high-precision control method and system based on data driving
CN115741692A