Image recognition optimization algorithm based on optimal control principle

By applying optimization techniques such as optimal control principle and MDOCA algorithm in image recognition, the problems of high computing resources and insufficient recognition accuracy in traditional methods in large-scale data set processing are solved, and efficient and accurate image recognition is achieved.

CN120163997APending Publication Date: 2025-06-17JIANGSU UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510291749.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-12
Publication Date
2025-06-17

AI Technical Summary

Technical Problem

Traditional image recognition methods require high computing resources, take time, and the recognition accuracy does not always reach the expected level when processing large-scale data sets.

Method used

The image recognition method based on the optimal control principle is adopted, and the differential equation generated by the image is set, the objective function of image similarity in the end time and evolution is defined, the gradient calculation formula is derived using the Lagrangian multiplication method, and the MDOCA algorithm and other optimization algorithms are combined to improve the recognition efficiency and accuracy.

Benefits of technology

It significantly improves the efficiency and accuracy of image recognition, reduces computing time, and reduces the demand for computing resources, allowing the method to operate effectively in resource-constrained environments and provides high-quality recognition results in complex contexts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120163997A_ABST
    Figure CN120163997A_ABST
Patent Text Reader

Abstract

The invention discloses an image recognition optimization algorithm based on an optimal control principle, and the method comprises the following steps: setting a recognition system: constructing a corresponding differential equation through the deep research of the underlying logic of image generation, so as to describe the dynamic change in an image generation process, image data input: inputting an image to be identified and related data thereof, and if no data is provided, performing binarization processing on the image; setting a target function: setting the target function J as the sum of the image similarity at the end moment and in the evolution process; in the image recognition method based on the optimal control principle, the parameter updating rule mainly selects three algorithms including a projection gradient method, a Barzilai-Borwein method and a BFGS algorithm, it is ensured that each iteration is conducted in the specific gradient direction, the convergence direction is specific, and the recognition precision is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image recognition, and in particular, to an image recognition method based on the principle of optimal control is designed. Background Art

[0002] In the wave of the rapid development of social economy, information technology has made breakthrough progress, among which image recognition technology is particularly remarkable. This technology has quietly penetrated into all aspects of daily life and plays an indispensable role in improving the efficiency of social operation, enhancing security prevention capabilities, and enriching user experience. In order to further improve the application efficiency of image recognition technology, many scholars are committed to deeply studying its principles and continuously optimizing the recognition framework and key links, in order to fully release its huge potential in the social and economic fields. These explorations and efforts have undoubtedly injected strong impetus into the upgrading and improvement of China's intelligent systems.

[0003] Traditional recognition methods, such as those based on statistical principles and convolutional neural networks, although have achieved certain effects in some applications, still have some limitations in solving image recognition problems. For example, these methods usually require a large amount of training data to ensure the effectiveness and reliability of the model, and the recognition process takes a long time. Especially when dealing with large-scale data sets, the demand for computing resources is relatively high. At the same time, although the methods based on statistical principles and convolutional neural networks perform well in many tasks, their recognition accuracy does not always reach the expected level.

[0004] To solve the above problems, researchers have begun to explore new optimization algorithms and methods. Summary of the Invention

[0005] The main technical problem to be solved by an image recognition method based on the principle of optimal control disclosed by the present invention is: setting the differential equation of image generation through the underlying logic of image generation; setting the similarity of the image at the end time and during the evolution process as the objective function of image recognition; deriving the gradient calculation formula through the Lagrange multiplier method; gradually selecting and combining the MDOCA (Modified Discrete Optimal Control Algorithm) algorithm and using its projection gradient method with the Armijo line search criterion, the Barzilar-Borwein method of constant approximation to replace the Hessian matrix update step size, and the BFGS algorithm of iterative approximation matrix to replace the Hessian matrix and using the Wolfe line search criterion to select the step size as the parameter update rule to improve the efficiency and accuracy of image recognition.

[0006] To achieve the above object, the present invention adopts the following technical solutions.

[0007] An image recognition method based on the principle of optimal control disclosed by the present invention has the following steps:

[0008] (1) Setting up the recognition system:

[0009] By deeply studying the underlying logic of image generation, a corresponding differential equation can be constructed to describe the dynamic changes in the image generation process. This process involves mathematical modeling of the various components of the image and their interrelationships to reveal the behavior and evolution laws of the system under specific conditions. Based on this, a differential equation in the following form is obtained:

[0010]

[0011] In the formula, F is a system of differential equations, where the perturbation variable is denoted as X; t represents time; x is a vector composed of the components of the image; and respectively represent the partial derivative and the second partial derivative of the vector x with respect to time t.

[0012] (2) Inputting image data:

[0013] Input the image to be recognized and its related data, denoted as If no data is provided, the image is binarized to convert it into a data record that can be used for subsequent analysis. In this process, the gray values of the image are thresholded to convert it into a binary image that only contains two states (for example, black and white). The purpose of this processing step is to simplify the information content of the image and make it easier for subsequent feature extraction and pattern recognition. After binarization, the obtained image data will be recorded as the variable for use in subsequent recognition algorithms.

[0014] (3) Setting up the objective function:

[0015] The objective function J is set as the sum of the image similarity at the end time and during the evolution process. Specifically, this objective function aims to quantify the similarity between the evolution process of image generation and the target image within a specific time period. By adding the image similarity at the end time and the similarities at each stage during the evolution process, this setting can effectively evaluate the overall efficiency of the image recognition process. This objective function not only considers the instantaneous feature changes of the image during the evolution process but also comprehensively considers the distance between its final state and the target image, thus promoting the optimization of image generation and recognition effects. Finally, the minimization state of this function guides the algorithm to converge to the best solution. Based on this, the following form of the objective function J is obtained:

[0016]

[0017] Wherein, J is the objective function; X(x, T) represents the network image at the end time; X(x, t) represents the network image during the evolution process; is the target network image; a and b respectively represent the weights of the similarity to the target network image at the end time and during the evolution process.

[0018] (4) Gradient calculation formula:

[0019] Derive the adjoint system of system (1):

[0020]

[0021] Wherein, G is the adjoint system of F, and its form is a system of differential equations, where the adjoint variable is denoted as Y; t represents time; y is a vector composed of adjoint variables; and respectively represent the partial derivative and the second partial derivative of the vector y with respect to time t.

[0022] Derive the variational inequality of system (1), and use the proof by contradiction to remove the integral sign to obtain the gradient calculation formula:

[0023]

[0024] Wherein, g is the gradient calculation formula of the parameter to be identified; J is the objective function set as the sum of the image similarities at the end time and during the evolution process; η is the parameter to be identified; X is the perturbation variable; represents the gradient; T is the evolution time of image generation; Ω is the image range; x is a vector composed of the components of the image; t represents time;

[0025] (5) Parameter update rule and convergence check:

[0026] In the image recognition method based on the optimal control principle, three algorithms are mainly selected for the parameter update rule: the projected gradient method, the Barzilai-Borwein method, and the BFGS (Broyden-Fletcher-Goldfarb-Shanno) algorithm.

[0027] First, adopt the multi-directional optimal control algorithm (MDOCA) and combine it with the Armijo line search criterion to ensure that the selected step size can effectively reduce the projected gradient of the objective function. In the k-th iteration, let the gradient be g k .

[0028] The specific algorithm process is as follows.

[0029] 1. Initialization: Input the image to be recognized and its data, denoted as the target image as Set the initial step size to θ, and the initial iteration number k = 1. Initialize the maximum count count max , the maximum number k max and the error threshold Errend. Set the initial value η of the recognition parameter (0) , and calculate the perturbation variable X (0) , the adjoint variable Y (0) , the objective function J (0) and the gradient g (0) . Initialize the error Err (0) . Initialize the counter count = 0.

[0030] 2. Outer loop:

[0031] When the iteration number k < k max and the current error Err > Errend, determine the step size η (k) = max{η l , min{η u , η (k-1) - θg (k-1)}}, where max{a, b} and min{a, b} represent taking the maximum and minimum values of a and b respectively, η u and η l represent the maximum and minimum values of the value range of the recognition parameter η respectively, θ is the step size of the current algorithm, η (k-1) and g (k-1) are the current values of the recognition parameter and the gradient respectively; calculate the current perturbation variable X (k) , the adjoint variable Y (k) and the objective function J (k) .

[0032] 3. Inner loop:

[0033] When the counter count ≤ count max , check the current objective function value. If the objective function value where θ is the step size of the current algorithm; J (k-1) and g (k-1) are the current objective function and gradient respectively; c1 is the iteration coefficient, generally taken as 0.1; ‖‖ 2 2 represents the square of the vector two-norm; then calculate the error Err = |J (k) - J (k-1) | / J (k) , and update the step size θ = 3θ, and jump out of the inner loop (i.e., complete the current step size iteration); otherwise, update the step size θ = θ / 2. The counter is incremented by count = count + 1.

[0034] 4. Update:

[0035] Calculate the updated gradient g(k) Update the current iteration number \(k = k + 1\).

[0036] 5. End condition:

[0037] If the maximum iteration number is not reached or the set error requirement is met, the algorithm ends.

[0038] Due to the small step size, the projected gradient method is less efficient when approaching the target value. Therefore, consider the Barzilai - Borwein method proposed by Barzilai and Borwein. This method formally selects the descent direction as the \(k\)-th identification parameter \(\eta\) (k) the negative gradient direction, but the step size selection is different from the traditional gradient descent algorithm. The iterative format of the classical Newton method is where \(\eta\) (k) is the identification parameter after \(k\) iterations; is the gradient; \(J\) is the objective function; while the Barzilai - Borwein method uses \(\theta\) -1 \(I\) to approximately replace the inverse of the Hessian matrix where \(\theta\) -1 is the reciprocal of the step size, \(I\) is the identity matrix, and is updated through the secant equation which is given by the first - order Taylor expansion of the \(k\)-th identification parameter \(\eta\) (k) .

[0039] The specific algorithm process is as follows.

[0040] 1. Initialization:

[0041] Input the image to be recognized and its data, denoted as the target image Set the initial step size as \(\theta\), the initial iteration number \(k = 1\). Initialize the maximum count \(count\) max , the maximum number \(k\) max and the error threshold \(Errend\). Set the initial value of the identification parameter \(\eta\) (0) , and calculate the perturbation variable \(X\) (0) , the adjoint variable \(Y\) (0) , the objective function \(J\) (0) and the gradient \(g\) (0) . Initialize the error \(Err\) (0) . Initialize the counter \(count = 0\).

[0042] 2. Outer loop:

[0043] When the iteration number \(k\lt k\) max and the current error \(Err\gt Errend\), determine the step size \(\eta\) (k) =\(\max\{\eta\) l ,\(\min\{\eta\)u , η (k-1) -θg (k-1)}}. Calculate the current perturbation variable X (k) , the adjoint variable Y (k) and the objective function J (k) .

[0044] 3. Inner loop:

[0045] When the counter count ≤ count max , if the objective function value where θ is the step size of the current algorithm; J (k-1) and g (k-1) are the current objective function and gradient respectively; c1 is the iteration coefficient, generally taken as 0.1; represents the square of the vector two-norm; then calculate the current error Err = |J (k) - J (k-1) | / J (k) ; break out of the inner loop (for the next outer loop); otherwise, update the step size θ = θ / 2, and increment the counter count = count + 1.

[0046] 4. Update:

[0047] Calculate the updated gradient g (k) , identify the parameter change amount s (k) = η (k) - η (k-1) , the gradient change amount y (k) = g (k) - g (k -1) , update the step size θ = (s (k) ) T s (k) / (s (k) ) T y (k) . Update the current iteration number k = k + 1.

[0048] 5. End condition:

[0049] If the maximum iteration number is not reached or the set error requirement is met, the algorithm ends.

[0050] The technical problem to be solved by the present invention can also be further realized by the following algorithm. Consider a quasi-Newton algorithm, namely the BFGS algorithm, which was proposed by Broyden, Fletcher, Goldfarb, and Shanno. The principle of the BFGS algorithm is similar to that of the Barzilai-Borwein algorithm, and both use an approximate matrix to replace the second-order Hesse matrix in the Newton method. However, the approximate matrix B kIt is implemented by an iterative method, which is derived from the approximate Hesse matrix B of the previous step. k-1 This method effectively updates the approximation of Hesse, thus providing better convergence characteristics in the optimization process. During the iteration process, it is necessary to ensure the positive definiteness of the approximate Hesse matrix, so the Wolfe line search criterion is adopted to select the step size.

[0051] The specific algorithm process is as follows.

[0052] 1. Initialization:

[0053] Input the image to be recognized and its data, denoted as the target image Set the initial step size as θ, and the initial iteration number k = 1. Initialize the maximum count count max , the maximum number k max and the error threshold Errend. Set the initial value η of the recognition parameter (0) , and calculate the perturbation variable X (0) , the adjoint variable Y (0) , the objective function J (0) and the gradient g (0) . Initialize the error Err (0) . Initialize the counter count = 0. Calculate the Hesse matrix estimate B (0) = I (identity matrix), calculate the initial direction d (0) = -(B (0) ) -1 g (0) .

[0054] 2. Outer loop:

[0055] When the iteration number k < k max and the current error Err > Errend, calculate the step size η (k) = max{η l , min{η u , η (k-1) - θg (k-1)}}, calculate the current perturbation variable X (k) , the adjoint variable Y (k) , the objective function value J (k) and the gradient g (k) .

[0056] 3. Inner loop:

[0057] Update the objective function value J (k) and the gradient g (k) according to the conditions, perform a line search. When J (k) > J (k-1 ) + c1θ(g (k-1) ) T d (k-1) or (g (k) ) T d (k-1) < c2(g (k-1) ) T d (k-1) When, where θ is the step size of the current algorithm; J (k-1) , g (k-1) and d (k-1) are the current objective function, gradient and direction respectively; c1 and c2 are iteration coefficients, generally taken as 0.1; if the condition J (k) > J (k-1 ) + c1θ(g (k-1) ) T d (k-1) is satisfied, update the step size θ = 0.9 and calculate the recognition parameter η (k) , perturbation variable X (k) , adjoint variable Y (k) , objective function value J (k) and gradient g (k) ; if the step size θ < 10 -10 , then break out of the loop and continue to the next iteration.

[0058] If the condition (g (k) ) T d (k-1) < c2(g (k-1) ) T d (k-1) is satisfied, update the step size θ = 1.056, and update the recognition parameter η (k) , perturbation variable X (k) , adjoint variable Y (k) , objective function value J (k) and gradient g (k) .

[0059] 4. Update:

[0060] Calculate the new error Err (k) = |J (k) - J (k-1) | / |J (k) |, update the change amount s (k) = η (k) - η (k-1) of the recognition parameter and the change amount y (k) = g (k) - g (k-1) . Update the Hesse matrix estimate:

[0061]

[0062] and calculate the new search direction d(k) = -(B (k) ) -1 g (k) . Update the current iteration count k = k + 1.

[0063] 5. End condition:

[0064] If the maximum iteration count is not reached or the set error requirement is met, the algorithm ends.

[0065] Compared with the prior art, the present invention can provide high-quality solutions in practical applications to meet the needs of different users and scenarios. Its beneficial effects are mainly reflected in the following aspects:

[0066] 1. High convergence speed: The image recognition method based on the optimal control principle adopted by the present invention requires only more than one percent of the time required by the method based on the statistical principle and the convolutional neural network when re-identifying the same image. This significantly improved convergence speed enables significant reduction of the computing time and improvement of the system response efficiency when processing large-scale image data, thus better supporting real-time application scenarios. In addition, the fast convergence also greatly reduces the demand for computing resources, enabling the method to operate effectively in resource-constrained environments.

[0067] 2. Precise convergence accuracy: The present invention ensures that each iteration is carried out along a clear gradient direction, so the convergence direction is clear, which greatly improves the recognition accuracy. During the process of image recognition, through effective gradient information, the target image features can be quickly and accurately found to optimize the recognition result. In addition, the precise convergence accuracy not only improves the reliability of recognition, but also enhances the adaptability of the system in complex backgrounds, and can handle diverse user needs and different application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] Figure 1 is a flowchart of an algorithm of the present invention;

[0069] Figure 2 is a comparison of the present invention and the convolutional neural network for image recognition. Among them, (a) is the projection gradient method of the optimal control principle, (b) is the Barzilar-Borwein method of the optimal control principle, (c) is the BFGS algorithm of the optimal control principle, and (d) is the convolutional neural network;

[0070] Figure 3 is a comparison of the present invention and the method based on the statistical principle for image recognition. Among them, (a) is the optimal control principle, and (b) is the method based on the statistical principle;

[0071] Figure 4 is a schematic diagram of 8-parameter recognition implemented by the present invention. Among them, (a) is parameter d11 and d 22 The iterative path of, (b) is the parameter d 12 and d 21 The iterative path of, (c) is the iterative path of the parameters θ and r, and (d) is the iterative path of the parameters η and β. Specific implementation manners

[0072] In order to make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. It should be noted that the described embodiments are only partial embodiments of the present invention and do not constitute all embodiments. On this basis, any other embodiments that those skilled in the art can obtain without creative efforts shall fall within the scope of protection of the present invention.

[0073] Refer to Figure 1 For a giant example of an image recognition method based on the optimal control principle, the steps are as follows:

[0074] (1) Setting up the recognition system:

[0075] By deeply studying the underlying logic of image generation, corresponding differential equations can be constructed to describe the dynamic changes in the image generation process. This process involves mathematical modeling of the various components of the image and their interrelationships to reveal the behavior and evolution laws of the system under specific conditions. Based on this, with the background of network information dissemination, the following form of differential equation system is obtained:

[0076]

[0077] In the formula, S(x, t) and I(x, t) are the perturbation variables of system (5), representing the population densities of unknown information and known information respectively in the process of network information dissemination; t represents the time of information dissemination; x represents the population location of unknown or known information; r is the logistic growth rate of the population entering the information dissemination area; K is the total population capacity of the system; β is the probability of an unknown individual understanding the information after a short contact with a known individual; θ is the probability that an unknown individual is not interested in the information; c is the media correction intensity; b is the saturation effect; μ is the probability that the population spontaneously loses interest in the information; d ij is the intensity of reaction diffusion of this system; and are the derivative values on the boundary .

[0078] (2) Input of image data:

[0079] Input the image to be recognized and its population intensities of unknown and known information, which are respectively denoted as constants and For subsequent recognition algorithms to use.

[0080] (3) Objective function setting:

[0081] The objective function J is set as the sum of the image similarity at the end time and during the evolution process. Specifically, this objective function aims to quantify the similarity between the evolution process of image generation and the target image within a specific time period. By adding the image similarity at the end time to the similarities at each stage during the evolution process, this setting can effectively evaluate the overall efficiency of the image recognition process. This objective function not only considers the instantaneous feature changes of the image during the evolution process but also comprehensively takes into account the distance between its final state and the target image, thereby promoting the optimization of image generation and recognition effects. Ultimately, the minimized state of this function guides the algorithm to converge to the optimal solution. Based on this, the following form of the objective function J is obtained:

[0082]

[0083] In the formula, J is the objective function, S(x,T) and I(x,T) respectively represent the network images of the population density with unknown and known information at the end time; S(x,t) and I(x,t) respectively represent the network images of the population density with unknown and known information during the evolution process; They are respectively the network images of the population density with unknown and known target information; a i and b i , i = 1, 2 respectively represent the weights of the similarities to the target network image at the end time and during the evolution process; η is a vector group composed of parameters to be recognized, and the sum of the squares of all its elements with the addition of the weight c i , i = 1,..., 7 is obtained. Helps improve the stability of image recognition problem recognition.

[0084] (4) Gradient calculation formula:

[0085] Derive the adjoint system of system (5):

[0086]

[0087] In the formula, p(x,t) and q(x,t) are adjoint variables; the superscript * represents the optimal solution.

[0088] Derive the variational inequality of system (5), remove the integral sign by contradiction, and obtain the gradient calculation formula

[0089]

[0090]

[0091]

[0092]

[0093]

[0094]

[0095] where min{a, b} represents taking the minimum value between a and b, and max{a, b} represents taking the maximum value between a and b. and a represent the upper bound and the lower bound of the value range of parameter a, respectively.

