Intelligent image recognition method based on computer vision and machine learning

Through the visual feature similarity generative adversarial network and vortex optimization neural network, combined with multi-objective constrained autoencoding and meta-heuristic strategies, the problem of time-consuming data annotation and insufficient model generalization ability in image recognition technology is solved, and the recognition accuracy is improved. and efficiency.

CN118537816AInactive Publication Date: 2024-08-23XIAMEN SOFT CLOUD NETWORK TECH CO LTD
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202410593041.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-14
Publication Date
2024-08-23
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing image recognition technology faces time-consuming and labor-intensive data labeling, insufficient model generalization capabilities, insufficient feature extraction, vanishing or exploding gradients, excessive autoencoder reconstruction errors, and strong classifier dependence, resulting in poor recognition accuracy and Inefficiency, especially poor performance in new environments.

Method used

A generative adversarial network based on visual feature similarity is used for data expansion, combined with vortex optimization neural network and multi-objective constrained autoencoding network, the vortex phenomenon is used to optimize parameters, and a meta-heuristic strategy is used for classifier training to ensure feature extraction and reduction. Dimensional quality and discriminative ability.

Benefits of technology

It improves the generalization ability and recognition accuracy of the model, solves gradient problems and local optimal solutions, enhances feature representation and classification accuracy, and reduces computing resource requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118537816A
    Figure CN118537816A
Patent Text Reader

Abstract

The invention discloses an intelligent image recognition method based on computer vision and machine learning. The method comprises the following steps: step 1, data acquisition and labeling; 2, data expansion; step 3, training a feature extraction model; step 4, training a feature dimensionality reduction model, and inputting the data after feature extraction into the feature dimensionality reduction model to train the feature dimensionality reduction model; step 5, classifier training: inputting the data after dimension reduction into a classifier for classifier training; and step 6, intelligent image identification. The invention belongs to an intelligent model training method, and particularly relates to an intelligent image recognition method based on computer vision and machine learning, which serves as a frontier technical solution, has wide application prospects and huge market potential, can play an important role in multiple fields from the perspective of a product, and has wide application prospects. And innovation and upgrading of related industries are promoted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an artificial intelligence model training method, specifically an intelligent image recognition method based on computer vision and machine learning. Background Art

[0002] In today's information age, image recognition technology has become an important branch of artificial intelligence. With the continuous advancement of technology, the accuracy and efficiency of image recognition have been significantly improved, but it also faces new challenges and demands.

[0003] First, the core of image recognition technology lies in how to extract effective information from massive image data and convert it into machine-understandable features. Traditional image processing methods rely on manually designed feature extraction algorithms, such as edge detection and corner detection. These methods may perform well in specific scenarios, but in complex and changeable practical applications, their performance is limited by the versatility and robustness of the algorithm. Secondly, the rise of deep learning technology has brought revolutionary changes to image recognition; by building deep neural networks, the model can automatically learn the hierarchical feature representation of images, greatly improving the accuracy of recognition; however, deep learning models usually require a large amount of labeled data for training, and the data collection and labeling process is not only time-consuming and labor-intensive, but also costly. In addition, when faced with new application scenarios or categories, the model often needs to be retrained, which has great limitations in practical applications. Furthermore, the image recognition system needs to process a large amount of image data in actual operation, which places high demands on computing resources. Especially in mobile devices and edge computing scenarios, how to design lightweight and efficient models has become an urgent problem to be solved. At the same time, the generalization ability of the model is also one of the challenges faced by image recognition technology; since the distribution of training data may be different from the actual application scenario, the performance of the model in the new environment may decline. In addition, with the widespread application of image recognition technology, how to protect user privacy and data security has also become an important issue. The image recognition system needs to ensure accuracy while also considering the sensitivity and privacy protection of the data.

[0004] The patent application number CN201610942156.0 proposes a convolutional neural network training method, image recognition method and device. The image recognition method based on the convolutional neural network includes: obtaining a trained convolutional neural network; preprocessing the image to be recognized to obtain a test sample; and performing image recognition on the test sample. This saves training time and memory, making it possible to train CNNs with more layers; and ensuring the accuracy of image recognition.

[0005] The patent application number CN201610942583.9 proposes a method for automatic correction of a posture measurement device based on image recognition, including a transmitting module, a receiving module, and a processing module. The transmitting module includes a posture measurement device and a transmitting device. The present invention reduces the impact of error accumulation of the posture measurement device, reduces the user's discomfort and increases the sense of immersion.

[0006] The patent with application number CN201610881419.1 proposes an image recognition method and device, the method includes: obtaining a multi-region multi-feature combination vector of two images; the multi-region multi-feature combination vector is obtained by dividing the two images into M sub-regions and extracting N feature vectors from the M sub-regions respectively; determining the Hausdorff distance of the sub-region multi-feature combination vector between each corresponding sub-region in the M sub-regions; according to the Hausdorff distance of the sub-region multi-feature combination vector between each corresponding sub-region in the M sub-regions of the two images; the larger the Hausdorff distance value of the multi-region multi-feature combination vector, the more different the two images are. The present invention can make the corresponding features in the image use independently of each other, without using a multi-region and multi-feature recognition method for fusion using a kernel function, reducing the amount of calculation and improving the recognition efficiency.

[0007] However, the above application documents and prior art still have the following defects and limitations:

[0008] 1. Traditional image recognition systems usually rely on a large amount of labeled data for training, which is not only time-consuming and labor-intensive, but also limited by the quality and diversity of the data, which may lead to insufficient generalization of the model. In practical applications, samples of certain categories may be difficult to obtain, resulting in an unbalanced training data set, which affects the recognition performance of the model on these categories.

[0009] 2. Existing feature extraction methods may not be able to fully capture the key information of the image, resulting in insufficient feature representation and affecting the accuracy of subsequent classification;

[0010] 3. Traditional neural network parameter optimization methods, such as gradient descent, may encounter the problem of gradient vanishing or exploding, resulting in low training efficiency and easy to fall into local optimal solutions;

[0011] 4. Traditional autoencoders mainly focus on reconstruction errors, ignoring the representation ability and category separation of features, which may lead to insufficient feature discrimination ability after dimensionality reduction;

[0012] 5. Existing classifiers may be too dependent on specific network structures and loss functions, lack a global optimization perspective, and limit the improvement of classification performance. Due to the limitations of training data and the deficiencies of the model itself, existing technologies may not perform well when faced with new, unseen images. Summary of the invention

[0013] The present invention proposes an intelligent image recognition method based on computer vision and machine learning. As a cutting-edge technical solution, it has broad application prospects and huge market potential. From the product side, this technology can play an important role in many fields and promote the innovation and upgrading of related industries.

[0014] First, in the field of security monitoring, the image recognition technology of the present invention can improve the intelligence level of the monitoring system and realize the automatic detection and identification of abnormal behaviors, such as illegal intrusion, theft, etc.; by accurately analyzing the monitoring screen, the system can issue an alarm in time and take corresponding measures to greatly improve the security prevention capabilities; in the field of medical health, the present invention can assist doctors in diagnosing diseases; by analyzing medical images, such as X-rays, CT scans, etc., abnormal tissues or lesions can be intelligently identified to provide doctors with more accurate auxiliary diagnosis information, thereby improving the accuracy and efficiency of diagnosis; in autonomous driving technology, the image recognition method of the present invention can enhance the perception ability of the vehicle, accurately identify pedestrians, vehicles, traffic signs, etc., provide reliable environmental perception information for the autonomous driving system, and enhance the safety and reliability of autonomous driving; in the field of industrial manufacturing, the present invention can be applied to product quality inspection; through image recognition technology, product defects and defective products can be automatically identified, production efficiency and product quality can be improved, and labor costs and resource waste can be reduced.

[0015] To achieve the above technical effects, the present invention proposes an intelligent image recognition method based on computer vision and machine learning, comprising the following steps:

[0016] Step 1: Data collection and annotation;

[0017] Step 2: Data expansion;

[0018] Since the acquisition, labeling and preprocessing of training data are time-consuming and labor-intensive, and insufficient training samples can easily lead to poor generalization ability of the model and affect the accuracy of the model, a generative adversarial network algorithm based on visual feature similarity is adopted. Traditional generative adversarial network algorithms may generate images that are inconsistent with the style of the original data set when generating images, affecting the consistency of model training. The visual feature similarity mechanism is used to ensure that the generated images are highly consistent with the original data set in terms of visual features, thereby improving the quality and effect of data expansion. The loss function of the generative adversarial network is improved by using a deterministic loss function to make the generation process more focused on maintaining the key visual features of the image. Sufficient variation is used to enhance the model's adaptability to new samples and improve the quality and diversity of generated images.

