Image classification method and system based on machine vision

Through machine vision-based image classification method, preprocessing, feature extraction and model training and other technologies, the problems of inefficiency and limited generalization capabilities of traditional image classification methods are solved, and more efficient and adaptive image classification performance is achieved.

CN119399559BActive Publication Date: 2025-04-04GUANGZHOU YIDE AUTOMATION INSTR CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510000433.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-02
Publication Date
2025-04-04
Estimated Expiration
2045-01-02

AI Technical Summary

Technical Problem

Traditional image classification methods are inefficient and have limited generalization capabilities, making it difficult to deal with complex and changeable image data.

Method used

A machine vision-based image classification method is designed, which preprocesses, feature extraction, and dimensionality reduction by obtaining the initial image set, and uses pre-trained models for training and classification, and combines the Dune Cat algorithm for image recommendation.

Benefits of technology

It improves the accuracy and efficiency of image classification, enhances the adaptability of classification performance, and avoids the cumbersome manual design feature process in traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119399559B_ABST
    Figure CN119399559B_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, and discloses an image classification method and system based on machine vision, which comprises the following steps: obtaining an initial image set collected by a visual device, performing a preprocessing operation on image data in the initial image set to obtain a first image set; performing feature extraction on the image data in the first image set to obtain a second image set, performing dimensionality reduction processing on the second image set to obtain an input image set; splitting the input image set into a training data set and a test data set, and inputting the training data set to train a pre-trained model; taking the classification accuracy of the test data set as an evaluation index of the training result, updating the weight, determining the model parameter value, and outputting an image classification model; adopting the image classification model to classify images in a platform, and performing category marking, adopting a SandCat algorithm to recommend images according to the search information of users, and outputting the image classification result based on the search information; the invention improves the accuracy and efficiency of classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to an image classification method and system based on machine vision. Background Art

[0002] With the rapid development of big data and cloud computing technology, image data has exploded. How to effectively classify and identify these massive amounts of image data has become a hot topic in current research. Traditional image classification methods mainly rely on manually designed features and classifiers, which are not only inefficient, but also have limited generalization capabilities and are difficult to cope with complex and changing image data. Therefore, studying an image classification method and system based on machine vision is of great significance to improving classification accuracy and efficiency. Summary of the invention

[0003] The purpose of the present invention is to solve the above problems and to design an image classification method and system based on machine vision.

[0004] A first aspect of the present invention provides an image classification method based on machine vision, the image classification method based on machine vision comprising the following steps:

[0005] Acquire an initial image set collected by a visual device, and perform a preprocessing operation on image data in the initial image set to obtain a first image set;

[0006] Performing feature extraction on image data in the first image set to obtain a second image set, and performing dimensionality reduction processing on the second image set to obtain an input image set;

[0007] Splitting the input image set into a training data set and a test data set, obtaining a pre-trained model, initializing parameters, and inputting the training data set to train the pre-trained model;

[0008] Using the trained model, the classification accuracy of the test data set is used as an evaluation indicator of the training result, and the weights are updated, the model parameter values ​​are determined, and the image classification model is output;

[0009] The image classification model is used to classify the images in the platform and mark the categories, and the SandCat algorithm is used to recommend images according to the user's search information, and the image classification results are output based on the search information;

[0010] The step of performing feature extraction on the image data in the first image set to obtain the second image set includes:

[0011] Acquire image data in the first image set, and construct a scale space for the image data in the first image set;

[0012] The FAST algorithm with local adaptive threshold is used to detect feature points at each scale, and the detected feature points are used as initial feature points;

[0013] Constructing a Gaussian pyramid, performing extreme value comparison between the initial feature point and its neighborhood and points of upper and lower scales in the Gaussian pyramid, and determining whether the initial feature point is a maximum value or a minimum value;

[0014] If yes, the initial feature point is determined as the final feature point. If no, the extreme point closest to the center is searched within the neighborhood of the initial feature point as the final feature point.

[0015] The extracted final feature points are obtained and described using SIFT descriptors to generate corresponding feature vectors and a second image set.

[0016] Optionally, in a first implementation manner of the first aspect of the present invention, the acquiring an initial image set collected by a visual device and performing a preprocessing operation on image data in the initial image set to obtain a first image set includes:

[0017] Acquire image data in the initial image set, and convert the image data in the initial image set into a grayscale image;

[0018] Using a Gaussian filtering method to perform filtering and smoothing processing on the grayscale image to obtain a smoothed image;

