Adaptive Adjustment Object Detection Algorithm under Multiple Mechanisms Based on GAN

Target tracking is prone to problems such as target loss and identity jump when the target is occluded and the attitude is changed. In order to solve this phenomenon, this paper proposes the adaptive adjustment object detection algorithm under multiple mechanisms based on GAN. )is algorithm introduces a gradient penalty mechanism to the discriminator and uses the relative discriminator structure to reconstruct the discriminator, so as to improve the discriminatory ability of the discriminator. )en, through the feedback mechanism, the obtained data is fed back to the generator network in time, and the genetic mechanism is used to speed up the positioning of the key areas of the image. Experimental results show that compared with other existing algorithms, this algorithm can effectively locate and distinguish under different environments. And, the target still maintains a high resolution. When the target is occluded, it can effectively avoid the phenomenon of target loss and identity jump.


Introduction
Target detection is one of the important research directions in the field of computer vision. It integrates technologies such as positioning, recognition, and classification and is widely used in fields such as intelligent monitoring and human-computer interaction. In recent years, the target detection algorithm has made great breakthroughs. e representative target detection algorithms can be divided into two main categories. One is the R-CNN algorithm (R-CNN, Fast R-CNN, Faster R-CNN, etc.) [1,2]. e algorithm needs to generate the target first. Candidate frame (target location), and then, classify and regress the candidate frame. e other is one-stage algorithms such as Yolo and SSD [3][4][5], which use the convolutional neural network (CNN) to extract image features and establish detection models to classify and locate targets. After comparison, the second type of algorithm is faster, but the accuracy is lower. In practical applications, the target in the image often has problems such as being occluded and deformed, making the extracted target feature insignificant or lacking part of the feature information, leading to classification errors and tracking failures, and then prone to the problem of identity jump. erefore, we are comparing the advantages and disadvantages of existing algorithms; this paper adopts the generative confrontation network in the second type of algorithm. is model is a unique network structure that captures potential data distribution. e true and false confrontation error design based on game theory construction makes it possible to deal with different types of tasks [6,7].
Based on the idea of generative confrontation, this paper proposes a multimechanism adaptive target detection algorithm. First, through the organic combination of the punishment mechanism, feedback mechanism, and scoring mechanism, it effectively solves the problems of difficulty in training and model collapse of the generative confrontation network. en, use the relative discriminator structure to construct the discriminator to improve the probability of the discriminator in the process of fighting competition. e result is sent to the generator network through the feedback mechanism, and finally, the individual with the optimal value is obtained through the scoring mechanism, so as to quickly and effectively locate the key area of the image. After experiments, the experimental results are basically in line with expectations. e target detection algorithm can effectively locate and distinguish different objects and still maintain a high resolution for the occluded target, while maintaining a low number of missing alarms and false alarms.

Generative Adversarial Network (GAN)
e generative adversarial network (GAN) was proposed by Goodfellow. It uses two convolutional neural networks using game training to generate samples similar to the original picture [8][9][10].
By observing the structure of the generative confrontation network in Figure 1, GAN is mainly composed of two parts: generation network (G) and discriminant network (D). And, it uses a competing mechanism [11][12][13]; the purpose is to enable the generator to generate data similar to the real data distribution, which made the GAN achieve the effect of being fake. Aiming at the problem of data prediction, the generator is trained to learn the data distribution and predict the image distribution data. Generated data distribution and real data distribution are shown in Figure 2.
Because the difference between the generated data distribution P G and the real data distribution P data cannot be calculated, therefore, the discriminator uses data sampling to calculate the divergence of P G and P data . And, use these to discriminate the difference between the two data distributions, and the objective function of the discriminator is (1) Among them, E( * ) is mathematical expectation and D( * ) is the output result of the discriminator. e objective function is to maximize the discriminator, equivalent to the divergence generated data and real data. e optimal generator achieves the purpose of prediction by minimizing the divergence of the distribution between the real image data and the generated data. e optimal generator can be expressed as GAN can generate samples that are similar to the real data distribution, but it has problems such as difficulty in training, difficulty in network convergence, and mode collapse.