[0019] Step 3: Feature extraction model training:

[0020] A 3-layer fully connected neural network is used for feature extraction. Some schemes use neural networks for feature extraction. In some neural network structures, gradient vanishing, gradient exploding or falling into local optimal solutions may occur, affecting the stability of training and the performance of the model. A vortex optimization neural network algorithm is proposed. Inspired by the vortex phenomenon, the parameters in the neural network are optimized by simulating the formation, evolution and dissipation process of the vortex. The parameters include weight w and bias b. In fluid dynamics, vortices can increase the chaos and complexity of the fluid, thereby guiding the search process in the parameter space towards a better solution. By simulating the natural process of vortices, the vortex optimization neural network aims to find parameter configurations that can minimize the neural network loss function, without relying on gradient-based neural network parameter optimization methods.

[0021] Step 4: Feature dimensionality reduction model training: input the feature-extracted data into the feature dimensionality reduction model for feature dimensionality reduction model training:

[0022] An autoencoder neural network algorithm based on multi-objective constraints is adopted. The traditional autoencoder mainly focuses on the reconstruction error, that is, the difference between input and output. Additional constraints, namely the representation ability of features and the degree of category separation, are adopted to simultaneously consider the reconstruction quality and the discriminative ability of features in a multi-objective optimization manner; an adaptive loss function is used to automatically adjust the weights of the reconstruction error and the constraints according to the training process, so as to achieve a balance between the weights of different objectives in the process of feature dimensionality reduction.

[0023] Step 5: Classifier training: input the reduced-dimensional data into the classifier for classifier training:

[0024] A neural network classifier based on a meta-heuristic strategy is used for image recognition and classification. The meta-heuristic strategy is used to optimize the parameter configuration of the classifier and find one of the optimal and approximately optimal solutions in a wide search space, thereby improving the performance of the model.

[0025] Step 6: Intelligent image recognition:

[0026] After the model training is completed, the trained model is used to process new data. In one embodiment, for the newly collected images, after feature processing by the trained feature extraction model and feature dimensionality reduction model, the obtained features are input into the classifier for classification; in one embodiment, the classification categories include three categories: natural images, animal images, and human images.

[0027] Furthermore, the data collected in the step 1 is derived from a public image database, field photography and digital archiving, and the collected image data is stored in JPEG format. The data collected in the step 1 is annotated by manual annotation.

[0028] Furthermore, the training process of the generative adversarial network algorithm based on visual feature similarity in step 2 is as follows:

[0029] 1. Select the original image dataset as the training benchmark and initialize the generative adversarial network, including the network structure and parameters of the generator and discriminator:

[0030] Specifically, let the initialization weights of the generator G and the discriminator D be b G and b D , the network structure of the generator and discriminator adopts a deep convolutional network, and its weight initialization is expressed as:

[0031]

[0032]

[0033] Among them, l represents the network layer, N(0,σ 2 ) means that 0 is the mean, σ 2 is a normal distribution with variance;

[0034] 2. For each image in the dataset, use the pre-trained deep learning model to extract its key visual features, so as to ensure the consistency of the visual features of the generated image with the original image in the subsequent process:

[0035] Specifically, for each original image x i , a pre-trained deep network F is used to extract its visual features v i , expressed as:

[0036] v i =F(x i θ F )

[0037] Among them, F represents the pre-trained model, θ F represents the model parameters;

[0038] In the process of visual feature extraction, the pre-trained deep learning model is used to extract the key visual features of the image. Let the visual feature vector of image I be V. The process is expressed as:

[0039] V=F ext (I)

[0040] In one embodiment, the pre-trained model F is composed of a multi-layer convolutional neural network, and the output of each layer is expressed as:

[0041] H l+1 =Sig(W l *H l +b l )

[0042] Among them, H l and H l+1 Represent the output feature maps of the lth layer and the l+1th layer respectively, W l and b l are the weight and bias of the first layer, * represents the convolution operation, Sig() is the Sigmoid nonlinear activation function, and finally, V is the weight of the last layer H. L It is obtained through a fully connected layer and is expressed as:

[0043] V=W fc *H L +b fc

[0044] Among them, W fc and b fc are the weights and biases of the fully connected layer;

[0045] 3. Generator G is based on the input noise z i and visual features v i Generate image It is expressed as:

[0046]

[0047] Among them, z i ~N(0,I) represents random noise from a standard normal distribution, θ G Represents the parameters of the generator;

[0048] In this process, the deterministic loss function guides the generator to produce images that are similar to the original image in visual features but different in details;

[0049] 4. The discriminator evaluates the consistency of the generated image with the original image set, and the deterministic loss function provides feedback to optimize the generation effect of the generator:

[0050] Specifically, the discriminator D generates images and the real image x i Evaluate and output the probability p of it being a real image i The way is expressed as:

[0051]

[0052] q i =D(x i θ D )

[0053] Among them, θ D Represents the parameters of the discriminator.

[0054] The deterministic loss function L combines the visual feature differences between the generated image and the real image and the output of the discriminator, and is calculated as:

[0055]

[0056] Among them, λ is a hyperparameter that balances the quality of generated images and the consistency of visual features;

[0057] 5. Through the iterative process, the parameters of the generator and discriminator are continuously optimized until the predetermined generation quality or number of iterations is reached:

[0058] Specifically, the method of updating the parameters of G and D by the gradient descent method is expressed as:

[0059]

[0060]

[0061] Among them, θ G and θ D are the parameters of the generator and discriminator before updating, θ G ' and θ D ' are the updated generator and discriminator parameters, α represents the learning rate, and the learning rate α of the generator and discriminator is set to 0.0002;

[0062] The above steps are iterated repeatedly until a preset condition for stopping iteration is met. In one embodiment, the preset condition for stopping iteration is reaching a preset maximum number of iterations, and the preset maximum number of iterations is set to 1000 times.

[0063] Furthermore, the training process of the vortex optimization neural network algorithm in step 3 is as follows:

[0064] 1. Randomly generate a set of vortices in the parameter space, each vortex represents a possible parameter configuration, and the parameter configuration includes weight w and bias b;

[0065] Specifically, define the neural network parameter vector P i =(w i ,b i ), where i is the vortex index; during initialization, the parameter vector P of each vortex i It is randomly generated in the parameter space and conforms to the uniform distribution. The total number of initial vortices is set to N, and the initialization process is expressed as:

[0066]

[0067] Among them, U represents uniform distribution, a and b are the lower and upper bounds of the parameter space, which are preset manually;

[0068] 2. Calculate the performance of the parameter configuration represented by each vortex on the training set and sort the vortices according to the performance;

[0069] Specifically, the performance evaluation uses the loss function L(P i ) is used to complete the evaluation. After the evaluation is completed, the vortices are sorted according to the value of the loss function:

[0070] L(P1)≤L(P2)≤…≤L(P N )

[0071] In one embodiment, the loss function L(P i ) is the cross entropy loss;

[0072] 3. Update the vortex dynamically, dynamically adjust the position and intensity of the vortex according to the ranking of the vortex and the distance between them, and simulate the interaction and evolution of the vortex;

[0073] Specifically, in the vortex dynamic update stage, the interaction of the vortices is simulated to adjust their positions in the parameter space, and the distance between vortices i and j is set to d ij =∥P i -P j ∥, then the update amount of the i-th vortex ΔP i It is expressed as:

[0074]

[0075] Among them, γ is a hyperparameter that adjusts the distance effect, F(d ij ) is a distance-based adjustment function, λ b is the adaptive vortex factor, ξ i is a regulatory factor based on environmental feedback;

[0076] In one embodiment, the distance-based adjustment function F(d ij ) is calculated using an exponential decay model to reflect the weakening of the interaction force between vortices as the distance increases, expressed as:

[0077] F(d ij )=α q exp(-β q d ij )

[0078] Among them, α q and β q is a hyperparameter that controls the magnitude and decay rate of the force. In one embodiment, the parameter α q is set to 0.5, β q is set to 0.1; d ijrepresents the distance between vortex i and vortex j, which is calculated based on the Euclidean distance of the parameter vectors representing the two vortices and is expressed as:

[0079]

[0080] Where D is the dimension of the parameter vector, P ik and P jk are the parameter values ​​of vortex i and vortex j in the kth dimension respectively;