[0019] Calculating the gradient of each pixel in the smoothed image, performing non-maximum suppression on the gradient amplitude, determining a local maximum point in each gradient direction, and determining the local maximum point as an edge point to obtain an edge extracted image;

[0020] An adaptive histogram equalization method is used to perform contrast enhancement processing on the edge-extracted image to obtain an enhanced image, and a first image set is generated.

[0021] Optionally, in a second implementation manner of the first aspect of the present invention, performing dimensionality reduction processing on the second image set to obtain an input image set includes:

[0022] Acquire feature vectors in the second image set, process the feature vectors in the second image set by normalization, and map the processed feature vectors to a high-dimensional space by using a nonlinear mapping function;

[0023] The initial matrix is ​​constructed by using the Gaussian kernel function, and the similarity measure between each pair of data points in the eigenvector is calculated to obtain the matrix to be processed;

[0024] Centralize the matrix to be processed, and perform eigenvalue decomposition on the centralized matrix to be processed to extract eigenvectors corresponding to the first k eigenvalues, where k=1,2,...,k;

[0025] Based on the eigenvectors corresponding to the first k eigenvalues, a feature matrix composed of the first k principal components is calculated, and the image is reconstructed based on the feature matrix to obtain an input image set.

[0026] Optionally, in a third implementation of the first aspect of the present invention, splitting the input image set into a training data set and a test data set, obtaining a pre-trained model, initializing parameters, and inputting the training data set to train the pre-trained model, comprising:

[0027] Obtaining a sample feature map in the training data set, and inputting the sample feature map into a pre-training model, wherein the pre-training model is constructed based on a convolutional neural network;

[0028] Perform overlapping block processing through the deep position encoding overlapping block embedding module of the pre-trained model to obtain pixel blocks with local overlapping details and edge information;

[0029] The obtained pixel blocks are linearly mapped to output features, and a deep convolution is performed using the deep attention module to obtain the weight information of the pixel blocks, and the corresponding position information is added to obtain a feature sequence with position information;

[0030] Multiply the feature with position information with the sample feature map, fuse the position information and local features, and obtain the feature map;

[0031] The K-Means clustering algorithm is used to cluster the generated feature maps. After pruning, the recognition accuracy is determined. The upper confidence function is used as the acquisition function to predict the candidate parameter combination with the highest acquisition value. The model corresponding to the candidate parameter combination is trained based on the prediction results.

[0032] Optionally, in a fourth implementation of the first aspect of the present invention, clustering the generated feature graphs using a K-Means clustering algorithm includes:

[0033] Obtaining the generated feature graph, obtaining a feature set, setting the number of cluster centers, and calculating the cluster center point value based on the feature set;

[0034] Calculate the distance between the sample point of each feature map and the cluster center value, and divide similar feature maps into the same cluster according to the calculation results. The feature maps with smaller distances and the corresponding convolution kernels are cut off.

[0035] Update the center point value according to the new cluster, and update iteratively until the center point and sample point of each cluster remain unchanged.

[0036] Optionally, in a fifth implementation of the first aspect of the present invention, the using of the SandCat algorithm to perform image recommendation according to the user's search information, and outputting image classification results based on the search information, includes:

[0037] Obtain the user's search information, set the initial parameters, use the singer mapping to initialize the population, use the refraction reverse learning strategy to optimize the population position and calculate the fitness value of each sand dune cat;

[0038] Use the roulette wheel selection algorithm to select an angle for each sand dune cat and determine the value of the parameter R in the sand dune cat algorithm;

[0039] If R>1, the sand dune cat group switches to the exploration stage and updates its position; if R≤1, the sand dune cat group switches to the attack and exploitation stage and updates its position;

[0040] When the maximum number of iterations is reached, if yes, the loop ends, the optimal solution is output, and the image classification result is output based on the search information.

[0041] A second aspect of the present invention provides an image classification system based on machine vision, the image classification system based on machine vision comprising a preprocessing module, a feature extraction module, a training module, an updating module and a classification module, wherein the preprocessing module is used to obtain an initial image set collected by a visual device, perform a preprocessing operation on the image data in the initial image set, and obtain a first image set;

[0042] A feature extraction module, configured to extract features from the image data in the first image set to obtain a second image set, and perform dimensionality reduction processing on the second image set to obtain an input image set;