The Discriminator Network Introduces a Gradient Penalty Mechanism
In order to make the training of the model more stable and solve the problem of model collapse, this paper adds a gradient penalty to the discriminator objective function. After adding the gradient penalty, the objective function is Among them, λ gp is the weight parameter. P penalty is the probability distribution of the sample for calculating the gradient penalty. Sampling a point in P G and P data , respectively, the method is random sampling. ‖ * ‖ 2 is a twonorm number.
In the proposed data prediction algorithm, the loss function can reduce the difference in probability distribution between the predicted data and the real data so that the predicted data generated by the generator can more accurately fit the real data distribution. e loss function is defined as Adding a traditional loss function to the loss function of GAN can improve the accuracy of the data generated by the generator. e role of the generator is not only to generate data that can deceive the discriminator, but the generated data should be close enough to the real data. Since data prediction is a regression problem, adding the output result data of the discriminator to the loss function can punish the extreme error between the predicted value and the true value. erefore, the loss function after introducing the gradient penalty is where λ MSE is the weight parameter, and the loss function of rough research, it can be found that L MSE (G) is the loss function that is only extracted for the generator. Just considering the generator data to improve the accuracy of the algorithm is not enough. In GAN, the data generated by the discriminator corresponds to the generator has a guiding role. erefore, this paper adopts a feedback mechanism for the data output by the discriminator network based on the introduction of a gradient penalty mechanism in the generator. is improves the accuracy of the loss value L MSE (G).
e discriminator in this article is constructed with a relative discriminator structure to estimate the probability that the real image is more real than the fake image and then promote the discriminator to obtain better probability results in the process of fighting competition, thereby increasing the loss of the generator value L MSE (G) to strengthen the network parameter optimization of the generator. By collecting the real data and false data of the discriminator and estimating the corresponding sample expectations, the following function is obtained: Among them, E I real and E I fake are the sample expectations of real data and fake data, respectively. is paper uses the minimum loss function to calculate.
For the global discriminator, the ideal values of E I fake (D(I fake )) and E I fake (D(I real )) should be close to 0 and 1. e expected discrimination result is D(I real ) � 1 and D(I fake ) � 0. erefore, the regression targets of D RI (I real , I fake ) and D RI (I fake , I real ) are 1 and 0.
For the generator, its role is to confuse the authenticity judgment of the discriminator as much as possible, which is opposite to the return goal of the discriminator. e regression targets of D RI (I real , I fake ) and D RI (I fake , I real ) are 0 and 1. erefore, the adversarial function to obtain the global discriminator is defined as follows: In this paper, by setting the feature-preserving loss function, the confrontation function L MSE (G) of the global discriminator is input into the above loss function for feature error calculation; finally, the loss function is defined as follows: By observing Figures 3-5, it can be seen that, after the reconstruction of the generated network in this paper, the image is basically effectively repaired, and it has a good real consistency. Although the repaired part is somewhat unclear and may have subtle changes, but it basically does not affect the detection effect.

Generating Network Scoring Mechanism
However, for the targets in the video, they are basically in a state of movement and overlap. We need to quickly and effectively locate the key areas of the image [14,15]. erefore, based on the above formula, this paper proposes a scoring mechanism for the generative network in the generative confrontation network. Each iteration of the generator network is composed of three stages: mutation, evaluation, and selection so that the generator can quickly and accurately locate the key areas in the image.

Variation.
Mainly for the input random noise signal z, the gradient penalty loss function of this article is used in the new round of update process. e penalty loss function L(G, D) for the generating network gradient is calculated only for noise data, and finally, L MSE(G, D) is obtained and the network data is updated:  Figure 2: Generated data distribution P G and real data distribution P data .