[0096] (5) Parameter update rule and convergence check:

[0097] In the image recognition method based on the optimal control principle, three algorithms are mainly selected for the parameter update rule: the projected gradient method, the Barzilai - Borwein method, and the BFGS algorithm.

[0098] First, the multi - direction optimal control algorithm (MDOCA) is adopted and combined with the Armijo line search criterion to ensure that the selected step size can effectively reduce the projected gradient of the objective function. In the k - th iteration, let the gradient be g k .

[0099] The specific algorithm process is as follows.

[0100] 1. Initialization: Input the image to be recognized and its data, denoted as the target image as and Set the initial step size as θ, the initial iteration number k = 1. Initialize the maximum count count max , the maximum number k max and the error threshold Errend. Set the initial value of the recognition parameter η (0) , and calculate the perturbation variable S (0) , I (0) , the adjoint variable p (0) , q (0) , the objective function J (0) and the gradient g (0) . Initialize the error Err (0) . Initialize the counter count = 0.

[0101] 2. Outer loop:

[0102] When the iteration number k < k max and the current error Err > Errend, determine the step size η (k) = max{ηl , min{η u , η (k-1) - θg (k-1)}}, calculate the current perturbation variable S (k) 、I (k) 、adjoint variable p (k) 、q (k) and objective function J (k) .

[0103] 3. Inner loop:

[0104] When the counter count ≤ count max , check the current objective function value. If the objective function value In the formula, θ is the step size of the current algorithm; J (k-1) and g (k-1) are the current objective function and gradient respectively; c1 is the iteration coefficient, generally taken as 0.1; represents the square of the vector two-norm; then calculate the error Err = |J (k) - J (k-1) | / J (k) , and update the step size θ = 3θ, and jump out of the inner loop (i.e., complete the current step size iteration); otherwise, update the step size θ = θ / 2. The counter is incremented by count = count + 1.

[0105] 4. Update:

[0106] Calculate the updated gradient g (k) . Update the current iteration number k = k + 1.

[0107] 5. End condition:

[0108] If the maximum iteration number is not reached or the set error requirement is met, the algorithm ends.

[0109] Due to the small step size, the projected gradient method is less efficient when approaching the target value. Therefore, consider the Barzilai-Borwein method proposed by Barzilai and Borwein. This method formally selects the descent direction as the k-th identification parameter η (k) negative gradient direction, but the step size selection is different from the traditional gradient descent algorithm. The iterative format of the classical Newton method is In the formula, η (k) is the identification parameter after k iterations; is the gradient; J is the objective function; while the Barzilai-Borwein method uses θ -1 I to approximately replace the inverse of the Hessian matrix In the formula, θ -1 is the reciprocal of the step size, I is the identity matrix, and through the secant equation is updated, which is given by the first-order Taylor expansion of the recognition parameter η at the k-th time (k) .

[0110] The specific algorithm process is as follows.

[0111] 1. Initialization:

[0112] Input the image to be recognized and its data, denoted as the target image and Set the initial step size as θ, the initial iteration number k = 1. Initialize the maximum count count max , the maximum number k max and the error threshold Errend. Set the initial value of the recognition parameter η (0) , and calculate the perturbation variable S (0) , I (0) , the adjoint variable p (0) , q (0) , the objective function J (0) and the gradient g (0) . Initialize the error Err (0) . Initialize the counter count = 0.

[0113] 2. Outer loop:

[0114] When the iteration number k < k max and the current error Err > Errend, determine the step size η (k) = max{η l , min{η u , η (k-1) -θg (k-1)}}. Calculate the current perturbation variable S (k) , I (k) , the adjoint variable p (k) , q (k) and the objective function J (k) .

[0115] 3. Inner loop:

[0116] When the counter count ≤ count max , if the value of the objective function where θ is the step size of the current algorithm; J (k-1) and g (k-1) are the current objective function and gradient respectively; c1 is the iteration coefficient, generally taken as 0.1; represents the square of the vector two-norm; then calculate the current error Err = |J (k) -J (k-1) | / J (k); Jump out of the inner loop (for the next outer loop); otherwise, update the step size θ = θ / 2, and increment the counter count = count + 1.

[0117] 4. Update:

[0118] Calculate the updated gradient g (k) , identify the parameter change amount s (k) = η (k) -η (k-1) , the gradient change amount y (k) = g (k) -g (k -1) , update the step size θ = (s (k) ) T s (k) / (s (k) ) T y (k) . Update the current iteration number k = k + 1.

[0119] 5. End condition:

[0120] If the maximum number of iterations is not reached or the set error requirement is met, the algorithm ends.

[0121] The technical problem to be solved by the present invention can also be further realized by the following algorithm. Consider a quasi-Newton algorithm, namely the BFGS algorithm, which was proposed by Broyden, Fletcher, Goldfarb, and Shanno. The principle of the BFGS algorithm is similar to that of the Barzilai-Borwein algorithm, and both use an approximate matrix to replace the second-order Hesse matrix in the Newton method. However, the approximate matrix B k in the BFGS algorithm is implemented through an iterative method, and it is derived from the previous approximate Hesse matrix B k-1 through the secant equation. This method effectively updates the approximation of Hesse, thus providing better convergence characteristics during the optimization process. During the iteration process, it is necessary to ensure the positive definiteness of the approximate Hesse matrix, so the Wolfe line search criterion is adopted to select the step size.