[0043] A training module is used to split the input image set into a training data set and a test data set, obtain a pre-trained model, initialize parameters, and input the training data set to train the pre-trained model;

[0044] An updating module is used to use the trained model to take the classification accuracy of the test data set as an evaluation indicator of the training result, update the weights, determine the model parameter values, and output the image classification model;

[0045] A classification module is used to classify images in the platform using the image classification model, mark the images by category, recommend images based on the user's search information, and output image classification results;

[0046] The feature extraction module includes a construction submodule, a detection submodule, a comparison submodule, a search submodule and a description submodule, wherein the construction submodule is used to obtain image data in the first image set and construct a scale space for the image data in the first image set;

[0047] The detection submodule is used to detect feature points at each scale using the FAST algorithm with a local adaptive threshold, and use the detected feature points as initial feature points;

[0048] A comparison submodule is used to construct a Gaussian pyramid, compare the initial feature point with its neighborhood and the points of the upper and lower scales in the Gaussian pyramid, and determine whether the initial feature point is a maximum value or a minimum value;

[0049] A search submodule, for determining the initial feature point as the final feature point if yes, and for searching the extreme point closest to the center within the neighborhood of the center of the initial feature point as the final feature point if no;

[0050] The description submodule is used to obtain the extracted final feature points, describe them using SIFT descriptors, generate corresponding feature vectors, and generate a second image set.

[0051] Optionally, in an implementation of the second aspect of the present invention, the training module includes an input submodule, an overlapping block submodule, a mapping submodule, a fusion submodule and a prediction submodule, wherein the input submodule is used to obtain a sample feature map in the training data set, and input the sample feature map into a pre-training model, wherein the pre-training model is constructed based on a convolutional neural network;

[0052] An overlapping block submodule is used to perform overlapping block processing through the depth position encoding overlapping block embedding module of the pre-trained model to obtain pixel blocks with local overlapping details and edge information;

[0053] The mapping submodule is used to linearly map the obtained pixel blocks into output features, use the deep attention module to perform a deep convolution to obtain the weight information of the pixel blocks, and add the corresponding position information to obtain a feature sequence with position information;

[0054] The fusion submodule is used to multiply the feature with position information with the sample feature map, fuse the position information and local features, and obtain the feature map;

[0055] The prediction submodule is used to cluster the generated feature maps using the K-Means clustering algorithm, identify the accuracy after pruning, use the upper confidence function as the acquisition function, predict the candidate parameter combination with the highest acquisition value, and train the model corresponding to the candidate parameter combination based on the prediction results.

[0056] In the technical solution provided by the present invention, an initial image set collected by a visual device is obtained, and a preprocessing operation is performed on the image data in the initial image set to obtain a first image set; feature extraction is performed on the image data in the first image set to obtain a second image set, and dimension reduction is performed on the second image set to obtain an input image set; the input image set is split into a training data set and a test data set, a pre-trained model is obtained, and parameters are initialized, and the training data set is input to train the pre-trained model; the trained model is used to take the classification accuracy of the test data set as an evaluation indicator of the training result, and the weight is updated to determine the model parameter value, and an image classification model is output; the image classification model is used to classify images in the platform, and category marking is performed, and image recommendation is performed according to the user's search information, and image classification results are output based on the search information; the present invention avoids the tedious process of manually designing features in traditional methods, improves the accuracy and efficiency of classification, and further improves the classification performance through the model algorithm, and has strong adaptability. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the following detailed description of the preferred embodiment.The drawings are only for the purpose of illustrating the preferred embodiments and are not to be construed as limiting the invention.

[0058] Figure 1 A schematic diagram of a first embodiment of a machine vision-based image classification method provided by an embodiment of the present invention;

[0059] Figure 2 A schematic diagram of a second embodiment of the machine vision-based image classification method provided by an embodiment of the present invention;

[0060] Figure 3 A schematic diagram of a third embodiment of the machine vision-based image classification method provided by an embodiment of the present invention;

[0061] Figure 4 A schematic diagram of the structure of a machine vision-based image classification system provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0062] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0063] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 A schematic diagram of a first embodiment of a method for image classification based on machine vision provided by an embodiment of the present invention, the method specifically comprises the following steps:

[0064] Step 101, obtaining an initial image set collected by a visual device, and performing a preprocessing operation on image data in the initial image set to obtain a first image set;

