Improved Immune Moth–Flame Optimization Based on Gene Correction for Automatic Reverse Parking

During the process of reverse parking, it is difficult to achieve the ideal reference trajectory while avoiding collision. In this study, with the aim of establishing reference trajectory optimization for automatic reverse parking that smooths and shortens the trajectory length and ensures the berthing inclination angle is small enough, an improved immune moth–flame optimization method based on gene correction is proposed. Specifically, based on the standard automatic parking plane system, a reasonable high-quality reference trajectory optimization model for automatic parking is constructed by combining the cubic spline-fitting method and a boundary-crossing solution based on gene correction integrated into moth–flame optimization. To enhance the model’s global optimization performance, nonlinear decline strategies, including crossover and variation probability and weight coefficient, and a high-quality solution-set maintenance mechanism based on fusion distance are also designed. Taking garage No.160 of the Dalian Shell Museum located in Dalian, Xinghai Square, as the experimental site, experiments on automatic parking reference trajectory optimization and tracking control were carried out. The results show that the proposed optimization algorithm provides higher accuracy for reference trajectory optimization and can achieve better tracking control of the reference trajectory.


Introduction
Automatic parking behavior whereby vehicles meet the reverse parking conditions from a starting area within an allowable range is called automatic reverse parking.With the rapid development of transportation, the demand for comprehensive performance indicators for intelligent vehicles is increasing, and the performance quality of intelligent ARP functions is also increasingly scrutinized [1].The reverse automatic parking system is indispensable for intelligent vehicles to ensure optimal reverse parking performance indicators, such as safety, comfort, speed, and accuracy.Its reference trajectory optimizer should exhibit reverse parking trajectory optimization performance to provide collision-free, accurate automatic parking trajectories, and the path length should be smooth and short and the berthing inclination angle small [2,3].However, given the optimization abilities of existing optimization algorithms, the ideal conditions are difficult to achieve [4].
Regarding the problems encountered when applying automatic parking systems to intelligent vehicles, scholars have carried out a series of studies.As early as 1996, a novel neural network architecture for trajectory generation and the control of automated car parking was proposed [5].In [6], the authors undertook the design, testing, and validation of a deep neural network (DNN)-based control scheme for autonomous ground vehicles (AGVs) during the parking process.An automatic vacant parking space management system using multicamera vehicle detection was presented in [7].A graph-based algorithm for the optimal control of switched systems for application to car parking was developed in [8].A distributed control method for coordinating multiple vehicles within the framework of an automated valet parking system was introduced in [9].However, there are relatively few effective improvement strategies for the reference trajectory optimization of intelligent ARP.
The parking trajectory optimizer has a strong influence on the performance quality of automatic parking systems.In recent years, intelligent optimization algorithms have received significant attention from researchers in the field of automatic parking, with many scholars around the world having conducted studies on this topic.A computational trajectory optimization framework for multiobjective automatic parking motion planning was proposed in [10].An improved A * and dynamic window approach was proposed in [11] to enhance the accuracy and speed of automatic parking in tracked vehicles.Improved ant colony optimization (ACO) for path planning in an AGV-based intelligent parking system was introduced in [12].Improved immune moth-flame optimization (IIMFO) based on the immune mechanism, Gaussian mutation mechanism, and opposition-based learning strategy was proposed for automatic parking path optimization in intelligent vehicles in [13].However, the high-performance optimization frameworks using improved immune moth-flame optimization based on gene correction (IIMFO-GC) for ARP trajectory optimization lack guidelines for their design, so it may be difficult to obtain optimal ARP reference trajectories.
With the rapid development of the public transportation system, the quality requirements for daily travel are also increasing.However, for intelligent ARP, the reference trajectory optimization performance of traditional parking trajectory optimizers is often unsatisfactory.Based on a study [13] about reference trajectory optimization for automatic reverse parking in intelligent vehicles, the major contributions of this work are as follows: (I) A reasonable high-quality reference trajectory optimization model for ARP is constructed by combining the cubic spline-fitting method and a boundary-crossing solution based on gene correction integrated into moth-flame optimization.
(II) An improved immune moth-flame optimization method is designed.Specifically, nonlinear decline strategies for weight coefficient and crossover and mutation probabilities, and a high-quality solution-set maintenance mechanism based on fusion distance, are designed to enhance the global optimization performance of immune moth-flame optimization.
(III) A gene correction method is designed to establish a highly effective boundarycrossing solution for ARP; on this basis, an IIMFO-GC is proposed and used in the trajectory optimizer of the ARP system to further improve reference trajectory optimization performance.
This paper is organized as follows: Section 2 introduces the reference trajectory optimization model for ARP; Section 3 introduces the gene correction method for reverse parking; Section 4 introduces the IIMFO; Section 5 presents the ARP experimental results and simulation analysis; and Section 6 concludes the article.