[0122] The specific algorithm process is as follows.

[0123] 1. Initialization:

[0124] Input the image to be recognized and its data, denoted as the target image as and Set the initial step size as θ, and the initial iteration number k = 1. Initialize the maximum count count max , the maximum number k max and the error threshold Errend. Set the initial value of the recognition parameter η (0), and calculate the perturbation variable S (0) 、I (0) 、adjoint variable p (0) 、q (0) 、objective function J (0) and gradient g (0) 。Initialize the error Err (0) 。Initialize the counter count = 0. Calculate the Hesse matrix estimate B (0) = I (identity matrix), calculate the initial direction d (0) = -(B (0) ) -1 g (0) 。

[0125] 2. Outer loop:

[0126] When the number of iterations k < k max and the current error Err > Errend, calculate the step size η (k) = max{η l , min{η u , η (k-1) - θg (k-1)}}}, calculate the current perturbation variable S (k) 、I (k) 、adjoint variable p (k) 、q (k) 、objective function value J (k) and gradient g (k) 。

[0127] 3. Inner loop:

[0128] Update the objective function value J (k) and gradient g (k) according to the conditions, perform a line search. When J (k) > J (k-1 ) + c1θ(g (k -1) ) T d (k-1) or (g (k) ) T d (k-1) < c2(g (k-1) ) T d (k-1) where θ is the step size of the current algorithm; J (k-1) 、g (k-1) and d (k-1) are the current objective function, gradient, and direction respectively; c1 and c2 are iteration coefficients, generally taken as 0.1; if the condition J (k) > J (k-1 ) + c1θ(g (k-1) ) T d(k-1) , update the step size θ = 0.9 and calculate the recognition parameter η (k) , perturbation variable X (k) , adjoint variable Y (k) , objective function value J (k) and gradient g (k) ; if the step size θ < 10 -10 , then break out of the loop and continue to the next iteration.

[0129] If the condition (g (k) ) T d (k-1) < c2(g (k-1) ) T d (k-1) is satisfied, update the step size θ = 1.056 and update the recognition parameter η (k) , perturbation variable S (k) , I (k) , adjoint variable p (k) , q (k) , objective function value J (k) and gradient g (k) .

[0130] 4. Update:

[0131] Calculate the new error Err (k) = |J (k) - J (k-1) | / |J (k) |, update the change in the recognition parameter s (k) = η (k) - η (k-1) and the change in the gradient y (k) = g (k) - g (k-1) . Update the Hesse matrix estimate:

[0132]

[0133] and calculate the new search direction d (k) = -(B (k) ) -1 g (k) . Update the current iteration count k = k + 1.

[0134] 5. End condition:

[0135] If the maximum number of iterations is not reached or the set error requirement is met, the algorithm ends.

[0136] The recognition process when the parameter to be recognized is 2 is as shown in Figure 2 and Figure 3 . Figure 2(a)-(c) show the variation of the two-norm of the difference between the parameters to be recognized and the target parameters of the projection gradient method, Barzilai-Borwein method, and BFGS algorithm with the increase of the number of iteration steps during the image recognition process. When the three algorithms stop iterating, they all reach an error level of about 10 -4 . The average relative error is 0.016%. Specifically, the average number of iterations of the G projection gradient method, Barzilai-Borwein method, and BFGS algorithm are 23.53, 14.67, and 12.27 respectively. The results show that among these three algorithms, the BFGS algorithm has the fastest iteration termination speed, while the GD algorithm has the slowest convergence speed. Figure 2 (d) shows the iteration process of image recognition based on a convolutional neural network, with an average relative error of 1.19%, but the time required for the training cycle is relatively long. It can be seen that the image recognition method based on the optimal control principle can achieve fast and accurate recognition of unknown parameters. Figure 3 (a) shows the downward trend of the parameters to be recognized under the Barzilai-Borwein method during the image recognition process, clearly indicating that the image recognition method based on the optimal control principle has global convergence. Figure 3 (b) shows the iteration process of image recognition based on statistical principles. The results show that its accuracy fails to reach the level achieved by the image recognition method based on the optimal control principle, and the error is slightly larger.

[0137] The recognition process when the parameter to be recognized is 8 is as Figure 4 shown. The iteration paths of the projection gradient method and the Barzilai-Borwein method are highly similar, and most of the trajectories almost coincide. This similarity stems from the fact that both algorithms converge in the negative gradient direction. In addition, through the analysis of the number of iteration points, it can be seen that the Barzilai-Borwein algorithm significantly requires fewer iteration times than the projection gradient method. Although the BFGS algorithm is significantly superior to the Barzilai-Borwein algorithm in terms of iteration efficiency, and the number of iteration steps it requires is only one-tenth of the latter, this algorithm has higher requirements for the initial value and appropriate step size, so it cannot guarantee global convergence.

