An image matching method combined with deep learning
Through the combination of the deep learning model and the SURF algorithm, the problem of high time complexity and rotation size change matching of the image matching algorithm in the existing technology is solved, and efficient image matching is achieved.
Patent Information
- Application Number
- CN202110540653.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-18
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-05-18
AI Technical Summary
Existing image matching algorithms have high time complexity and cannot effectively handle matching after image rotation or size changes.
A deep learning model is used to train the images to be matched, a data set is generated through row-by-row area segmentation and image enhancement technology, a convolutional neural network is used for image matching, and the final position of the image is calculated using the SURF algorithm.
It significantly reduces the time complexity of image matching, can effectively handle matching problems after image rotation and size changes, and improves calculation speed and accuracy.
Smart Images

Figure CN113240015B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and more specifically to an image matching method combined with deep learning. Background Art
[0002] Image matching refers to a method of finding similar image targets by analyzing the correspondence, similarity and consistency of image content, features, structure, relationship, texture and grayscale. The existing image matching algorithms have the problems of high time complexity and long algorithm time consumption due to the need for line-by-line scanning. In addition, they cannot solve the matching problem after the matching target in the original image is rotated or resized. The present invention proposes an image matching method combined with deep learning. Summary of the invention
[0003] The purpose of the present invention is to overcome the problems existing in the above-mentioned prior art and provide an image matching method combined with deep learning, in which the image to be matched is input into a trained model to obtain the sub-area where the image is located, and then the final position of the image is calculated using an image matching algorithm.
[0004] An image matching method combined with deep learning comprises the following steps:
[0005] Step 1: Build a deep learning model;
[0006] Step 2: Train the deep learning model and establish a trained deep learning neural network model;
[0007] Step 3: Use the trained deep learning neural network model for image matching.
[0008] Furthermore, the method for establishing the deep learning model comprises the following steps:
[0009] Step 1: Obtain the microstructure surface by photographing through a camera lens;
[0010] Step 2: Segment the microstructure surface image row by row and column by column;
[0011] Step 3: Label each sub-region and finally obtain a sub-region set;
[0012] Step 4: In each sub-region, continue to divide the pattern into several smaller images, so that multiple data sets are formed under each sub-region label;
[0013] Step 5: Randomly extract several images from the data set under each sub-region label, retain their labels, and make them the test set and verification set.
[0014] Furthermore, in step 2 of the method for establishing the deep learning model, the image sizes of each region in the region segmentation are the same, and the region is finally segmented into nxn sub-regions, where n is the number of blocks per row and column. Label each sub-region and finally obtain {X 11 ,X 12 .....X 1n ......X nn}Sub-area collection.
[0015] Furthermore, the method for establishing the trained deep learning neural network model includes:
[0016] The data set, validation set, and test set are used as the input layer of the deep learning framework for input model training. Each microstructure pattern is transmitted through the neural layer training and is finally accurately classified into the corresponding sub-pattern coordinates, and a trained neural network model is obtained at the same time.
[0017] Furthermore, the microstructure surface refers to an object surface structure with a non-periodic pattern processed by ultra-precision processing technology, and the pattern is anisotropic, that is, the pattern is guaranteed to be different in shape at any place while having regularity, and is not limited by the geometric size of the microstructure surface.
[0018] Furthermore, the scale of the data set, the number of images in the validation set and the test set, can be expanded into the data set by augmenting the sub-pattern images of each region through image enhancement.
[0019] Furthermore, the image enhancement method includes cropping, rotating, translating, and adding noise.
[0020] Furthermore, the method for performing image matching using the trained deep learning neural network model comprises the following steps:
[0021] Step 1: Use the camera lens to capture the image to be matched;
[0022] Step 2: Input the new image to be matched into the trained neural network model, and obtain the sub-region after being classified by the model, and obtain the coordinates of the sub-region (x0, y0) through the sub-region label;
[0023] Step 3: In the sub-region, apply the corresponding image matching algorithm to the image to be matched and the sub-region image, and calculate the coordinate value (x1, y1) of the matching image relative to the sub-region image;
[0024] Step 4: The final position coordinates of the image to be matched are (x0+x1, y0+y1).
[0025] Furthermore, the input received by the deep learning model is in the form of a vector, and the microstructure surface image and the sub-region image are both represented in the form of a vector.
[0026] Furthermore, the neural network model for image classification includes a convolutional layer, an activation function, a pooling layer, and a fully connected layer.
[0027] The beneficial effects of the image matching method combined with deep learning of the present invention are:
[0028] The image to be matched is input into the trained model to obtain the sub-region where the image is located, and then the final position of the image is calculated using the image matching algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 A schematic block diagram of the overall process of establishing a trained deep learning neural network model provided by the present invention;
[0030] Figure 2 A schematic block diagram of the overall process of the method for image matching using a trained deep learning neural network model provided by the present invention. DETAILED DESCRIPTION
[0031] A specific implementation of the present invention is described in detail below in conjunction with the accompanying drawings, but it should be understood that the protection scope of the present invention is not limited by the specific implementation.
[0032] Specifically, Figure 1 As shown, the embodiment of the present invention provides a method for establishing a deep learning model, comprising the following steps:
[0033] First: Use an industrial camera lens to obtain the overall image of the microstructure surface of the image to be matched;
[0034] In the above steps, the microstructure surface refers to the surface structure of an object with a non-periodic pattern processed by ultra-precision processing technology, and the pattern is anisotropic, that is, the pattern is guaranteed to have regularity while the shape of the pattern is different at any place, and is not limited by the geometric size of the microstructure surface. Other non-periodic and anisotropic image data can also be used, and the acquisition method is not limited to industrial cameras.
[0035] Second: segment the microstructure surface image row by row and column by column; label each sub-region and finally obtain a sub-region set;
[0036] The image size of each region is the same, and it is finally divided into nxn sub-regions, where n is the number of blocks divided in each row and column. Label each sub-region and finally obtain {X 11 ,X 12 .....X 1n......X nn}Sub-area collection.
[0037] In the above steps, the number of sub-regions finally formed should be determined by the nature of the overall image and the requirements of image processing, and will also affect the subsequent training process.
[0038] Third, in each sub-region, continue to divide the pattern into several smaller images to form multiple data sets under each sub-region label; in the data set under each sub-region label, randomly extract several images and retain their labels to make them the test set and verification set.
[0039] In the above steps, the size of the data set, the number of images in the validation set and the test set vary with different implementation methods, and the implementer can also determine the optimal solution through experiments during the implementation process. The sub-pattern image of each area can also be expanded into a data set by image enhancement methods such as cropping, rotating, translating, adding noise, etc.
[0040] A deep learning neural network model is established, and the above-mentioned data set, validation set, and test set are used as the input layer input model of the deep learning framework for training. Each microstructure pattern is transmitted through the neural layer training and finally accurately classified into the corresponding sub-pattern coordinates. In the above steps, the neural network model for image classification should include convolution layer, activation function, pooling layer, and fully connected layer. The specific neural network for training is not limited to LeNet, AlexNet, ZF-net, GoogleNet, VGG, ResNet, SqueezeNet, DenseNet, ShuffleNet, etc. In this embodiment, ResNet50 is used as the main network.
[0041] In the above steps, the convolution layer is divided into 5 parts. The first part is a single-layer convolution with a 7x7 convolution kernel. The second part is a three-layer residual block with convolution kernels of 1x1, 3x3, and 1x1, repeated three times. The third part is the same three-layer residual block repeated four times. The fourth part is the same residual block repeated six times. The fifth part is a residual block repeated three times.
[0042] In the above steps, the feature vector obtained by the convolution layer is input into the pooling layer and the fully connected layer for dimensionality reduction, and the output 512-dimensional feature vector is input into the final classification layer.
[0043] The classification results are compared with the classification labels, the loss value is calculated, and the model is adjusted by reversely optimizing the loss function. Finally, a higher-precision image classification model is obtained, in which the loss function uses the cross entropy loss function and the optimization method uses stochastic gradient descent.
[0044] In this embodiment, the input received by the deep learning model is in the form of vectors, and the microstructure image and the sub-region image are both represented in the form of vectors. This makes the input data easier to be accepted by the model and easier to extract.
[0045] A specific implementation of the present invention is described in detail below in conjunction with the accompanying drawings, but it should be understood that the protection scope of the present invention is not limited by the specific implementation.
[0046] In this embodiment, the next step of image matching is performed based on the trained neural network model, such as Figure 2 As shown, the following steps are included:
[0047] First, the industrial camera lens captures the image to be matched.
[0048] In the above steps, the field of view of the camera lens should become smaller at this time. The smaller the range of the initial positioning is, the smaller the search range of the subsequent matching is. The range of the initial positioning is determined by the size of the microstructure surface division area used for model training.
[0049] Second, the new image to be matched is input into the trained neural network model, and the sub-region is obtained after being classified by the model, and the coordinates (x0, y0) of the sub-region are obtained through the sub-region label.
[0050] Third, in the sub-region, a corresponding image matching algorithm is applied to the image to be matched and the sub-region image to calculate the coordinate value (x1, y1) of the matching image relative to the sub-region image.
[0051] In the above steps, the image matching algorithm applied is not limited to RPM, CPD, SM, Monte Carlo, GS, SIFT, SURF, PCA-SIFT, C-SIFT, ASIFT, DSP-SIFT and other algorithms.
[0052] Fourth, the final global position coordinates of the image to be matched are (x0+x1, y0+y1).
[0053] In this embodiment, the accelerated robust feature SURF algorithm is used to calculate the final sub-pattern image matching, which solves the image rotation matching problem, reduces the time complexity, and speeds up the calculation speed.
[0054] The SURF algorithm process is to construct the Hessian matrix and Gaussian pyramid, and compare each pixel processed by the Hessian matrix with the 26 points in its 3D neighborhood. If it is the maximum value among the 26 points, it is retained as a preliminary feature point.
[0055] Then determine the main direction of the feature point and construct the feature point descriptor. Define a description area around each feature point. The area consists of 4×4 sub-regions, and each sub-region contains 5×5 pixels. When the image is rotated to the main direction of the pixel intensity gradient, the descriptor vector of each sub-region is obtained by Haar wavelet transform. Each feature point is combined into a 64-dimensional vector through different descriptor vectors of 4×4 sub-regions as the neighboring descriptor of the feature point. Finally, the Euclidean distance between descriptors is used to judge the similarity between image regions, and the region with the highest similarity between images is matched.
[0056] In the above steps, the RANSAC algorithm can be used to solve the problem of incorrect matching of feature points during the matching process. According to the distribution design and constraint conditions of the feature points, the points that meet the constraints are defined as inliers, and the points that do not meet the constraints are defined as outliers. In a set of data containing outliers, the parameter model that best suits the inliers is obtained through an iterative method. The number of inliers and outliers that meet the requirements is recorded during the iteration, the maximum number of inliers is updated, and finally the result with the largest number of inliers is output.
[0057] The above disclosures are only several specific embodiments of the present invention. However, the embodiments of the present invention are not limited thereto. Any changes that can be conceived by those skilled in the art should fall within the protection scope of the present invention.
Claims
1. An image matching method combined with deep learning, characterized in that: The following steps are involved: Step 1: Build a deep learning model; Step 2: Train the deep learning model and establish a trained deep learning neural network model; Step 3: Use the trained deep learning neural network model for image matching; The method for establishing the deep learning model comprises the following steps: Step 1: Obtain the microstructure surface by photographing with a camera lens; Step 2: Segment the microstructure surface image row by row and column by column; Step 3: Label each sub-region and finally obtain a sub-region set; Step 4: In each sub-region, continue to divide the pattern into several smaller images, so that multiple data sets are formed under each sub-region label; Step 5: Randomly extract a number of images from the data set under each sub-region label, retain their labels, and make them the test set and validation set; In step 2 of the method for establishing the deep learning model, the image sizes of each region in the region segmentation are the same, and are finally segmented into nxn sub-regions, where n is the number of blocks segmented in each row and column; The method for establishing the trained deep learning neural network model includes: The data set, validation set, and test set are used as the input layer of the deep learning framework for input model training. Each microstructure pattern is passed through the neural layer training and finally accurately classified into the corresponding sub-pattern coordinates, and a trained neural network model is obtained at the same time; The method for performing image matching using the trained deep learning neural network model comprises the following steps: Step 1: Use the camera lens to capture the image to be matched; Step 2: Input the new image to be matched into the trained neural network model, and obtain the sub-region after being classified by the model, and obtain the coordinates of the sub-region (x0, y0) through the sub-region label; Step 3: In the sub-region, apply the corresponding image matching algorithm to the image to be matched and the sub-region image, and calculate the coordinate value (x1, y1) of the matching image relative to the sub-region image; Step 4: The final position coordinates of the image to be matched are (x0+x1, y0+y1).
2. The image matching method combined with deep learning according to claim 1, characterized in that: The microstructure surface refers to an object surface structure with a non-periodic pattern processed by ultra-precision processing technology. The pattern is anisotropic, that is, the pattern is guaranteed to be different in shape at any place while being regular, and is not limited by the geometric size of the microstructure surface.
3. The image matching method combined with deep learning according to claim 2, characterized in that: The size of the dataset, the number of images in the validation set and the test set, can be expanded into the dataset by augmenting the sub-pattern images of each region through image enhancement.
4. The image matching method combined with deep learning according to claim 3, characterized in that: The image enhancement methods include cropping, rotating, translating, and adding noise.
5. The image matching method combined with deep learning according to claim 4, characterized in that: The input received by the deep learning model is in the form of a vector, and the microstructure surface image and the sub-region image are both represented in the form of a vector.
6. An image matching method combined with deep learning according to any one of claims 1 to 5, characterized in that: The neural network model for image classification includes a convolutional layer, an activation function, a pooling layer, and a fully connected layer.
Citation Information
Patent Citations
Realization method of image searching system based on image recognition
CN101571875A
Deep learning-based SAR remote sensing image water surface target detection method
CN108052940A
Deep learning model for image processing and remote sensing image map extraction method
CN112633056A
Robust and efficient image identification
US20110158533A1
