Local learning-based deep field adaptation target identification method and system
Through the deep domain adaptation method based on local learning, the data distribution differences and data scarcity problems of image classification models in different fields are solved, the recognition accuracy and model generalization ability are improved, and the target recognition that quickly adapts to new data is achieved.
Patent Information
- Application Number
- CN202411226319.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2024-12-17
AI Technical Summary
The existing image classification technology has large differences in image data distribution in different fields or scenarios, which makes it difficult for the model to directly adapt to new data. The cost of obtaining labeled data in specific fields is high, making it difficult to train high-performance models. Traditional methods re-collect data and train models to consume. Time-consuming and labor-intensive, unable to quickly adapt to dynamically changing image classification tasks.
Using a deep domain adaptation method based on local learning, the neighborhood is determined by selecting the source target image data and data to be identified, and the neighborhood is determined by preprocessing and K nearest neighbor standards, a local covariance matrix is established, affine invariant metric is calculated, and the depth domain adaptation is constructed. Loss function, the cross-entropy loss function is used to optimize the AlexNet network, and improve the generalization ability and robustness of the model.
It improves the recognition accuracy in complex scenarios, reduces data differences in different fields, enhances model generalization capabilities and robustness, and provides a more accurate and efficient target recognition solution that can quickly adapt to new data and new needs.
Smart Images