Basic Principles of ARP
ARP generally adopts the method of automatic reversing.A schematic diagram of the ARP principle is shown in Figure 1.
In Figure 1, it is assumed that the vehicle coverage areas are purposefully collected in sequence ns times in the ARP process, which is denoted as the collected vehicle coverage area set In this figure, A 1 represents the parking starting area, A ns is the parking stop area, and P 1 , P is , and P ns are the center points of the collected vehicle coverage areas.L d represents the bottom line of parking garage, and L ne and L f e are the near and far side lines of the parking garage, respectively.P nt , P f t , P nb and P f b are the near and far corner points of the garage top and the near and far corner points of garage bottom, respectively.T R and T C are the reference parking trajectory and the actual tracking control trajectory, respectively.Due to the uncertain interference in the parking process, it is impossible to achieve a tracking control error of zero, that is, T C cannot completely coincide with T R .T S is the tracking control trajectory monitoring value obtained by the sensor and image system.Due to the limitation in sensor accuracy and measurement error, it is impossible to achieve an error value of zero for tracking control trajectory monitoring, that is, T S cannot completely coincide with T C .

Constraint Judgment of ARP Feasibility
ARP usually requires that there are no obstacles in the parking environment, that the parking garage is known, and that the bottom and side lines of the parking garage, as well as the bottom and top corners of the parking garage, are clearly identifiable.In addition, the constraint on the starting feasibility of parking in the garage should be satisfied: the center point P 1 of the starting area should be within the feasible starting area Ω C,1 .The angle between the line connecting the center point P 1 of the starting area with its bottom midpoint P b 1 and the bottom line L d of the garage is called the starting inclination angle ∆∠ B .If its absolute value is less than the threshold ∆∠ B max , the constraint expression of the starting feasibility of reverse parking is as follows :

Conversion Principle of ARP Plane Coordinate System
The standard ARP plane coordinate system takes the far corner point of the bottom of the garage as the origin and the bottom line of the garage as the positive horizontal axis (x-axis).Adopting a standard ARP plane coordinate system is not only beneficial for simplifying reverse parking calculations, but also enables drivers to evaluate real-time conditions and make more rational parking decisions.To convert the real scene's ARP plane coordinate system obtained by the parking image system into a standard ARP plane system, we must carry out three steps: first, determine the largest range of the real rectangular parking scene Ω; then, rotate the coordinate system according to the real scene's rotation angle ∠α; finally, translate the origin according to the coordinate (x 0 , y 0 ) of the far corner point of the garage bottom in the real scene's coordinate system.
Assume there is a point s in the parking area whose coordinate in the standard ARP plane system is (x s , y s ) and whose angle with the horizontal axis is ∠β.Then, ∠β = arcsin y s

