Cross-domain small target detection method, system and device based on ViT and fuzzy system adapter and medium
By introducing a fuzzy system adapter and a desertation anchor frame mechanism in small target detection, the problem of decreased accuracy and insufficient cross -domain adaptability of small and small target detection in complex environments, and achieved efficient small target detection and cross -domain tasks. Essence
Patent Information
- Application Number
- CN202411544244.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-01-28
AI Technical Summary
The prior art has reduced accuracy and insufficient cross-domain adaptability in complex environments, especially in high noise conditions, which are difficult to effectively detect small objects.
Use cross -domain target detection methods based on VIT and fuzzy system adapters, enhance its robustness through fuzzy logic processing input features, and combine the features of the desertation anchor frame to improve the characteristics Essence
It significantly improves the accuracy and cross -domain adaptability of small and medium target detection in complex environments, reduces the burden of calculation, and enhances the generalization capacity of the model.
Smart Images

Figure CN119379994A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer vision and deep learning, and relates to a cross-domain small target detection method, system, device and medium based on ViT and fuzzy system adapter. Background Art
[0002] In the field of computer vision, deep learning models have demonstrated excellent performance in target detection and recognition tasks, especially in target detection in natural scenes. However, when this technology is applied to small target detection in complex environments, it still faces many challenges. These challenges include small target scale, complex background, and severe noise interference. These factors cause the detection accuracy of traditional target detection models in these scenarios to drop significantly, and the generalization ability is also severely limited. Especially in cross-domain application scenarios, the adaptability of the model becomes the main bottleneck, making it difficult to achieve ideal detection results in scenarios outside the training data. Therefore, how to effectively improve the model's ability to detect small targets in complex environments and enhance its cross-domain adaptability is an important technical issue that needs to be solved urgently.
[0003] Existing detection methods, such as models based on convolutional neural networks (CNN) or Transformer, perform well on standard data sets, but in complex and high-noise environments, the detection performance is often greatly reduced. For example, Chinese patent application CN118334313A discloses a lightweight remote sensing image target detection method based on deep learning. This method solves the problems of uneven target size, uneven target distribution, and complex background in remote sensing images by designing a frequency domain attention module and a lightweight multi-scale receptive field feature fusion module, effectively improving the distinction between the target and the background and the detection accuracy. However, this method still faces the problem of insufficient generalization ability in extremely complex environments, especially the inability to provide sufficient robustness in cross-domain detection tasks.
[0004] In addition, Chinese patent application CN116994116B proposed a target detection method and system based on the self-attention model and YOLOv5, which solves the problem of small target detection in the entire high-altitude area and low-altitude area by combining high-definition video at high altitude and rapid video at low altitude, and combining the Transformer model and YOLOv5 model for feature enhancement and target detection. However, this method relies on the acquisition of multi-source high-definition images, and there are still challenges in detecting small targets in complex backgrounds, especially when facing cross-domain tasks, the adaptability and computational efficiency of the model are not fully guaranteed.
[0005] Therefore, the prior art urgently needs a new model that can effectively improve the detection accuracy of small targets in complex environments, enhance cross-domain adaptability and reduce computational burden. The FSDN-DETR model proposed in the present invention solves the above problems by introducing a mechanism combining a fuzzy system adapter with a denoising anchor frame. The fuzzy system adapter enhances the robustness of the features, enabling the model to better cope with uncertainty and fuzzy features; the denoising anchor frame mechanism improves the detection accuracy in a noisy environment, thereby effectively improving the cross-domain generalization ability of the model and reducing computational costs.
[0006] [1] Xiang Siyuan, Shi Aiye. A lightweight remote sensing image target detection method based on deep learning[P]. Jiangsu Province: CN202410476059.1, 2024-07-12. [2] Yang Wenbo, Shi Puli, Ma Xiaoyu, et al. Object detection method and system based on self-attention model and yolov5[P]. Beijing: CN202310977658.7, 2024-04-16. Summary of the invention In view of the problems existing in the prior art, the present invention provides a cross-domain small target detection method based on ViT and fuzzy system adapter to solve the problems of reduced accuracy and insufficient cross-domain adaptability of small target detection in complex environments. This method improves the robustness and detection accuracy of features by combining fuzzy logic and denoising anchor frame mechanism, thereby achieving efficient small target detection, especially in complex backgrounds and high noise conditions. In addition, the present invention aims to enhance the cross-domain adaptability of the model, reduce the dependence of training on large-scale annotated data, reduce the computational burden, and provide new solutions for small target detection and cross-domain tasks in complex environments.
[0007] The present invention is achieved through the following technical solutions: A cross-domain small target detection method based on ViT and fuzzy system adapter, including: The preliminary multi-scale feature matrix is fuzzy enhanced and self-attention encoded to obtain the global feature matrix ; For the global feature matrix Perform denoising and fuzzy system enhancement to obtain the fuzzy enhancement feature matrix ; Fuzzy Enhanced Feature Matrix Perform feature decoding to capture feature relationships in complex backgrounds and perform target location and classification to generate a decoding feature matrix ; Based on the decoding feature matrix Classification and positioning optimization are performed to output the category and bounding box position of the detected target and generate small target detection results.
[0008] Preferably, the extraction process of the preliminary multi-scale feature matrix is: performing feature extraction of a convolutional neural network on the input image block feature matrix, extracting the underlying feature information of the image, generating a feature representation suitable for input into a subsequent Transformer encoder, and calculating it through a backbone network to generate a preliminary multi-scale feature matrix.
[0009] Preferably, the processing process of the image block feature matrix is: The input image is divided into image blocks of fixed size, and each image block is flattened into a one-dimensional feature representation through linear projection, and then calculated through the linear projection and flattening module to generate an image block feature matrix.
[0010] Preferably, the specific process of the fuzzy enhancement processing and self-attention encoding is: The preliminary feature matrix is fuzzified and enhanced, and the input features are fuzzified through the fuzzy system converter and the attention mechanism smoother to cope with the uncertainty in the complex environment and generate a fuzzy feature matrix , and then the fuzzy feature matrix Perform self-attention encoding to capture the long-range dependencies of input features and improve the globality of feature expression to obtain a global feature matrix .
[0011] Preferably, the specific process of the noise reduction processing and the fuzzy system enhancement processing is: Fuzzy enhancement feature matrix based on anchor boxes of different scales Perform denoising to generate a high-quality denoised feature matrix , and then denoising feature matrix The fuzzy system is enhanced by combining fuzzy membership and self-attention mechanism to further extract detailed features in complex environments and generate a fuzzy enhanced feature matrix. .
[0012] Preferably, a cross-domain fine-tuning strategy is adopted to fine-tune and optimize the components of the fuzzy system and the denoising anchor frame components by freezing some layers of the Transformer encoder and the Transformer decoder to adapt to the feature distribution of the target domain.
[0013] A cross-domain small target detection system based on ViT and fuzzy system adapter, including a fuzzy adapter Transformer encoder module, a fuzzy denoising anchor box Transformer decoder module and a prediction output module; The fuzzy adapter Transformer encoder module includes a fuzzy attention cross-domain module and a Transformer encoder; The fuzzy attention cross-domain module is used to perform fuzzy enhancement processing on the preliminary multi-scale feature matrix; The Transformer encoder is used to perform self-attention encoding on the thickness features of the row fuzzy enhancement process to obtain a global feature matrix ; The fuzzy denoising anchor box Transformer decoder module includes a denoising anchor box module, a fuzzy system attention module and a Transformer decoder; The noise anchor frame module is used to Perform denoising, The fuzzy system attention module is used to perform fuzzy system enhancement processing on the features after denoising to obtain a fuzzy enhanced feature matrix ; The Transformer decoder is used to fuzzy enhance the feature matrix Perform feature decoding to capture feature relationships in complex backgrounds and perform target location and classification to generate a decoding feature matrix ; The prediction output module is used to predict the Classification and positioning optimization are performed to output the category and bounding box position of the detected target and generate small target detection results.
[0014] Preferably, it also includes a linear projection and flattening module, a backbone network module and a cross-domain fine-tuning strategy module; The linear projection and flattening module is used to perform image block division and linear projection processing on the input image data to obtain a flattened image block feature matrix; The backbone network module is used to perform feature extraction of a convolutional neural network on an image block feature matrix to generate a preliminary multi-scale feature matrix; The cross-domain fine-tuning strategy module is used to fine-tune and optimize the fuzzy system component and the denoising anchor frame component by freezing some layers of the Transformer encoder and the Transformer decoder to adapt to the feature distribution of the target domain.
[0015] An electronic device comprises a processor and a memory, wherein at least one instruction is stored in the memory, and the instruction stored in the memory is executed to implement a cross-domain small target detection method based on ViT and a fuzzy system adapter.
[0016] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the cross-domain small target detection method based on ViT and a fuzzy system adapter is implemented.
[0017] Compared with the prior art, the present invention has the following beneficial technical effects: The present invention provides a cross-domain small target detection method based on ViT and fuzzy system adapter, which is used for small target detection in complex and noisy environments. The input features are processed by fuzzy logic to enhance its robustness to uncertainty in complex environments. The global information of the self-attention mechanism is extracted for the same input features to enhance the long-range dependency of the features. The enhanced feature matrix is enhanced by defining anchor frames of different scales. Denoising is performed to remove invalid noise and retain high-quality features; at the same time, fuzzy logic and self-attention mechanism are combined to further refine the denoised features to improve the detection effect of small targets in complex environments. The features processed by the fuzzy denoising anchor frame module and the fuzzy system attention are decoded to capture the relationship between the features to achieve accurate positioning and classification of the target. The decoded feature matrix is optimized by the classification and positioning algorithm, and the detection result of the small target is finally output to solve the problem of reduced accuracy and insufficient cross-domain adaptability of small target detection in complex environments. This method improves the robustness and detection accuracy of the features by combining fuzzy logic and denoising anchor frame mechanism, thereby achieving efficient small target detection, especially under complex backgrounds and high noise conditions. It has significant advantages. In addition, the present invention aims to enhance the cross-domain adaptability of the model, reduce the dependence of training on large-scale labeled data, reduce the computational burden, provide new solutions for small target detection and cross-domain tasks in complex environments, effectively improve the accuracy of small target detection, handle uncertainty in complex backgrounds, reduce dependence on large-scale labeled data, and enhance the cross-domain generalization ability of the model.
[0018] Furthermore, the present invention fine-tunes the model for cross-domain tasks through a cross-domain fine-tuning strategy, by freezing the Transformer encoder and decoder layers during training and only fine-tuning the fuzzy adaptation component. The purpose is to maintain the global feature extraction and decoding capabilities of the encoder and decoder, while optimizing specific components to adapt to the feature distribution of the target domain, thereby reducing dependence on large-scale annotated data and enhancing the generalization ability of the model in different fields. During the fine-tuning stage, the adjustment of the model focuses on the fuzzy adaptation component and the denoising feature processing module to better adapt to changes in the target domain while maintaining the stability of the original feature encoding and decoding structure. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 This is a flow chart of the cross-domain small target detection method based on ViT and fuzzy system adapter in the method of the present invention. Figure 2 It is a schematic diagram of the architecture of the FSDN-DETR framework in the method of the present invention; Figure 3is a schematic diagram of a fuzzy adapter Transformer encoder module in the method of the present invention; Figure 4 is a schematic diagram of a fuzzy denoising Transformer decoder module in the method of the present invention; Figure 5 It is a schematic diagram of the training strategy of the FSDN-DETR model in the method of the present invention; DETAILED DESCRIPTION The present invention is further described in detail below in conjunction with specific embodiments, which are intended to explain the present invention rather than to limit it.
[0020] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described 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, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0021] Example 1. The present invention discloses a cross-domain small target detection method (FSDN-DETR) based on ViT and fuzzy system adapter, which aims to improve the accuracy of small target detection, handle uncertainty in complex backgrounds, reduce dependence on large-scale labeled data, and enhance the cross-domain generalization ability of the model.
[0022] In an embodiment according to the present disclosure, the cross-domain small target detection system based on ViT and fuzzy system adapter includes a linear projection and flattening module, a backbone network module, a fuzzy adapter Transformer encoder module, a fuzzy denoising anchor box Transformer decoder module, a prediction output module and a cross-domain fine-tuning strategy. The fuzzy adapter Transformer encoder enhances the robustness of feature representation through fuzzy logic, so that the model can better adapt to complex environments; the fuzzy denoising Transformer decoder combines the denoising anchor box mechanism to denoise the features and improve the detection accuracy; the two-stage fine-tuning strategy is used to optimize the adaptability of the model in cross-domain tasks, and the dynamic attention adjustment mechanism ensures that the model can effectively focus on the target area. Compared with the prior art, the present invention effectively improves the accuracy of small target detection through the combination of fuzzy logic system and denoising anchor box, specifically: Linear Projection Flattened Patches: It is used to divide the input image into image blocks of fixed size and flatten each image block into a one-dimensional feature representation through linear projection, thereby providing input for the subsequent feature extraction module. The linear projection and flattening module calculates and generates an image block feature matrix.
[0023] Backbone network: used to extract preliminary features of the input image, including multiple convolutional layers and pooling layers of ResNet to extract the underlying feature information of the image and generate feature representations suitable for input to the subsequent Transformer encoder. The backbone network calculates and generates a preliminary feature matrix.
[0024] Fuzzy Adapter Transformer Encoder: Connect the Transformer encoder with the fuzzy attention cross-domain module through an adapter to enhance the robustness of input features and improve feature expression capabilities.
[0025] The FuzzyAdapter Transformer encoder module consists of: Fuzzy attention cross-domain module: includes a fuzzy system converter and an attention mechanism smoother, which is used to process input features through fuzzy logic and self-attention mechanism to cope with uncertainties in complex environments. The fuzzy attention cross-domain module calculates the input features to generate a fuzzy enhanced feature matrix.
[0026] Transformer encoder: extract global information from the fuzzy adapted features, use the self-attention mechanism to capture long-distance feature dependencies, improve the detection effect of targets in complex backgrounds, and generate a global enhanced feature matrix through calculation by the Transformer encoder.
[0027] Fuzzy denoising anchor box Transformer decoder: It includes the denoising anchor box module and the fuzzy system attention module, which are adapted to be connected to the Transformer decoder part to further decode the denoised features and improve the accuracy of small target detection.
[0028] The fuzzy denoising anchor box Transformer decoder includes: Denoising anchor frame module: It is used to perform denoising on the input features. By defining anchor frames of different scales and positions, it can remove noise from the features, retain high-quality features, and enhance the detection accuracy in high-noise environments. The denoising anchor frame module calculates and generates a denoised feature matrix.
[0029] Fuzzy system attention module: Combining fuzzy logic and self-attention mechanism, the denoised features are refined to further improve the detection performance of the model in complex environments. The fuzzy system attention module calculates and generates a refined feature matrix.
[0030] Transformer decoder: Combined with the fuzzy system attention mechanism, the features output from the fuzzy denoising anchor box Transformer decoder are decoded, focusing on the refined detection of small targets, improving the positioning and classification accuracy in complex scenes, and calculated by the Transformer decoder to generate a decoding feature matrix.
[0031] Prediction output module: Based on the similarity matching convolutional network, the decoded features are further classified and positioned to optimize, and finally the detection results of small targets are output, including the target category and bounding box position.
[0032] Cross-domain fine-tuning strategy: By freezing some pre-trained modules, including the Transformer decoder and Transformer encoder, only fine-tuning the fuzzy adaptation components, including the fuzzy adapter Transformer encoder and the fuzzy denoising anchor box Transformer decoder, to enhance the adaptability of the model in cross-domain tasks and reduce the need for large-scale labeled data.
[0033] One of the preferred implementations: the backbone network module includes using a deep convolutional network ResNet to process the input data matrix Perform feature extraction to generate a preliminary feature matrix at multiple scales , the calculation formula of each feature matrix is:
[0034] in, Represents a function that uses ResNet to extract features. It is a multi-scale feature representation output at different network layers.
[0035] One of the preferred implementations: the fuzzy adapter Transformer encoder includes the preliminary feature matrix Perform feature enhancement, and its structure is combined with the Transformer encoder through the fuzzy attention cross-domain module (FACM) to generate an enhanced feature matrix The fuzzy attention cross-domain module (FACM) includes a fuzzy rule base and a fuzzy membership calculation module. The feature enhancement process is expressed as:
[0036] in, is the feature output after Transformer encoder processing, is the feature output calculated by the fuzzy attention cross-domain module, and is the learnable weight coefficient. The fuzzy membership calculation is expressed by the following formula:
[0037] in, For the The membership function of the fuzzy rules is is the input feature, is an adjustable parameter, is the center of the fuzzy rule.
[0038] One of the preferred implementations: the fuzzy denoising anchor box Transformer decoder includes a denoising anchor box module and a fuzzy system attention module. The denoising anchor box module defines anchor boxes of different scales to input feature matrix After noise reduction, the output feature is expressed as:
[0039] in, is the weight of the scale anchor box, For the The fuzzy membership matrix of anchor boxes, is the number of anchor box scales, is the element-wise product operator.
[0040] Feature matrix after denoising After being processed by the fuzzy system attention module, the noise reduction effect is further optimized, and the fuzzy enhancement process is expressed as:
[0041] in, is the number of fuzzy rules, is the weight of each rule, is the fuzzy membership function.
[0042] One of the preferred implementations: the cross-domain fine-tuning strategy module freezes some layers of the Transformer encoder and decoder, and only fine-tunes the fuzzy system adapter and denoising anchor frame modules to improve the cross-domain generalization ability of the model. The specific loss function optimization strategy is as follows:
[0043] in, and are the model parameters of the fuzzy adapter Transformer encoder and the denoising anchor box Transformer decoder, Represents the total loss function, which is composed of the reconstruction loss Matching losses with Hungary Combination of:
[0044] in, and is the loss weight coefficient.
[0045] One of the preferred implementations: the Transformer encoder includes a multi-head attention layer, a layer normalization layer, a feedforward layer and a Softmax layer, and the feature matrix The calculation is expressed as:
[0046] in, are query matrix, key matrix and value matrix respectively. is the feature dimension, For blurred attention One of the preferred implementations: The fuzzy attention cross-domain module defines the fuzzy rule base by the following formula And membership function , and calculate the input features Matching degree with fuzzy rules :
[0047] in, is the input feature matrix, is the fuzzy rule matrix, is the membership function. The fuzzy rules are optimized by adjusting the importance of the following fuzzy rules:
[0048] in, is the importance weight of the fuzzy rule.
[0049] One of the preferred implementations: the denoising anchor frame module performs denoising based on multi-scale anchor frames and defines a set of anchor frames of different scales. , for the input feature matrix To optimize noise reduction, the specific formula is:
[0050] in, is the anchor box weight, For the anchor box The corresponding fuzzy membership function.
[0051] One of the preferred implementations: the fuzzy system attention module is used to calculate the noise-reduced feature matrix Fuzzy enhancement processing is performed, and the enhancement process is adjusted by fuzzy membership Finish:
[0052] in, is the fuzzy membership matrix, is the fuzzy rule weight, Represents the Hadamard product.
[0053] One of the preferred implementations: The loss function of the Transformer decoder includes the reconstruction loss and Hungarian matching loss . The reconstruction loss is defined as:
[0054] in, is the number of targets in target detection, For the The ground-truth bounding box of the object, The model predicts bounding boxes, express and The L1 loss between is the weight of GIoU loss, is the generalized intersection over union loss, which is defined as:
[0055] in, Represents the intersection area of the predicted box and the true box, represents the union area of the predicted box and the true box, is the area of the minimum enclosing rectangle.
[0056] Hungarian matching loss Defined as:
[0057] in, is the category classification loss, Indicates The predicted category of the target, is the true category label, represents the reconstruction loss of the bounding box, is the weight factor of the reconstruction loss.
[0058] Total loss function The weighted sum of the reconstruction loss and the Hungarian matching loss is expressed as:
[0059] in, and are the weight coefficients of reconstruction loss and Hungarian matching loss respectively. This loss function is used to optimize the performance of the Transformer decoder in small target detection tasks and improve the positioning and classification accuracy of the model.
[0060] A cross-domain small target detection method based on ViT and fuzzy system adapter, the specific steps are as follows: S1: The linear projection and flattening step is used to divide the input image data into image blocks and perform linear projection processing to obtain the flattened image block feature matrix to provide input for subsequent feature extraction.
[0061] S2: The backbone network feature extraction step is used to perform convolutional neural network feature extraction on the image block feature matrix after linear projection and flattening to generate a preliminary multi-scale feature matrix .
[0062] S3: The fuzzy attention cross-domain module feature enhancement step is used to perform fuzzy enhancement processing on the preliminary feature matrix extracted by the backbone network feature. The processing fuzzifies the input features through the fuzzy system converter and the attention mechanism smoother to cope with the uncertainty in the complex environment and generate a fuzzy feature matrix .
[0063] S4: Transformer encoder step is used to fuzzify the feature matrix processed by the fuzzy attention cross-domain module Perform self-attention encoding to capture the long-range dependencies of input features and improve the globality of feature expression, generating an enhanced global feature matrix .
[0064] S5: The fuzzy denoising anchor frame step is used to enhance the feature matrix after the Transformer encoder processing Perform denoising. The denoising process performs denoising calculations on features based on anchor frames of different scales to generate a high-quality denoised feature matrix .
[0065] S6: The fuzzy system attention processing step is used to process the feature matrix after the denoised anchor frame processing. Perform fuzzy system enhancement processing, which combines fuzzy membership and self-attention mechanism to further extract detailed features in complex environments to generate a fuzzy enhanced feature matrix .
[0066] S7: Transformer decoder step is used to process the fuzzy enhanced feature matrix after the fuzzy system attention processing Perform feature decoding to capture feature relationships in complex backgrounds and perform target location and classification to generate a decoding feature matrix .
[0067] S8: The prediction output step is used to decode the feature matrix after the Transformer decoder is processed. Classification and positioning optimization are performed to output the category and bounding box position of the detected target, and finally generate small target detection results.
[0068] S9: The cross-domain fine-tuning strategy step is used to fine-tune the model for cross-domain tasks. The strategy freezes some pre-trained Transformer encoder and decoder layers and only fine-tunes the fuzzy adaptation component and denoising anchor frame module to improve the generalization ability of the model in different domains and reduce dependence on large-scale labeled data.
[0069] Based on the above, in an embodiment of the present disclosure, S1 is used to divide the input image into image blocks of a fixed size, and convert it into a one-dimensional feature representation through linear projection to provide input for subsequent feature extraction. S2 further performs a convolution operation on the input features to extract the underlying features of the image and generate a multi-scale preliminary feature matrix. S3 and S4 are processed in parallel through adapters. S3 processes the input features through fuzzy logic to enhance its robustness to uncertainty in complex environments; at the same time, S4 extracts global information from the same input features through a self-attention mechanism to enhance the long-range dependencies of the features. S5 and S6 are processed in parallel with S7 through adapters. S5 defines anchor frames of different scales for the enhanced feature matrix. De-noising is performed to remove invalid noise and retain high-quality features; at the same time, S6 combines fuzzy logic and self-attention mechanism to further refine the de-noised features to improve the detection effect of small targets in complex environments. S7 decodes the features processed by the fuzzy denoising anchor frame module and the fuzzy system attention, captures the relationship between features, and realizes accurate positioning and classification of targets. S8 optimizes the decoded feature matrix through classification and positioning algorithms, and finally outputs the detection results of small targets.
[0070] In addition, the S9 described above fine-tunes only the fuzzy adaptation component by freezing S4 and S7 during the training process. The purpose is to maintain the global feature extraction and decoding capabilities of the encoder and decoder, while optimizing specific components to adapt to the feature distribution of the target domain, thereby reducing the dependence on large-scale labeled data and enhancing the generalization ability of the model in different domains. In the fine-tuning stage, the adjustment of the model focuses on the fuzzy adaptation component and the denoising feature processing module to better adapt to the changes in the target domain while maintaining the stability of the original feature encoding and decoding structure.
[0071] A terminal device is provided in one embodiment of the present invention. The terminal device of this embodiment includes: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor executes the computer program, the functions of the modules / units in the above-mentioned device embodiments are implemented.
[0072] The computer program may be divided into one or more modules / units, and the one or more modules / units are stored in the memory and executed by the processor to accomplish the present invention.
[0073] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.
[0074] The processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0075] The memory may be used to store the computer programs and / or modules, and the processor implements various functions of the terminal device by running or executing the computer programs and / or modules stored in the memory and calling the data stored in the memory.
[0076] If the module / unit integrated in the terminal device 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 present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0077] Example 2: In order to make the purpose, technical solution and advantages of the present invention clearer, the specific process is as follows Figure 1 As shown, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings.
[0078] Dataset: The dataset uses two public datasets, COCO2017 and AI-TOD-V2, and is rebuilt for the special needs of small target detection. The COCO2017 dataset contains a large number of diverse scenes of common objects, while the AI-TOD-V2 dataset focuses on small target detection, including small targets with complex backgrounds and different resolutions. In order to meet the needs of the model, we enlarge the small targets with lower resolution in the original dataset through image enhancement technology and introduce scenes with complex backgrounds to build a challenging detection environment. The size of the input image is a fixed 512×512 color image, and each image randomly contains small targets of different types. The total number of images in the dataset is 5,000, which is divided into training and test sets in a ratio of 7 to 3 to ensure the generalization ability of the model.
[0079] Label processing: Map the category labels of small targets to a continuous coding space to adapt the fuzzy system in the model. Each target category is encoded by fuzzy rules to generate a corresponding membership sequence. Fuzzy membership encoding is performed on each target in the training set, and a mapping relationship between category and membership is established to enhance the model's ability to cope with fuzzy environments.
[0080] Data preprocessing: Read the image dataset and resize all images to 256×256, normalize and add noise to simulate a real complex environment. The noise processing uses a combination of Gaussian noise and salt and pepper noise to improve the robustness of the model to different noise types. At the same time, the images are randomly cropped and flipped to expand the diversity and effectiveness of the training set.
[0081] Network construction: The network model in this embodiment is as follows Figure 2 As shown in the figure, the ViT (Vision Transformer) and the fuzzy system adapter are combined to build the model. The model mainly includes a linear projection and flattening module, a backbone network, a fuzzy adapter Transformer encoder, a fuzzy denoising anchor frame module, a fuzzy system attention processing module, a Transformer decoder module, and a prediction output module. The input image is divided into fixed-size image blocks and flattened after the linear projection and flattening module to generate a block feature matrix. Then, the feature matrix is convolutionally extracted through the backbone network (using ResNet) to generate a multi-scale feature map.
[0082] Fuzzy Adapter and Transformer Encoder: Figure 3 As shown in the figure, the fuzzy adapter module is used to enhance the preliminary features, and the features are fuzzified through the fuzzy rule base to enhance the model's adaptability to complex environments. The fuzzified features are simultaneously input into the Transformer encoder, and the global dependencies are captured and feature fusion is performed through the self-attention mechanism, and finally an enhanced global feature matrix is generated.
[0083] Blurred denoising anchor box and Transformer decoder: Figure 4 As shown in the figure, the fuzzy denoising anchor frame module is used to denoise the enhanced features. Through anchor frame definition and membership calculation, low-quality noise features are removed. At the same time, the fuzzy system attention processing module further refines the denoised features through the weighting of fuzzy membership and self-attention mechanism. The processed features are input to the Transformer decoder, and the target positioning and classification of the features are achieved through decoding, thereby generating the final feature decoding results.
[0084] Model training: This example uses the Adam optimizer for model training to optimize initial parameters and ensure smooth convergence. The learning rate is set to 0.00001, the batch size is set to 16, and the training is performed for 100 epochs. In order to further optimize the model, the model parameters are tuned, and different learning rates and batch size combinations are used for multiple rounds of training, and 10-fold cross validation is performed to select the best model. In order to improve the generalization ability of the model, some Transformer encoder and decoder layers are frozen during the training process, and only the fuzzy adaptation component and denoising module are fine-tuned, such as Figure 5 shown.
[0085] Model evaluation: After training, the model performance is evaluated using the test set. Evaluation indicators include IOU (Intersection over Union), Precision, Recall, and F1-score. IOU is used to evaluate the overlap between the predicted boundary and the true boundary, and is calculated as follows:
[0086] in, is the real boundary, is the prediction boundary, and a higher score indicates a higher prediction accuracy.
[0087] Precision (P) and recall (R) are used to measure the classification performance of the model and are calculated as follows:
[0088] in, is a true positive, is a false positive. It is a false negative.
[0089] F1-score is used to comprehensively evaluate the precision and recall of the model. The formula is as follows:
[0090] Finally, the model with the highest test accuracy is selected as the final model of the solution to ensure that the model has high detection and classification capabilities for small targets in complex environments.
[0091] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and the specific implementation of the present invention cannot be considered to be limited to these descriptions. For ordinary technicians in this technical field, simple deductions or substitutions in various forms can be performed without departing from the concept of the present invention, which should all be deemed to belong to the protection scope of the present invention.
Claims
1. A cross-domain small target detection method based on ViT and fuzzy system adapter, characterized in that: include, The preliminary multi-scale feature matrix is fuzzy enhanced and self-attention encoded to obtain the global feature matrix ; For the global feature matrix Perform denoising and fuzzy system enhancement to obtain the fuzzy enhancement feature matrix ; Fuzzy Enhanced Feature Matrix Perform feature decoding to capture feature relationships in complex backgrounds and perform target location and classification to generate a decoding feature matrix ; Based on the decoding feature matrix Classification and positioning optimization are performed to output the category and bounding box position of the detected target and generate small target detection results.
2. According to claim 1, a cross-domain small target detection method based on ViT and fuzzy system adapter is characterized in that: The extraction process of the preliminary multi-scale feature matrix is as follows: the feature matrix of the input image block is subjected to feature extraction of a convolutional neural network, the underlying feature information of the image is extracted, a feature representation suitable for input to a subsequent Transformer encoder is generated, and the feature representation is calculated by a backbone network to generate a preliminary multi-scale feature matrix.
3. According to claim 2, a cross-domain small target detection method based on ViT and fuzzy system adapter is characterized in that: The processing process of the image block feature matrix is: The input image is divided into image blocks of fixed size, and each image block is flattened into a one-dimensional feature representation through linear projection, and then calculated through the linear projection and flattening module to generate an image block feature matrix.
4. According to claim 1, a cross-domain small target detection method based on ViT and fuzzy system adapter is characterized in that: The specific process of the fuzzy enhancement processing and self-attention encoding is as follows: The preliminary feature matrix is fuzzified and enhanced, and the input features are fuzzified through the fuzzy system converter and the attention mechanism smoother to cope with the uncertainty in the complex environment and generate a fuzzy feature matrix , and then the fuzzy feature matrix Perform self-attention encoding to capture the long-range dependencies of input features and improve the globality of feature expression to obtain a global feature matrix .
5. According to claim 1, a cross-domain small target detection method based on ViT and fuzzy system adapter is characterized in that: The specific process of the noise reduction process and the fuzzy system enhancement process is as follows: Fuzzy enhancement feature matrix based on anchor boxes of different scales Perform denoising to generate a high-quality denoised feature matrix , and then denoising feature matrix The fuzzy system is enhanced by combining fuzzy membership and self-attention mechanism to further extract detailed features in complex environments and generate a fuzzy enhanced feature matrix. .
6. According to claim 1, a cross-domain small target detection method based on ViT and fuzzy system adapter is characterized in that: A cross-domain fine-tuning strategy is adopted to fine-tune and optimize the components of the blur system and the denoising anchor frame components by freezing some layers of the Transformer encoder and Transformer decoder to adapt to the feature distribution of the target domain.
7. A cross-domain small target detection system based on ViT and fuzzy system adapter, characterized in that: Based on the detection method according to any one of claims 1 to 6, Including, fuzzy adapter Transformer encoder module, fuzzy denoising anchor box Transformer decoder module and prediction output module; The fuzzy adapter Transformer encoder module includes a fuzzy attention cross-domain module and a Transformer encoder; The fuzzy attention cross-domain module is used to perform fuzzy enhancement processing on the preliminary multi-scale feature matrix; The Transformer encoder is used to perform self-attention encoding on the thickness features of the row fuzzy enhancement process to obtain a global feature matrix ; The fuzzy denoising anchor box Transformer decoder module includes a denoising anchor box module, a fuzzy system attention module and a Transformer decoder; The noise anchor frame module is used to Perform denoising, The fuzzy system attention module is used to perform fuzzy system enhancement processing on the features after denoising to obtain a fuzzy enhanced feature matrix ; The Transformer decoder is used to fuzzy enhance the feature matrix Perform feature decoding to capture feature relationships in complex backgrounds and perform target location and classification to generate a decoding feature matrix ; The prediction output module is used to predict the Classification and positioning optimization are performed to output the category and bounding box position of the detected target and generate small target detection results.
8. The cross-domain small target detection system based on ViT and fuzzy system adapter according to claim 7 is characterized in that: It also includes a linear projection and flattening module, a backbone network module, and a cross-domain fine-tuning strategy module; The linear projection and flattening module is used to perform image block division and linear projection processing on the input image data to obtain a flattened image block feature matrix; The backbone network module is used to perform feature extraction of a convolutional neural network on an image block feature matrix to generate a preliminary multi-scale feature matrix; The cross-domain fine-tuning strategy module is used to fine-tune and optimize the fuzzy system component and the denoising anchor frame component by freezing some layers of the Transformer encoder and the Transformer decoder to adapt to the feature distribution of the target domain.
9. An electronic device, characterized in that: It comprises a processor and a memory, wherein at least one instruction is stored in the memory, and the instruction stored in the memory is executed to implement the cross-domain small target detection method based on ViT and fuzzy system adapter as described in claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the cross-domain small target detection method based on ViT and fuzzy system adapter as described in claims 1-7 is implemented.
Citation Information
Patent Citations
Object detection method and system based on self-attention model and yolov5
CN116994116B
Light-weight remote sensing image target detection method based on deep learning
CN118334313A