[0081] Adaptive swirl factor λ b It is calculated by adaptive vortex guided learning, and the information entropy H of vortex distribution is defined as:

[0082]

[0083] Among them, p i is the proportion of the i-th vortex in all vortices, which is calculated by the inverse of the vortex loss function and is expressed as:

[0084]

[0085] According to the change of information entropy, the adaptive vortex factor λ b The search strategy for adjusting the vortex is calculated as:

[0086]

[0087] Among them, κ is a preset maximum regulation strength, H max is the maximum information entropy value that can be achieved theoretically, indicating a completely uniform distribution state, μ i is the momentum adjustment factor, M i is the average momentum vector of vortex i in the most recent T iterations;

[0088] Momentum adjustment factor μ i and the average momentum vector M i It is obtained through time series momentum adjustment. The time series momentum adjustment aims to adjust the exploration trend of the vortex by analyzing its historical movement trend in the parameter space, considering the movement direction and speed of the vortex in the historical iteration, calculating its momentum, and then using this momentum information to guide future parameter updates;

[0089] Specifically, calculate the average momentum vector M of vortex i in the last T iterations i It is expressed as:

[0090]

[0091] in, is the parameter vector of vortex i after the tth iteration, is the parameter vector after the t-1th iteration;

[0092] Define the momentum adjustment factor μ i Used to measure the size and consistency of momentum, expressed as:

[0093] μ i =∥M i ∥·cos(θ i )

[0094] Among them, θ i It is M i and The angle between is used to measure the consistency between the latest moving direction and the average momentum direction. The smaller the angle, the more consistent the momentum.

[0095] The calculation method of the adjustment factor based on environmental feedback is expressed as:

[0096] ξ i =Sig(E(P i ))

[0097] Among them, Sig() is the Sigmoid mapping function, which maps the environmental feedback to the (0, 1) interval. i ) is the environmental feedback function, which is used to evaluate the characteristics of the environment around vortex i. The calculation method is expressed as:

[0098]

[0099] in, is the Hessian matrix of the loss function at the vortex i position, which is used to evaluate the local concavity, is the modulus of the gradient, used to assess the steepness of the parameter space;

[0100] 4. Simulate the merging and splitting phenomena of vortices in nature to promote the diversity of solution space and explore new parameter areas. Specifically, set the merging threshold T m and the splitting threshold T s , when the distance between the two vortices is less than T m When the strength of a vortex exceeds T s When , it will split into two vortices, and the merging operation is expressed as:

[0101]

[0102] Among them, L(P i ) and L(P j ) is the loss function value corresponding to vortex i and vortex j;

[0103] The split operation is expressed as:

[0104] P i1 =P i +δ q

[0105] P i2 =P i -δ q

[0106] Among them, δ q is a random perturbation vector based on the parameter vector of vortex i, used to generate the parameters of two new vortices;

[0107] The random perturbation vector δ is generated based on the local gradient information of the current vortex position to increase the randomness and exploration of the search process. The calculation method is expressed as:

[0108]

[0109] Among them, q and ε q is a hyperparameter that controls the gradient direction and random perturbation intensity, and g represents the vortex position P i The gradient information calculated at N(0,Σδ q ) has a mean of 0 and a covariance matrix of Σδ q Gaussian noise, in one embodiment, ζ q is set to 1.0, ε q is set to 0.1;

[0110] 5. Select the best performing vortex and perform local search to fine-tune its parameters, simulating the local absorption and energy concentration phenomenon of the vortex in the fluid. For the best performing vortex, perform local search to further fine-tune its parameters, which is achieved through a field-based search strategy;

[0111] Specifically, in the domain-based search strategy, the local search method is expressed as:

[0112] P i '=P i +η m ·N(0,Σ loc )

[0113] Among them, η m is the learning rate, N(0,Σ loc ) takes 0 as the mean, Σ loc is the Gaussian distribution of the covariance matrix, used to generate random perturbations of the parameters;

[0114] Covariance matrix Σ locAccording to the historical moving direction and speed of the vortex in the parameter space, it is dynamically adjusted to adapt to different search stages and characteristics. Its update strategy is expressed as:

[0115]

[0116] in, is the adjusted covariance matrix, is the covariance matrix before adjustment, ρ n is a learning rate parameter used to control the influence of historical information on the current search. In one embodiment, ρ n is set to 0.2;

[0117] 6. Perform vortex attenuation to simulate the dissipation process of vortex energy in nature, gradually eliminate vortices with poor performance, and release resources to newly generated or better performing vortices. Specifically, the attenuation process can be achieved by adjusting the life value of the vortex. Vortices with a life value below a certain threshold will be eliminated. Set the life value of vortex i to L i , the decay rule is:

[0118]

[0119] in, is the health value after decay, δ L is the amount of health reduction;

[0120] 7. Repeat steps 2 to 6 until the preset maximum number of iterations is reached. After each round of iteration, the state of the vortices is updated and their performance is re-evaluated to ensure that the algorithm progresses toward the optimal solution. In one embodiment, the maximum number of iterations is set to 1000.

[0121] Furthermore, the training process of the autoencoder neural network algorithm based on multi-objective constraints in step 4 is as follows:

[0122] 1. Initialize the network parameters of the autoencoder, including the weights and biases of the encoder and decoder. The encoder part of the autoencoder is represented by parameters eW and eb, and the decoder part is represented by parameters dW and db. The parameters of the autoencoder are initialized by random initialization.

[0123] 2. The input image is converted into a low-dimensional feature representation by the encoder, and the low-dimensional feature is reconstructed into an image by the decoder. Specifically, let the input image be represented as X, the encoder maps X to the hidden layer Z, and then the decoder reconstructs Z into The encoding process is expressed as:

[0124] Z=Re(eW·X+eb)

[0125] And the decoding process is expressed as:

[0126]

[0127] Where Re() is the ReLU activation function used by the encoder and decoder;

[0128] 3. Calculate the reconstruction error to evaluate the similarity between the reconstructed image and the original image, and calculate additional constraint losses to ensure that the features after dimensionality reduction have good discriminative ability;

[0129] Specifically, the total loss includes the reconstruction error loss L recon and the additional constraint loss L const , the reconstruction error is calculated using the mean square error, expressed as:

[0130]

[0131] The constraint loss depends on the specific constraint target. In one embodiment, a sparsity constraint is adopted, which is expressed as:

[0132]

[0133] Among them, λ is a hyperparameter that adjusts the constraint strength, Z j is the jth element of feature layer Z;

[0134] 4. Dynamically adjust the weight between reconstruction error and constraint loss according to the training progress to find the optimal training balance;

[0135] Specifically, in order to balance the reconstruction error and constraint loss, an adaptive mechanism is used to adjust the λ value, which is dynamically completed based on the training progress or the change of the loss value, expressed as:

[0136] λ new =Adapt(λ,epoch,L recon ,L const )

[0137] Wherein, Adapt is a function that adjusts λ according to the current training cycle epoch, reconstruction error, and constraint loss. In one embodiment, the way Adapt() adjusts λ adopts a dynamic adjustment strategy based on training progress, which is expressed as:

[0138]

[0139] Among them, epoch max Represents the total number of training cycles, β is a coefficient used to balance the proportion of reconstruction error and constraint loss. The value of λ is gradually reduced as the training progresses. Considering the ratio between reconstruction error and constraint loss, the importance of both is adaptively adjusted. β is set to 0.3;

[0140] 5. Based on the total loss L total =L recon +L const The network parameters eW, eb, dW, db are updated through the back propagation algorithm. Specifically, the parameters are updated using the gradient descent method, which is expressed as:

[0141]

[0142]

[0143]

[0144]

[0145] Where α is the learning rate. Preferably, α is set to 0.01;

[0146] Encoder weight update term The calculation method is expressed as:

[0147]

[0148] Among them, the partial derivative of the reconstruction error with respect to the weight and the partial derivative of the constraint loss with respect to the weight Further expanding through the chain rule, taking the reconstruction error as an example, the specific calculation method may involve the path of error back propagation to the encoder weight, expressed as:

[0149]

[0150] 6. Repeat the above steps until a preset condition for stopping iteration is met. In one embodiment, the preset condition for stopping iteration is reaching a preset maximum number of iterations, and the preset maximum number of iterations is set to 1000 times.

[0151] Furthermore, the training process of the neural network classifier based on the meta-heuristic strategy in step 5 is as follows:

[0152] 1. Initialize the neural network model parameters and configuration, including weights, biases, and learning rates. Let pW and pb represent the weight and bias parameters of the classifier. The weight pW is initialized by normal distribution. The initialization is expressed as:

[0153] pW~N(0,σ 2 )

[0154] Among them, σ 2 is the variance;

[0155] The bias pb is initialized to 0, expressed as:

[0156] pb=0

[0157] The neural network classifier is a 3-layer neural network model;

[0158] 2. Use meta-heuristic strategies to globally optimize the initial parameters of the model and determine the most promising parameter configuration as the starting point for training;

[0159] Specifically, the objective function f(pW, pb) is set as the classification accuracy based on the validation set, and the meta-heuristic strategy is used to find the optimal pW and pb. The meta-heuristic strategy adopts the particle swarm optimization PSO method, and the update rule is expressed as:

[0160] v i+1 =ωv i +c1r1(p best -x i )+c2r2(g best -x i )

[0161] x i+1 =x i +v i+1

[0162] Among them, v is the velocity of the particle, x is the position of the particle (corresponding to pW and pb), and p best and g best are the individual optimal position and global optimal position of the particle respectively, ω, c1, c2 are weighting coefficients, r1, r2 are random numbers;

[0163] 3. Extract data from the training data set in batches, with each batch containing multiple samples to improve the efficiency and stability of training;

[0164] For each batch of data, the output of the model is calculated, and the loss value is calculated according to the set loss function. Specifically, the forward propagation calculates the loss by calculating the difference between the model output o and the actual label y. Suppose the classifier output is:

[0165] o=softmax(pW·X+pb)

[0166] The loss function L uses cross entropy loss, expressed as:

[0167]

[0168] 4. Use the loss function to calculate the total loss of the current model, and update the model parameters through the back propagation algorithm to minimize the total loss;

[0169] The learning rate is dynamically adjusted according to the performance changes of the model during the training process to optimize the training process. Specifically, the learning rate adjustment strategy is assumed to be performance-based adjustment, and the update method of the learning rate α is expressed as:

[0170] α new =α0×exp(-δ×E)

[0171] Among them, α new is the updated learning rate; δ is the decay rate, which indicates the speed at which the learning rate decreases; E is the current number of training cycles, and δ is set to 0.01;

[0172] The weights and biases are updated using the gradient descent method, expressed as:

[0173]

[0174]

[0175] in, and is the gradient of the loss function with respect to the weights and biases;

[0176] 7. Repeat the above steps until a preset condition for stopping iteration is met. In one embodiment, the preset condition for stopping iteration is reaching a preset maximum number of iterations, and the preset maximum number of iterations is set to 1000 times.

[0177] The beneficial effects achieved by the present invention using the above structure are as follows:

[0178] 1. The present invention combines the visual feature similarity mechanism with the generative adversarial network algorithm. The present invention can generate new images that are highly consistent with the original data set in visual features, effectively expand the training data set, and enhance the generalization ability and recognition accuracy of the model;

[0179] 2. The present invention makes innovative improvements to the loss function of the generative adversarial network and adopts a deterministic loss function, so that the generated images have sufficient variability while maintaining key visual features, thereby improving the model's adaptability to new samples and recognition accuracy;

[0180] 3. Inspired by the vortex phenomenon, the present invention proposes a new neural network parameter optimization method, which effectively solves the gradient problem and local optimal solution problem in traditional neural network training by simulating the formation, evolution and dissipation process of the vortex, and improves the performance of the feature extraction model;

[0181] 4. In the feature dimension reduction stage, the present invention adopts an adaptive loss function and a multi-objective optimization strategy, taking into account the reconstruction error and the representation ability and category separation of the features, thereby achieving effective dimension reduction and optimization of the features;

[0182] 5. During the classifier training phase, the present invention adopts a meta-heuristic strategy, such as particle swarm optimization, to perform global parameter optimization, thereby improving the performance and classification accuracy of the classifier. BRIEF DESCRIPTION OF THE DRAWINGS

[0183] Figure 1 This is a flowchart of feature extraction model training in the intelligent image recognition method based on computer vision and machine learning proposed in the present invention. DETAILED DESCRIPTION

[0184] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. The described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.

[0185] Embodiment 1:

[0186] The intelligent image recognition method based on computer vision and machine learning includes the following steps:

[0187] Step 1: Data collection and annotation;

[0188] Step 2: Data expansion;

[0189] Since the acquisition, labeling and preprocessing of training data are time-consuming and labor-intensive, and insufficient training samples can easily lead to poor generalization ability of the model and affect the accuracy of the model, a generative adversarial network algorithm based on visual feature similarity is adopted. Traditional generative adversarial network algorithms may generate images that are inconsistent with the style of the original data set when generating images, affecting the consistency of model training. The visual feature similarity mechanism is used to ensure that the generated images are highly consistent with the original data set in terms of visual features, thereby improving the quality and effect of data expansion. The loss function of the generative adversarial network is improved by using a deterministic loss function to make the generation process more focused on maintaining the key visual features of the image. Sufficient variation is used to enhance the model's adaptability to new samples and improve the quality and diversity of generated images.

[0190] Step 3: Feature extraction model training:

[0191] A 3-layer fully connected neural network is used for feature extraction. Some schemes use neural networks for feature extraction. In some neural network structures, gradient vanishing, gradient exploding or falling into local optimal solutions may occur, affecting the stability of training and the performance of the model. A vortex optimization neural network algorithm is proposed. Inspired by the vortex phenomenon, the parameters in the neural network are optimized by simulating the formation, evolution and dissipation process of the vortex. The parameters include weight w and bias b. In fluid dynamics, vortices can increase the chaos and complexity of the fluid, thereby guiding the search process in the parameter space towards a better solution. By simulating the natural process of vortices, the vortex optimization neural network aims to find parameter configurations that can minimize the neural network loss function, without relying on gradient-based neural network parameter optimization methods.

[0192] Step 4: Feature dimensionality reduction model training: input the feature-extracted data into the feature dimensionality reduction model for feature dimensionality reduction model training:

[0193] An autoencoder neural network algorithm based on multi-objective constraints is adopted. The traditional autoencoder mainly focuses on the reconstruction error, that is, the difference between input and output. Additional constraints, namely the representation ability of features and the degree of category separation, are adopted to simultaneously consider the reconstruction quality and the discriminative ability of features in a multi-objective optimization manner; an adaptive loss function is used to automatically adjust the weights of the reconstruction error and the constraints according to the training process, so as to achieve a balance between the weights of different objectives in the process of feature dimensionality reduction.

[0194] Step 5: Classifier training: input the reduced-dimensional data into the classifier for classifier training:

[0195] A neural network classifier based on a meta-heuristic strategy is used for image recognition and classification. The meta-heuristic strategy is used to optimize the parameter configuration of the classifier and find one of the optimal and approximately optimal solutions in a wide search space, thereby improving the performance of the model.

[0196] Step 6: Intelligent image recognition:

[0197] After the model training is completed, the trained model is used to process new data. In one embodiment, for the newly collected images, after feature processing by the trained feature extraction model and feature dimensionality reduction model, the obtained features are input into the classifier for classification; in one embodiment, the classification categories include three categories: natural images, animal images, and human images.

[0198] The data collected in the step 1 is derived from a public image database, field photography and digital archiving, and the collected image data is stored in JPEG format. The data collected in the step 1 is annotated by manual annotation.

[0199] The training process of the generative adversarial network algorithm based on visual feature similarity in step 2 is as follows:

[0200] 1. Select the original image dataset as the training benchmark and initialize the generative adversarial network, including the network structure and parameters of the generator and discriminator:

[0201] Specifically, let the initialization weights of the generator G and the discriminator D be b G and b D , the network structure of the generator and discriminator adopts a deep convolutional network, and its weight initialization is expressed as:

[0202]

[0203]

[0204] Among them, l represents the network layer, N(0,σ 2 ) means that 0 is the mean, σ 2 is a normal distribution with variance;

[0205] 2. For each image in the dataset, use the pre-trained deep learning model to extract its key visual features, so as to ensure the consistency of the visual features of the generated image with the original image in the subsequent process:

[0206] Specifically, for each original image x i , a pre-trained deep network F is used to extract its visual features v i , expressed as:

[0207] v i =F(x i θ F )

[0208] Among them, F represents the pre-trained model, θ F represents the model parameters;

[0209] In the process of visual feature extraction, the pre-trained deep learning model is used to extract the key visual features of the image. Let the visual feature vector of image I be V. The process is expressed as:

[0210] V=F ext (I)