[0065] In this embodiment, image data in the initial image set is obtained, and the image data in the initial image set is converted into a grayscale image; the grayscale image is filtered and smoothed using a Gaussian filtering method to obtain a smoothed image; the gradient of each pixel in the smoothed image is calculated, the gradient amplitude is non-maximum suppressed, the local maximum point is determined in each gradient direction, and the local maximum is determined as an edge point to obtain an edge extracted image; the edge extracted image is contrast enhanced using an adaptive histogram equalization method to obtain an enhanced image, and a first image set is generated.

[0066] Step 102, extracting features from the image data in the first image set to obtain a second image set, and performing dimensionality reduction processing on the second image set to obtain an input image set;

[0067] In this embodiment, the feature vectors in the second image set are obtained, the feature vectors in the second image set are processed by normalization, and the processed feature vectors are mapped to a high-dimensional space by using a nonlinear mapping function; an initial matrix is ​​constructed by a Gaussian kernel function, and a similarity measure between each pair of data points in the feature vector is calculated to obtain a matrix to be processed; the matrix to be processed is centralized, and the eigenvalue decomposition is performed on the centralized matrix to be processed to extract the eigenvectors corresponding to the first k eigenvalues, where k=1,2,...,k; based on the eigenvectors corresponding to the first k eigenvalues, a feature matrix composed of the first k principal components is calculated, and the image is reconstructed based on the feature matrix to obtain an input image set.

[0068] Step 103: split the input image set into a training data set and a test data set, obtain a pre-trained model, initialize parameters, and input the training data set to train the pre-trained model;

[0069] Step 104: Use the trained model to take the classification accuracy of the test data set as an evaluation indicator of the training result, update the weight, determine the model parameter value, and output the image classification model;

[0070] Step 105: Use the image classification model to classify the images in the platform and mark them by category, use the SandCat algorithm to recommend images according to the user's search information, and output the image classification results based on the search information.

[0071] In this embodiment, the user's search information is obtained, the initial parameters are set, the population is initialized using singer mapping, the refraction reverse learning strategy is used to optimize the population position and calculate the fitness value of each sand dune cat; a roulette wheel selection algorithm is used to select an angle for each sand dune cat, and the value of the parameter R in the sand dune cat algorithm is determined; if R>1, the sand dune cat group is converted to the exploration stage and the position is updated; if R≤1, the sand dune cat group is converted to the attack and utilization stage and the position is updated; when the maximum number of iterations is reached, if so, the loop ends, the optimal solution is output, and the image classification result is output based on the search information.

[0072] In an embodiment of the present invention, an initial image set collected by a visual device is obtained, and image data in the initial image set is preprocessed to obtain a first image set; feature extraction is performed on the image data in the first image set to obtain a second image set, and dimension reduction is performed on the second image set to obtain an input image set; the input image set is split into a training data set and a test data set, a pre-trained model is obtained, and parameters are initialized, and the training data set is input to train the pre-trained model; the trained model is used to take the classification accuracy of the test data set as an evaluation indicator of the training result, and the weight is updated to determine the model parameter value, and an image classification model is output; the image classification model is used to classify images in the platform, and category marking is performed, and image recommendation is performed according to the user's search information, and image classification results are output based on the search information; the present invention avoids the tedious process of manually designing features in traditional methods, improves the accuracy and efficiency of classification, and further improves the classification performance through the model algorithm, and has strong adaptability.

[0073] See also Figure 2 , a schematic diagram of a second embodiment of a method for image classification based on machine vision provided by an embodiment of the present invention, the method comprising:

[0074] Step 201: Obtain image data in a first image set, and construct a scale space for the image data in the first image set;

[0075] Step 202: Use the FAST algorithm with a local adaptive threshold to detect feature points at each scale, and use the detected feature points as initial feature points;

[0076] Step 203: construct a Gaussian pyramid, compare the initial feature point with its neighborhood and the points of the upper and lower scales in the Gaussian pyramid, and determine whether the initial feature point is a maximum value or a minimum value;

[0077] Step 204: If yes, the initial feature point is determined as the final feature point. If no, the extreme point closest to the center is searched within the neighborhood of the initial feature point as the final feature point.

[0078] Step 205: obtain the extracted final feature points, describe them using SIFT descriptors, generate corresponding feature vectors, and generate a second image set.

[0079] See also Figure 3 , a schematic diagram of a third embodiment of a method for image classification based on machine vision provided by an embodiment of the present invention, the method comprising:

[0080] Step 301: Obtain a sample feature map in a training data set, and input the sample feature map into a pre-training model, wherein the pre-training model is constructed based on a convolutional neural network;

[0081] Step 302: Perform overlapping block processing through the depth position coding overlapping block embedding module of the pre-trained model to obtain pixel blocks with local overlapping details and edge information;

[0082] Step 303: linearly map the obtained pixel block to an output feature, use a deep attention module to perform a deep convolution to obtain the weight information of the pixel block, and add the corresponding position information to obtain a feature sequence with position information;

[0083] Step 304: multiply the feature with the position information with the sample feature map, fuse the position information and the local feature, and obtain the feature map;

[0084] Step 305: Use the K-Means clustering algorithm to cluster the generated feature graphs, perform pruning, identify the accuracy, use the upper confidence function as the acquisition function, predict the candidate parameter combination with the highest acquisition value, and train the model corresponding to the candidate parameter combination according to the prediction result.

[0085] In this embodiment, the generated feature map is obtained, the feature set is obtained, the number of cluster centers is set, and the cluster center point value is calculated based on the feature set; the distance between the sample point of each feature map and the cluster center point value is calculated, and similar feature maps are divided into the same cluster according to the calculation result, and the feature maps with smaller distances and the corresponding convolution kernels are pruned; the center point value is updated according to the new cluster, and it is updated iteratively until the center point and sample point of each cluster remain unchanged.

[0086] See also Figure 4 , a schematic diagram of the structure of a machine vision-based image classification system provided by an embodiment of the present invention, the system comprises a preprocessing module, a feature extraction module, a training module, an updating module and a classification module, wherein the preprocessing module 401 is used to obtain an initial image set collected by a visual device, perform a preprocessing operation on the image data in the initial image set, and obtain a first image set;

[0087] A feature extraction module 402 is used to extract features from the image data in the first image set to obtain a second image set, and perform dimensionality reduction processing on the second image set to obtain an input image set;

[0088] The training module 403 is used to split the input image set into a training data set and a test data set, obtain a pre-trained model, initialize parameters, and input the training data set to train the pre-trained model;

[0089] An updating module 404 is used to use the trained model to take the classification accuracy of the test data set as an evaluation indicator of the training result, and to update the weights, determine the model parameter values, and output the image classification model;

[0090] The classification module 405 is used to classify the images in the platform using an image classification model, mark the images by category, recommend images based on the user's search information, and output the image classification results.

[0091] In this embodiment, the feature extraction module includes a construction submodule, a detection submodule, a comparison submodule, a search submodule and a description submodule, wherein the construction submodule is used to obtain image data in the first image set and construct a scale space for the image data in the first image set;

[0092] The detection submodule is used to detect feature points at each scale using the FAST algorithm with a local adaptive threshold, and use the detected feature points as initial feature points;

[0093] The comparison submodule is used to construct a Gaussian pyramid, compare the initial feature point with its neighborhood and the points of the upper and lower scales in the Gaussian pyramid, and determine whether the initial feature point is a maximum or minimum value;

[0094] A search submodule is used to determine the initial feature point as the final feature point if yes, and to search the extreme point closest to the center within the neighborhood of the initial feature point as the final feature point if no;

[0095] The description submodule is used to obtain the extracted final feature points, describe them using SIFT descriptors, generate corresponding feature vectors, and generate a second image set.

[0096] In this embodiment, the training module includes an input submodule, an overlapping block submodule, a mapping submodule, a fusion submodule and a prediction submodule, wherein the input submodule is used to obtain a sample feature map in a training data set, and input the sample feature map into a pre-training model, wherein the pre-training model is constructed based on a convolutional neural network;

[0097] The overlapping block submodule is used to perform overlapping block processing through the deep position encoding overlapping block embedding module of the pre-trained model to obtain pixel blocks with local overlapping details and edge information;

[0098] The mapping submodule is used to linearly map the obtained pixel blocks into output features, use the deep attention module to perform a deep convolution to obtain the weight information of the pixel blocks, and add the corresponding position information to obtain a feature sequence with position information;

[0099] The fusion submodule is used to multiply the feature with position information with the sample feature map, fuse the position information and local features, and obtain the feature map;

[0100] The prediction submodule is used to cluster the generated feature maps using the K-Means clustering algorithm, identify the accuracy after pruning, use the upper confidence function as the acquisition function, predict the candidate parameter combination with the highest acquisition value, and train the model corresponding to the candidate parameter combination based on the prediction results.