[0138] Compared with the prior art, the present invention can provide high-quality solutions in practical applications to meet the needs of different users and scenarios. Its beneficial effects are mainly reflected in the following aspects:

[0139] 1. High efficient convergence speed: The image recognition method based on the optimal control principle adopted by the present invention requires only more than one percent of the time required by the method based on the statistical principle and the convolutional neural network when re-identifying the same image. This significantly improved convergence speed enables significant reduction of the computing time and improvement of the system response efficiency when dealing with large-scale image data, thus better supporting real-time application scenarios. In addition, the fast convergence also greatly reduces the demand for computing resources, enabling the method to operate effectively in resource-constrained environments.

[0140] 2. Precise convergence accuracy: The present invention ensures that each iteration is carried out along a clear gradient direction, so the convergence direction is clear, which greatly improves the recognition accuracy. During the process of image recognition, through effective gradient information, the target image features can be quickly and accurately found to optimize the recognition results. In addition, the precise convergence accuracy not only improves the reliability of recognition, but also enhances the adaptability of the system in complex backgrounds, capable of coping with diverse user needs and different application scenarios.

Claims

1. An image recognition optimization algorithm based on the optimal control principle, characterized by: The steps of this method are as follows: (1) Identification system settings: By deeply studying the underlying logic of image generation, we can construct corresponding differential equations to describe the dynamic changes in the image generation process. This process involves mathematical modeling of the various components of the image and their interrelationships to reveal the behavior and evolution of the system under specific conditions, and obtain the following form of differential equations: In the formula, F() is a system of differential equations, where the disturbance variable is denoted by X; t represents time; x is a vector consisting of the components of the image; and Respectively represent the partial derivative and quadratic partial derivative of vector x with respect to time t; (2) Image data input: Input the image to be recognized and its related data. If no data is provided, the image will be binarized to convert it into a data record that can be used for subsequent analysis. The grayscale value of the image will be thresholded to convert it into a binary image containing only two states. The purpose of this processing step is to simplify the information content of the image, making it easier to perform subsequent feature extraction and pattern recognition. After binarization, the image data obtained will be recorded as variables For use by subsequent recognition algorithms; (3) Objective function setting: The objective function J is set as the sum of the image similarities at the end moment and during the evolution process. Specifically, the objective function aims to quantify the similarity between the evolution process of image generation and the target image within a specific time period. By adding the image similarity at the end moment to the similarity of each stage in the evolution process, this setting can effectively evaluate the overall efficiency of the image recognition process. This objective function not only considers the instantaneous feature changes of the image during the evolution process, but also integrates the distance between its final state and the target image, thereby promoting the optimization of image generation and recognition effects; finally, the minimized state of the function guides the algorithm to converge to the optimal solution; (4) Gradient calculation formula: The companion system of the export system: In the formula, G() is the adjoint system of F(), which is expressed as a system of differential equations, where the adjoint variable is denoted by Y; t represents time; y is a vector composed of adjoint variables; and Respectively represent the partial derivative and quadratic partial derivative of vector y with respect to time t; The variational inequality of formula (1) is derived, and the integral sign is removed by contradiction to obtain the gradient calculation formula: Where g is the gradient calculation formula of the parameter to be identified; J is the objective function set as the sum of the image similarities at the end moment and during the evolution process; η is the parameter to be identified; X is the disturbance variable; represents the gradient; T is the evolution time of image generation; Ω is the image range; x is the vector composed of the components of the image; t represents time; (5) Parameter update rules and convergence check: In the image recognition method based on the optimal control principle, three algorithms are mainly selected for parameter updating rules: projected gradient method, Barzilai-Borwein method and BFGS algorithm.

2. The image recognition optimization algorithm based on the optimal control principle according to claim 1, characterized in that: The objective function is set as the similarity with the target network image at the terminal moment and during the evolution process: Where J is the objective function, X(x,T) represents the network image at the end time, and X(x,t) represents the network image during the evolution process. is the target network image, a and b represent the weights of the similarity with the target network image at the end moment and during the evolution process, respectively.

3. The image recognition optimization algorithm based on the optimal control principle according to claim 1, characterized in that: In the gradient calculation formula, the parameter η to be identified is set as a spatiotemporally heterogeneous controller, and the corresponding strain distribution inequalities are respectively solved to obtain the gradient of the objective function.