[0211] In one embodiment, the pre-trained model F is composed of a multi-layer convolutional neural network, and the output of each layer is expressed as:

[0212] H l+1 =Sig(W l *H l +b l )

[0213] Among them, H l and H l+1 Represent the output feature maps of the lth layer and the l+1th layer respectively, W l and b l are the weight and bias of the first layer, * represents the convolution operation, Sig() is the Sigmoid nonlinear activation function, and finally, V is the weight of the last layer H. L It is obtained through a fully connected layer and is expressed as:

[0214] V=W fc *H L +b fc

[0215] Among them, W fc and b fcare the weights and biases of the fully connected layer;

[0216] 3. Generator G is based on the input noise z i and visual features v i Generate image It is expressed as:

[0217]

[0218] Among them, z i ~N(0,I) represents random noise from a standard normal distribution, θ G Represents the parameters of the generator;

[0219] In this process, the deterministic loss function guides the generator to produce images that are similar to the original image in visual features but different in details;

[0220] 4. The discriminator evaluates the consistency of the generated image with the original image set, and the deterministic loss function provides feedback to optimize the generation effect of the generator:

[0221] Specifically, the discriminator D generates images and the real image x i Evaluate and output the probability p of it being a real image i The way is expressed as:

[0222]

[0223] q i =D(x i θ D )

[0224] Among them, θ D Represents the parameters of the discriminator.

[0225] The deterministic loss function L combines the visual feature differences between the generated image and the real image and the output of the discriminator, and is calculated as:

[0226]

[0227] Among them, λ is a hyperparameter that balances the quality of generated images and the consistency of visual features;

[0228] 5. Through the iterative process, the parameters of the generator and discriminator are continuously optimized until the predetermined generation quality or number of iterations is reached:

[0229] Specifically, the method of updating the parameters of G and D by the gradient descent method is expressed as:

[0230]

[0231]

[0232] Among them, θ G and θ D are the parameters of the generator and discriminator before updating, θ G ' and θ D ' are the updated generator and discriminator parameters, α represents the learning rate, and the learning rate α of the generator and discriminator is set to 0.0002;

[0233] The above steps are iterated repeatedly until a preset condition for stopping iteration is met. In one embodiment, the preset condition for stopping iteration is reaching a preset maximum number of iterations, and the preset maximum number of iterations is set to 1000 times.

[0234] The training process of the vortex optimization neural network algorithm in step 3 is as follows:

[0235] 1. Randomly generate a set of vortices in the parameter space, each vortex represents a possible parameter configuration, and the parameter configuration includes weight w and bias b;

[0236] Specifically, define the neural network parameter vector P i =(w i ,b i ), where i is the vortex index; during initialization, the parameter vector P of each vortex i It is randomly generated in the parameter space and conforms to the uniform distribution. The total number of initial vortices is set to N, and the initialization process is expressed as:

[0237]

[0238] Among them, U represents uniform distribution, a and b are the lower and upper bounds of the parameter space, which are preset manually;

[0239] 2. Calculate the performance of the parameter configuration represented by each vortex on the training set and sort the vortices according to the performance;

[0240] Specifically, the performance evaluation uses the loss function L(P i ) is used to complete the evaluation. After the evaluation is completed, the vortices are sorted according to the value of the loss function:

[0241] L(P1)≤L(P2)≤…≤L(P N )

[0242] In one embodiment, the loss function L(P i ) is the cross entropy loss;

[0243] 3. Update the vortex dynamically, dynamically adjust the position and intensity of the vortex according to the ranking of the vortex and the distance between them, and simulate the interaction and evolution of the vortex;

[0244] Specifically, in the vortex dynamic update stage, the interaction of the vortices is simulated to adjust their positions in the parameter space, and the distance between vortices i and j is set to d ij =∥P i -P j ∥, then the update amount of the i-th vortex ΔP i It is expressed as:

[0245]

[0246] Among them, γ is a hyperparameter that adjusts the distance effect, F(d ij ) is a distance-based adjustment function, λ b is the adaptive vortex factor, ξ i is a regulatory factor based on environmental feedback;

[0247] In one embodiment, the distance-based adjustment function F(d ij ) is calculated using an exponential decay model to reflect the weakening of the interaction force between vortices as the distance increases, expressed as:

[0248] F(d ij )=α q exp(-β q d ij )

[0249] Among them, α q and β q is a hyperparameter that controls the magnitude and decay rate of the force. In one embodiment, the parameter α q is set to 0.5, β q is set to 0.1; d ij represents the distance between vortex i and vortex j, which is calculated based on the Euclidean distance of the parameter vectors representing the two vortices and is expressed as:

[0250]

[0251] Where D is the dimension of the parameter vector, P ik and P jk are the parameter values ​​of vortex i and vortex j in the kth dimension respectively;

[0252] Adaptive swirl factor λ b It is calculated by adaptive vortex guided learning, and the information entropy H of vortex distribution is defined as:

[0253]

[0254] Among them, p iis the proportion of the i-th vortex in all vortices, which is calculated by the inverse of the vortex loss function and is expressed as:

[0255]

[0256] According to the change of information entropy, the adaptive vortex factor λ b The search strategy for adjusting the vortex is calculated as:

[0257]

[0258] Among them, κ is a preset maximum regulation strength, H max is the maximum information entropy value that can be achieved theoretically, indicating a completely uniform distribution state, μ i is the momentum adjustment factor, M i is the average momentum vector of vortex i in the most recent T iterations;

[0259] Momentum adjustment factor μ i and the average momentum vector M i It is obtained through time series momentum adjustment. The time series momentum adjustment aims to adjust the exploration trend of the vortex by analyzing its historical movement trend in the parameter space, considering the movement direction and speed of the vortex in the historical iteration, calculating its momentum, and then using this momentum information to guide future parameter updates;

[0260] Specifically, calculate the average momentum vector M of vortex i in the last T iterations i It is expressed as:

[0261]

[0262] in, is the parameter vector of vortex i after the tth iteration, is the parameter vector after the t-1th iteration;

[0263] Define the momentum adjustment factor μ i Used to measure the size and consistency of momentum, expressed as:

[0264] μ i =∥M i ∥·cos(θ i )

[0265] Among them, θ i It is M i and The angle between is used to measure the consistency between the latest moving direction and the average momentum direction. The smaller the angle, the more consistent the momentum.

[0266] The calculation method of the adjustment factor based on environmental feedback is expressed as:

[0267] ξ i =Sig(E(P i ))

[0268] Among them, Sig() is the Sigmoid mapping function, which maps the environmental feedback to the (0, 1) interval. i ) is the environmental feedback function, which is used to evaluate the characteristics of the environment around vortex i. The calculation method is expressed as:

[0269]

[0270] in, is the Hessian matrix of the loss function at the vortex i position, which is used to evaluate the local concavity, is the modulus of the gradient, used to assess the steepness of the parameter space;

[0271] 4. Simulate the merging and splitting phenomena of vortices in nature to promote the diversity of solution space and explore new parameter areas. Specifically, set the merging threshold T m and the splitting threshold T s , when the distance between the two vortices is less than T m When the strength of a vortex exceeds T s When , it will split into two vortices, and the merging operation is expressed as:

[0272]

[0273] Among them, L(P i ) and L(P j ) is the loss function value corresponding to vortex i and vortex j;

[0274] The split operation is expressed as:

[0275] P i1 =P i +δ q

[0276] P i2 =P i -δ q

[0277] Among them, δ q is a random perturbation vector based on the parameter vector of vortex i, used to generate the parameters of two new vortices;

[0278] The random perturbation vector δ is generated based on the local gradient information of the current vortex position to increase the randomness and exploration of the search process. The calculation method is expressed as:

[0279]

[0280] Among them, q and ε q is a hyperparameter that controls the gradient direction and random perturbation intensity, and g represents the vortex position P i The gradient information calculated at N(0,Σδ q ) has a mean of 0 and a covariance matrix of Σδ q Gaussian noise, in one embodiment, ζ q is set to 1.0, ε q is set to 0.1;

[0281] 5. Select the best performing vortex and perform local search to fine-tune its parameters, simulating the local absorption and energy concentration phenomenon of the vortex in the fluid. For the best performing vortex, perform local search to further fine-tune its parameters, which is achieved through a field-based search strategy;

[0282] Specifically, in the domain-based search strategy, the local search method is expressed as:

[0283] P i '=P i +η m ·N(0,Σ loc )

[0284] Among them, η m is the learning rate, N(0,Σ loc ) takes 0 as the mean, Σ loc is the Gaussian distribution of the covariance matrix, used to generate random perturbations of the parameters;