[0101] Through the implementation of the above scheme, the system includes a preprocessing module, a feature extraction module, a training module, an update module and a classification module. The present invention avoids the tedious process of manually designing features in traditional methods, improves the accuracy and efficiency of classification, further improves the classification performance through the model algorithm, and has strong adaptability.

[0102] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments. The above embodiments and descriptions are only preferred examples of the present invention and are not intended to limit the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.

Claims

1. A method for image classification based on machine vision, characterized in that: The image classification method based on machine vision comprises the following steps: Acquire an initial image set collected by a visual device, and perform a preprocessing operation on image data in the initial image set to obtain a first image set; Performing feature extraction on image data in the first image set to obtain a second image set, and performing dimensionality reduction processing on the second image set to obtain an input image set; Splitting the input image set into a training data set and a test data set, obtaining a pre-trained model, initializing parameters, and inputting the training data set to train the pre-trained model; Using the trained model, the classification accuracy of the test data set is used as an evaluation indicator of the training result, and the weights are updated, the model parameter values ​​are determined, and the image classification model is output; The image classification model is used to classify the images in the platform and mark the categories, and the SandCat algorithm is used to recommend images according to the user's search information, and the image classification results are output based on the search information; The step of performing feature extraction on the image data in the first image set to obtain the second image set includes: Acquire image data in the first image set, and construct a scale space for the image data in the first image set; The FAST algorithm with local adaptive threshold is used to detect feature points at each scale, and the detected feature points are used as initial feature points; Constructing a Gaussian pyramid, performing extreme value comparison between the initial feature point and its neighborhood and points of upper and lower scales in the Gaussian pyramid, and determining whether the initial feature point is a maximum value or a minimum value; If yes, the initial feature point is determined as the final feature point. If no, the neighborhood with the initial feature point as the center is searched for the extreme point closest to the center as the final feature point. The final feature points extracted are obtained, described using SIFT descriptors, corresponding feature vectors are generated, and a second image set is generated; The input image set is split into a training data set and a test data set, a pre-trained model is obtained, and parameters are initialized, and the training data set is input to train the pre-trained model, including: Obtaining a sample feature map in the training data set, and inputting the sample feature map into a pre-training model, wherein the pre-training model is constructed based on a convolutional neural network; Perform overlapping block processing through the deep position encoding overlapping block embedding module of the pre-trained model to obtain pixel blocks with local overlapping details and edge information; The obtained pixel blocks are linearly mapped to output features, and a deep convolution is performed using the deep attention module to obtain the weight information of the pixel blocks, and the corresponding position information is added to obtain a feature sequence with position information; Multiply the feature with position information with the sample feature map, fuse the position information and local features, and obtain the feature map; The K-Means clustering algorithm is used to cluster the generated feature maps. After pruning, the recognition accuracy is determined. The upper confidence function is used as the acquisition function to predict the candidate parameter combination with the highest acquisition value. The model corresponding to the candidate parameter combination is trained based on the prediction results.

2. The image classification method based on machine vision as claimed in claim 1, characterized in that: The step of acquiring an initial image set collected by a visual device and performing a preprocessing operation on image data in the initial image set to obtain a first image set includes: Acquire image data in the initial image set, and convert the image data in the initial image set into a grayscale image; Using a Gaussian filtering method to perform filtering and smoothing processing on the grayscale image to obtain a smoothed image; Calculating the gradient of each pixel in the smoothed image, performing non-maximum suppression on the gradient amplitude, determining a local maximum point in each gradient direction, and determining the local maximum point as an edge point to obtain an edge extracted image; An adaptive histogram equalization method is used to perform contrast enhancement processing on the edge-extracted image to obtain an enhanced image, and a first image set is generated.

3. The image classification method based on machine vision as claimed in claim 1, characterized in that: Performing dimensionality reduction processing on the second image set to obtain an input image set includes: Acquire feature vectors in the second image set, process the feature vectors in the second image set by normalization, and map the processed feature vectors to a high-dimensional space by using a nonlinear mapping function; The initial matrix is ​​constructed by using the Gaussian kernel function, and the similarity measure between each pair of data points in the eigenvector is calculated to obtain the matrix to be processed; Centralizing the matrix to be processed, and performing eigenvalue decomposition on the centralized matrix to be processed to extract eigenvectors corresponding to the first k eigenvalues; Based on the eigenvectors corresponding to the first k eigenvalues, a feature matrix composed of the first k principal components is calculated, and the image is reconstructed based on the feature matrix to obtain an input image set.

