A classification method and classification system for infrared ship images
By extracting and clustering multi-domain feature of infrared ship images, the fusion enhancement features are used for gradient update model, which solves the problem of poor image quality and recognition deviation of infrared ship images in sea surface environment, and achieves the effect of improving image quality and enhancing processing performance.
Patent Information
- Application Number
- CN202510050075.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-13
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2045-01-13
AI Technical Summary
Infrared ship images are prone to noise and interference under the variability of sea surface environment, resulting in poor image quality and identification deviation.
A method for classification of infrared ship images is proposed. By dividing the infrared ship image data set into at least two source domains, the first branch network and the second branch network of the image classification model are used to extract the first domain and the second domain invariant features, and cluster these features to obtain fusion enhanced features, which are used to update the model in gradient until the training is mature.
The image quality of infrared ship images is improved, the image processing performance of the model in complex situations is enhanced, the impact of domain offsets is reduced, and the generalization ability and robustness of the model are improved.
Smart Images

Figure CN119445266B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of infrared image processing, and in particular to a classification method and classification system for infrared ship images. Background Art
[0002] Infrared imaging generates images based on infrared radiation (thermal radiation) emitted by objects. It can work in the absence of visible light or in low light conditions. Therefore, it is widely used in many fields such as military, security monitoring, medical imaging, industrial inspection, etc., especially in the field of ships.
[0003] Due to the variability of the sea surface environment, such as temperature fluctuations, humidity changes, wind effects, etc., infrared ship images often contain noise and interference, making it difficult to clearly present the outline and details of the ship, resulting in poor image quality obtained by traditional infrared image processing algorithms. In addition, the complexity of the sea surface environment makes the generated infrared ship images more complex, with unknown image features, which in turn leads to recognition or classification deviations in traditional infrared image processing algorithms. Summary of the invention
[0004] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
[0005] The main purpose of the embodiments of the present disclosure is to propose a classification method and classification system for infrared ship images, which can improve the image quality of processed infrared ship images and enhance the image processing performance of the model under complex situations.
[0006] A first aspect of an embodiment of the present application provides a classification method for infrared ship images, which is used in a central controller. The method includes:
[0007] An infrared ship image dataset and a target infrared ship image are acquired, and the infrared ship image dataset is divided into infrared ship images of at least two source domains according to domain attributes; the target infrared ship image is an image of a target domain, and the target domain is different from the source domain;
[0008] The infrared ship images of the at least two source domains are input into a preset image classification model, so as to extract first domain invariant features from the infrared ship images of the at least two source domains through a first branch network of the image classification model, and cluster the first domain invariant features to obtain first cluster features; and extract second domain invariant features from the infrared ship images of the at least two source domains through a second branch network of the image classification model, and cluster the second domain invariant features to obtain second cluster features; the structures of the first branch network and the second branch network are different;
[0009] Obtaining a fusion enhancement feature according to the first clustering feature and the second clustering feature;
[0010] Performing gradient updating on the image classification model according to the fusion enhancement feature, and so on, until a trained image classification model is obtained;
[0011] The target infrared ship image is input into a trained image classification model to obtain a classification result of the target infrared ship image.
[0012] An embodiment of the present application provides a classification method for infrared ship images, which divides an infrared ship image data set into infrared ship images of at least two source domains; inputs the infrared ship images into a preset image classification model, extracts first domain invariant features from the infrared ship images through a first branch network of the image classification model, and clusters the first domain invariant features to obtain first clustering features; and extracts second domain invariant features from the infrared ship images through a second branch network of the image classification model, and clusters the second domain invariant features to obtain second clustering features; obtains fused enhancement features based on the first clustering features and the second clustering features; gradient updates the image classification model based on the fused enhancement features to obtain a trained image classification model; inputs a target infrared ship image into the trained image classification model to obtain a classification result of the target infrared ship image, which can improve the quality of the infrared ship image and enhance the processing performance.
[0013] In some embodiments of the present application, before acquiring the infrared ship image dataset, the method further includes:
[0014] Obtain an initial infrared ship image dataset;
[0015] Preprocessing the initial infrared ship image dataset to convert the initial infrared ship image dataset into a model input format required by the image classification model to obtain a processed initial infrared ship image dataset;
[0016] The processed initial infrared ship image data set is subjected to data enhancement processing to obtain the infrared ship image data set; the data enhancement processing includes at least one of rotation, translation and flipping.
[0017] In some embodiments of the present application, the first branch network includes a cascaded first feature extraction unit, a CBAM hybrid attention unit, and a first clustering unit for clustering the first domain invariant features;
[0018] The step of extracting first domain invariant features from the infrared ship images of the at least two source domains comprises:
[0019] Extracting initial features from the infrared ship images of the at least two source domains by the first feature extraction unit;
[0020] The initial feature is input into the CBAM mixed attention unit to obtain the first domain invariant feature output by the CBAM mixed attention unit.
[0021] In some embodiments of the present application, the second branch network includes a cascaded semantic segmentation unit, a second feature extraction unit, and a second clustering unit for clustering the second domain invariant features;
[0022] The step of extracting second domain invariant features from the infrared ship images of the at least two source domains comprises:
[0023] Segmenting the infrared ship images of the at least two source domains by the semantic segmentation unit to remove redundant features of the image background to obtain foreground images corresponding to the infrared ship images of the at least two source domains;
[0024] Feature enhancement is performed on the foreground image, and the second domain invariant feature is extracted from the enhanced foreground image by the second feature extraction unit.
[0025] In some embodiments of the present application, obtaining a fusion enhancement feature according to the first clustering feature and the second clustering feature includes:
[0026] Performing feature fusion on the first cluster feature and the second cluster feature to obtain a fused feature;
[0027] A noise is randomly sampled, and the fused feature is enhanced to obtain the fused enhanced feature.
[0028] In some embodiments of the present application, the fusion enhancement feature is calculated by the following formula:
[0029] ;
[0030] in, To enhance the fusion features, and is the noise weight, is the first clustering feature, is the second clustering feature.
[0031] In some embodiments of the present application, the gradient updating of the image classification model according to the fusion enhancement feature, and so on, until a trained image classification model is obtained, includes:
[0032] Constructing positive and negative sample pairs by using the fusion enhanced features and the first domain invariant features;
[0033] The distance between the positive and negative sample pairs is optimized according to the contrast loss function, and the parameters of the image classification model are updated by back propagation until a trained image classification model is obtained.
[0034] To achieve the above object, a second aspect of an embodiment of the present invention provides a classification system for infrared ship images, the system comprising:
[0035] an acquisition module, used for acquiring an infrared ship image dataset and a target infrared ship image, and dividing the infrared ship image dataset into infrared ship images of at least two source domains according to domain attributes; the target infrared ship image is an image of a target domain, and the target domain is different from the source domain;
[0036] an extraction module, configured to input the infrared ship images of the at least two source domains into a preset image classification model, so as to extract first domain invariant features from the infrared ship images of the at least two source domains through a first branch network of the image classification model, and cluster the first domain invariant features to obtain first cluster features; and extract second domain invariant features from the infrared ship images of the at least two source domains through a second branch network of the image classification model, and cluster the second domain invariant features to obtain second cluster features; the first branch network and the second branch network have different structures;
[0037] A fusion module, used for obtaining a fusion enhancement feature according to the first cluster feature and the second cluster feature;
[0038] An updating module, used for performing gradient updating on the image classification model according to the fusion enhancement feature, and so on, until a trained image classification model is obtained;
[0039] The classification module is used to input the target infrared ship image into a trained image classification model to obtain a classification result of the target infrared ship image.
[0040] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present invention provides an electronic device, comprising: at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor so that the at least one control processor can execute the above-mentioned method for classifying infrared ship images.
[0041] To achieve the above-mentioned purpose, a fourth aspect of an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the above-mentioned infrared ship image classification method.
[0042] It can be understood that the beneficial effects of the second to fourth aspects compared with the related art are the same as the beneficial effects of the first aspect compared with the related art. Please refer to the relevant description in the first aspect, and no further details will be given here. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0044] Figure 1 It is a flow chart of a classification method of infrared ship images provided in an embodiment of the present application;
[0045] Figure 2 This is a schematic diagram of infrared ship image data provided by an embodiment of the present application;
[0046] Figure 3 This is a schematic diagram of a branch network in an image classification model provided in an embodiment of the present application;
[0047] Figure 4 It is a schematic diagram of a feature extraction network architecture provided by an embodiment of the present application;
[0048] Figure 5 is a schematic diagram of a hybrid attention mechanism provided in an embodiment of the present application;
[0049] Figure 6 is a schematic diagram of image processing provided by an embodiment of the present application;
[0050] Figure 7 is another schematic diagram of image processing provided by an embodiment of the present application;
[0051] Figure 8 It is a structural schematic diagram of a classification system for infrared ship images provided in an embodiment of the present application;
[0052] Fig. 9 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0053] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limiting the present application.
[0054] In the description of this application, if there is a description of first, second, etc., it is only for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0055] In the description of the present application, it should be understood that the descriptions involving orientation, such as the orientation or positional relationship indicated as up, down, etc., are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present application.
[0056] In the description of this application, it should be noted that, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meaning of the above terms in this application based on the specific content of the technical solution.
[0057] First, some nouns involved in this application are analyzed:
[0058] Infrared ship images: In the field of ships, infrared ship images refer to cruise ships, bulk carriers, warships, sailboats, kayaks, container ships, fishing boats and other ship targets at sea, in ports and on the coast in different scenarios, at different time periods and at different resolutions. They are mainly used for the research of target detection and recognition technology for infrared ships.
[0059] Infrared images are generated based on infrared radiation (thermal radiation) emitted by objects. They can work in the absence of visible light or in low light conditions. Therefore, they are widely used in many fields such as military, security monitoring, medical imaging, industrial detection, etc., especially in the field of ships. However, due to the variability of the sea environment, such as temperature fluctuations, humidity changes, wind effects, etc., infrared ship images often contain noise and interference, making it difficult to clearly present the outline and details of the ship, resulting in poor image quality obtained by traditional infrared image processing algorithms.
[0060] Moreover, traditional infrared image processing algorithms usually assume that training data and test data come from the same distribution, but in practical applications, there may be significant differences in the data distribution between the two, namely domain shift, which in turn limits the generalization ability of traditional infrared image processing models.
[0061] In addition, due to the complexity of the sea environment, the infrared ship images generated become more complex, and there are unknown image features, which leads to recognition or classification deviations in traditional infrared image processing algorithms. Therefore, there are technical problems in the prior art of infrared ship image processing, such as poor image quality and low accuracy.
[0062] Based on this, the embodiments of the present application provide a classification method, system, electronic device and medium for infrared ship images, aiming to improve the image quality of infrared ship images and enhance the image processing performance of the model in complex situations.
[0063] The infrared ship image classification method, system, electronic device and medium provided in the embodiments of the present application are specifically described through the following embodiments. First, the infrared ship image classification method in the embodiments of the present application is described.
[0064] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0065] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0066] The infrared ship image classification method provided in the embodiment of the present application relates to the field of infrared image processing technology. The infrared ship image classification method provided in the embodiment of the present application can be applied to a terminal, can also be applied to a server side, and can also be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the infrared ship image classification method, etc., but is not limited to the above forms.
[0067] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0068] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0069] For this purpose, refer to Figure 1 The embodiment of the present application provides a classification method for infrared ship images. The method is applied to a central controller. The controller can be a server, an electronic device, or a mobile terminal, etc., which is not specifically limited here. The method includes the following steps S110 to S150.
[0070] Step S110, obtaining an infrared ship image dataset and a target infrared ship image, and dividing the infrared ship image dataset into at least two source domain infrared ship images according to domain attributes; the target infrared ship image is an image of the target domain, and the target domain is different from the source domain.
[0071] In this step, the infrared ship image dataset is not limited to the photos directly taken by the image processing device (such as visual intelligent monitoring instrument, intelligent terminal device) equipped with the infrared ship image classification system, but also includes the photos taken by other external devices (such as network cameras, portable cameras, etc.) and then imported or synchronized to the image processing device. In addition, the infrared ship image dataset may also come from the cloud storage platform and directly reach the image processing device for processing through network transmission. Similarly, these images may also be taken by independent imaging devices, such as high-end digital SLR cameras or professional cameras in different environments, and then uploaded to the image processing device through wireless transmission (Wi-Fi, Bluetooth, etc.), data cable transmission, etc.
[0072] Specifically, you can also collect public data sets by consulting academic resources such as academic papers and research reports, or collect publicly available institutional resources, or collect through professional forums and communities, or visit specialized data repositories such as Kaggle, UCI Machine Learning Repository, or other scientific research data sharing platforms.
[0073] In some embodiments, the image classification model is trained by using the IRShips infrared ship image dataset, wherein IRShips is a ship infrared image simulation dataset jointly synthesized and generated by researchers from Cranfield University, MBDA UK Ltd., and Oxford University, mainly using a long-wave infrared virtual camera in the 8-14µm frequency band, and includes at least 10 types of ships. In addition, each image has data annotation information such as shooting distance, azimuth, pitch angle, integer identification of the ship's thermal appearance, sea surface temperature, and ambient temperature.
[0074] Furthermore, the infrared ship image dataset is divided into infrared ship images of at least two source domains according to domain attributes, which are used for subsequent feature fusion and enhancement of the same type but different domains. At the same time, by ensuring that the number of samples in each source domain is large enough to represent the characteristics of the domain, and the independence and mutual exclusivity of each source domain should be maintained as much as possible, the model can learn a wider range of analysis performance according to the dataset, thereby enhancing the generalization ability of the model.
[0075] In the field of infrared image processing, domain generalization technology is particularly important because infrared ship data in reality is affected by many factors, such as changes in environmental conditions, differences in camera perspectives, and different equipment, which may cause significant changes in data distribution. Applying domain generalization technology can help the model improve its robustness on infrared ship images from different sources, especially when dealing with infrared ship data under different climate and lighting conditions, which can effectively reduce the impact of these changes on model performance.
[0076] The target domain is the domain to be learned in transfer learning, the destination of transfer learning, and the new domain to which the source domain knowledge is applied. In the context of domain generalization, the source domain refers to the environment or conditions represented by the dataset used to train and verify the image classification model, and the target domain refers to the new environment or conditions represented by the data in the actual environment encountered when the model is applied. Domain generalization (DG) refers to the ability of the image classification model to maintain good performance in unseen, new domains or distributions. This is achieved without direct access to the target domain data during training, that is, the model needs to be able to generalize the knowledge learned from the source domain to different target domains.
[0077] In the process of applying the knowledge of the source domain to the target domain, there are usually some differences between the target domain and the source domain, which may be reflected in the data distribution or feature space. The definition of the source domain enables the application of image classification models across different fields and applies existing knowledge to new problem solving, thereby improving the generalization ability and adaptability of the model.
[0078] Therefore, we can also enhance the infrared ship image dataset to generate additional training samples, increase the diversity of the dataset, help the model generalize better, and help simulate the changes of infrared ship images in different environments. Among them, enhancement techniques include image rotation, scaling, flipping, etc., which optimize the overall performance of the image classification model, thereby enhancing the robustness and accuracy of the model and reducing the risk of overfitting.
[0079] In some embodiments of the present invention, before acquiring the infrared ship image dataset, the method further includes:
[0080] Obtain an initial infrared ship image dataset;
[0081] Preprocessing the initial infrared ship image dataset to convert the initial infrared ship image dataset into a model input format required by the image classification model, thereby obtaining a processed initial infrared ship image dataset;
[0082] The processed initial infrared ship image data set is subjected to data enhancement processing to obtain an infrared ship image data set; the data enhancement processing includes at least one of rotation, translation and flipping.
[0083] In this embodiment, for the initial infrared ship image dataset used for model training, the initial infrared ship image dataset is preprocessed, and the image resolution is unified according to the input requirements of the model, so that the initial infrared ship image dataset is converted into the model input format required by the image classification model, and the processed initial infrared ship image dataset is obtained, thereby improving the model processing efficiency.
[0084] Furthermore, an infrared ship image dataset is obtained by performing data enhancement processing on the processed initial infrared ship image dataset, wherein the data enhancement processing includes data processing methods such as rotation, translation and flipping, so that the error of the training process is reduced and the model performance is better.
[0085] In some embodiments, Figure 2 As shown, for the unprocessed infrared ship image dataset , which is divided into at least two source domains of infrared ship images ( , ,... ),in, represents the sample space (source domain image), represents the label space (source domain label), is the joint space of samples and labels (the complete source domain with images and labels), Representative source domain, and Figure 2 The middle right part It represents the infrared ship image as the test domain, wherein the infrared ship image in the test domain belongs to the target domain and is used to test the ability of the model in an untrained data domain. The model is trained by using images from at least two source domains as training domains, aiming to improve the generalization ability of the model in unseen target domains.
[0086] Furthermore, the target infrared ship image can be obtained by obtaining a target initial infrared ship image, preprocessing the target initial infrared ship image, unifying the image resolution according to the input requirements of the model, and converting the target initial infrared ship image into the model input format required by the image classification model.
[0087] Specifically, the generalization performance of the model is tested by taking the infrared ship images in the target domain as the test domain. At the same time, the model performance can be further optimized through the infrared ship images in the target domain. Therefore, by implicitly or explicitly learning domain-invariant features, the model can still maintain good robustness and generalization ability when facing different infrared ship data distributions, thus solving the domain shift problem existing in the real environment.
[0088] Step S120, inputting the infrared ship images of at least two source domains into a preset image classification model, so as to extract first domain invariant features from the infrared ship images of at least two source domains through a first branch network of the image classification model, and cluster the first domain invariant features to obtain first cluster features; and extract second domain invariant features from the infrared ship images of at least two source domains through a second branch network of the image classification model, and cluster the second domain invariant features to obtain second cluster features; the structures of the first branch network and the second branch network are different.
[0089] In this step, the preset image classification model is preferably an image classification model including a first branch network and a second branch network. By inputting infrared ship images of at least two source domains into the preset image classification model, the image classification model learns image features of different source domains to be applied to infrared ship images with different domain attributes.
[0090] Specifically, a first domain invariant feature is extracted from infrared ship images of at least two source domains through a first branch network of an image classification model, and the first domain invariant feature is clustered to obtain a first cluster feature; and a second domain invariant feature is extracted from infrared ship images of at least two source domains through a second branch network of the image classification model, and the second domain invariant feature is clustered to obtain a second cluster feature, and then the two cluster features obtained by different processing methods are fused to analyze the infrared ship image, so that the image classification model can recognize more accurately, wherein the structures of the first branch network and the second branch network are different.
[0091] In some embodiments, the first branch network includes a cascaded first feature extraction unit, a CBAM (Convolutional Block Attention Module) hybrid attention unit, and a first clustering unit for clustering first domain invariant features, wherein the first feature extraction unit is a feature extractor based on ResNet18. In order to enable the image classification model to extract features with universality and cross-domain transferability from infrared ship images, the CBAM hybrid attention mechanism is introduced into the feature extractor based on ResNet18 to adaptively assign weights to different features, thereby enhancing the image classification model's ability to focus on cross-domain consistency features.
[0092] Specifically, the expressiveness of features is adjusted by adopting channel attention mechanism and spatial attention mechanism. Among them, the channel attention mechanism can adaptively enhance those feature channels containing cross-domain consistency information and weaken the channels that are greatly affected by domain-specific factors; the spatial attention mechanism can highlight local areas with cross-domain consistency and further filter out domain-specific noise information.
[0093] Specifically, the first feature extraction unit is a feature extractor based on ResNet18, where ResNet18 (Residual Network) is a deep convolutional neural network used for image classification and feature extraction. It mainly solves the gradient vanishing and overfitting problems in deep network training by introducing residual modules. ResNet18 consists of 18 layers, including 16 convolutional layers and 2 fully connected layers. The residual module is constructed through skip connection, which directly adds the input features to the output features, constructing a "short circuit" so that information can be transmitted faster, thereby solving the problem of gradient vanishing.
[0094] In some embodiments, Figure 3 As shown, the original infrared image is divided into infrared images containing at least two source domains according to the domain ( , , ... ),in, represents the source domain. Then, the infrared image ( , , ... ) Input the first branch network of the image classification model and the second branch network of the image classification model.
[0095] Specifically, the infrared images containing at least two source domains ( , , ... ) is input into the first branch network of the image classification model, and first passes through the first feature extraction unit in the first branch network From infrared images containing at least two source domains ( , , ... ) to extract the initial features , and then the initial features Input to the CBAM mixed attention unit that introduces the mixed attention mechanism to obtain the first domain invariant feature , and then through the first domain invariant features Perform clustering and obtain the first clustering feature , therefore, the first cluster feature Each source domain contains , ... Various categories.
[0096] Specifically, the infrared images containing at least two source domains ( , , ... ) is input into the second branch network of the image classification model. First, the semantic segmentation unit in the second branch network is used to classify the infrared image ( , , ... ) is segmented to obtain the infrared image ( , , ... ) and then pass through the second feature extraction unit From the infrared image ( , , ... ) to extract the second domain invariant features from the foreground image , and then the second domain invariant features are Perform clustering to obtain the second clustering feature , therefore, the second clustering feature Each source domain contains , ... Various categories.
[0097] Furthermore, the first cluster feature and the second clustering feature The features of the same type but from different domains are fused and enhanced to obtain fused enhanced features , which improves the generalization ability of the image classification model and enhances the robustness of the image classification model in complex real-world scenes.
[0098] like Figure 4 As shown in the figure, the network structure of ResNet18 (Residual Network) is divided into five stages, each of which contains multiple residual modules. The first stage is a 7x7 convolution layer, which is used to perform preliminary feature extraction on the input image. The following four stages contain multiple residual modules, each of which consists of two 3x3 convolution layers. These residual modules are interconnected through jump connections, so that information can be freely transmitted in the network. Finally, the network maps the extracted features to specific classification results through two fully connected layers, which effectively reduces the number of network parameters and computational complexity, while also improving the accuracy and generalization ability of the network. Therefore, it has extremely strong feature extraction capabilities and low computational complexity.
[0099] In some embodiments, the second branch network includes a cascaded semantic segmentation unit, a second feature extraction unit, and a second clustering unit for clustering the second domain invariant features.
[0100] Specifically, firstly, the input infrared ship image is input into the semantic segmentation unit for semantic segmentation, the redundant features of the image background are removed, the edge enhancement technology is used to enhance the edge features in the image, and then the second feature extraction unit is used to extract features of the image foreground obtained after segmentation, and finally the extracted features are clustered to obtain cluster features, thereby improving the accuracy of target recognition and making the classification result more accurate.
[0101] In some embodiments, extracting first domain invariant features from infrared ship images of at least two source domains in step S120 includes the following steps:
[0102] Step S210: extracting initial features from infrared ship images of at least two source domains through a first feature extraction unit;
[0103] Step S220: input the initial feature into the CBAM mixed attention unit to obtain the first domain invariant feature output by the CBAM mixed attention unit.
[0104] In this step, the feature extractor of ResNet18 of the first feature extraction unit is used to extract features of the infrared ship image containing at least two source domains to obtain initial features. , and then the initial features Input to the CBAM mixed attention unit, where Figure 5 As shown in Figure 2, the CBAM hybrid attention unit specifically includes a channel attention module and a spatial attention module. Therefore, the initial feature Input to the CBAM hybrid attention unit to obtain the first domain invariant feature , thereby enhancing the common information in the features and making the features more consistent across domains.
[0105] In some embodiments, the initial features are input into a channel attention module to obtain intermediate extracted features, wherein the channel attention module is a channel attention mechanism, which specifically calculates the global average pooling and / or maximum pooling of each channel feature, and then adjusts the weight of each channel through a multi-layer perceptron (MLP) or a convolutional layer to enhance the understanding of the importance of different channel features.
[0106] Furthermore, the intermediate extracted features output by the channel attention module are input into the spatial attention module to obtain the first domain invariant features, wherein the spatial attention module is a spatial attention mechanism (Spatial Attention Mechanism), which specifically performs cross-channel average pooling and maximum pooling on the feature map, and then combines the two results of cross-channel average pooling and maximum pooling to capture the spatial importance distribution, and then focuses on the spatial position information of the image, thereby enhancing the common information in the features and making the features more consistent across domains.
[0107] Furthermore, for the first domain invariant features Clustering is performed to obtain the first clustering feature As a preference, clustering can be performed using a clustering algorithm such as K-means or hierarchical clustering, thereby clustering features from different domains but with the same semantics by finding similarities in the feature space, thereby achieving cross-domain feature alignment.
[0108] In some embodiments, extracting second domain invariant features from infrared ship images of at least two source domains in step S120 includes the following steps:
[0109] Step S230, segmenting the infrared ship images of at least two source domains by a semantic segmentation unit to remove redundant features of the image background to obtain foreground images corresponding to the infrared ship images of at least two source domains;
[0110] Step S240: perform feature enhancement on the foreground image, and extract a second domain invariant feature from the enhanced foreground image by a second feature extraction unit.
[0111] In this embodiment, the second branch network includes a cascaded semantic segmentation unit, a second feature extraction unit, and a second clustering unit for clustering the second domain invariant features.
[0112] Specifically, the infrared ship image containing at least two source domains is processed through the second branch network of the image classification model, including firstly performing semantic segmentation on the input infrared ship image through a semantic segmentation unit to clearly separate the foreground and the background, thereby removing the redundant features of the image background by segmenting the infrared ship image.
[0113] Furthermore, the foreground image is enhanced by edge enhancement technology to enhance the edge features in the image, making the edge features of the infrared ship image clearer. While enhancing the domain-invariant features, certain domain-specific features are removed, thereby further reducing the domain shift caused by domain style differences.
[0114] Furthermore, the second feature extraction unit extracts features from the image foreground obtained after segmentation to obtain the second domain invariant feature , and then the second domain invariant features are Clustering is performed to obtain the second clustering feature .
[0115] Preferably, clustering can be performed using a clustering algorithm such as K-means or hierarchical clustering, thereby alleviating the impact of inter-domain distribution differences and improving the generalization ability of the model. The first clustering unit and the second clustering unit can use the same clustering method or different clustering methods, which can be determined according to unit requirements and is not limited here.
[0116] In some embodiments, the infrared ship image is first semantically segmented by a semantic segmentation unit to obtain a classification label for each pixel, thereby distinguishing the foreground (ship) from the background. The segmentation process can be combined with morphological operations (such as dilation, erosion) or other methods to optimize the boundary to ensure that the segmented foreground area can clearly display the target.
[0117] Furthermore, edge enhancement is applied to the segmented foreground area through edge detection operators (such as Sobel, Canny) or deep learning-based methods (such as EdgeNet) to highlight the edge information in the image.
[0118] In some embodiments, the original image and the enhanced edge information can be combined in a certain weighted manner to obtain a clearer image of the ship's outline. The image after semantic segmentation and edge enhancement is then input into a feature extractor to obtain a higher-level feature representation and obtain a second feature, thereby effectively removing background noise from infrared ship images, enhancing the edge features of the target, and ultimately improving the accuracy of target recognition and classification precision.
[0119] In some embodiments, semantic segmentation is performed on infrared ship images through a U-Net-based semantic segmentation unit to clearly separate the foreground and background, making the edge features of the image clearer, while enhancing domain-invariant features and removing certain domain-specific features.
[0120] Specifically, semantic segmentation refers to classification at the pixel level. Pixels belonging to the same category are classified into one category, that is, to understand the image at the pixel level. The U-Net (Convolutional Networks for Biomedical Image Segmentation) semantic segmentation unit is a deep learning unit for image segmentation tasks. The entire process of U-Net can be divided into two main parts: encoder and decoder. The encoder is responsible for extracting meaningful features from the original image, while the decoder uses these features for pixel-level classification and segmentation. The full process of the U-Net semantic segmentation model includes: the input image is extracted through the encoder layer and the resolution is gradually reduced, and then the feature map is gradually restored to the resolution through the decoder, and the features of the encoder and decoder are fused through jump connections.
[0121] Furthermore, the real number is mapped to a value between 0 and 1 through the sigmoid function (logistic function) to generate a segmentation mask, thereby obtaining the final segmentation result.
[0122] Step S130: Obtain a fusion enhancement feature according to the first cluster feature and the second cluster feature.
[0123] In this step, the first cluster feature and the second cluster feature are fused to obtain a fused feature, and then a noise is randomly sampled to enhance the fused feature to obtain a fused enhanced feature. Feature fusion refers to combining features from different sources or from the same source but different perspectives to construct a richer and more expressive feature representation.
[0124] Specifically, for clustering features, feature fusion can be achieved through a variety of methods. Optionally, it can be achieved by directly concatenating two feature vectors together to form a new feature vector, or by assigning weights to each feature based on experience or through learning, and then adding them together to create a new feature, or for feature vectors of the same length, by element-by-element multiplication, or by combining the original features to create a new feature, such as polynomial feature expansion, or by using a machine learning model (such as a fully connected layer in a neural network, a decision tree, etc.) to automatically learn how to best combine the two features to obtain a fused feature.
[0125] Furthermore, by randomly sampling a noise, the fused features are randomly enhanced and a small amount of random noise is added to the fused features, which helps the model better handle small changes in the input data and improves its robustness.
[0126] In some embodiments, obtaining a fusion enhancement feature according to the first cluster feature and the second cluster feature in step S130 includes the following steps:
[0127] Step S310: fusing the first cluster feature and the second cluster feature to obtain a fused feature;
[0128] Step S320: randomly sample a noise, perform feature enhancement on the fused feature, and obtain the fused enhanced feature.
[0129] In this embodiment, the first clustering feature and the second clustering feature The similar features from different domains are fused across domains, and a noise is randomly sampled from the normal distribution. The fused features are randomly enhanced to obtain fused enhanced features. The dual-domain similar feature mixing technology is used to learn the consistency of feature representations of different domains. At the same time, it is proposed to use Gaussian noise to perturb the features to enhance the feature representation, thereby improving the generalization ability of the image classification model and enhancing the robustness of the image classification model in complex real scenes.
[0130] Preferably, the fusion enhancement feature is calculated by the following formula:
[0131] ;
[0132] in, To enhance the fusion features, and is the noise weight, is the first clustering feature, is the second clustering feature.
[0133] In some embodiments, the calculation formula for the fusion enhancement feature is , , and You can randomly sample from the distribution or directly take the value 1, and is the default value and adopts the standard normal distribution. and is a super constant.
[0134] Step S140: gradient update the image classification model according to the fusion enhancement features, and so on, until a trained image classification model is obtained.
[0135] In this step, sample pairs are constructed by fusing the enhanced features and the first domain-invariant features to obtain positive sample pairs and negative sample pairs. The positive sample pairs are samples of the same category, and the negative sample pairs are samples of different categories. According to the positive sample pairs and the negative sample pairs, the classification model is updated using the gradient of the contrast loss function until the loss function of the classification model meets the preset conditions. By contrastive learning, the rich semantic relationships between sample pairs are used to further learn the domain-invariant representation of infrared ships and enhance the robustness of the image classification model in realistic infrared ship scenarios.
[0136] In some embodiments, in step S140, the image classification model is gradient updated according to the fusion enhancement feature, and so on, until a trained image classification model is obtained, including the following steps:
[0137] Step S410, constructing positive and negative sample pairs by fusing the enhanced features and the first domain invariant features;
[0138] Step S420: Optimize the distance between the positive and negative sample pairs according to the contrast loss function, and update the parameters of the image classification model through back propagation until a trained image classification model is obtained.
[0139] In this embodiment, the feature enhancement is achieved by fusion The first domain invariant feature Construct positive and negative sample pairs, and select samples of the same category to form positive sample pairs , samples of different categories form negative sample pairs , which is used for the subsequent optimization model process.
[0140] Furthermore, the distance between positive and negative sample pairs is optimized according to the contrastive loss function, the total loss function is calculated, and the model parameters are updated through back propagation to improve the model performance.
[0141] Step S150: input the target infrared ship image into the trained image classification model to obtain the classification result of the target infrared ship image.
[0142] In this step, the target infrared ship image is input into the trained image classification model to obtain the classification result of the target infrared ship image, which means that the image classification model can still maintain good robustness and generalization ability when facing different infrared ship data distributions, especially when dealing with infrared ship data under different climate and lighting conditions, and solve the domain offset problem existing in the real environment.
[0143] In this embodiment, if Figure 6 and Figure 7 As shown, Figure 6 This is an implementation diagram of processing through the first branch network of the image classification model. Figure 7Figure 2 is an implementation diagram of the processing by the second branch network of the image classification model, which specifically includes the effective removal of redundant information in the infrared ship image using semantic segmentation and hybrid attention mechanism to obtain domain-invariant features while avoiding the loss of some important information in the extracted domain-invariant features.
[0144] Furthermore, the extracted features are fused and enhanced to ensure the diversity of the extracted features, and finally contrastive learning is used to further enhance the generalization ability of the model. The two branch networks use different processing procedures, so different processing results are obtained, which provide data that more accurately reflects the image features for subsequent feature fusion, provide data support for the model to more accurately determine the target and classify, improve the model's ability to process images, and enhance the model's generalization performance.
[0145] In some embodiments, the trained image classification model may also be optimized according to the classification result of the target infrared ship image and the true category of the classification result of the target infrared ship image, so that the image classification model has better performance in target domain data processing.
[0146] In this embodiment, an infrared ship image dataset and a target infrared ship image are acquired, and the infrared ship image dataset is divided into infrared ship images of at least two source domains according to domain attributes; the target infrared ship image is an image of the target domain, and the target domain is different from the source domain; the infrared ship images of at least two source domains are input into a preset image classification model, so as to extract first domain invariant features from the infrared ship images of at least two source domains through a first branch network of the image classification model, and cluster the first domain invariant features to obtain first clustering features; and extract second domain invariant features from the infrared ship images of at least two source domains through a second branch network of the image classification model, and cluster the second domain invariant features to obtain second clustering features; the structures of the first branch network and the second branch network are different; a fusion enhancement feature is obtained according to the first clustering feature and the second clustering feature; the image classification model is gradient updated according to the fusion enhancement feature, and so on, until a trained image classification model is obtained; the target infrared ship image is input into the trained image classification model to obtain a classification result of the target infrared ship image, which can improve the image quality of infrared ship images and enhance the image processing performance of the model under complex conditions.
[0147] In this embodiment, by implicitly or explicitly learning domain invariant features and training on multiple related tasks, a rapid adjustment capability is learned so that when faced with new and unseen tasks, existing knowledge can be effectively utilized, so that the image classification model can still maintain good robustness and generalization capabilities when faced with different infrared ship image data distributions, and the image classification model can quickly adapt to new tasks. Therefore, when faced with new infrared ship data, it can quickly adjust to adapt to different environments.
[0148] like Figure 8 As shown, some embodiments of the present application provide a classification system for infrared ship images, the system includes an acquisition module 810, an extraction module 820, a fusion module 830, an update module 840, and a classification module 850, specifically:
[0149] The acquisition module 810 is used to acquire an infrared ship image dataset and a target infrared ship image, and divide the infrared ship image dataset into infrared ship images of at least two source domains according to domain attributes; the target infrared ship image is an image of the target domain, and the target domain is different from the source domain;
[0150] The extraction module 820 is used to input the infrared ship images of at least two source domains into a preset image classification model, so as to extract first domain invariant features from the infrared ship images of at least two source domains through a first branch network of the image classification model, and cluster the first domain invariant features to obtain first cluster features; and extract second domain invariant features from the infrared ship images of at least two source domains through a second branch network of the image classification model, and cluster the second domain invariant features to obtain second cluster features; the structures of the first branch network and the second branch network are different;
[0151] A fusion module 830, configured to obtain a fusion enhancement feature according to the first cluster feature and the second cluster feature;
[0152] An updating module 840 is used to perform gradient updating on the image classification model according to the fusion enhancement feature, and so on, until a trained image classification model is obtained;
[0153] The classification module 850 is used to input the target infrared ship image into the trained image classification model to obtain the classification result of the target infrared ship image.
[0154] In some implementations, the acquisition module 810 may include: acquiring an initial infrared ship image dataset.
[0155] In some embodiments, the acquisition module 810 may include: preprocessing the initial infrared ship image dataset to convert the initial infrared ship image dataset into a model input format required by the image classification model to obtain a processed initial infrared ship image dataset.
[0156] In some embodiments, the acquisition module 810 may include: performing data enhancement processing on the processed initial infrared ship image data set to obtain the infrared ship image data set; the data enhancement processing includes at least one of rotation, translation and flipping.
[0157] In some implementations, the extraction module 820 may include: extracting initial features from infrared ship images of at least two source domains through a first feature extraction unit.
[0158] In some embodiments, the extraction module 820 may include: inputting the initial feature into a CBAM mixed attention unit to obtain a first domain invariant feature output by the CBAM mixed attention unit.
[0159] In some embodiments, the extraction module 820 may include: segmenting the infrared ship images of at least two source domains through a semantic segmentation unit to remove redundant features of the image background to obtain foreground images corresponding to the infrared ship images of at least two source domains.
[0160] In some implementations, the extraction module 820 may include: performing feature enhancement on the foreground image, and extracting the second domain-invariant feature from the enhanced foreground image through a second feature extraction unit.
[0161] In some implementations, the fusion module 830 may include: fusing the first clustering feature and the second clustering feature to obtain a fused feature.
[0162] In some implementations, the fusion module 830 may include: randomly sampling a noise, performing feature enhancement on the fusion feature, and obtaining the fusion enhanced feature.
[0163] In some implementations, the fusion module 830 may include:
[0164] ;
[0165] in, To enhance the fusion features, and is the preset weight, is the first clustering feature, is the second clustering feature.
[0166] In some implementations, the updating module 840 may include: constructing positive and negative sample pairs by fusing the enhanced features and the first domain invariant features.
[0167] In some embodiments, the updating module 840 may include: optimizing the distance between the positive and negative sample pairs according to the contrast loss function, and updating the parameters of the image classification model by back propagation until a trained image classification model is obtained.
[0168] It should be noted that the infrared ship image classification system provided in this embodiment and the above-mentioned infrared ship image classification method are based on the same inventive concept, so the relevant content of the above-mentioned infrared ship image classification method is also applicable to the content of the infrared ship image classification system, and therefore, it will not be repeated here.
[0169] In order to solve the technical problems of poor image quality and low accuracy in infrared ship image processing in the prior art, the system divides the infrared ship image data set into infrared ship images of at least two source domains; inputs the infrared ship image into a preset image classification model, extracts the first domain invariant features from the infrared ship image through the first branch network of the image classification model, and clusters the first domain invariant features to obtain the first clustering features; and extracts the second domain invariant features from the infrared ship image through the second branch network of the image classification model, and clusters the second domain invariant features to obtain the second clustering features; obtains fusion enhancement features based on the first clustering features and the second clustering features; performs gradient update on the image classification model based on the fusion enhancement features to obtain a trained image classification model; inputs the target infrared ship image into the trained image classification model to obtain the classification result of the target infrared ship image. In this way, the quality of infrared ship images can be improved and the processing performance can be enhanced.
[0170] An embodiment of the present application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor implements the above-mentioned infrared ship image classification method when executing the computer program.
[0171] like Fig. 9 , Fig. 9 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application, wherein the electronic device includes:
[0172] At least one battery;
[0173] at least one memory;
[0174] at least one processor;
[0175] at least one program;
[0176] The program is stored in the memory, and the processor executes at least one program to implement the above-mentioned infrared ship image classification method implemented in the present disclosure.
[0177] The electronic device may be any intelligent terminal including a mobile phone, a tablet computer, a personal digital assistant (PDA), a vehicle-mounted computer, etc.
[0178] The electronic device according to the embodiment of the present application is described in detail below.
[0179] The processor 1600 may be implemented by a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present disclosure;
[0180] The memory 1700 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1700 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1700, and the processor 1600 calls and executes a classification method for infrared ship images in the embodiment of the present disclosure.
[0181] Input / output interface 1800, used to implement information input and output;
[0182] Communication interface 1900, used to realize communication interaction between the device and other devices, which can be realized through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);
[0183] Bus 2000 , which transmits information between various components of the device (e.g., processor 1600 , memory 1700 , input / output interface 1800 , and communication interface 1900 );
[0184] The processor 1600 , the memory 1700 , the input / output interface 1800 , and the communication interface 1900 are connected to each other in communication within the device via the bus 2000 .
[0185] The embodiment of the present disclosure also provides a storage medium, which is a computer-readable storage medium. The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the above-mentioned infrared ship image classification method.
[0186] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0187] The embodiments described in the embodiments of the present disclosure are intended to more clearly illustrate the technical solutions of the embodiments of the present disclosure and do not constitute a limitation on the technical solutions provided by the embodiments of the present disclosure. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of the present disclosure are also applicable to similar technical problems.
[0188] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present disclosure, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0189] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0190] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0191] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application 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 interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising 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.
[0192] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0193] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0194] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0195] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0196] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable an electronic device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store programs.
[0197] The above is a specific description of the preferred implementation of the embodiments of the present application, but the embodiments of the present application are not limited to the above-mentioned implementation methods. Technical personnel familiar with the field can also make various equivalent modifications or substitutions without violating the spirit of the embodiments of the present application. These equivalent modifications or substitutions are all included in the scope defined by the claims of the embodiments of the present application.
[0198] The embodiments of the present application are described in detail above in conjunction with the accompanying drawings, but the present application is not limited to the above embodiments. Various changes can be made within the knowledge scope of ordinary technicians in the relevant technical field without departing from the purpose of the present application.
Claims
1. A classification method for infrared ship images, characterized in that: The method comprises: An infrared ship image dataset and a target infrared ship image are acquired, and the infrared ship image dataset is divided into infrared ship images of at least two source domains according to domain attributes; the target infrared ship image is an image of a target domain, and the target domain is different from the source domain; The infrared ship images of the at least two source domains are input into a preset image classification model, so as to extract first domain invariant features from the infrared ship images of the at least two source domains through a first branch network of the image classification model, and cluster the first domain invariant features to obtain first cluster features; and extract second domain invariant features from the infrared ship images of the at least two source domains through a second branch network of the image classification model, and cluster the second domain invariant features to obtain second cluster features; the structures of the first branch network and the second branch network are different; Obtaining a fusion enhancement feature according to the first clustering feature and the second clustering feature; Performing gradient updating on the image classification model according to the fusion enhancement feature, and so on, until a trained image classification model is obtained; Inputting the target infrared ship image into a trained image classification model to obtain a classification result of the target infrared ship image; The first branch network includes a cascaded first feature extraction unit, a CBAM hybrid attention unit, and a first clustering unit for clustering the first domain invariant features; The step of extracting first domain invariant features from the infrared ship images of the at least two source domains comprises: Extracting initial features from the infrared ship images of the at least two source domains by the first feature extraction unit; Inputting the initial feature into the CBAM mixed attention unit to obtain the first domain invariant feature output by the CBAM mixed attention unit; The second branch network includes a cascaded semantic segmentation unit, a second feature extraction unit, and a second clustering unit for clustering the second domain invariant features; The step of extracting second domain invariant features from the infrared ship images of the at least two source domains comprises: Segmenting the infrared ship images of the at least two source domains by the semantic segmentation unit to remove redundant features of the image background to obtain foreground images corresponding to the infrared ship images of the at least two source domains; Feature enhancement is performed on the foreground image, and the second domain invariant feature is extracted from the enhanced foreground image by the second feature extraction unit.
2. The classification method of infrared ship images according to claim 1 is characterized in that: Before acquiring the infrared ship image dataset, the method further includes: Obtain an initial infrared ship image dataset; Preprocessing the initial infrared ship image dataset to convert the initial infrared ship image dataset into a model input format required by the image classification model to obtain a processed initial infrared ship image dataset; The processed initial infrared ship image data set is subjected to data enhancement processing to obtain the infrared ship image data set; the data enhancement processing includes at least one of rotation, translation and flipping.
3. The classification method of infrared ship images according to claim 1 is characterized in that: The obtaining a fusion enhancement feature according to the first cluster feature and the second cluster feature includes: Fusing the first clustering feature and the second clustering feature to obtain a fused feature; A noise is randomly sampled, and the fused feature is enhanced to obtain the fused enhanced feature.
4. The classification method of infrared ship images according to claim 3 is characterized in that: The fusion enhancement feature is calculated by the following formula: ; in, To fuse enhanced features, and is the noise weight, is the first clustering feature, is the second clustering feature.
5. The classification method of infrared ship images according to claim 1 is characterized in that: The step of performing gradient updating on the image classification model according to the fusion enhancement feature, and so on, until a trained image classification model is obtained, comprises: Constructing positive and negative sample pairs by using the fusion enhanced features and the first domain invariant features; The distance between the positive and negative sample pairs is optimized according to the contrast loss function, and the parameters of the image classification model are updated by back propagation until a trained image classification model is obtained.
6. A classification system for infrared ship images, characterized in that: The system comprises: an acquisition module, used for acquiring an infrared ship image dataset and a target infrared ship image, and dividing the infrared ship image dataset into infrared ship images of at least two source domains according to domain attributes; the target infrared ship image is an image of a target domain, and the target domain is different from the source domain; an extraction module, configured to input the infrared ship images of the at least two source domains into a preset image classification model, so as to extract first domain invariant features from the infrared ship images of the at least two source domains through a first branch network of the image classification model, and cluster the first domain invariant features to obtain first cluster features; and extract second domain invariant features from the infrared ship images of the at least two source domains through a second branch network of the image classification model, and cluster the second domain invariant features to obtain second cluster features; the first branch network and the second branch network have different structures; A fusion module, used for obtaining a fusion enhancement feature according to the first cluster feature and the second cluster feature; An updating module, used for performing gradient updating on the image classification model according to the fusion enhancement feature, and so on, until a trained image classification model is obtained; A classification module, used for inputting the target infrared ship image into a trained image classification model to obtain a classification result of the target infrared ship image; The first branch network includes a cascaded first feature extraction unit, a CBAM hybrid attention unit, and a first clustering unit for clustering the first domain invariant features; The step of extracting first domain invariant features from the infrared ship images of the at least two source domains comprises: Extracting initial features from the infrared ship images of the at least two source domains by the first feature extraction unit; Inputting the initial feature into the CBAM mixed attention unit to obtain the first domain invariant feature output by the CBAM mixed attention unit; The second branch network includes a cascaded semantic segmentation unit, a second feature extraction unit, and a second clustering unit for clustering the second domain invariant features; The step of extracting second domain invariant features from the infrared ship images of the at least two source domains comprises: Segmenting the infrared ship images of the at least two source domains by the semantic segmentation unit to remove redundant features of the image background to obtain foreground images corresponding to the infrared ship images of the at least two source domains; Feature enhancement is performed on the foreground image, and the second domain invariant feature is extracted from the enhanced foreground image by the second feature extraction unit.
7. An electronic device, characterized in that: It includes at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor so that the at least one control processor can execute the infrared ship image classification method described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the infrared ship image classification method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Visible light image and infrared image fusion ship classification method and device based on deep learning
CN113610180A
Adaptive infrared ship semantic segmentation method and system based on SAM enhanced domain
CN119169295A