[0285] Covariance matrix Σ loc According to the historical moving direction and speed of the vortex in the parameter space, it is dynamically adjusted to adapt to different search stages and characteristics. Its update strategy is expressed as:

[0286]

[0287] in, is the adjusted covariance matrix, is the covariance matrix before adjustment, ρ n is a learning rate parameter used to control the influence of historical information on the current search. In one embodiment, ρ n is set to 0.2;

[0288] 6. Perform vortex attenuation to simulate the dissipation process of vortex energy in nature, gradually eliminate vortices with poor performance, and release resources to newly generated or better performing vortices. Specifically, the attenuation process can be achieved by adjusting the life value of the vortex. Vortices with a life value below a certain threshold will be eliminated. Set the life value of vortex i to Li , the decay rule is:

[0289]

[0290] in, is the health value after decay, δ L is the amount of health reduction;

[0291] 7. Repeat steps 2 to 6 until the preset maximum number of iterations is reached. After each round of iteration, the state of the vortices is updated and their performance is re-evaluated to ensure that the algorithm progresses toward the optimal solution. In one embodiment, the maximum number of iterations is set to 1000.

[0292] The training process of the autoencoder neural network algorithm based on multi-objective constraints in step 4 is as follows:

[0293] 1. Initialize the network parameters of the autoencoder, including the weights and biases of the encoder and decoder. The encoder part of the autoencoder is represented by parameters eW and eb, and the decoder part is represented by parameters dW and db. The parameters of the autoencoder are initialized by random initialization.

[0294] 2. The input image is converted into a low-dimensional feature representation by the encoder, and the low-dimensional feature is reconstructed into an image by the decoder. Specifically, let the input image be represented as X, the encoder maps X to the hidden layer Z, and then the decoder reconstructs Z into The encoding process is expressed as:

[0295] Z=Re(eW·X+eb)

[0296] And the decoding process is expressed as:

[0297]

[0298] Where Re() is the ReLU activation function used by the encoder and decoder;

[0299] 3. Calculate the reconstruction error to evaluate the similarity between the reconstructed image and the original image, and calculate additional constraint losses to ensure that the features after dimensionality reduction have good discriminative ability;

[0300] Specifically, the total loss includes the reconstruction error loss L recon and the additional constraint loss L const , the reconstruction error is calculated using the mean square error, expressed as:

[0301]

[0302] The constraint loss depends on the specific constraint target. In one embodiment, a sparsity constraint is adopted, which is expressed as:

[0303]

[0304] Among them, λ is a hyperparameter that adjusts the constraint strength, Z j is the jth element of feature layer Z;

[0305] 4. Dynamically adjust the weight between reconstruction error and constraint loss according to the training progress to find the optimal training balance;

[0306] Specifically, in order to balance the reconstruction error and constraint loss, an adaptive mechanism is used to adjust the λ value, which is dynamically completed based on the training progress or the change of the loss value, expressed as:

[0307] λ new =Adapt(λ,epoch,L recon ,L const )

[0308] Wherein, Adapt is a function that adjusts λ according to the current training cycle epoch, reconstruction error, and constraint loss. In one embodiment, the way Adapt() adjusts λ adopts a dynamic adjustment strategy based on training progress, which is expressed as:

[0309]

[0310] Among them, epoch max Represents the total number of training cycles, β is a coefficient used to balance the proportion of reconstruction error and constraint loss. The value of λ is gradually reduced as the training progresses. Considering the ratio between reconstruction error and constraint loss, the importance of both is adaptively adjusted. β is set to 0.3;

[0311] 5. Based on the total loss L total =L recon +L const The network parameters eW, eb, dW, db are updated through the back propagation algorithm. Specifically, the parameters are updated using the gradient descent method, which is expressed as:

[0312]

[0313]

[0314]

[0315]

[0316] Where α is the learning rate. Preferably, α is set to 0.01;

[0317] Encoder weight update term The calculation method is expressed as:

[0318]

[0319] Among them, the partial derivative of the reconstruction error with respect to the weight and the partial derivative of the constraint loss with respect to the weight Further expanding through the chain rule, taking the reconstruction error as an example, the specific calculation method may involve the path of error back propagation to the encoder weight, expressed as:

[0320]

[0321] 6. Repeat the above steps until a preset condition for stopping iteration is met. In one embodiment, the preset condition for stopping iteration is reaching a preset maximum number of iterations, and the preset maximum number of iterations is set to 1000 times.

[0322] The training process of the neural network classifier based on the meta-heuristic strategy in step 5 is as follows:

[0323] 1. Initialize the neural network model parameters and configuration, including weights, biases, and learning rates. Let pW and pb represent the weight and bias parameters of the classifier. The weight pW is initialized by normal distribution. The initialization is expressed as:

[0324] pW~N(0,σ 2 )

[0325] Among them, σ 2 is the variance;

[0326] The bias pb is initialized to 0, expressed as:

[0327] pb=0

[0328] The neural network classifier is a 3-layer neural network model;

[0329] 2. Use meta-heuristic strategies to globally optimize the initial parameters of the model and determine the most promising parameter configuration as the starting point for training;

[0330] Specifically, the objective function f(pW, pb) is set as the classification accuracy based on the validation set, and the meta-heuristic strategy is used to find the optimal pW and pb. The meta-heuristic strategy adopts the particle swarm optimization PSO method, and the update rule is expressed as:

[0331] v i+1 =ωv i +c1r1(p best -x i )+c2r2(g best -x i )

[0332] x i+1 =xi +v i+1

[0333] Among them, v is the velocity of the particle, x is the position of the particle (corresponding to pW and pb), and p best and g best are the individual optimal position and global optimal position of the particle respectively, ω, c1, c2 are weighting coefficients, r1, r2 are random numbers;

[0334] 3. Extract data from the training data set in batches, with each batch containing multiple samples to improve the efficiency and stability of training;

[0335] For each batch of data, the output of the model is calculated, and the loss value is calculated according to the set loss function. Specifically, the forward propagation calculates the loss by calculating the difference between the model output o and the actual label y. Suppose the classifier output is:

[0336] o=softmax(pW·X+pb)

[0337] The loss function L uses cross entropy loss, expressed as:

[0338]

[0339] 4. Use the loss function to calculate the total loss of the current model, and update the model parameters through the back propagation algorithm to minimize the total loss;

[0340] The learning rate is dynamically adjusted according to the performance changes of the model during the training process to optimize the training process. Specifically, the learning rate adjustment strategy is assumed to be performance-based adjustment, and the update method of the learning rate α is expressed as:

[0341] α new =α0×exp(-δ×E)

[0342] Among them, α new is the updated learning rate; δ is the decay rate, which indicates the speed at which the learning rate decreases; E is the current number of training cycles, and δ is set to 0.01;

[0343] The weights and biases are updated using the gradient descent method, expressed as:

[0344]

[0345]

[0346] in, and is the gradient of the loss function with respect to the weights and biases;

[0347] 7. Repeat the above steps until a preset condition for stopping iteration is met. In one embodiment, the preset condition for stopping iteration is reaching a preset maximum number of iterations, and the preset maximum number of iterations is set to 1000 times.

[0348] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

[0349] The present invention and its embodiments are described above, and such description is not restrictive. The drawings show only one embodiment of the present invention, and the actual structure is not limited thereto. In short, if ordinary technicians in the field are inspired by it, without departing from the purpose of the invention, they can design a structure and embodiment similar to the technical solution without creativity, which should belong to the protection scope of the present invention.

Claims