4. The image recognition optimization algorithm based on the optimal control principle according to claim 1, characterized in that: Among the parameter updating rules, the projected gradient method combining the MDOCA (Modified Discrete Optimal Control Algorithm) algorithm and the Armijo line search criterion is selected: (1) Initialization: Input the image to be recognized and its data, denoted as the target image Set the initial step size to θ, the initial number of iterations k = 1, and initialize the maximum count count max , the maximum number of times k max and error threshold Errend, set the initial value of the identification parameter η (0) , and calculate the disturbance variable X (0) , accompanying variable Y (0) 、Objective function J (0) and the gradient g (0) , initialization error Err (0) , initialize counter count = 0; (2) External circulation: When the number of iterations k < k max When the current error Err>Errend, determine the step length η (k) =max{η l ,min{η u ,η (k-1) -θg (k-1) }}, where max{a,b} and min{a,b} represent the maximum and minimum values ​​of a and b respectively, η u and η l They represent the maximum and minimum values ​​of the range of the identification parameter η, θ is the step size of the current algorithm, and η (k-1) and g (k-1) are the current identification parameter values ​​and gradients respectively; calculate the current disturbance variable X (k) , accompanying variable Y (k) And the objective function J (k) ; (3) Internal loop: When counter count≤count max When the current objective function value is checked, if the objective function value Where θ is the step size of the current algorithm; J (k-1) and g (k-1) are the current objective function and gradient respectively; c1 is the iteration coefficient, which is generally 0.1; represents the square of the vector norm; then the calculation error Err=|J (k) -J (k-1) | / J (k) , and update the step size θ = 3θ, jump out of the inner loop (i.e. complete the current step size iteration); otherwise, update the step size θ = θ / 2. The counter increases by count = count + 1; (4) Update: Calculate the updated gradient g (k) , update the current number of iterations k = k + 1; (5) Ending conditions: If the maximum number of iterations is not reached or the set error requirement is not met, the algorithm ends; The Barzilar-Borwein method of constant approximation replacing the Hessian matrix update step size: (1) Initialization: Input the image to be recognized and its data, denoted as the target image Set the initial step size to θ, the initial number of iterations k = 1, and initialize the maximum count count max , the maximum number of times k max and error threshold Errend, set the initial value of the identification parameter η (0) , and calculate the disturbance variable X (0) , accompanying variable Y (0) 、Objective function J (0) and the gradient g (0) , initialization error Err (0) , initialize counter count = 0; (2) External circulation: When the number of iterations k < k max When the current error Err>Errend, determine the step length η (k) =max{η l ,min{η u ,η (k-1) -θg (k-1) }}; Calculate the current disturbance variable X (k) , accompanying variable Y (k) And the objective function J (k) ; (3) Internal loop: When counter count≤count max If the objective function value is Where θ is the step size of the current algorithm; J (k-1) and g (k-1) are the current objective function and gradient respectively; c1 is the iteration coefficient, which is generally 0.1; represents the square of the vector norm; then calculate the current error Err = |J (k) -J (k-1) | / J (k) ; Jump out of the inner loop (go to the next outer loop); otherwise, update the step size θ = θ / 2, and increase the counter count = count + 1; (4) Update: Calculate the updated gradient g (k) , identification parameter change s (k) =η (k) -η (k-1) , gradient change y (k) =g (k) -g (k-1) , update step size θ = (s (k) ) T s (k) / (s (k) ) T y (k) , update the current number of iterations k = k + 1; (5) Ending conditions: If the maximum number of iterations is not reached or the set error requirement is not met, the algorithm ends; The BFGS algorithm replaces the Hessian matrix with an iterative approximation matrix and uses the Wolfe line search criterion to select the step size: (1) Initialization: Input the image to be recognized and its data, denoted as the target image Set the initial step size to θ, the initial number of iterations k = 1, and initialize the maximum count count max , the maximum number of times k max and error threshold Errend, set the initial value of the identification parameter η (0) , and calculate the disturbance variable X (0) , accompanying variable Y (0) 、Objective function J (0) and the gradient g (0) , initialization error Err (0) , initialize the counter count = 0, calculate the Hesse matrix estimate B (0) =I (unit matrix), calculate the initial direction d (0) =-(B (0) ) -1 g (0) ; (2) External circulation: When the number of iterations k < k max When the current error Err>Errend, calculate the step length η (k) =max{η l ,min{η u ,η (k-1) -θg (k-1) }}, calculate the current disturbance variable X (k) , accompanying variable Y (k) 、Objective function value J (k) and gradient g (k) ; (3) Internal loop: Update the objective function value J according to the condition (k) and the gradient g (k) , perform linear search, when J (k) >J (k-1 )+c1θ(g (k-1) ) T d (k -1) or (g (k) ) T d (k-1) <c2(g (k-1) ) T d (k-1) When, where θ is the step size of the current algorithm; J (k-1) , g (k-1) and d (k-1) are the current objective function, gradient and direction respectively; c1 and c2 are iteration coefficients, generally 0.1; if the condition J is met (k) >J (k-1 )+c1θ(g (k-1) ) T d (k-1) , update step size θ = 0.9 and calculate the identification parameter η (k) , disturbance variable X (k) , accompanying variable Y (k) 、Objective function value J (k) and gradient g (k) ; If the step size θ < 10 -10 , then jump out of the loop and continue to the next iteration If the condition (g (k) ) T d (k-1) <c2(g (k-1) ) T d (k-1) , update the step size θ = 1.056, and update the identification parameter η (k) , disturbance variable X (k) , accompanying variable Y (k) 、Objective function value J (k) and gradient g (k) ; (4) Update: Calculate the new error Err (k) =|J (k) -J (k-1) | / |J (k) |, update the recognition parameter change s (k) =η (k) -η (k-1) and the gradient change y (k) =g (k) -g (k-1) ; Update the Hesse matrix estimate: And calculate the new search direction d (k) =-(B (k) ) -1 g (k) ; Update the current number of iterations k = k + 1; (5) Ending conditions: If the maximum number of iterations is not reached or the set error requirement is met, the algorithm ends.