4. The image classification method based on machine vision as claimed in claim 1, characterized in that: The K-Means clustering algorithm is used to cluster the generated feature graph, including: Obtaining the generated feature graph, obtaining a feature set, setting the number of cluster centers, and calculating the cluster center point value based on the feature set; Calculate the distance between the sample point of each feature map and the cluster center value, and divide similar feature maps into the same cluster according to the calculation results. The feature maps with smaller distances and the corresponding convolution kernels are cut off. Update the center point value according to the new cluster, and update iteratively until the center point and sample point of each cluster remain unchanged.

5. The image classification method based on machine vision as claimed in claim 1, characterized in that: The method of using the SandCat algorithm to recommend images according to the user's search information and outputting image classification results based on the search information includes: Obtain the user's search information, set the initial parameters, use the singer mapping to initialize the population, use the refraction reverse learning strategy to optimize the population position and calculate the fitness value of each sand dune cat; Use the roulette wheel selection algorithm to select an angle for each sand dune cat and determine the value of the parameter R in the sand dune cat algorithm; If R>1, the sand dune cat group switches to the exploration stage and updates its position; if R≤1, the sand dune cat group switches to the attack and exploitation stage and updates its position; When the maximum number of iterations is reached, the loop ends, the optimal solution is output, and the image classification result is output based on the search information.

6. An image classification system based on machine vision, characterized in that: The machine vision-based image classification system comprises a preprocessing module, a feature extraction module, a training module, an updating module and a classification module, wherein the preprocessing module is used to obtain an initial image set collected by a visual device, and perform a preprocessing operation on the image data in the initial image set to obtain a first image set; A feature extraction module, configured to extract features from the image data in the first image set to obtain a second image set, and perform dimensionality reduction processing on the second image set to obtain an input image set; A training module is used to split the input image set into a training data set and a test data set, obtain a pre-trained model, initialize parameters, and input the training data set to train the pre-trained model; An updating module is used to use the trained model to take the classification accuracy of the test data set as an evaluation indicator of the training result, update the weights, determine the model parameter values, and output the image classification model; A classification module, which is used to classify the images in the platform using the image classification model, mark the categories, and use the SandCat algorithm to recommend images according to the user's search information, and output the image classification results; The feature extraction module includes a construction submodule, a detection submodule, a comparison submodule, a search submodule and a description submodule, wherein the construction submodule is used to obtain image data in the first image set and construct a scale space for the image data in the first image set; The detection submodule is used to detect feature points at each scale using the FAST algorithm with a local adaptive threshold, and use the detected feature points as initial feature points; A comparison submodule is used to construct a Gaussian pyramid, compare the initial feature point with its neighborhood and the points of the upper and lower scales in the Gaussian pyramid, and determine whether the initial feature point is a maximum value or a minimum value; A search submodule, for determining the initial feature point as the final feature point if yes, and searching the extreme point closest to the center within a neighborhood with the initial feature point as the final feature point if no; A description submodule is used to obtain the extracted final feature points, describe them using SIFT descriptors, generate corresponding feature vectors, and generate a second image set; The training module includes an input submodule, an overlapping block submodule, a mapping submodule, a fusion submodule and a prediction submodule, wherein the input submodule is used to obtain a sample feature map in the training data set, and input the sample feature map into a pre-training model, wherein the pre-training model is constructed based on a convolutional neural network; An overlapping block submodule is used to perform overlapping block processing through the depth position encoding overlapping block embedding module of the pre-trained model to obtain pixel blocks with local overlapping details and edge information; The mapping submodule is used to linearly map the obtained pixel blocks into output features, use the deep attention module to perform a deep convolution to obtain the weight information of the pixel blocks, and add the corresponding position information to obtain a feature sequence with position information; The fusion submodule is used to multiply the feature with position information with the sample feature map, fuse the position information and local features, and obtain the feature map; The prediction submodule is used to cluster the generated feature maps using the K-Means clustering algorithm, identify the accuracy after pruning, use the upper confidence function as the acquisition function, predict the candidate parameter combination with the highest acquisition value, and train the model corresponding to the candidate parameter combination based on the prediction results.

Citation Information

Patent Citations

  • Method and device for registering optical image and infrared image of circuit board

    CN116433733A

  • Method for batch identification and automatic classification and archiving of picture content

    CN118799619A