Scientific Programming
Among them, λ gp is the weight parameter and P z is the distribution of noise data.

Evaluation.
is stage is the data evaluation stage. e network uses the above loss function and selects the best sample under the feedback of the discriminator, so as to learn the correct training sample distribution and improve the stability of model training. e evaluation mechanism is as follows.
is stage is quantified as an adaptability score, which mainly analyzes the quality of the samples generated by the network and the diversity of the generated samples. It evaluates the quality of the generated samples and the diversity of the generated samples; the adaptability score can be expressed as Among them, F q is the quality score of the generated sample and F d is the diversity score of the generated sample. It is used to measure whether the generator can fully disperse the generated samples, which can further avoid mode collapse. c is a super parameter that balances the proportion of the F q and F d .
Calculate the highest fitness score. And, compare it with the highest score on the network to get the global best score.

Selection.
Select the best individual according to the evaluation mechanism. Others with lower scores will gradually decay so that the generated network has a certain directionality, and the best value sample is selected. e structure of the article generation adversarial network is shown in Figure 6.

Simulation Experiment
is paper uses the ImageNet dataset and the MOT training dataset to test the algorithm. All experiments in this paper are carried out in the same experimental environment, and Scientific Programming the data obtained by the article algorithm are compared with traditional algorithms, YOLO-based target detection, Deep Sort, and literature algorithms [16] to verify the effectiveness of the algorithm.
Considering that there is a big difference between artificial occlusion and occlusion in the real world, this chapter directly simulates the actual dataset, and the result of target detection is shown in the figure below.
By observing the target detection effect map in Figure 7, we can see that the article algorithm can effectively locate and distinguish different objects and still maintain a high resolution for the occluded target, even if the characters in Figures 7(d) and 7(i) are occluded. More than half of the area can still accurately identify and mark the target.

Accuracy Test.
is paper uses the evaluation criteria in MOTChallenge to evaluate the performance of the proposed algorithm and compares the measured data with traditional target detection algorithms and literature algorithms. Among them, the MOTChallenge dataset has a comprehensive data type, which includes different viewing angles, camera movement methods, and pictures taken in different climates, which can effectively evaluate algorithms. Standards are shown in Table 1.
is article uses evaluation criteria: MOTA, MOTP, IDs, FP, and FN. By observing the identity jump problem of the algorithm in the target detection process. rough the test, we can obtain the data as shown in Table 2.
By observing the target tracking effect data comparison table in Table 2, we can see that the MOTA, IDs, and FP in this paper are better than other algorithms. In terms of MOTP data, the article algorithm is only 0.4% higher than the literature algorithm. It can be seen that the article algorithm can preserve better detection accuracy, while performing well in the number of false alarms (FP) and number of missed alarms (FN). It can effectively prove that the article algorithm can effectively reduce the problem of identity jumps.
By observing Figure 8, it can be seen that, under the same accuracy, the number of identity jumps of the algorithm in this paper is smaller than that of other algorithms. And, in terms of the highest accuracy, the article algorithm is about 2% higher than the literature algorithm. Observing Figure 9, one can clearly see that the algorithm in this paper is in the lower left corner of the image, and the number of missed alarms and false alarms are the lowest.

Conclusion
ere are problems such as target loss and identity jump in current target detection. In response to these phenomena, we propose a GAN-based multimechanism adaptive target detection algorithm. e article optimizes the construction model of GAN by introducing gradient penalty and feedback and scoring mechanism into the original GAN, which achieves an effective improvement in detection accuracy. Experimental results show that compared with other existing algorithms, the article algorithm has a more stable training model, which can effectively reduce the problem of target identity jump, while maintaining high detection accuracy. Although the method is effective, there are still areas that can be improved, such as the use of a more appropriate size convolution kernel to extract features, which will continue to be studied in future works.

Data Availability
e data used to support the findings of the study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that there are no conflicts of interest regarding the publication of this paper.