1. An intelligent image recognition method based on computer vision and machine learning, comprising the following steps: Step 1: Data collection and annotation; Step 2: Data expansion; The generative adversarial network algorithm based on visual feature similarity is adopted, and the visual feature similarity mechanism is used to ensure that the generated image maintains a high degree of consistency with the original dataset in terms of visual features. The loss function of the generative adversarial network is improved, and a deterministic loss function is used to make the generation process more focused on maintaining the key visual features of the image, and sufficient variation is adopted. Step 3: Feature extraction model training: A 3-layer fully connected neural network is used for feature extraction. A vortex optimization neural network algorithm is proposed. Inspired by the vortex phenomenon, the parameters in the neural network are optimized by simulating the formation, evolution and dissipation process of the vortex. The parameters include weight w and bias b. By simulating the natural process of the vortex, the vortex optimization neural network is constructed. Step 4: Feature dimensionality reduction model training: input the feature extracted data into the feature dimensionality reduction model for feature dimensionality reduction model training: An autoencoder neural network algorithm based on multi-objective constraints is adopted. Additional constraints, namely the representation ability of features and the degree of category separation, are adopted to simultaneously consider the reconstruction quality and the discriminative ability of features in a multi-objective optimization manner. An adaptive loss function is used to automatically adjust the weights of the reconstruction error and the constraints according to the training process, so as to achieve a balance between the weights of different objectives in the process of feature dimensionality reduction. Step 5: Classifier training: input the reduced-dimensional data into the classifier for classifier training: A neural network classifier based on a meta-heuristic strategy is used for image recognition and classification. The meta-heuristic strategy is used to optimize the parameter configuration of the classifier and find one of the optimal and approximately optimal solutions in a wide search space. Step 6: Intelligent image recognition: After the model training is completed, the trained model is used to process new data. In one embodiment, for the newly collected images, after feature processing by the trained feature extraction model and feature dimensionality reduction model, the obtained features are input into the classifier for classification; in one embodiment, the classification categories include three categories: natural images, animal images, and human images.

2. The intelligent image recognition method based on computer vision and machine learning according to claim 1, characterized in that: The data collected in the step 1 is derived from a public image database, field photography and digital archiving, and the collected image data is stored in JPEG format. The data collected in the step 1 is annotated by manual annotation.

3. The intelligent image recognition method based on computer vision and machine learning according to claim 1, characterized in that: The training process of the generative adversarial network algorithm based on visual feature similarity in step 2 is as follows: 1) Select the original image dataset as the training benchmark and initialize the generative adversarial network, including the network structure and parameters of the generator and discriminator: Specifically, let the initialization weights of the generator G and the discriminator D be b G and b D , the network structure of the generator and discriminator adopts a deep convolutional network, and its weight initialization is expressed as: Among them, l represents the network layer, N(0,σ 2 ) means that 0 is the mean, σ 2 is a normal distribution with variance; 2) For each image in the dataset, use the pre-trained deep learning model to extract its key visual features: Specifically, for each original image x i , a pre-trained deep network F is used to extract its visual features v i , expressed as: vi=F(xi;θ F ) Among them, F represents the pre-trained model, θ F represents the model parameters; In the process of visual feature extraction, the pre-trained deep learning model is used to extract the key visual features of the image. Let the visual feature vector of image I be V. The process is expressed as: V=F ext (I) In one embodiment, the pre-trained model F is composed of a multi-layer convolutional neural network, and the output of each layer is expressed as: H l+1 =Sig(W l *H l +b l ) Among them, H l and H l+1 Represent the output feature maps of the lth layer and the l+1th layer respectively, W l and b l are the weight and bias of the first layer, * represents the convolution operation, Sig() is the Sigmoid nonlinear activation function, and finally, V is the weight of the last layer H. L It is obtained through a fully connected layer and is expressed as: V=W fc *H L +b fc Among them, W fc and b fc are the weights and biases of the fully connected layer; 3) Generator G is based on the input noise z i and visual features v i Generate image It is expressed as: Among them, z i ~N(0,I) represents random noise from a standard normal distribution, θ G Represents the parameters of the generator; In this process, the deterministic loss function guides the generator to produce images that are similar to the original image in visual features but different in details; 4) The discriminator evaluates the consistency of the generated image with the original image set, and the deterministic loss function provides feedback to optimize the generation effect of the generator: Specifically, the discriminator D generates images and the real image x i Evaluate and output the probability p of it being a real image i The way is expressed as: q i =D(x i ;θ D ) Among them, θ D Represents the parameters of the discriminator. The deterministic loss function L combines the visual feature differences between the generated image and the real image and the output of the discriminator, and is calculated as: Among them, λ is a hyperparameter that balances the quality of generated images and the consistency of visual features; 5) Through the iterative process, the parameters of the generator and discriminator are continuously optimized until the predetermined generation quality or number of iterations is reached: Specifically, the method of updating the parameters of G and D by the gradient descent method is expressed as: Among them, θ G and θ D are the parameters of the generator and discriminator before updating, θ G ' and θ D ' are the updated generator and discriminator parameters, α represents the learning rate, and the learning rate α of the generator and discriminator is set to 0.0002; The above steps are iterated repeatedly until a preset condition for stopping iteration is met. In one embodiment, the preset condition for stopping iteration is reaching a preset maximum number of iterations, and the preset maximum number of iterations is set to 1000 times.

4. The intelligent image recognition method based on computer vision and machine learning according to claim 1, characterized in that: The training process of the vortex optimization neural network algorithm in step 3 is as follows: 1) A set of vortices is randomly generated in the parameter space, each of which represents a possible parameter configuration, which includes weight w and bias b; Specifically, define the neural network parameter vector P i =(w i ,b i ), where i is the vortex index; During initialization, the parameter vector P of each vortex i It is randomly generated in the parameter space and conforms to the uniform distribution. The total number of initial vortices is set to N, and the initialization process is expressed as: Among them, U represents uniform distribution, a and b are the lower and upper bounds of the parameter space, which are preset manually; 2) Calculate the performance of the parameter configuration represented by each vortex on the training set and rank the vortices according to the performance; Specifically, the performance evaluation uses the loss function L(P i ) is used to complete the evaluation. After the evaluation is completed, the vortices are sorted according to the value of the loss function: L(P1)≤L(P2)≤…≤L(P N ) In one embodiment, the loss function L(P i ) is the cross entropy loss; 3) Perform vortex dynamic updates, dynamically adjust the position and intensity of vortices according to the ranking of vortices and the distance between them, and simulate the interaction and evolution of vortices; Specifically, in the vortex dynamic update stage, the interaction of the vortices is simulated to adjust their positions in the parameter space, and the distance between vortices i and j is set to d ij =∥P i -P j ∥, then the update amount of the i-th vortex ΔP i It is expressed as: Among them, γ is a hyperparameter that adjusts the distance effect, F(d ij ) is a distance-based adjustment function, λ b is the adaptive vortex factor, ξ i is a regulatory factor based on environmental feedback; In one embodiment, the distance-based adjustment function F(d ij ) is calculated using an exponential decay model to reflect the weakening of the interaction force between vortices as the distance increases, expressed as: F(d ij )=a q exp(-β q d ij ) Among them, α q and β q is a hyperparameter that controls the magnitude and decay rate of the force. In one embodiment, the parameter α q is set to 0.5, β q is set to 0.1; d ij represents the distance between vortex i and vortex j, which is calculated based on the Euclidean distance of the parameter vectors represented by the two vortices and is expressed as: Where D is the dimension of the parameter vector, P ik and P jk are the parameter values ​​of vortex i and vortex j in the kth dimension respectively; Adaptive swirl factor λ b It is calculated by adaptive vortex guided learning, and the information entropy H of vortex distribution is defined as: Among them, p i is the proportion of the i-th vortex in all vortices, which is calculated by the inverse of the vortex loss function and is expressed as: According to the change of information entropy, the adaptive vortex factor λ b The search strategy for adjusting the vortex is calculated as: Among them, κ is a preset maximum regulation strength, H max is the maximum information entropy value that can be achieved theoretically, indicating a completely uniform distribution state, μ i is the momentum adjustment factor, M i is the average momentum vector of vortex i in the most recent T iterations; Momentum adjustment factor μ i and the average momentum vector M i It is obtained through time series momentum adjustment. The time series momentum adjustment aims to adjust the exploration trend of the vortex by analyzing its historical movement trend in the parameter space, considering the movement direction and speed of the vortex in the historical iteration, calculating its momentum, and then using this momentum information to guide future parameter updates; Specifically, calculate the average momentum vector M of vortex i in the last T iterations i It is expressed as: in, is the parameter vector of vortex i after the tth iteration, is the parameter vector after the t-1th iteration; Define the momentum adjustment factor μ i Used to measure the size and consistency of momentum, expressed as: m i =∥M i ∥·cos(θ i ) Among them, θ i It is M i and The angle between is used to measure the consistency between the latest moving direction and the average momentum direction. The smaller the angle, the more consistent the momentum. The calculation method of the adjustment factor based on environmental feedback is expressed as: ξ i =Mr(E(P i )) Among them, Sig() is the Sigmoid mapping function, which maps the environmental feedback to the (0, 1) interval. i ) is the environmental feedback function, which is used to evaluate the characteristics of the environment around vortex i. The calculation method is expressed as: in, is the Hessian matrix of the loss function at the vortex i position, which is used to evaluate the local concavity, is the modulus of the gradient, used to assess the steepness of the parameter space; 4) Simulate the merging and splitting phenomena of vortices in nature to promote the diversity of solution space and explore new parameter regions. Specifically, set the merging threshold T m and the splitting threshold T s , when the distance between the two vortices is less than T m When the strength of a vortex exceeds T s When , it will split into two vortices, and the merging operation is expressed as: Among them, L(P i ) and L(P j ) is the loss function value corresponding to vortex i and vortex j; The split operation is expressed as: P i1 =P i +d q P i2 =P i -d q Among them, δ q is a random perturbation vector based on the parameter vector of vortex i, used to generate the parameters of two new vortices; The random perturbation vector δ is generated based on the local gradient information of the current vortex position to increase the randomness and exploration of the search process. The calculation method is expressed as: Among them, q and ε q is a hyperparameter that controls the gradient direction and random perturbation intensity, and g represents the vortex position P i The gradient information calculated at The mean is 0 and the covariance matrix is Gaussian noise, in one embodiment, ζ q is set to 1.0, ε q is set to 0.1; 5) Select the best performing vortex and perform local search to fine-tune its parameters, simulating the local absorption and energy concentration phenomenon of the vortex in the fluid. For the best performing vortex, perform local search to further fine-tune its parameters, which is achieved through a field-based search strategy; Specifically, in the domain-based search strategy, the local search method is expressed as: P i ′=P i +n m ·N(0,Σ loc ) Among them, η m is the learning rate, N(0,Σ loc ) takes 0 as the mean, Σ loc is the Gaussian distribution of the covariance matrix, used to generate random perturbations of the parameters; Covariance matrix Σ loc According to the historical moving direction and speed of the vortex in the parameter space, it is dynamically adjusted to adapt to different search stages and characteristics. Its update strategy is expressed as: in, is the adjusted covariance matrix, is the covariance matrix before adjustment, ρ n is a learning rate parameter used to control the influence of historical information on the current search. In one embodiment, ρ n is set to 0.2; 6) Perform vortex decay, simulating the dissipation process of vortex energy in nature, gradually eliminating vortices with poor performance, and releasing resources to newly generated or better performing vortices. Specifically, the decay process can be achieved by adjusting the life value of the vortex. Vortices with a life value below a certain threshold will be eliminated. The life value of vortex i is set to L i , the decay rule is: in, is the health value after decay, δ L is the amount of health reduction; 7) Repeat steps 2 to 6 until a preset maximum number of iterations is reached. After each iteration, the state of the vortices is updated and their performance is re-evaluated. In one embodiment, the maximum number of iterations is set to 1000.

