A Multi-View Small Sample Android Malware Classification Method Based on Optimal Bootstrap Matching
By constructing a deep convolutional neural network with multi-view grayscale images and a fusion attention mechanism, the problems of insufficient feature extraction and rigid multi-view fusion in small sample malware detection are solved, improving classification accuracy and robustness, and adapting to the rapid identification of new malware.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- WUXI UNIV
- Filing Date
- 2026-02-26
- Publication Date
- 2026-05-26
AI Technical Summary
Existing malware detection methods struggle to converge quickly in small sample scenarios, single features are insufficient to characterize complex malicious behavior logic, they have weak anti-disguise capabilities, and multi-view fusion strategies lack dynamic noise resistance, resulting in insufficient classification accuracy and robustness.
A multi-view grayscale image is constructed, and a deep convolutional neural network with a fusion attention mechanism is adopted. An auxiliary supervision signal is generated through a self-supervised rotation prediction mechanism, and discriminative feature vectors with geometric structure awareness are extracted. Cosine similarity is used to lock the local best guiding sample, and dynamic group correction is combined to calculate the category similarity and perform dynamic weighted fusion of multi-view images.
It improves classification accuracy in small sample scenarios, enhances the discriminativeness and reliability of features, optimizes the accuracy of classification matching, achieves anti-interference capabilities and practicality, and adapts to the rapid identification of new malware families.
Smart Images