Figure CN119152264A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image classification, and in particular to a deep domain adaptation target recognition method and system based on local learning. Background Art
[0002] With the rapid development of artificial intelligence technology, image classification tasks play a vital role in many fields. However, in practical applications, the following problems are often encountered: image data in different fields or scenarios often have different distribution characteristics. For example, images collected under different lighting conditions, different shooting angles, and different devices may have large differences in color, texture, shape and other features. This difference in data distribution makes it difficult to directly apply an image classification model trained on one dataset to another dataset with a different distribution, thereby reducing the generalization ability of the model.
[0003] In certain specific fields, it is very difficult and expensive to obtain a large amount of labeled image data. For example, in the field of medical images, it is difficult to collect large-scale labeled data due to the requirements of professional knowledge and data privacy restrictions. Deep learning models usually require a large amount of labeled data to achieve good performance. The scarcity of data has become an important factor restricting image classification tasks.
[0004] Image classification tasks in the real world are often dynamic, requiring models to quickly adapt to new image data and classification requirements. Traditional image classification methods usually require re-collecting data and training models, which is a time-consuming and labor-intensive process.
[0005] In order to solve the above problems, the present invention proposes a deep domain adaptation target recognition method and system based on local learning. Summary of the invention
[0006] The purpose of the present invention is to propose a deep domain adaptation target recognition method and system based on local learning to solve the problems raised in the background technology:
[0007] In existing image classification technologies, the distribution of image data from different sources and in different scenarios varies greatly, and it is difficult for trained classification models to directly adapt to new distributions, resulting in reduced classification performance on new data. It is costly and difficult to obtain a large amount of labeled image data in a specific field, and existing methods are difficult to train high-performance classification models when data is scarce. Faced with dynamically changing image classification tasks, traditional methods are time-consuming and labor-intensive to re-collect data and train models, and cannot quickly adapt to new data and new needs.
[0008] In order to achieve the above object, the present invention adopts the following technical solutions:
[0009] A local learning-based deep domain adaptation target recognition method comprises the following steps:
[0010] S1, selecting source target image data and target image data to be identified;
[0011] S2, preprocessing the selected source target image data and the target image data to be identified, and inputting them into the AlexNet network respectively;
[0012] S3, respectively for the source target image data and the target image data to be identified, using the K nearest neighbor standard to determine the neighborhood, thereby establishing a local covariance matrix, and obtaining a distribution difference measure of the source target image data and the target image data to be identified based on an affine invariant measure representation;
[0013] S4. Establish a deep domain adaptation loss function to achieve the classification of target image data to be identified.
[0014] Preferably, the preprocessing operations in S2 include: normalization processing, data enhancement processing, grayscale processing, histogram equalization processing and size adjustment processing, and then the processed source target image data and the target image data to be identified are used as the input of the source AlexNet network and the target AlexNet network respectively; when the magnitude of the image data set is one hundred or less, the data set is divided into a training set and a test set in a ratio of 7:3; when the magnitude of the image data set is one thousand, the data set is divided into a training set and a test set in a ratio of 8:2; when the magnitude of the image data set is ten thousand or more, the data set is divided into a training set and a test set in a ratio of 9:1.
[0015] Preferably, S3 is specifically as follows:
[0016] For source target image data and the target image data to be identified Using the K nearest neighbor standard, we search for the K nearest neighbor images that make up the nearest neighbor feature space.
[0017] Source target image data The following local linear representation is performed:
[0018]
[0019] in, Represents the source and target image data Projection in nearest neighbor feature space: represents the linear representation coefficient; Represents the distance between the source and target image data The K images that are closest and constitute the nearest neighbor feature space;
[0020] Target image data to be identified The following local linear representation is performed:
[0021]
[0022] in, Represents the source and target image data Projection in nearest neighbor feature space: represents the linear representation coefficient; Represents the distance between the source and target image data The K images that are closest and constitute the nearest neighbor feature space;
[0023] The local covariance matrix of the source target image data based on local learning and the local covariance matrix of the target image data to be identified are constructed as follows:
[0024]
[0025]
[0026] Among them, n s Indicates the number of all source and target image data; n s represents the number of target image data to be identified; F(·) represents the nonlinear mapping function based on the AlexNet network;
[0027] An affine invariant metric matrix based on local learning to characterize the distance of symmetric positive manifolds is established to express the distribution difference between the source target image data and the target image data to be identified as follows:
[0028]
[0029] Among them, L AIRM (C s ,C t ) is the distribution difference between the source target image data and the target image data to be identified; ||·||2 represents the Euclidean distance.
[0030] Preferably, the S4 is specifically as follows:
[0031] The distribution difference represented by the affine invariant metric based on local learning is used as the domain adaptation loss function of the AlexNet network, and the cross entropy is used as the classification loss function of the target image to be identified. Therefore, the overall deep learning loss function is expressed as follows:
[0032] L total =L Cross-Entroy +αL LED
[0033] Among them, L Cross-Entroy represents the cross entropy loss; α is a constant.
[0034] A local learning-based deep domain adaptation target recognition system, comprising:
[0035] Target image data selection module: used for selecting source target image data and target image data to be identified;
[0036] Target image data preprocessing module: used to preprocess the source target image data and the target image data to be identified, and input them into the AlexNet network deep convolutional neural network respectively;
[0037] Distribution difference measurement establishment module: for the source target image data and the target image data to be identified, the K nearest neighbor standard is used to obtain the neighborhood and project it to establish the local covariance matrix;
[0038] Target image data classification module to be identified: used to establish a deep domain adaptation loss function to achieve the classification of target image data to be identified.
[0039] Compared with the prior art, the present invention provides a deep domain adaptation target recognition method and system based on local learning, which has the following beneficial effects:
[0040] The present invention utilizes local learning to accurately capture local features of the target, improves recognition accuracy in complex scenarios, and combines deep domain adaptation to reduce data differences in different fields; establishes a loss function that can characterize the distribution differences between source target image data and target image data to be identified, and the loss function is constructed based on the affine invariant metric of local learning, and can construct a local covariance matrix based on manifold local learning, better measure the distribution differences between the source domain and the target domain, optimize the deep framework based on the AlexNet network, improve the recognition effect and performance of the target image, enhance the generalization ability and robustness of the model, and can cope with interference and data changes, providing a more accurate and efficient target recognition solution for practical applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 This is a flow chart of the method mentioned in Example 1 of the present invention;
[0042] Figure 2 This is a diagram of the deep migration network architecture mentioned in Example 1 of the present invention;
[0043] Figure 3 This is a system block diagram mentioned in Example 2 of the present invention.
[0044] Meaning of the symbols in the figure:
[0045] 11. Target image data selection module; 12. Target image data preprocessing module; 13. Distribution difference measurement establishment module; 14. Target image data classification module to be identified. DETAILED DESCRIPTION
[0046] 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. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0047] The present invention uses local learning to accurately capture the local features of the target, improves the recognition accuracy in complex scenes, and combines deep domain adaptation to reduce data differences in different fields; establishes a loss function that can characterize the distribution difference between the source target image data and the target image data to be identified, and the loss function is built based on the affine invariant measurement of local learning, and can construct a local covariance matrix based on manifold local learning, better measure the distribution difference between the source domain and the target domain, optimize the deep framework based on the AlexNet network, improve the recognition effect and performance of the target image, enhance the generalization ability and robustness of the model, and can cope with interference and data changes, providing a more accurate and efficient target recognition solution for practical applications. Specifically include the following contents.
[0048] Embodiment 1:
[0049] See also Figure 1-2 The present invention provides a method and system for deep domain adaptation target recognition based on local learning, comprising the following steps:
[0050] S1. Select source target image data and target image data to be identified; the details are as follows:
[0051] Select a portion of the existing large-scale annotated image datasets (such as ImageNet) as the source target image data, which has rich category annotations and diverse image content. The target image data to be identified can be collected from specific application scenarios, such as images taken by surveillance cameras in specific fields, medical imaging data, etc. Ensure that there are certain differences in content and style between the source target image data and the target image data to be identified to simulate the domain adaptation problem in actual applications.
[0052] S2. Preprocess the selected source target image data and the target image data to be identified, and input them into the AlexNet network respectively; the details are as follows:
[0053] The source target image data and the target image data to be identified collected in S1 are subjected to normalization, data enhancement, grayscale, histogram equalization and resizing in sequence, and then the processed source target image data and the target image data to be identified are used as the input of the source AlexNet network and the target AlexNet network respectively; when the image data set is in the order of one hundred or less, the data set is divided into a training set and a test set in the ratio of 7:3; when the image data set is in the order of one thousand, the data set is divided into a training set and a test set in the ratio of 8:2; when the image data set is in the order of ten thousand or more, the data set is divided into a training set and a test set in the ratio of 9:1. In order to reduce the influence of randomness, the model can also be evaluated by using the method of multiple random divisions and taking the average performance.
[0054] S3, respectively for the source target image data and the target image data to be identified, using the K nearest neighbor standard to determine the neighborhood, thereby establishing a local covariance matrix, and obtaining a distribution difference measure of the source target image data and the target image data to be identified based on an affine invariant measure representation; specifically as follows:
[0055] For source target image data and the target image data to be identified Using the K nearest neighbor standard, we search for the K nearest neighbor images that make up the nearest neighbor feature space.
[0056] Source target image data The following local linear representation is performed:
[0057]
[0058] in, Represents the source and target image data Projection in nearest neighbor feature space: represents the linear representation coefficient; Represents the distance between the source and target image data The K images that are closest and constitute the nearest neighbor feature space, K is a natural number greater than 2;
[0059] Target image data to be identified The following local linear representation is performed:
[0060]
[0061] in, Represents the source and target image data Projection in nearest neighbor feature space: represents the linear representation coefficient; Represents the distance between the source and target image data The K images that are closest and constitute the nearest neighbor feature space;
[0062] The local covariance matrix of the source target image data based on local learning and the local covariance matrix of the target image data to be identified are constructed as follows:
[0063]
[0064]
[0065] Among them, n s Indicates the number of all source and target image data; n s represents the number of target image data to be identified; F(·) represents the nonlinear mapping function based on the AlexNet network; the local covariance matrix can reflect the characteristic distribution of sample points in the local area.
[0066] An affine invariant metric matrix based on local learning to characterize the distance of symmetric positive manifolds is established to express the distribution difference between the source target image data and the target image data to be identified as follows:
[0067]
[0068] Among them, L AIRM (C s ,C t ) is the distribution difference between the source target image data and the target image data to be identified; ||·||2 represents the Euclidean distance.
[0069] Based on the local covariance matrix, the affine invariant metric between the source target image data and the target image data to be identified is calculated. The affine invariant metric can measure the degree of difference between the two distributions and has a certain invariance to the scale change of the data. By calculating the affine invariant metric between all sample points, the distribution difference metric of the source target image data and the target image data to be identified can be obtained. This metric can be used in the subsequent deep domain adaptation process.
[0070] S4. Establish a deep domain adaptation loss function to achieve the classification of target image data to be identified. The details are as follows:
[0071] The distribution difference represented by the affine invariant metric based on local learning is used as the domain adaptation loss function of the AlexNet network, and the cross entropy is used as the classification loss function of the target image to be identified. Therefore, the overall deep learning loss function is expressed as follows:
[0072] L total =L Cross-Entroy +αL LED
[0073] Among them, L Cross-Entroyrepresents the cross entropy loss; α is a constant.
[0074] The model is trained using the source target image data and the target image data to be recognized. During the training process, the parameters of the model are continuously adjusted through the back propagation algorithm to minimize the deep domain adaptation loss function.
[0075] After the model training is completed, the trained model is used to classify the target image data to be identified. The target image data to be identified is input into the model to obtain the category probability distribution predicted by the model, and the category with the largest probability is selected as the classification result of the target image data.
[0076] Embodiment 2:
[0077] See also Figure 3 The present invention provides a deep migration image classification system based on manifold learning, comprising:
[0078] Target image data selection module 11: used for selecting source target image data and target image data to be identified;
[0079] Target image data preprocessing module 12: used to preprocess the source target image data and the target image data to be identified, and input them into the AlexNet network deep convolutional neural network respectively;
[0080] Distribution difference measurement establishment module 13: for the source target image data and the target image data to be identified, respectively, a K-nearest neighbor standard is used to obtain the neighborhood and project it, and establish a local covariance matrix;
[0081] The target image data classification module 14 is used to establish a deep domain adaptation loss function to achieve the target image data classification.
[0082] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A deep domain adaptation target recognition method based on local learning, characterized in that: The steps include: S1, selecting source target image data and target image data to be identified; S2, preprocessing the selected source target image data and the target image data to be identified, and inputting them into the AlexNet network respectively; S3, respectively for the source target image data and the target image data to be identified, using the K nearest neighbor standard to determine the neighborhood, thereby establishing a local covariance matrix, and obtaining a distribution difference measure of the source target image data and the target image data to be identified based on an affine invariant measure representation; S4. Establish a deep domain adaptation loss function to achieve the classification of target image data to be identified.
2. The method for deep domain adaptation target recognition based on local learning according to claim 1, characterized in that: The preprocessing operations in S2 include: normalization processing, data enhancement processing, grayscale processing, histogram equalization processing and size adjustment processing, and then the processed source target image data and the target image data to be identified are used as the input of the source AlexNet network and the target AlexNet network respectively; when the magnitude of the image data set is one hundred or less, the data set is divided into a training set and a test set in a ratio of 7:3; when the magnitude of the image data set is one thousand, the data set is divided into a training set and a test set in a ratio of 8:2; when the magnitude of the image data set is ten thousand or more, the data set is divided into a training set and a test set in a ratio of 9:
1.
3. The method for deep domain adaptation target recognition based on local learning according to claim 2, characterized in that: The S3 is as follows: For source target image data and the target image data to be identified Using the K nearest neighbor standard, we search for the K nearest neighbor images that make up the nearest neighbor feature space. Source target image data The following local linear representation is performed: in, Represents the source and target image data Projection in nearest neighbor feature space: represents the linear representation coefficient; Represents the distance between the source and target image data The K images that are closest and constitute the nearest neighbor feature space; Target image data to be identified The following local linear representation is performed: in, Represents the source and target image data Projection in nearest neighbor feature space: represents the linear representation coefficient; Represents the distance between the source and target image data The K images that are closest and constitute the nearest neighbor feature space; The local covariance matrix of the source target image data based on local learning and the local covariance matrix of the target image data to be identified are constructed as follows: Among them, n s Indicates the number of all source and target image data; n s represents the number of target image data to be identified; F(·) represents the nonlinear mapping function based on the AlexNet network; An affine invariant metric matrix based on local learning to characterize the distance of symmetric positive manifolds is established to express the distribution difference between the source target image data and the target image data to be identified as follows: Among them, L AIRM (C s ,C t ) is the distribution difference between the source target image data and the target image data to be identified; ||·||2 represents the Euclidean distance.
4. The method for deep domain adaptation target recognition based on local learning according to claim 3, characterized in that: The S4 is specifically as follows: The distribution difference represented by the affine invariant metric based on local learning is used as the domain adaptation loss function of the AlexNet network, and the cross entropy is used as the classification loss function of the target image to be identified. Therefore, the overall deep learning loss function is expressed as follows: L total =L Cross-Entroy +αL LED Among them, L Cross-Entroy represents the cross entropy loss; α is a constant.
5. A local learning-based deep domain adaptation target recognition system as claimed in any one of claims 1 to 4, characterized in that: include: Target image data selection module (11): used for selecting source target image data and target image data to be identified; Target image data preprocessing module (12): used to preprocess the source target image data and the target image data to be identified, and input them into the AlexNet network deep convolutional neural network respectively; Distribution difference measurement establishment module (13): for the source target image data and the target image data to be identified, respectively, the K nearest neighbor standard is used to obtain the neighborhood and project it, and establish a local covariance matrix; The target image data classification module (14) is used to establish a deep domain adaptation loss function to achieve the target image data classification.