5. The intelligent image recognition method based on computer vision and machine learning according to claim 1, characterized in that: The training process of the autoencoder neural network algorithm based on multi-objective constraints in step 4 is as follows: 1) Initialize the network parameters of the autoencoder, including the weights and biases of the encoder and decoder. The encoder part of the autoencoder is represented by parameters eW and eb, and the decoder part is represented by parameters dW and db. The parameters of the autoencoder are initialized by random initialization. 2) The input image is converted into a low-dimensional feature representation by the encoder, and the low-dimensional feature is reconstructed into an image by the decoder. Specifically, let the input image be represented as X, the encoder maps X to the hidden layer Z, and then the decoder reconstructs Z into X. The encoding process is expressed as: Z=Re(eW·X+eb) And the decoding process is expressed as: Where Re() is the ReLU activation function used by the encoder and decoder; 3) Calculate the reconstruction error to evaluate the similarity between the reconstructed image and the original image, and calculate additional constraint losses to ensure that the features after dimensionality reduction have good discriminative ability; Specifically, the total loss includes the reconstruction error loss L recon and an additional constraint loss L const , the reconstruction error is calculated using the mean square error, expressed as: The constraint loss depends on the specific constraint target. In one embodiment, a sparsity constraint is adopted, which is expressed as: Among them, λ is a hyperparameter that adjusts the constraint strength, Z j is the jth element of feature layer Z; 4) Dynamically adjust the weight between reconstruction error and constraint loss according to the training progress to find the optimal training balance; Specifically, in order to balance the reconstruction error and constraint loss, an adaptive mechanism is used to adjust the λ value, which is dynamically completed based on the training progress or the change of the loss value, expressed as: λ new =Adapt(λ,epoch,L recon ,L const ) Wherein, Adapt is a function that adjusts λ according to the current training cycle epoch, reconstruction error, and constraint loss. In one embodiment, the way Adapt() adjusts λ adopts a dynamic adjustment strategy based on training progress, which is expressed as: Among them, epoch max Represents the total number of training cycles, β is a coefficient used to balance the proportion of reconstruction error and constraint loss. The value of λ is gradually reduced as the training progresses. Considering the ratio between reconstruction error and constraint loss, the importance of both is adaptively adjusted. β is set to 0.3; 5) Based on the total loss L total =L recon +L const The network parameters eW, eb, dW, db are updated through the back propagation algorithm. Specifically, the parameters are updated using the gradient descent method, which is expressed as: Where α is the learning rate. Preferably, α is set to 0.01; Encoder weight update term The calculation method is expressed as: Among them, the partial derivative of the reconstruction error with respect to the weight and the partial derivative of the constraint loss with respect to the weight Further expanding through the chain rule, taking the reconstruction error as an example, the specific calculation method may involve the path of error back propagation to the encoder weight, expressed as: 6) Repeat the above steps until a preset stop iteration condition is met. In one embodiment, the preset stop iteration condition is reaching a preset maximum number of iterations, and the preset maximum number of iterations is set to 1000 times.

6. The intelligent image recognition method based on computer vision and machine learning according to claim 1, characterized in that: The training process of the neural network classifier based on the meta-heuristic strategy in step 5 is as follows: 1) Initialize the neural network model parameters and configuration, including weights, biases, and learning rates. Let pW and pb represent the weight and bias parameters of the classifier. The weight pW is initialized by normal distribution. The initialization is expressed as: pW~N(0,σ 2 ) Among them, σ 2 is the variance; The bias pb is initialized to 0, expressed as: pb=0 The neural network classifier is a 3-layer neural network model; 2) Use meta-heuristic strategies to globally optimize the initial parameters of the model and determine the most promising parameter configuration as the starting point for training; Specifically, the objective function f(pW, pb) is set as the classification accuracy based on the validation set, and the meta-heuristic strategy is used to find the optimal pW and pb. The meta-heuristic strategy adopts the particle swarm optimization PSO method, and the update rule is expressed as: v i+1 =ωv i +c1r1(p best -x i )+c2r2(g best -x i ) x i+1 =x i +v i+1 Among them, v is the velocity of the particle, x is the position of the particle (corresponding to pW and pb), and p best and g best are the individual optimal position and global optimal position of the particle respectively, ω, c1, c2 are weighting coefficients, r1, r2 are random numbers; 3) Extract data from the training data set in batches, where each batch contains multiple samples; For each batch of data, the output of the model is calculated, and the loss value is calculated according to the set loss function. Specifically, the forward propagation calculates the loss by calculating the difference between the model output o and the actual label y. Suppose the classifier output is: o=softmax(pW·X+pb) The loss function L uses cross entropy loss, expressed as: 4) Use the loss function to calculate the total loss of the current model, and update the model parameters through the back-propagation algorithm to minimize the total loss; The learning rate is dynamically adjusted according to the performance changes of the model during the training process to optimize the training process. Specifically, the learning rate adjustment strategy is assumed to be performance-based adjustment, and the update method of the learning rate α is expressed as: a new =α0×exp(-δ×E) Among them, α new is the updated learning rate; δ is the decay rate, which indicates the speed at which the learning rate decreases; E is the current number of training cycles, and δ is set to 0.01; The weights and biases are updated using the gradient descent method, expressed as: in, and is the gradient of the loss function with respect to the weights and biases; 7. Repeat the above steps until a preset condition for stopping iteration is met. In one embodiment, the preset condition for stopping iteration is reaching a preset maximum number of iterations, and the preset maximum number of iterations is set to 1000 times.

Citation Information

Cited By

  • Drilling fluid performance evaluation method based on multi-source measurement data fusion

    CN118690155A

  • Training method and device of image recognition model and image recognition method and device

    CN119580358A

  • Image recognition model training method and device, and image recognition method and device

    CN119580358B

  • Model training method, driver state monitoring method and system

    CN119723232A

  • Animal three-dimensional attitude estimation method, device and equipment and storage medium

    CN120108036A