Figure CN121744010B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information security technology, specifically to a multi-view small sample Android malware classification method based on optimal boot matching. Background Technology
[0002] Existing technologies widely employ deep learning-based malware detection methods. While these methods perform well in detecting known malware families, they generally rely heavily on large-scale labeled datasets for training. In real-world scenarios, facing novel malware families with extremely limited samples—i.e., small-sample scenarios—traditional deep learning models that depend on large datasets struggle to converge quickly and cannot meet the demands of real-time defense. Therefore, researchers have begun introducing Few-Shot Learning (FSL) into malware classification tasks, attempting to identify new categories using a small number of samples.
[0003] The existing methods for feature representation suffer from the following technical problems: 1. Existing feature representation methods are too simplistic and struggle to resist code obfuscation. Current few-sample detection methods often rely on single-dimensional features, such as using only API sequences or only binary grayscale image textures. However, malware developers frequently use code obfuscation and packing techniques, leading to significant differences in single features among samples within the same malware family, i.e., high within-class variance. Single features are insufficient to comprehensively characterize complex malicious behavior logic and high-level semantic information, resulting in insufficient feature extraction capabilities and weak anti-disguise capabilities when facing complex malware variants.
[0004] 2. Traditional prototype calculation strategies are prone to failure when sample diversity is high. In few-shot learning, mainstream methods typically employ an "average prototype" strategy, which uses the mean of features from the support set samples to represent the entire category. However, due to the diverse variants within malware families, feature distribution is extremely uneven. Simple mean calculation is easily affected by outliers or noisy samples, leading to biased generated category prototypes that fail to accurately represent the core features of the family, thus reducing classification accuracy.
[0005] 3. Existing multi-view fusion mechanisms are rigid and lack dynamic noise resistance. To compensate for the shortcomings of single features, existing multimodal methods attempt to fuse multiple views such as source code, API graphs, and opcodes. However, current fusion strategies are mostly "globally static," meaning they learn a fixed set of feature weights based on the overall distribution of the dataset, or simply perform feature-level concatenation. This approach ignores the "view quality asymmetry" in adversarial environments, where obfuscation techniques often selectively destroy specific views, such as obfuscating API calls, while preserving others. When a view is contaminated or its quality degrades, the static model lacks sample-level dynamic confidence perception and cannot suppress the weights of damaged views in real time, thus triggering a "negative transfer" effect. This results in the fused performance being worse than that of a single view, severely limiting the model's robustness in complex attack scenarios. Summary of the Invention
[0006] To address the aforementioned technical shortcomings, the present invention aims to provide a multi-view small sample Android malware classification method based on optimal boot matching.
[0007] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: The present invention provides a multi-view small sample Android malware classification method based on optimal bootstrap matching, comprising the following steps:
[0008] Step 1: Construct a multi-view grayscale image: Obtain the software package of the Android application to be analyzed, parse and extract permissions, APIs, components and intent features, construct the original correlation matrix based on the relationship between features, assign values using a four-value grayscale encoding strategy, and then scale to a fixed size using a max pooling strategy to generate a grayscale image view.
[0009] Step 2: Training the backbone network: Construct a deep convolutional neural network with an attention mechanism as the backbone network, introduce a self-supervised rotation prediction mechanism to generate auxiliary supervision signals, and train the backbone network by jointly optimizing the main classification task and the rotation prediction task to extract discriminative feature vectors with geometric structure awareness.
[0010] Step 3, Optimal Guided Matching Classification: Using the trained backbone network, feature vectors of support set and query set samples are extracted. For grayscale image views, the cosine similarity between query samples and support set samples is calculated to lock in the local optimal guided sample and construct an effective guide set. Combined with dynamic group correction, the similarity score of the query sample belonging to each malware family category is calculated.
[0011] Step 4: Dynamic Fusion of Multiple Views: Calculate the confidence of each view based on the predicted margin to generate adaptive weights, dynamically weight and fuse the similarity scores of multiple views, and complete the classification of malware families based on the final fused score.
[0012] Preferably, the specific analysis process for parsing and extracting permissions, APIs, components, and intent features is as follows:
[0013] Regarding permission features: A full extraction strategy is adopted to summarize all non-duplicate permissions from the training set as the permission feature set.
[0014] Based on API call characteristics: Obtain a pre-defined list of sensitive APIs and filter the extracted API calls based on a whitelist of high-risk prefixes covering device information, network communication, and data operations.
[0015] For component features and intent features: a global-to-local hybrid strategy is used for initial extraction, combining global high-frequency features and family local high-frequency features.
[0016] The refining stage performs differentiated noise reduction: component features are retained based on a whitelist of common vendors and SDK prefixes, while private code obfuscation noise is filtered out.
[0017] Intent features are removed based on the original equipment manufacturer (OEM) and a blacklist of redundant information prefixes, while retaining general intent behavior features.
[0018] Preferably, the four-value grayscale encoding strategy is used for assignment, and the specific assignment process is as follows: Based on the pre-extracted feature list, the feature space is decomposed into three two-dimensional views with permissions as the core. Each view constructs an original high-dimensional matrix in which rows correspond to permission features and columns correspond to another dimension of features in the same view.
[0019] The original high-dimensional matrix is assigned values using a four-valued grayscale encoding strategy, letting Indicates whether the sample possesses the first One permission. Indicates whether the sample possesses the first Each corresponding view feature, matrix element The assignment logic is as follows: .
[0020] The numerical value represents the grayscale brightness, with 1 indicating presence and 0 indicating absence. The encoding strategy maps the co-occurrence relationship between features to the highest brightness.
[0021] Preferably, the max pooling strategy is scaled to a fixed size, and the specific scaling process is as follows: the original high-dimensional matrix after being assigned values by four-value grayscale encoding... A max-pooling strategy is used to scale the matrix to a fixed, preset size. Specifically: to Divide into multiple non-overlapping local rectangular regions, let... The target matrix coordinates For the corresponding local region, the element value of the target matrix at that location is defined as the maximum value within that region, calculated as follows: .
[0022] The max pooling strategy is used to preserve key co-occurring feature signals in local regions during dimensionality reduction.
[0023] The beneficial effects of this invention are as follows: 1. This invention improves classification performance in small sample scenarios: In response to the pain points of scarce small sample data and insufficient supervision signals, a self-supervised rotation prediction mechanism is introduced to generate auxiliary supervision signals. The backbone network is optimized in conjunction with the main classification task, which effectively makes up for the lack of supervision information in small sample scenarios, enhances the sufficiency and discriminability of feature extraction, and significantly improves the classification accuracy of malware families under small sample conditions.
[0024] 2. This invention enhances the discriminativeness and reliability of features: It adopts a multi-view grayscale image construction strategy to map the association relationship of permissions, APIs, components and intent features into grayscale images, preserving the inherent geometric structure and co-occurrence rules between features; at the same time, it refines features through a differentiated denoising strategy to filter out confusing noise and redundant information, thereby improving the purity and reliability of features; the backbone network that integrates the attention mechanism can accurately focus on key features, further enhancing the discriminative ability of features.
[0025] 3. This invention optimizes the accuracy of classification matching: It adopts the best guided matching strategy, locks the local best guided sample through cosine similarity and constructs an effective guide set, and calculates the category similarity score by combining dynamic group correction, avoiding the bias caused by a single guided sample, improving the accuracy and stability of classification matching, and reducing the occurrence of misclassification.
[0026] 4. This invention achieves adaptive and efficient fusion of multiple views: Based on the predicted margin, the confidence of each view is calculated and adaptive weights are assigned. The scores of multiple views are dynamically weighted and fused, which can automatically amplify the influence of high-confidence views and suppress the interference of low-confidence views. This solves the problem of fixed weights and inability to adapt to sample differences in traditional multi-view fusion, and further optimizes the accuracy of classification results.
[0027] 5. This invention has strong anti-interference ability and practicality: In the feature extraction stage, targeted filtering and denoising strategies are adopted. Component features are retained based on a whitelist and intent features are removed based on a blacklist, which effectively resists the interference caused by code obfuscation and redundant information. The entire method does not require a large number of labeled samples, has high training efficiency, can quickly adapt to the identification needs of new malware families, and has strong practicality and excellent generalization ability. Attached Figure Description
[0028] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0029] Figure 1 This is a schematic diagram of the implementation steps of the method of the present invention.
[0030] Figure 2 A flowchart for extracting the inventory provided in this embodiment of the disclosure.
[0031] Figure 3a This is a visualization of the Avpass family of components, manifest intents, and APIs.
[0032] Figure 3b This is a visualization of the FakeJobOffer family from the perspectives of components, manifest intents, and APIs.
[0033] Figure 4 This is a diagram of the backbone network structure provided in an embodiment of the present disclosure.
[0034] Figure 5 A flowchart of the best guide matching process provided for embodiments of this disclosure.
[0035] Figure 6 This is a schematic diagram of edge confidence provided for an embodiment of this disclosure.
[0036] Figure 7 A comparison chart of different threshold coefficients provided for embodiments of this disclosure.
[0037] Figure 8a This is a visualization of the t-SNE distribution of features trained using Softmax loss.
[0038] Figure 8b A visualization of the t-SNE distribution of features trained using Triplet Loss.
[0039] Figure 8c This is a visualization of the t-SNE distribution of features based on Episodic Training (task-level meta-learning training).
[0040] Figure 8d This is a visualization of the t-SNE distribution of features trained using the S2M2R method proposed in this disclosure.
[0041] Figure 9aThis is a statistical chart comparing the classification accuracy of different fusion strategies (including single view, average score weighted fusion, and margin confidence dynamic fusion proposed in this disclosure) in the 1-Shot scenario.
[0042] Figure 9b This is a statistical chart comparing the classification accuracy of the different fusion strategies mentioned above in the 5-Shot scenario. Detailed Implementation
[0043] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0044] according to Figure 1 As shown, this invention provides a multi-view small sample Android malware classification method based on optimal bootstrap matching, including the following steps:
[0045] Step 1: Construct a multi-view grayscale image: Obtain the software package of the Android application to be analyzed, parse and extract the permissions, APIs, components and intent features, construct the original correlation matrix based on the correlation between features, assign values using a four-value grayscale encoding strategy, and then scale it to a fixed size using a max pooling strategy to generate a grayscale image view.
[0046] In a specific embodiment, the process of parsing and extracting permissions, APIs, components and intent features is as follows: For permission features: a full extraction strategy is adopted to summarize all non-duplicate permissions from the training set as a permission feature set.
[0047] Based on API call characteristics: Obtain a pre-defined list of sensitive APIs and filter the extracted API calls based on a whitelist of high-risk prefixes covering device information, network communication, and data operations.
[0048] For component features and intent features: a global-to-local hybrid strategy is used for initial extraction, combining global high-frequency features and family local high-frequency features.
[0049] The refining stage performs differentiated noise reduction: component features are retained based on a whitelist of common vendors and SDK prefixes, while private code obfuscation noise is filtered out.
[0050] Intent features are removed based on the original equipment manufacturer (OEM) and a blacklist of redundant information prefixes, while retaining general intent behavior features.
[0051] In one specific embodiment, the assignment process using a four-value grayscale encoding strategy is as follows: Based on Figure 2 The process involves: based on a pre-extracted feature list, decomposing the feature space into three two-dimensional views centered on permissions. Each view constructs an original high-dimensional matrix where rows correspond to permission features and columns correspond to another dimension of features within the same view.
[0052] The original high-dimensional matrix is assigned values using a four-valued grayscale encoding strategy, letting Indicates whether the sample possesses the first One permission. Indicates whether the sample possesses the first Each corresponding view feature, matrix element The assignment logic is as follows: .
[0053] The numerical value represents the grayscale brightness, with 1 indicating presence and 0 indicating absence. The encoding strategy maps the co-occurrence relationship between features to the highest brightness.
[0054] In one specific embodiment, the three two-dimensional views are: a grayscale image view of the permission API, a grayscale image view of the permission component, and a grayscale image view of the permission intent.
[0055] In one specific embodiment, the max pooling strategy is scaled to a fixed size, and the specific scaling process is as follows: the original high-dimensional matrix after being assigned values by four-value grayscale encoding... A max-pooling strategy is used to scale the matrix to a fixed, preset size. Specifically: to Divide into multiple non-overlapping local rectangular regions, let... The target matrix coordinates For the corresponding local region, the element value of the target matrix at that location is defined as the maximum value within that region, calculated as follows: .
[0056] The max pooling strategy is used to preserve key co-occurring feature signals in local regions during dimensionality reduction.
[0057] Step 2: Training the backbone network: Construct a deep convolutional neural network with an attention mechanism as the backbone network, introduce a self-supervised rotation prediction mechanism to generate auxiliary supervision signals, and train the backbone network by jointly optimizing the main classification task and the rotation prediction task to extract discriminative feature vectors with geometric structure awareness.
[0058] In one specific embodiment, the construction process of the deep convolutional neural network with fused attention mechanism is as follows: DenseNet-121 is used as the basic feature extraction network, and a fixed-size grayscale image generated by four-value encoding and max pooling is received as input. The basic feature extraction network is composed of multiple dense blocks and transition layers stacked alternately. Through the dense connection mechanism, each layer is directly connected to all the previous layers to achieve feature reuse.
[0059] After the output of the last dense block Dense-Block-4 of DenseNet-121 and before the Global-Average-Pooling layer, a Convolutional Block Attention (CBAM) module is embedded. The CBAM module processes the feature maps in a cascade manner: first, the importance of feature channels is evaluated and the channel weights are adaptively calibrated through a channel attention mechanism, and then the key spatial regions are located through a spatial attention mechanism.
[0060] In one specific embodiment, the introduction of a self-supervised rotation prediction mechanism to generate an auxiliary supervision signal involves the following training process: Constructing a dual-branch training objective: Based on the main task classification branch, a self-supervised rotation prediction auxiliary branch is added to construct a joint optimization objective.
[0061] Generating self-supervised rotated samples: encoding the input quaternary grayscale image Perform discrete angle rotation operation, randomly rotate the angle. From the set Select from the options to generate rotated samples. As a self-supervised input, the rotation angle As a self-supervised label.
[0062] Calculate the joint loss function: calculate the main classification cross-entropy loss based on the true labels separately. and rotation prediction cross-entropy loss based on rotation angle labels The total loss is obtained by weighted summation. The calculation formula is as follows: in, Hyperparameters for balancing the weights of the two tasks.
[0063] During training, only the rotation prediction task is retained, and no manifold blending operation based on linear interpolation is performed.
[0064] Step 3, Optimal Guided Matching Classification: Use the trained backbone network to extract feature vectors from the support set and query set samples, calculate the cosine similarity between the query sample and the support set samples, lock the local optimal guided sample and construct an effective guide set, and combine dynamic group correction to calculate the similarity score of the query sample belonging to each malware family category.
[0065] In one specific embodiment, the construction of the effective guide set is carried out as follows: Calculate cosine similarity: for each malware family category Calculate the feature vector of the query sample With the feature vectors of all samples in the support set of this category cosine similarity The calculation formula is as follows: .
[0066] Identify the best facilitator: such as Figure 5 The following is stated: In category In the process, the support set sample with the highest similarity to the query sample is identified as the best guide for that category, and its similarity score is used to determine its successor. Defined as: Constructing an effective set of facilitators: Introducing a threshold parameter The support set samples are screened, and samples that meet the preset similarity criteria are included in the effective facilitator set based on the best facilitator. The filtering criteria are as follows: .
[0067] in, This is an adjustable threshold scaling factor.
[0068] In one specific embodiment, the similarity score is calculated as follows: Constructing a comprehensive guide: based on the set of effective guides. The feature information in the set is used to calculate the mean of the feature vectors of the samples within the set, and to construct the query sample in the category. Comprehensive guide : .
[0069] Calculating dynamic weights: Centered on the comprehensive facilitator, the Softmax function is used to calculate the weights for each sample in the support set. relative to the weight of the comprehensive facilitator Samples that are closer to the overall facilitator receive a higher weight, calculated as follows: .
[0070] in, Temperature parameter is used to smooth the distribution of weights; the final classification score is calculated by taking the query sample. The category to which the query sample belongs is obtained by weighted summation of the original similarities with the samples in each support set. Final classification score : .
[0071] Step 4: Dynamic Fusion of Multiple Views: Calculate the confidence of each view based on the predicted margin to generate adaptive weights, dynamically weight and fuse the similarity scores of multiple views, and complete the classification of malware families based on the final fused score.
[0072] In one specific embodiment, the calculation of the similarity score of the query sample belonging to each malware family category is carried out as follows: For a given query sample Retrieve the outputs of the permission API view, permission component view, and permission intent view respectively. The score vectors for each malware family category are denoted as follows: , and ; Calculate the predicted margin: Define the first A view Predicted margin The difference between the maximum and second-largest values in the score vector is used to quantify the certainty of the classifier's prediction for that sample. The calculation formula is as follows: .
[0073] in, The highest score in the rating vector is represented by , and the second highest score is represented by excluding the highest score. Dynamic weights are calculated: based on the predicted margins, the margins of the three views are normalized using the Softmax function, and the weights assigned to the _th_ view are calculated. Adaptive weights for each view To amplify the influence of high-confidence views, the calculation formula is as follows: .
[0074] The final classification result is generated by weighting the predicted scores of the three views using the calculated adaptive weights and then selecting the category with the largest sum of weighted scores as the final classification result. The calculation formula is as follows: .
[0075] in, Indicates the first The view is for the first Predicted scores for each category.
[0076] In another specific embodiment, the CIC-InvesAndMal2019 dataset, specifically designed for small-sample and novel threat analysis in the field of Android malware detection, was selected when constructing the experimental dataset. This dataset contains 426 malware samples, covering 42 different malware families. Each family contains an average of approximately 10 samples, with a relatively balanced class distribution and a small total sample size, accurately simulating the scarce, few-shot characteristics of a new malware family's initial outbreak in real-world scenarios. In the experimental setup, to verify the model's generalization ability to unseen new families, this embodiment adopted a common base / novel class partitioning strategy for few-shot learning. The base subset is used to build the representation ability of the feature extractor during the training phase, while the novel subset is used to evaluate the model's transfer performance to unseen categories during the testing phase; both subsets are required to be non-overlapping in the class space. Specifically, this embodiment divides all 42 malware families in the CIC-InvesAndMal2019 dataset according to the principle of mutual exclusion between the Base and Novel classes: The Base subset (training set) consists of approximately 25 families (about 60%), used to train the DenseNet-CBAM backbone network and the S2M2R self-supervised task, enabling the model to learn common malware texture features. The Novel subset (test and validation set) consists of the remaining approximately 17 families (about 40%). To avoid data leakage, the Novel subset is further divided into a validation set and a test set. The validation set is used to find the backbone network parameters with the strongest generalization ability, while the test set is only used in the final evaluation stage. This setup ensures that the model faces completely unfamiliar malware families during testing, thus objectively verifying its true effectiveness against zero-day attacks.
[0077] In another specific embodiment, all experiments in this embodiment were completed in a local working environment, running on a Windows 11 operating system, equipped with an Intel Core i7-14700HX processor and an NVIDIA GeForce RTX 4070 Laptop GPU, with 16GB of memory. Model development was based on the Python 3.8 programming language, using the PyTorch 2.7.0 deep learning framework, and PyCharm 2024.1.1 as the primary development tool. The aforementioned hardware and software environment fully meets the computational requirements of the proposed method during the training and inference phases, ensuring the stability of the experimental process and the reproducibility of the results.
[0078] During training, the model was trained using a self-supervised S2M2R strategy combined with a main task optimization strategy. The initial learning rate was set to 0.001, the optimizer was SGD, and the loss function consisted of a weighted average of cross-entropy classification loss and rotation prediction loss. The total number of training epochs was set to 200, and the batch size was 64. During testing, a standard N-way K-shot small sample setting was used to evaluate the model's generalization ability in unseen class scenarios. Specifically, a 5-way classification task was configured, providing 1-shot or 5-shot support samples for each class. To ensure the statistical stability of the evaluation results, 1000 episodes were randomly constructed for testing, and the average accuracy was taken. Furthermore, to meet the requirements of the optimal guided matching BLGM classifier, the threshold scaling factor of its core hyperparameter was adjusted. It is set to 0.9 by default to achieve the best balance between filtering noise and preserving population characteristics.
[0079] In another specific embodiment, the multi-view feature extraction and refinement: To comprehensively capture the multi-dimensional behavioral logic and structural information of Android applications, this embodiment constructs a list of four types of sensitive features, including permissions, API calls, components, and manifest intents. To filter out the most distinctive features from massive amounts of raw data and effectively reduce obfuscation noise, this embodiment designs a unified processing framework comprising three stages: preliminary extraction, strategy refinement, and final consolidation, employing differentiated processing strategies for different types of feature characteristics.
[0080] Specifically, regarding the permission feature, given its relatively limited number and explicit security semantics such as SEND_SMS and INTERNET, this embodiment adopts a full extraction strategy in the initial extraction stage. That is, it directly traverses the AndroidManifest.xml files of all samples in the training set, summarizes all unique permissions that appear, and does not perform secondary filtering or refinement to retain a complete profile of permission request behavior.
[0081] To focus on key runtime behaviors of malware and target API call characteristics, this embodiment uses a sensitive API list provided by MalScan for initial extraction. Subsequently, in the policy refinement phase, a filtering mechanism based on a high-risk prefix whitelist is implemented. This whitelist covers high-risk areas such as device information acquisition, network communication, and sensitive data operations, retaining only API calls involving these key behaviors, thereby removing general system call noise that is weakly correlated with malicious behavior.
[0082] To address the characteristics of high-dimensionality and susceptibility to obfuscation in both Component and Manifest features, this embodiment employs a "global-local hybrid strategy" in the initial extraction stage. This strategy combines global high-frequency Top-N features to reflect general patterns with family-specific local high-frequency Top-K features to reflect the uniqueness of a particular family, thus balancing the universality and specificity of the features.
[0083] In the subsequent strategy refinement phase, differentiated denoising schemes were designed for both. For component features, to avoid being misled by highly obfuscated and unstable proprietary code such as randomly named classes, a strict whitelist retention strategy based on common vendors and SDK prefixes was implemented. This aimed to filter out meaningless random noise and focus on commonly used third-party libraries in malware, such as advertising plugins, statistics SDKs, and basic attack frameworks, to extract the most robust public component fingerprints. For Manifest intent, a blacklist removal strategy based on OEM (Original Equipment Manufacturer) and redundant information prefixes was adopted. By removing system-level intents and redundant information that are strongly coupled to specific device environments, environmental noise was effectively stripped away, and common intent behavior characteristics were retained.
[0084] In another specific embodiment, the multi-view feature visualization and four-value encoding: In order to transform heterogeneous unstructured features into structured visual inputs suitable for convolutional neural network processing, this embodiment proposes a multi-view visualization method based on four-value encoding. Specifically, the feature space of the application is decomposed into three complementary two-dimensional views centered on "permissions": behavior (permission-API), intent (permission-Manifest), and structure (permission-component).
[0085] For each of the above views, an original association matrix is first constructed based on the aforementioned fixed feature list. To simultaneously encode the existence of individual features and their cross-dimensional co-occurrence relationships, this embodiment employs a four-valued grayscale encoding strategy to assign values to the matrix elements. Let... Indicates whether the sample possesses the first One permission. Indicates whether the sample possesses the first Each corresponding view feature, matrix element The assignment logic is shown in the following formula:
[0086] ;
[0087] The above formula maps strong co-occurrence relationships between features to the highest brightness, while the presence of a single feature is mapped to an intermediate gray level, thus visually highlighting potential key behavioral patterns.
[0088] Considering the high-dimensional sparsity of the original feature space, and in order to unify the network input size and effectively reduce dimensionality, this embodiment abandons the traditional interpolation algorithm and instead adopts a max-pooling strategy. Specifically, this involves converting the original high-dimensional matrix of arbitrary size into a single, sparse feature space. Divide into multiple non-overlapping local rectangular regions, let... The target matrix coordinates For the corresponding local region, the element value of the target matrix at that location is defined as the maximum value within that region, calculated as follows: .
[0089] In another specific embodiment, the max-pooling strategy ensures that even in extremely sparse cases, key non-zero feature signals existing in local regions, especially the 255 value representing co-occurrence, can be retained as maximum values without being smoothed out, thus achieving effective dimensionality reduction while preserving key information. Ultimately, each Android application sample is converted into three images. The grayscale image is input into the subsequent model.
[0090] Figure 3a and Figure 3b This embodiment presents a multi-view visualization comparison of two typical malware families, avpass and fakejoboffer, using the method described herein. Figure 3a The three-view visualization results of the avpass family samples are presented. Figure 3b This presents a three-dimensional visualization of samples from the fakejoboffer family. For example... Figure 3a and Figure 3b As shown, different samples within the same family exhibit highly consistent texture patterns and brightness distributions across all views, demonstrating significant intra-class similarity. Conversely, images from different families, such as avpass and fakejoboffer, show clear differences in visual structure and texture features, demonstrating good inter-class differentiation. This intuitive visual comparison demonstrates that the visualization method proposed in this embodiment successfully transforms abstract, unstructured features into highly discriminative structured visual representations, validating the effectiveness of this feature representation method.
[0091] In another specific embodiment, addressing the challenge of extremely limited samples and susceptibility to overfitting in small-sample malware detection tasks, this embodiment designs an improved backbone network structure, the specific architecture of which is as follows: Figure 4 As shown. This structure uses DenseNet-121 as its base feature extraction network, and its input receives the generated... Grayscale image. DenseNet-121 consists of multiple dense blocks and transition layers stacked alternately. Utilizing its unique dense connectivity mechanism, DenseConnectivity, each layer in the network is directly connected to all the layers preceding it. This mechanism enables efficient feature reuse across different layers, effectively mitigating the vanishing gradient problem in deep network training and helping the model extract richer, more discriminative features from limited data, thus significantly reducing the risk of overfitting. To further enhance the model's ability to perceive key local features...
[0092] In another specific embodiment, a lightweight convolutional block attention module (CBAM) is integrated after the output of the last dense block (Dense-Block4) of DenseNet-121 and before the global average pooling layer. This module performs fine-tuning of the feature maps sequentially in a cascade manner: first, it evaluates and adaptively recalibrates channel weights through a channel-attention mechanism to emphasize feature channels containing high discriminative information and suppress noise; then, it further locates key spatial regions based on the channel calibration through a spatial-attention mechanism. This dual attention mechanism enables the model to adaptively focus on key patterns of malicious behavior without significantly increasing computational overhead, thereby improving overall generalization performance.
[0093] In another specific embodiment, self-supervised training based on improved S2M2R is employed: To train a backbone network with strong generalization ability in scenarios with scarce samples, this embodiment constructs a simplified and efficient S2M2R self-supervised training framework, using a joint optimization strategy to simultaneously train the main task classification branch and the auxiliary self-supervised rotation prediction branch. Specifically, for input samples... and its real family label On the one hand, features are extracted and classified through the backbone network, and the main classification loss based on standard cross-entropy is calculated. On the other hand, in order to enhance the model's ability to perceive the spatial structure of malicious code, the input image is rotated at discrete angles (rotation angle). Randomly selected from ), generate rotated samples As a self-supervised input, the model needs to predict this rotation angle in order to calculate the rotation prediction loss. The total loss during the entire training process is defined as the weighted sum of the two: ,in To balance the hyperparameters of the weights, the network parameters are updated by minimizing this total loss, forcing the model to capture the intrinsic geometric texture of the image while learning semantic classification.
[0094] In another specific embodiment, considering the unique physical properties of grayscale images of Android malware, this embodiment adaptively improves the original S2M2R method by removing the manifold-Mixup module. This is because malware grayscale images are essentially direct mappings of discrete code instructions or data bytes, rather than continuous natural scene images. Forced linear interpolation operations would produce meaningless non-integer pixel values, breaking the strict correspondence between original bytes and pixels, thus triggering the "semantic collapse" phenomenon. Therefore, this embodiment retains only the rotation prediction task during training, aiming to enhance the model's ability to perceive the texture of program structure through geometric transformations without introducing destructive semantic noise, thereby ensuring the purity and robustness of feature extraction under small sample conditions.
[0095] In another specific embodiment, this embodiment uses the Best Guided Matching Classifier (BLGM) to make classification decisions on the feature vectors, and its core process is as follows: Figure 5 As shown. First, for the N-way K-shot task, the query sample is calculated. With support for all samples The cosine similarity is calculated using the formula: Then, in each category The supporting sample with the highest similarity to the query sample is selected as the "best guide," and its similarity score is denoted as [score missing]. To overcome the limitation of single-point matching being susceptible to specific noise interference, this embodiment introduces an adjustable threshold parameter. (thresholdratio) is used to select and construct an effective set of facilitators based on the best facilitator. The filtering logic is as follows:
[0096] ;
[0097] This step utilizes group information to correct for potential biases in a single best sample, ensuring that all samples within the decision set have high reference value. Based on the aforementioned effective facilitator set, this embodiment further employs a dynamic weighting strategy for the final scoring. First, as... Figure 5 As shown, by calculating the set The mean of the feature vectors of the sample is used to construct the category of the query sample. The "Comprehensive Guide" The formula is Subsequently, as Figure 5As shown, with the facilitator as the core, the Softmax function is used to calculate the weight of each sample in the set relative to the facilitator. Samples closer to the overall leader (i.e., closer to the centroid of the high-quality sample cluster) receive greater weight: .
[0098] in Temperature parameters for smoothing weights. Finally, categories. Classification score Defined as the weighted sum of the original similarities between the query sample and each support set sample, i.e. This enables robust and accurate classification.
[0099] In another specific embodiment, a multi-view dynamic fusion method based on margin confidence is constructed: through feature extraction and optimal guided matching (BLGM) classifier construction in the aforementioned steps, this embodiment obtains classification scores for query samples from three views: Component (permissions), API (permissions), and Manifest (permissions). To integrate multi-view information for more accurate predictions, this embodiment abandons the traditional average weighting strategy and instead adopts a dynamic weighted fusion strategy based on margin confidence. The core of this strategy is to consider the differences in discriminative ability shown by different views when facing specific malware samples, aiming to give greater weight to those views that predict with "more certainty." First, this embodiment introduces "prediction margin" as an indicator to quantify the predictive certainty of the classifier for a single sample. Assuming there are a total of For a given query sample, let the view be the nth view. Each view output is for The score vector for each family category is We will... Predicted margins for each view Defined as the difference between the maximum and second-largest values in the rating vector: .
[0100] Among them, such as Figure 6 As shown, The larger the value, the better the view distinguishes the target sample from other interference classes, and the higher its decision confidence. Conversely, if the highest score and the second highest score are very close, it indicates that the model is in a "hesitant" state, with low confidence. Based on the above prediction margins, this embodiment uses the Softmax function to normalize the margins of all views, thereby dynamically allocating weights. This mechanism can amplify the influence of high-confidence views and ensure that the sum of the weights is 1. For the query sample, the weights assigned to the first... Weight of each view The calculation is as follows: .
[0101] Through this mechanism, when a view's judgment on the current sample is ambiguous with a small margin, its weight is automatically suppressed; while views with larger margins of decisive judgment will gain greater weight. After obtaining the adaptive weights for each view, this embodiment performs a weighted sum of the predicted scores of all views, and selects the category with the largest sum of weighted scores as the final classification result. : .
[0102] In another specific embodiment, regarding the data partitioning scheme and multi-view grayscale images, this embodiment uses a subset of the Base as training data. For the three different views—permission API, permission components, and permission intent—corresponding improved backbone networks are independently constructed and trained. When training for a specific view, the grayscale image corresponding to that view is input into the improved backbone network. Strictly following the S2M2R mechanism, the backbone network parameters are updated by simultaneously calculating the main task classification loss and the self-supervised rotation prediction loss, and minimizing the joint loss function using backpropagation. This forces the current network to focus on capturing the specific malicious code geometry and texture features under that view.
[0103] To ensure the generalization performance of the backbone network, a validation set is introduced for periodic evaluation during training. At this stage, no multi-view fusion strategy is implemented; instead, performance monitoring is performed independently only for the currently trained view. This involves extracting features from the validation set samples for that view using the current backbone network and directly applying the best facilitator matching BLGM classifier to calculate classification accuracy. Finally, by monitoring the accuracy change curves, the model parameters that maximize the validation set accuracy for each view are recorded and saved. This results in three backbone network versions optimized for different view characteristics, laying a solid foundation for further improving overall performance through multi-view fusion.
[0104] In another specific embodiment, based on the data partitioning scheme, this embodiment selects the test set that did not participate in the training as the evaluation object, uses three preferred and saved backbone network versions for different views to extract features, and performs the final classification test through the best guided matching (BLGM) strategy.
[0105] Specifically, for each query sample in the test set, it is first input into the trained permission-API, permission-component, and permission-intent backbone networks to obtain the corresponding feature vectors. Then, the BLGM classifier is used to calculate the classification results for the three single views. Finally, a dynamic fusion strategy is applied to arrive at the final decision. Experimental results show that in the 5-way 1-shot setting with extremely limited samples, the accuracies for the three single views (permission-API, permission-component, and permission-intent) reached 73.10%, 72.48%, and 72.62%, respectively. In the 5-way and 5-shot settings, the accuracies for these three single views increased to 87.76%, 87.13%, and 87.38%, respectively. More importantly, the final model after multi-view fusion achieved accuracies of 74.75% and 88.74% in the 1-shot and 5-shot tasks, respectively. This result strongly demonstrates that by combining feature modeling from different perspectives with the optimal guided matching strategy, it is possible to effectively mine complementary information between views, thereby breaking through the performance bottleneck of a single view under different sample sizes and achieving accurate classification of malware families.
[0106] To verify the superiority of the constructed improved backbone network (DenseNet-CBAM) in feature extraction, ResNet-18, MobileNetV3, EfficientNet-B0, and the original DenseNet-121 were selected as benchmarks for comparison. The detailed performance comparison results are shown in Table 1 and Table 2, respectively.
[0107] Table 1: 5-way 1-shot accuracy:
[0108] Model accuracy Accuracy Recall rate F1 value Resnet18 67.50% 67.09% 67.50% 65.14% EfficientnetB0 68.29% 69.49% 68.29% 65.99% Mobilenet 69.04% 69.32% 69.04% 66.46% Densenet121 69.29% 68.74% 69.29% 66.02% MLMDroid 73.10% 73.76% 73.10% 70.36%
[0109] Table 2: 5-way 5-shot accuracy;
[0110] Model accuracy Accuracy Recall rate F1 value Resnet18 82.13% 84.90% 82.13% 81.54% EfficientnetB0 85.61% 88.15% 85.61% 84.98% Mobilenet 86.00% 88.39% 86.00% 85.56% Densenet121 86.66% 88.99% 86.66% 86.25% MLMDroid 87.76% 89.98% 87.76% 87.49%
[0111] According to the data in Table 1, under the extremely challenging 1-shot setting, the accuracy of benchmark models generally encountered bottlenecks due to the severe lack of sample features. Even the relatively good MobileNetV3 and the original DenseNet-121 only achieved 69.04% and 69.29%, respectively. In contrast, the improved network proposed in this embodiment breaks through this limitation, with its accuracy significantly improved to 73.10%, achieving a gain of 3.81% compared to the original DenseNet-121. This leap strongly demonstrates that the introduction of the CBAM spatial attention mechanism successfully compensates for the shortcomings of simple convolution operations in locating key textures under single-sample conditions, achieving efficient feature generalization. As the number of support set samples increases, as shown in Table 2, the performance of all models generally improves under the 5-shot setting. Among them, MobileNetV3 and the original DenseNet-121 reach relatively high levels of 86.00% and 86.66%, respectively, while the model in this embodiment continues to maintain its leading performance, ranking first with an accuracy of 87.76%. The comparison results of the two sets of table data above show that, regardless of whether the data is extremely scarce or relatively abundant, the improved backbone network has stronger robustness and feature generalization ability.
[0112] In another specific embodiment, the BLGM classifier threshold coefficient analysis involves experimental analysis of the impact of the BLGM classifier threshold coefficient, with results as follows: Figure 7 As shown. Compared with the traditional nearest-nearest-class mean algorithm, BLGM performs better under all settings, especially with an accuracy of 87.76% at 5-shot, significantly higher than NCM's 84.78%, proving the effectiveness of the local best matching strategy in handling high intra-class variance data. Further observation reveals that the value determines the balance between "group correction" and "noise introduction": although the differences between the curves are not significant under low sample size, the red solid line of the curve shows the best performance when the support set is expanded to more than 4. This indicates that setting can effectively screen out the core sample cluster with high confidence to smooth single-point bias, while avoiding the introduction of low-correlation noise, thereby achieving the best generalization ability. Therefore, in this embodiment, it is determined as the default parameter.
[0113] In another specific embodiment, the different training strategies are compared and analyzed as follows: To intuitively evaluate the superiority of the S2M2R training mechanism in feature extraction, the experiment used t-SNE technology to perform feature embedding visualization analysis on five representative families in the test set that had never participated in training, such as Charger, Plankton, and Dowgin, and compared them with three mainstream paradigms: SoftmaxLoss, TripletLoss, and EpisodicTraining. The results are as follows: Figure 8a , Figure 8b , Figure 8c and Figure 8d As shown. Observation Figure 8a It is known that Softmax training, due to the lack of explicit distance constraints, results in an extremely loose feature distribution, especially in the Dowgin family, which exhibits widespread dispersion and squeezes out other classes, making it highly prone to confusion; while Figure 8b and Figure 8c The results show that the Triplet and Episodic methods, which incorporate conventional metric strategies, actually lead to severe feature entanglement, causing features from Dowgin and Plankton to interpenetrate and disrupting global topological integrity. In contrast, such as Figure 8d As shown, the S2M2R mechanism used in this embodiment constructs the optimal feature space morphology, which not only establishes a clear and wide safety margin between each category to eliminate confusion, but also effectively tolerates the existence of intra-class subclusters of highly variable families. Thus, while ensuring intra-class diversity, it maximizes the key inter-class separability, verifying the strong generalization ability of this training mechanism on unseen categories.
[0114] In another specific embodiment, the effectiveness of the multi-view dynamic fusion strategy is verified: To verify the effectiveness of the margin confidence-based dynamic fusion strategy, experiments were conducted comparing the single-view, static average fusion, and margin confidence-based dynamic fusion strategies of this embodiment. The results are as follows: Figure 9a and Figure 9b As shown. Specifically, as Figure 9a As shown, under the highly challenging 1-Shot setting, the multi-view fusion models all outperformed the best single-view fusion model. The fusion strategy in this embodiment achieved 74.75% of the optimal performance, significantly better than static average fusion. Figure 9b As shown, this advantage is further solidified with the support set increasing to 5-shot, and the accuracy of the fusion strategy climbs to 88.74%, successfully breaking through the performance bottleneck of the best single-view authority—API 87.76%. These results demonstrate that, compared to static averaging which cannot distinguish prediction quality, the margin-based strategy can keenly identify and amplify the weight of high-confidence views, automatically suppressing ambiguous interference, thereby achieving more robust decision-making through sample-level adaptive adjustment.
[0115] In another specific embodiment, this embodiment, based on a few-sample malware family classification task, innovatively proposes a multi-view visualization method based on four-value encoding to address the problem of sparse and easily confused traditional features. By decomposing heterogeneous unstructured features such as permissions, APIs, components, and intents into three complementary two-dimensional views, and utilizing a unique four-value grayscale encoding strategy to map the existence and co-occurrence relationships between features, this method successfully transforms abstract malicious behavior logic into a highly discriminative structured visual texture. This visualization strategy not only effectively preserves key local behavioral patterns, such as highlighted co-occurrence features, through max pooling operations, but also effectively reduces data dimensionality, providing high-quality, noise-resistant input data for subsequent deep learning models.
[0116] To further enhance the robustness of feature extraction in scenarios with limited samples, this embodiment constructs an improved backbone network structure. Based on DenseNet-121, this structure integrates CBAM channels and spatial attention mechanisms, enabling adaptive focusing on key local regions that play a decisive role in classification decisions. Coupled with a specially optimized S2M2R self-supervised training strategy, by introducing a rotation prediction auxiliary task and eliminating hybrid operations that might disrupt code semantics, the model is forced to capture the inherent geometric structure of the image while learning semantic classification. This dual optimization of "architecture + training" significantly enhances the model's generalization ability on unseen categories and effectively alleviates the overfitting problem commonly encountered in small-sample training.
[0117] In another specific embodiment, this embodiment also designs an optimal guide matching (BLGM) classifier and a dynamic fusion mechanism based on margin confidence to address the significant intra-class variations within malware families. BLGM abandons the reliance on the global class mean and instead uses dynamic thresholding to select high-confidence local core sample clusters as decision references, effectively avoiding the interference of outlier noise. The dynamic fusion strategy utilizes prediction margins to quantify the confidence of each view, adaptively integrating complementary information from the three views: permission-API, permission-component, and permission-intent. This entire mechanism enables the model to automatically suppress ambiguous predictions when facing highly variable malware families, breaking through the performance bottleneck of single views and achieving accurate and reliable final classification.
[0118] The examples described in this invention are not limited to the specific embodiments listed above. The examples are merely illustrative to facilitate understanding of the invention and do not constitute a limitation on the scope of protection of this invention. Any modifications, equivalent substitutions, etc., made within the spirit and principles of this invention should be included within the scope of protection.
[0119] The above description is merely an example and illustration of the concept of the present invention. Those skilled in the art can make various modifications or additions to the specific embodiments described or use similar methods to replace them, as long as they do not deviate from the concept of the invention or exceed the scope defined in this specification, they should all fall within the protection scope of the present invention.
Claims
1. A multi-view small-sample Android malware classification method based on optimal bootstrap matching, characterized in that, Includes the following steps: Step 1: Construct a multi-view grayscale image: Obtain the software package of the Android application to be analyzed, parse and extract the permissions, APIs, components and intent features, construct the original correlation matrix based on the correlation between features, assign values using a four-value grayscale encoding strategy, and then scale it to a fixed size using a max pooling strategy to generate a grayscale image view. Step 2: Training the backbone network: Construct a deep convolutional neural network with an attention mechanism as the backbone network, introduce a self-supervised rotation prediction mechanism to generate auxiliary supervision signals, and train the backbone network by jointly optimizing the main classification task and the rotation prediction task to extract discriminative feature vectors with geometric structure awareness. Step 3, Optimal Guided Matching Classification: Use the trained backbone network to extract feature vectors of support set and query set samples, calculate the cosine similarity between query sample and support set sample, lock the local optimal guided sample and construct an effective guide set, and combine dynamic group correction to calculate the similarity score of query sample belonging to each malware family category. Step 4: Dynamic Fusion of Multiple Views: Calculate the confidence of each view based on the predicted margin to generate adaptive weights, dynamically weight and fuse the similarity scores of multiple views, and complete the classification of malware families based on the final fused score. The specific process for constructing a valid set of facilitators is as follows: Calculate cosine similarity: for each malware family category Calculate the feature vector of the query sample With the feature vectors of all samples in the support set of this category cosine similarity The calculation formula is as follows: ; Lock in the best guide: in the category In the process, the support set sample with the highest similarity to the query sample is identified as the best guide for that category, and its similarity score is used to determine its successor. Defined as: Constructing an effective set of facilitators: Introducing a threshold parameter The support set samples are screened, and samples that meet the preset similarity criteria are included in the effective facilitator set based on the best facilitator. The filtering criteria are as follows: ; in, This is an adjustable threshold scaling factor.
2. The multi-view small-sample Android malware classification method based on optimal bootstrap matching according to claim 1, characterized in that, The specific analysis process for parsing and extracting permissions, APIs, components, and intent features is as follows: Regarding permission features: A full extraction strategy is adopted to summarize all non-duplicate permissions from the training set as the permission feature set; Based on API call characteristics: Obtain a pre-defined list of sensitive APIs and filter the extracted API calls based on a whitelist of high-risk prefixes covering device information, network communication, and data operations. For component features and intent features: a global-to-local hybrid strategy is used for initial extraction, combining global high-frequency features and family local high-frequency features; The refining stage performs differentiated noise reduction: component features are retained based on a whitelist of common vendors and SDK prefixes, while noise from proprietary code obfuscation is filtered out; Intent features are removed based on the original equipment manufacturer (OEM) and a blacklist of redundant information prefixes, while retaining general intent behavior features.
3. The multi-view small sample Android malware classification method based on optimal bootstrap matching according to claim 1, characterized in that, The four-value grayscale encoding strategy is used for value assignment, and the specific assignment process is as follows: Based on the pre-extracted feature list, the feature space is decomposed into three two-dimensional views with permissions as the core. Each view constructs an original high-dimensional matrix in which rows correspond to permission features and columns correspond to another dimension of features in the same view. The original high-dimensional matrix is assigned values using a four-valued grayscale encoding strategy, letting Indicates whether the sample possesses the first One permission. Indicates whether the sample possesses the first Each corresponding view feature, matrix element The assignment logic is as follows: ; The numerical value represents the grayscale brightness, with 1 indicating presence and 0 indicating absence. The encoding strategy maps the co-occurrence relationship between features to the highest brightness.
4. The multi-view small sample Android malware classification method based on optimal bootstrap matching according to claim 3, characterized in that, The three two-dimensional views are: grayscale image view of permission API, grayscale image view of permission component, and grayscale image view of permission intent.
5. The multi-view small sample Android malware classification method based on optimal bootstrap matching according to claim 3, characterized in that, The max pooling strategy is scaled to a fixed size, and the specific scaling process is as follows: The original high-dimensional matrix after being assigned values by quaternary grayscale encoding A max-pooling strategy is used to scale the matrix to a fixed, preset size. Specifically: to Divide into multiple non-overlapping local rectangular regions, let... The target matrix coordinates For the corresponding local region, the element value of the target matrix at that location is defined as the maximum value within that region, calculated as follows: ; The max pooling strategy is used to preserve key co-occurring feature signals in local regions during dimensionality reduction.
6. The multi-view small sample Android malware classification method based on optimal bootstrap matching according to claim 1, characterized in that, The specific construction process of the deep convolutional neural network that incorporates the attention mechanism is as follows: DenseNet-121 is used as the basic feature extraction network. It takes a fixed-size grayscale image generated by quadrature encoding and max pooling as input. The basic feature extraction network is composed of multiple dense blocks and transition layers stacked alternately. Through the dense connection mechanism, each layer is directly connected to all the previous layers to achieve feature reuse. After the output of the last dense block Dense-Block-4 of DenseNet-121 and before the Global-Average-Pooling layer, a Convolutional Block Attention (CBAM) module is embedded. The CBAM module processes the feature maps in a cascade manner: first, the importance of feature channels is evaluated and the channel weights are adaptively calibrated through a channel attention mechanism, and then the key spatial regions are located through a spatial attention mechanism.
7. The multi-view small sample Android malware classification method based on optimal bootstrap matching according to claim 1, characterized in that, The introduction of a self-supervised rotation prediction mechanism to generate auxiliary supervision signals, and the specific training process is as follows: Construct a dual-branch training objective: Based on the main task classification branch, add a self-supervised rotation prediction auxiliary branch to construct a joint optimization objective; Generating self-supervised rotated samples: encoding the input quaternary grayscale image Perform discrete angle rotation operation, randomly rotate the angle. From the set Select from the options to generate rotated samples. As a self-supervised input, the rotation angle As a self-supervised label; Calculate the joint loss function: calculate the main classification cross-entropy loss based on the true labels separately. and rotation prediction cross-entropy loss based on rotation angle labels The total loss is obtained by weighted summation. The calculation formula is as follows: in, Hyperparameters for balancing the weights of the two tasks; During training, only the rotation prediction task is retained, and no manifold blending operation based on linear interpolation is performed.
8. The multi-view small sample Android malware classification method based on optimal bootstrap matching according to claim 1, characterized in that, The similarity score is calculated as follows: Constructing a comprehensive facilitator: Based on the aforementioned set of effective facilitators The feature information in the set is used to calculate the mean of the feature vectors of the samples within the set, and to construct the query sample in the category. Comprehensive guide : ; Calculating dynamic weights: Centered on the comprehensive facilitator, the Softmax function is used to calculate the weights for each sample in the support set. relative to the weight of the comprehensive facilitator Samples that are closer to the overall facilitator receive a higher weight, calculated as follows: ; in, Temperature parameter is used to smooth the distribution of weights; the final classification score is calculated by taking the query sample. The category to which the query sample belongs is obtained by weighted summation of the original similarities with the samples in each support set. Final classification score : .
9. The multi-view small sample Android malware classification method based on optimal bootstrap matching according to claim 1, characterized in that, The specific calculation process for the dynamic fusion of multiple views and the generation of the final classification result is as follows: For a given query sample Retrieve the outputs of the permission API view, permission component view, and permission intent view respectively. The score vectors for each malware family category are denoted as follows: , and ; Calculate the predicted margin: Define the first A view Predicted margin The difference between the maximum and second-largest values in the score vector is used to quantify the certainty of the classifier's prediction for that sample. The calculation formula is as follows: ; in, The highest score in the rating vector is represented by , and the second highest score after removing the highest score is represented by . Calculate the dynamic weights: based on the predicted margins, normalize the margins of the three views using the Softmax function, and calculate the weights assigned to the . Adaptive weights for each view To amplify the influence of high-confidence views, the calculation formula is as follows: ; The final classification result is generated by weighting the predicted scores of the three views using the calculated adaptive weights and then selecting the category with the largest sum of weighted scores as the final classification result. The calculation formula is as follows: ; in, Indicates the first The view is for the first Predicted scores for each category.