√
x s 2 +y s 2 .If the coordinate (x s , y s ) is known, the conversion formula for the coordinate (x r , y r ) of the real scene's reverse parking plane system can be obtained as follows: Similarly, if the coordinate (x r , y r ) is known, it is easy to establish the coordinate (x s , y s ).
In the standard parking coordinate system, the set of decision variables is set as , and x(P is ) and y(P is ) are the abscissa and ordinates of the central point P is of the is collected vehicle coverage areas in the standard reverse parking coordinate system.On the premise that the starting inclination angle ∆∠ B is small enough (∠ B ≤ ∆∠ B max ), to obtain the reverse parking reference trajectory with the shortest length, it is known from the parking experience that the abscissa and ordinates about the center points of the collected vehicle coverage areas should decrease one by one.The expression is as follows:

Optimization Model for ARP Reference Trajectory
The number of center points of the collected vehicle coverage areas is set to ns, and the ARP reference trajectory can be obtained by fitting ns center points P 1 , P 2 , • • • , P ns .Among them, the center point P 1 of the starting area is fixed, and the center points P 2 , • • • , P ns of the other n − 1 collected vehicle coverage areas can be adjusted within a certain region.The periodic time of the ARP process is set to ∆t, and the optimization model of the ARP reference trajectory is expressed as follows: where Ω g is the coverage area of the edges on both sides of the garage, P g is the collection of detected edge collision avoidance point positions, n g is the detected point position, P g (ig) is the ig-th detected edge collision avoidance point position, i ∈ {1, 2, • • • , ng} (then, ∀P g (ig) ∈ Ω g ), and ∆L it , ∆∠ it , and Ω c,it are the parking interval distance, attitude angle difference, and vehicle coverage area for the it-th period, respectively.In this study, the vehicle coverage area Ω c,it is equalized as a rectangle with the length and width of the vehicle, ∆L max and ∆∠ max are the threshold values for parking interval distance and attitude angle difference, T max is the parking time, nt is the number of periods, nt= T max ∆t , it ∈ {1, 2, • • • , nt}, ⌈⌉ is the rounding up operator, since the vehicle cannot collide with the bottom line of the garage and the edges on both sides, ∀P g (i ), and t f is the reverse parking reference trajectory obtained through fitting, with the cubic spline-fitting method adopted in this study; ∆∠ S is the parking inclination angle, ∆∠ S = ∠ T(P ns , P bm ), L f e and is the angle between the line T(P ns , P bm ) connecting the center point P ns of the parking area with the midpoint P bm at the bottom of the garage and the far side line L f e of the garage, and ∆∠ S max is the threshold for its absolute value; ∆y ns is parking position error and is the error between the ordinate y(P ns ) of the center point P ns of the parking area and the expected ordinate y H , ∆y H max is the threshold, and T R is the reference trajectory.
The cubic spline-fitting method is a spline curve-fitting method using the cubic spline interpolation function, and it has been widely used in various industrial applications.Assuming that the closed interval ∆ = [a, b] and n + 1 interpolation points (x 0 , x 1 , • • • , x n ) within the interval ∆ are known, in terms of the cubic spline interpolation function s(x), there are two kinds of features.
Firstly, regarding the arbitrary subinterval is a cubic polynomial, the cubic polynomial formula is as follows: where s i (x) is the segmented cubic polynomial function for the cubic spline interpolation function s(x), and (a 0 , Secondly, s(x) is a second-order continuous and differentiable within interval ∆.

Basic Concepts and Application Principles of Gene Correction
Gene correction is a method of repairing problematic genes in a diseased individual so that they can be correctly expressed [14].The appropriate use of gene correction is beneficial for enhancing the preservation effect of optimization, but if used excessively, it will lead to too many adjustable parameters, which will increase the amount of calculation required [15].Considering computational efficiency, this paper applies genetic modifications to three situations generated in the optimization of the reference trajectory for parking: collision avoidance on the far side line of the parking garage, berthing inclination, and parking dislocation.The other situations are replaced with new boundary-crossing solutions for reverse parking.

Gene Correction for Collision on the Far Side Line of the Parking Garage
In the standard parking coordinate system, the far side line of the garage is equal to the vertical axis (y-axis).To solve the problem of collision on the far side line of parking garage, it is necessary to rotate the coordinate system counterclockwise based on the center points of the collected vehicle coverage areas within a certain range.Whether or not it is necessary to rotate the center point of the is-th collected vehicle coverage area counterclockwise, the empirical determination formula is as follows: where tPget x lb, IT , y lb, IT is the function for the bottom left corner x lb, IT , y lb, IT , and ∆Y f c max is the maximum ordinate offset.The empirical estimation formula for correcting the abscissa movement ∆x is, f c for collision avoidance on the far side line of parking garage is as follows: where c f c is the empirical coefficient of collision avoidance on the far side line of the parking garage.
A schematic diagram of gene correction for collision avoidance on the far side line of the parking garage is shown in Figure 2. In Figure 2, P is2 , = x f c , y f c , where P is2 is the center point of the vehicle about the crossing boundary point for collision on the far side line of garage during the parking process.

Berthing Inclination Gene Correction
If the condition stating that the absolute value of the berthing inclination angle ∆∠ S must be less than the threshold value ∆∠ S max is not met, it is called berthing inclination.If berthing inclination is to be corrected, the abscissa of some of the center points of the collected vehicle coverage areas should be moved slightly to the left.The empirical judgment formula for this left shift is as follows: y(P is ) − y(P ns ) ≤ ∆Y SI max (10) where ∆Y SI max is the maximum ordinate offset for correcting the berthing inclination.The empirical estimation formula for obtaining the left-shift value ∆x is,SI is as follows: A schematic diagram of gene correction for berthing inclination is shown in Figure 3.In Figure 3, the abscissas of center points P ns−1 and P ns−2 of the collected vehicle coverage areas within the interval (y ns , y ns + ∆Y SI max ) are shifted to the left by ∆x ns−1,SI and ∆x ns−2,SI , achieving the correction of berthing inclination.

Berthing Dislocation Gene Correction
If the condition stating that the absolute value of the berthing stop position error ∆y ns must be less than the threshold value is not met, it is called berthing dislocation.In order to correct berthing dislocation, the ordinate of the center point of the parking area should be appropriately moved.The empirical estimation formula for the ordinate movement ∆y SP of gene correction for berthing dislocation is as follows: A schematic diagram of gene correction for berthing dislocation is shown in Figure 4.
In Figure 4, since the center point P ns of the parking area is not in the allowable parking range (y H − ∆y H max , y H + ∆y H max ), it is above the parking area and is moved down to ∆y SP to achieve the goal of correcting berthing dislocation.
Based on the gene correction method proposed in this study, only three empirical parameters need to be added: the maximum ordinate offset ∆Y f c max and the empirical coefficient c f c of abscissa movement for correcting collision on the far side line of the parking garage, and the maximum ordinate offset ∆Y SI max for correcting berthing inclination.
T : where I represents initializing the moth population and flame set and calculating the fitness value of each moth and flame, M is the moth population, OM is its fitness value vector matrix, F is the flame set, OF is its fitness value vector matrix, , n is the population size, d is the solution dimension, and n f is the number of flames (at the beginning, the number of flames is equal to the population size), n f = n; P represents updating the running trajectory of the moth population (after updating the moth population, the fitness value of each individual moth should be recalculated; if the fitness value is better than the current flame, the flame set will be updated), T represents updating position of moths according to the logarithmic spiral law, D ij • e τt • cos(2πt) is the logarithmic spiral term, M i is the position of the i-th moth, F j is the position of the j-th flame, D ij is the Euclidean distance between the i-th moth and the j-th flame, τ is the logarithmic spiral shape adjustment coefficient, t is a random number in the interval (−1, 1), and ω is the weight coefficient.
The number of flames will be reduced gradually during the iteration [18].The formula for updating the number of flames is as follows: where t is the current iteration number, t max is the maximum number of iterations, and round(x) represents x rounded to the nearest integer.

Immune Mechanism
In this study, the concentration selection mechanism in the artificial immune algorithm for adjusting the distribution of moths in space is introduced into the MFO to improve its global optimization performance [19].In the concentration selection mechanism, the formulas for calculating antibody concentration and concentration probability are as follows: where f (x i ), D(x i ), and P d (x i ) are the fitness function value, antibody concentration, and concentration probability of the i-th moth, respectively, and i = 1, 2, • • • , m + N.

Nonlinear Decline Strategy of Weight Coefficient
If the weight coefficient ω is large, the swarm intelligence optimization algorithm offers strong global exploration ability and is suitable for the early stage of the optimization process; contrarily, if the weight coefficient is small, the algorithm's local development ability is strong and it is suitable for the later stage [20].Several nonlinear decline strategies for weight coefficients ω with strong plasticity are conducive improving the global optimization ability of MFO [21].The two weight coefficient calculation formulas ω are as follows: where ω d is the decreasing weight coefficient; ω d = ω max − ω min , ω min , and ω max are the minimum and maximum weight coefficient values, respectively; t r is the iteration progress; t r = t • t max −1 ; and β is the optimization factor.
where α is the decline rate and exhibits a significant difference throughout the whole iteration process.
According to the above formulas, the nonlinear declining trend for the weight coefficient ω can be optimized and adjusted.The two calculation formulas above have excellent effects on improving global optimization ability; in different scenarios the improvement effects are discrepant, and to choose the best option, extensive tests should be carried out.

Nonlinear Decline Strategy for Crossover and Mutation Probability
In the early stage of iterative optimization, population diversity should be emphasized, the intensity of gene change should be enhanced, and global exploration should be strengthened to improve individual adaptability.Following iteration optimization, preserving the existing optimization results should be emphasized, the intensity of gene changes should be reduced, and local development should be strengthened to avoid the destruction of existing advantageous genes.Therefore, mutation and crossover probability should decrease gradually with an increasing number of iterations.This paper presents a nonlinear decline strategy for directional variation and crossover probabilities p c and p m with strong smoothness based on exponential formal decline.The formulas for calculating mutation and crossover probabilities p c and p m are as follows: where p c, min , p c, max , p m, min , and p m, max are the minimum and maximum crossover probability and the minimum and maximum mutation probability, respectively, and β m and β c are the the optimization factors for the nonlinear decline of mutation and crossover probabilities p m and p c , respectively.According to the above formulas, the exponential form of the nonlinear decline strategy is adopted, and the nonlinear decline trend can be optimized and adjusted by selecting the most suitable optimization factors, β m and β c .This strategy has strong smoothness, and its nonlinear decline is particularly smooth.This strategy can adjust the decline rates of mutation and cross probability in real time during iteration, which is conducive to improving the balance between global exploration and local exploitation, and thus, improving the global optimization ability of the algorithm.

High-Quality Solution-Set Maintenance Mechanism Based on Fusion Distance
In the evolution process of each iteration, a high-quality solution set should be established to preserve the existing optimization achievements.To prevent adverse effects on the algorithm's computational efficiency, the high-quality solution-set size HS s should be less than the allowable maximum HS AS , that is, HS S ≤ HS AS .So, the design of an elite set maintenance mechanism is very significant for MFO.In terms of the definition of the Mahalanobis distance M d , the M d results between two samples under identical states in different reference spaces will differ because of the difference in their correlation of variables.Since the Euclidean distance E d considers the independence of characteristic variables, and M d considers the independence of characteristic variables, this study combines M d and E d to effectively measure distance in the case of fuzzy correlation, and a new calculation method called "Fusion distance F d " that considers the correlation and independence between feature variables is given [22].The "Fusion distance F d " equation is as follows: where Y b and Y a denote the reference vectors with b and a elements to be tested; M d (Y b , X a ) denotes the Mahalanobis distance between vectors Y b and X a ; E d (Y b , X a ) denotes the Ed between vectors Y b and X a ; CM ba denotes the correlation coefficient matrix between vectors Y b and X a ; and µ represents the parameters used to ensure that the sum is meaningful and the distance adjustment is on the same scale.Due to the introduction of the correlation coefficient calculation in µ, µ reflects the adaptability of distance and the additivity on the distance scale [23].

Description of Experimental ARP Scene
In this study, we chose automatic parking garage No. 160 of the Dalian Shell Museum in Dalian, Xinghai Square, for the parking experiment.The near side and far side lines of the experimental garage are equal in length at 5 m long, the bottom line of the garage is 2.5 m long, and the width of the marker line is 0.1 m.The experimental vehicle model was a Toyota Corolla 1.2T S-CVT GL Pioneer Version (2019 model), with a length of 4635 mm, a width of 1780 mm, and a height of 1455 mm.The horizontal and longitudinal distances from the bottom right corner of the starting area of the experimental vehicle to the near corner point at the top of the garage were 2 m and 2.1 m, respectively.

Design and Configuration of ARP Experiment
The experimental vehicle used in this study is equipped with an ARP system, which has a real parking data acquisition sensor, a parking feasibility judgment device, a reference trajectory optimizer, a parking controller, a parking stop device, an emergency brake device, a parking image system, and a parking monitoring upper computer.The onboard sensors are mainly used for parking feasibility judgment and reference trajectory tracking control.In the parking process, the reference trajectory optimizer transmits the optimized reference trajectory to the parking controller and the upper parking monitoring computer, which not only provides the necessary reference trajectory for tracking control, but also enables safe parking, as the driver has a more comprehensive view of the real-time parking conditions.The ARP system exhibits powerful performance, especially regarding safety; once an accident risk is perceived, the emergency brake will be activated immediately.However, research on ARP is still in its early stages; security is critically important for this technology, and there is no room for error.The ARP experiment in this study was closely supervised by safety assurance personnel; the driver had a C2 driver's license and acted as both a safety officer and an enhanced track control corrector, the ground safety inspector was able to contact the driver, and we employed an aerial drone photographer with good photography skills.A diagram of the design of the ARP experiment is shown in Figure 5.As can be seen from Figure 5, in the ARP process, the ARP driver did not interfere with the normal parking tracking control, and would only activate the experimental vehicle's stop or emergency brake function if necessary; some of the experimental results were directly obtained from the ARP process environment using an unmanned aerial camera, and some were indirectly obtained using ARP data acquisition sensors and an upper ARP monitoring computer.
The main parameters of the automatic parking experiment were as follows: The parking data acquisition, parking feasibility judgment, reference trajectory optimization, reference trajectory tracking control, emergency parking stop, and parking stop limit times were 3.5 s, 1.5 s, 12 s, 25 s, 0.4 s, and 1.5 s, respectively.One unmanned aerial camera (Mavic 2 DJI's, 'Yu', from Dajiang, Shenzhen, China) was used, and the upper computer for parking monitoring was a 'MacBook Pro 2016 Core i5 @ 2.9 GHZ', which used Bluetooth for vehicle communication and was fixed to the mobile phone holder of the vehicle.Two MPC555LFMZP40 chips were used for the trajectory optimizer (used for parking data acquisition, parking feasibility judgment, and reference trajectory optimization) and tracking controller (used for reference trajectory tracking control, emergency parking stop, and parking stop), and two DSP28335 chips were used for the auxiliary control unit (ACU, used for the air-conditioner, overload protection device, communication, etc.) and actuator power unit (APU, used for the breaker, automobile steering gear, breaking/dynamical system, gear control system, etc.).

Experimental Results and Analysis of ARP
In order to verify the effectiveness of the optimization algorithm proposed in this study based on a real ARP scene in clear and windless weather, the IIMFO-GC proposed in this study, the IIMFO proposed in [13], the levy flight-based moth-flame optimization method proposed in [24], the MFO proposed in [25], the IPSO proposed in [4], and the PSO proposed in [26] were adopted to implement ARP reference trajectory optimization.Fuzzy proportional-integral-derivative (Fuzzy PID) control was adopted to implement parking tracking control for the reference trajectory.In order to achieve a fair comparison between the six algorithms, the same parameters were used for the optimization model as for the ARP reference trajectory, and are shown in Table 1.The parameters of IIMFO-GC for the ARP reference trajectory are shown in Table 2.The experimental results for actual reverse parking given in this study include not only the optimization and tracking control results obtained using the parking monitoring host computer, but also the unmanned aerial photography images of several fixed points of the collected vehicle coverage areas during reverse parking.In order to achieve a fair comparison between the six algorithms, the same three fixed points of the collected vehicle coverage areas were selected: parking point P 4 followed by y(P 4 ) ∈ [5.95, 6.05] m, parking point P 7 followed by y(P 7 ) ∈ [4.45, 4.55] m, and parking stop point P 10 followed by y(P 10 ) ∈ [2.30, 2.50] m.The results obtained using the parking monitoring host computer for optimization and tracking control at fixed points of the collected vehicle coverage areas are shown in Figures 6 and 7; the unmanned aerial images of the actual scene at fixed points of the collected vehicle coverage areas are shown in Figure 8; optimization and tracking control curves for the reference trajectories of automatic reverse parking are shown in Figures 9 and 10; and tracking control trajectory error curves of the whole ARP process are shown in Figure 11.The position, path length, and berthing inclination angle results for automatic reverse parking optimization and tracking control are shown in Tables 3 and 4. The tracking control errors in the position, path length, and berthing inclination angle results are shown in Table 5.The computational costs of each algorithm are shown in Table 6.As can be seen from Table 3 and Figure 9, compared with the other five optimization algorithms, the IIMFO-GC proposed in this study exhibits a better reference trajectory; in particular, as shown in Figure 9, the reference trajectory path of IIMFO-GC is shorter.As can be seen from Table 4 and Figure 10, compared with the other five optimization algorithms, based on the same tracking control algorithm (Fuzzy PID), the IIMFO-GC proposed in this study obtains better tracking control results; in particular, as shown in Figure 10, the actual parking path of IIMFO-GC is shorter.As can be seen from Table 5 and Figure 11, compared with the other five optimization algorithms, based on the same tracking control algorithm (Fuzzy PID), the IIMFO-GC proposed in this study obtains tracking control results with fewer errors; in particular, as shown in Figure 11, the error in the tracking control of IIMFO-GC is smaller, and its tracking control trajectory errors for whole ARP process are fewer.Figure 7 shows that compared with the other five optimization algorithms, the IIMFO-GC proposed in this study exhibits a better reference trajectory; moreover, the optimized reference trajectory is closer to the near side line of parking garage and has a smaller expected berth inclination angle.As can be seen from Table 5, compared with the other five optimization algorithms, the IIMFO-GC proposed in this study has a better berthing inclination angle for both optimization and tracking control.Table 6 and Figures 6 and 8 show that compared with the other five optimization algorithms, based on the same tracking control algorithm (Fuzzy PID), the IIMFO-GC proposed in this study obtains a better tracking control path; moreover, the tracking control path is closer to the near side line of the parking garage, and the actual berth inclination angle is smaller.As shown in Table 7, compared with the other five optimization algorithms, the IIMFO-GC proposed in this study is completed in a shorter time.

Conclusions
This paper proposes an IIMFO-GC for intelligent ARP function.Specifically, a novel reference trajectory optimization model for ARP is constructed, and a conversion principle for the ARP plane coordinate system is introduced; considering both the reference trajectory length and berthing inclination angle, a gene correction method for ARP is proposed for improving reference trajectory optimization performance.The proposed IIMFO-GC for the ARP trajectory optimizer effectively improves optimization performance.
The main contributions of this paper are as follows: (I) Improvements to the ARP trajectory optimizer: The traditional reference trajectory optimization model is not suitable, and it is diffucult to establish effective boundarycrossing solutions for reverse parking.Therefore, in this study, based on the standard automatic parking plane system, a reasonable high-quality reference trajectory optimization model for ARP is constructed by combining the cubic spline-fitting method and a highly effective gene correction method.
(II) Improvements to the MFO algorithm: this paper proposes using IIMFO-GC to obtain a more appropriate reference trajectory for ARP; the following improvements are proposed: (II) integrate the immune mechanism with a high-quality solution-set maintenance mechanism based on fusion distance to strengthen global optimization quality; (I) introduce nonlinear decline strategies for weight coefficients and crossover and mutation probabilities to further strengthen global optimization ability.
These experimental results indicate that using IIMFO-GC for intelligent ARP function provides a better reference trajectory optimization effect than traditional optimization algorithms.Further, the comparison of the experimental results based on intelligent ARP function indicates that IIMFO-GC has a better control effect than anticipated.
However, there are several shortcomings in this research: (I) Sensor accuracy has certain effects on ARP control.
(II) The effectiveness of the strategies for integrating the immune mechanism with moth-flame optimization is finite.
(III) The ARP scene used for the experimental comparison represents an ideal scenario, so the effectiveness of our experimental comparison is limited and one-sided.
We propose several future research directions for the use of MFO for ARP: (I) Conduct further research on precise ARP trajectory data (such as position, length, and inclination angle) and measuring algorithms.
(III) Enhance the MFO algorithm by integrating other mechanisms or methods (such as the dual-population genetic mechanism) to further improve optimization quality [27].
(IV) Use several (more than two) typical ARP scenes for experimental comparison to further improve verification precision [28].

Figure 1 .
Figure 1.Schematic diagram of the ARP principle.

Figure 2 .
Figure 2. Schematic diagram of gene correction for collision avoidance on the far side line of the parking garage.

Figure 3 .
Figure 3. Schematic diagram of gene correction for berthing inclination.

Figure 4 .
Figure 4. Schematic diagram of gene correction for berthing dislocation.

4 .
Improved Immune Moth-Flame Optimization 4.1.Moth-Flame Optimization Moth-flame optimization (MFO), proposed in 2015, imitates the behavior of moths searching for a light source through lateral positioning [16].The optimization process of MFO can be abstractly represented by a triplet [17].The mapping expressions are as follows: MFO = (I, P, T)

Figure 5 .
Figure 5. Diagram showing the design of the ARP experiment.

Figure 7 .
Figure 7. Results obtained using the parking monitoring host computer for tracking control of fixed points of collected vehicle coverage areas.

Figure 8 .
Figure 8. Unmanned aerial images of actual scene for fixed points of collected vehicle coverage areas.

Figure 9 .
Figure 9. Optimization curves for the reference trajectories of ARP.

Figure 10 .
Figure 10.Tracking control curves for the reference trajectories of ARP.

Figure 11 .
Figure 11.Tracking control trajectory error curves of whole ARP process.

Table 1 .
Parameters of optimization model for ARP reference trajectory.

Table 2 .
Parameter configuration of IIMFO-GC for ARP reference trajectory.

Table 3 .
Position and path length results of reference trajectory optimization for ARP.

Table 4 .
Position and path length results of reference trajectory tracking control for ARP.

Table 5 .
Berthing inclination angle results of reference trajectory optimization and tracking control for ARP.

Table 6 .
Tracking control errors in position, path length, and berthing inclination angle results for ARP.

Coordinates of p 10 , p 7 , p 4 (m) Path Length (m) Berthing Inclination Angle
Figure 6.Results obtained using parking monitoring host computer for optimization of fixed points of collected vehicle coverage areas.

Table 7 .
Computational cost of each algorithm performed for ARP.