Method and system for detecting and positioning malicious samples in computing power network
By adopting a deep detection method based on a hierarchical fine-grained network in the computing power network, the problems of low detection accuracy, insufficient defense capabilities and high traceability are solved, and the accurate detection and positioning of malicious samples are achieved, which enhances the security of the network.
Patent Information
- Application Number
- CN202510324559.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2045-03-19
AI Technical Summary
The existing technology has problems such as low detection accuracy, insufficient defense capabilities and difficult traceability in the detection and location of malicious samples in computing power networks, making it difficult to effectively deal with complex and changeable malicious sample attacks.
The depth detection method based on hierarchical fine-grained network is adopted to identify specific areas of malicious forgery through multi-branch feature extraction and positioning modules, and the dependencies between different forgery means are analyzed through a multi-level path prediction mechanism to achieve accurate positioning and classification.
It significantly improves the detection accuracy and positioning accuracy of malicious samples, reduces the false alarm rate, enhances the network's defense capabilities and traceability capabilities, and provides strong security guarantees.
Smart Images

Figure CN119848853A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network security technology, and in particular to a method and system for detecting and locating malicious samples in a computing network. Background Art
[0002] With the rapid development of computing power networks, new network security issues are becoming increasingly severe. In particular, the number of malicious samples (such as adversarial samples, forged images, etc.) has increased dramatically. The complexity and concealment of their attack methods have brought huge challenges to network security.
[0003] At present, the detection and positioning of malicious samples in computing power networks mainly rely on traditional signature-based detection methods and statistical-based anomaly detection methods. However, these methods are mainly used to deal with traditional network attacks, with the following characteristics: 1. Strong signature dependence: Traditional signature-based detection methods require pre-definition of the characteristic signatures of malicious samples, and have poor detection effects on unknown or mutated malicious samples. 2. High false alarm rate: Although statistical-based anomaly detection methods can detect unknown malicious samples, due to their characteristics based on statistical models, normal samples are easily misjudged as malicious samples, resulting in a high false alarm rate. 3. Low positioning accuracy: Existing methods can often only provide approximate location information for the positioning of malicious samples, and cannot accurately identify specific counterfeit areas, making it difficult to meet the needs of precision strikes.
[0004] When these traditional methods are applied to the detection and location of malicious samples in the current computing power network, these methods show obvious shortcomings, mainly reflected in: 1. Low detection accuracy: Traditional methods are difficult to accurately identify complex and changeable malicious samples, especially for carefully designed adversarial samples, the detection effect is greatly reduced. 2. Insufficient defense capabilities: In the face of new attack methods, traditional defense methods are often difficult to respond effectively, resulting in increased network security risks. 3. Difficulty in tracing the source: Once the network suffers a malicious attack, the existing tracing technology is often difficult to quickly and accurately locate the source of the attack, which increases the difficulty of network recovery and accountability. Summary of the invention
[0005] The present invention aims to solve one of the technical problems existing in the related art at least to a certain extent.
[0006] One object of the present invention is to provide a detection and positioning method for malicious samples in a computing network, to perform in-depth detection and precise positioning of malicious samples based on a hierarchical fine-grained network, to identify specific areas of malicious forgery, and to determine the specific means of malicious forgery.
[0007] Another object of the present invention is to provide a detection and positioning system for malicious samples in a computing network.
[0008] In order to achieve the above-mentioned purpose, the present invention provides a method for detecting and locating malicious samples in a computing network, comprising the following steps: S100, performing multi-branch feature extraction on the input image based on a hierarchical fine-grained network, including extracting features in the color block and frequency block dimensions respectively, and concatenating the extracted features and inputting them into a multi-branch feature extractor to generate a multi-resolution feature map; S200, setting a localization module at the end of the branch that generates the highest resolution feature map, converting the feature map into a global feature map through a self-attention mechanism and a convolutional layer, and generating a mask to identify the authenticity of the pixel, while constructing the boundary between the real pixel and the forged pixel through metric learning; S300, using a forgery mask to capture the features of the tampered or forged area, and using a multi-level path prediction mechanism to analyze the dependencies between different forgery methods and classify different forgery methods.
[0009] A further preferred technical solution of the present invention is that, when extracting features in the frequency block dimension in step S100, the Gaussian Laplacian operator is applied to the CNN feature map to reveal image artifacts hidden in the RGB domain and the frequency domain.
[0010] Preferably, in step S100, when the multi-branch feature extractor generates a multi-resolution feature map, each branch of the feature extractor is defined as , , each branch generates feature maps of different resolutions for the input features, which are used for the branch to classify the image at different levels; at the finest level, content modeling is performed at all spatial locations to generate high-resolution feature maps; for the coarsest level classification, only low-resolution feature maps are generated.
[0011] Preferably, in step S200, the feature map is converted into a global feature map through a self-attention mechanism and a convolution layer, and a mask is generated to identify the authenticity of the pixel, specifically: Defining Characteristics For a size of A tensor of and Represent the height and width of the feature respectively, 512 is the depth of the feature, which is mapped to the mask; The positioning module introduces a self-attention mechanism and combines it with the convolutional layer , Activate Layer And the transpose layer , the input feature Convert to , as well as ; For the convolutional layer , Activate Layer The output of is normalized with the nonlinear activation function softmax, and the normalized result is combined with the transposed layer The output is multiplied by a dot, and the output is still Tensor , represents the global feature map; Final Output Tensor , used to identify whether a pixel is real or fake.
[0012] Preferably, in step S200, the boundary between the real pixel and the forged pixel is constructed by metric learning, and the specific method is: First, a reference center is obtained by averaging all pixel features of the real image in the training set. , represents a D-dimensional vector in the real space, where D corresponds to the dimension of the eigenvector, and is defined For the boundary, define is the pixel of the final mask prediction layer, then the objective function is expressed as:
[0013] in, Indicates the row number where the pixel is located, ranging from 1 to H ; Indicates the column number where the image is located, ranging from 1 to W ; Indicates the image i Row, No. j Whether the element at the column position is judged to be real or forged, its value is 0 or 1, where 1 means the pixel is judged to be real and 0 means the pixel is judged to be forged; when a pixel is judged to be real, the objective function tries to make its feature as close to the reference center as possible , when a pixel is judged to be forged, the objective function tries to make its feature as far away from the reference center as possible ; By optimizing the objective function, the model’s ability to distinguish the boundaries between real pixels and forged pixels is improved.
[0014] Preferably, in step S300, a forged mask is used to capture the features of the tampered or forged area, specifically: First, a binary mask is generated and superimposed with the input image to obtain a mask image; Using the partial convolution operator, the convolution kernel is renormalized so that the convolution operation is only applied to pixels not covered by the mask, that is, the feature map only describes the information of the manipulated or forged area; the convolution operator is regarded as a conditional dot product operation, expressed as:
[0015] in, Represents the convolution operation; Represents the output feature map after partial convolution operation; Represents the input feature map, that is, the original image or the output feature map of the previous layer; Represents the convolution kernel, which is used to perform convolution operation on the input feature map; Represents a binary mask, which is used to capture the features of tampered or forged areas. Its value is 0 or 1, where 0 represents tampered or forged pixels and 1 represents untampered pixels; Using mask update functions between different layers , a new mask is generated based on the output feature map of the current layer and the mask of the previous layer, and the new mask is used for propagation, which is expressed as:
[0016] in, represents the updated mask, which is propagated between different layers to highlight the forged areas of the image; Represents the output feature map of the current layer, which is used to calculate the new mask.
[0017] Preferably, before performing multi-branch feature extraction, a malicious sample purification and denoising step based on an attention enhancement network is also included, specifically including: Channel importance-based feature selection quantifies the importance of each channel by calculating the sum of the gradients of the channel activations and dynamically adjusts the network weights based on these importance scores; Use a combination of median filtering and mean filtering to implement denoising at the feature map level; The denoised feature map is fed into the residual block structure to further remove the noise.
[0018] Preferably, before performing multi-branch feature extraction, an adversarial sample purification step based on information mask is also included, which combines the image block parallel reconstruction and random combination module of the region cross autoencoder to generate a purified image for resisting adversarial attacks.
[0019] Preferably, the adversarial sample purification step based on information masking specifically includes: The image is divided into several small blocks using segmentation and reorganization strategies; Each small block is converted into an embedded block through block embedding and position embedding, wherein the position embedding adopts a fixed two-dimensional sine-cosine coding; Divide the embedding blocks into several non-overlapping subsets, each of which contains uniformly sampled embedding blocks; For each subset, use the Transformer block to extract features and obtain a feature set; Select a subset to mask, and send the remaining subsets to the decoder to reconstruct the masked small blocks; loop through all subsets, and finally integrate all reconstruction results to form a complete purified image; The original adversarial image and the purified image are input into the random combination module for weighted combination. After weighted combination, the combined image is output, which is expressed as:
[0020] in, is the output combined image, is the original adversarial image, For the purified image, is a weight vector used to control the contribution ratio of the original adversarial image and the purified image in the output combined image. Represents element-by-element multiplication, which is used to perform element-by-element multiplication of two matrices or vectors of the same size.
[0021] Another aspect of the present invention provides a detection and location system for malicious samples in a computing network, comprising: Feature extraction module: constructs a hierarchical fine-grained network to perform multi-branch feature extraction on the input image, including extracting features in the color block and frequency block dimensions respectively, and concatenating the extracted features and inputting them into the multi-branch feature extractor to generate a multi-resolution feature map; Localization module: It is set at the end of the branch that generates the highest resolution feature map. It converts the feature map into a global feature map through a self-attention mechanism and a convolutional layer, generates a mask to identify the authenticity of the pixels, and constructs the boundary between real pixels and forged pixels through metric learning. Classification module: It is used to capture the features of tampered or forged areas using forgery masks, and adopt a multi-level path prediction mechanism to analyze the dependencies between different forgery methods and classify different forgery methods.
[0022] Preferably, the system further includes a preprocessing module for performing malicious sample purification and denoising processing based on an attention enhancement network on the input sample before performing multi-branch feature extraction; specifically including: Channel importance-based feature selection (CIFS), which quantifies the importance of each channel by calculating the sum of the gradients of the channel activations and dynamically adjusts the network weights based on these importance scores; Use a combination of median filtering and mean filtering to implement denoising at the feature map level; The denoised feature map is fed into the residual block structure to further remove the noise and finally output a purer and more informative feature representation.
[0023] Preferably, the system further includes a purification module for performing adversarial sample purification processing based on information mask on the input sample before performing multi-branch feature extraction, specifically including: Divide the image into several small blocks and process these small blocks separately; The small blocks are transformed into embedded blocks through block embedding and position embedding; The embedded patches are divided into several non-overlapping subsets, each of which contains uniformly sampled patches; For each subset, use the Transformer block to extract features and obtain a feature set; A subset is selected for masking, and the remaining subset is fed into the decoder to reconstruct the masked small blocks; Integrate all reconstruction results to form a complete cleansed image; The original adversarial image and the image purified by RIAE are input into the random combination module for weighted combination to generate a purified image with enhanced defense properties.
[0024] Another aspect of the present invention provides a non-transitory computer-readable storage medium having computer instructions stored thereon, which enable a computer to execute the above-mentioned method for detecting and locating malicious samples in a computing power network.
[0025] Yet another aspect of the present invention provides an electronic device, comprising: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus, and the processor calls the logic instructions in the memory to execute the above-mentioned method for detecting and locating malicious samples in a computing network.
[0026] On the other hand, the present invention provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer executes the above-mentioned method for detecting and locating malicious samples in a computing power network.
[0027] Beneficial effects: The present invention proposes a method and system for detecting and locating malicious samples in computing networks. Based on a hierarchical fine-grained network, the malicious samples are deeply detected and accurately located, the specific areas of malicious forgery are identified, and the specific means of malicious forgery are determined. On this basis, the interference of adversarial noise is effectively removed through denoising operations, and the model's ability to capture and extract key features is significantly enhanced through the attention mechanism.
[0028] To further improve the robustness of the system, this paper introduces the Regional Intersection Autoencoder (RIAE) and the Random Combination Module (RCM), which work together to effectively reduce the impact of adversarial perturbations on detection results. RIAE, with its unique image block parallel reconstruction capability, combined with the flexible combination strategy of RCM, jointly generates highly defensive purified images, ensuring that the system can maintain stable detection and traceability performance even in the face of complex and changeable adversarial attacks.
[0029] The present invention forms a closed-loop detection and defense system in the context of computing power network from data input, preprocessing, feature extraction, positioning and traceability analysis. This system not only significantly improves the detection accuracy and positioning accuracy of malicious samples, but also greatly reduces the false alarm rate, providing strong security protection for the computing power network. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 This is a flow chart of the method for detecting and locating malicious samples in a computing network in the present invention; Figure 2 This is a network architecture diagram of the positioning module in the present invention; Figure 3 It is a flow chart of the malicious sample purification and denoising steps based on the attention enhancement network in the present invention; Figure 4 This is a flowchart of the adversarial sample purification steps based on information masking in the present invention. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings in the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments, and they should not be understood as limitations on the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. In the description of the present invention, it should be understood that the terms used are only for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0032] Combine the following Figure 1-Figure 4 The present invention describes a method and system for detecting and locating malicious samples in a computing network.
[0033] Embodiment 1: This embodiment provides a method for detecting and locating malicious samples in a computing network.
[0034] The core of the method of this embodiment is to extract image features and define multiple hierarchical labels to characterize the forged attributes of malicious images. With these labels, the inherent hierarchical nature between different forged attributes can be fully utilized to analyze and classify the fine-grained forged attributes of each image layer by layer. Figure 1 As shown, the specific steps are: S100, multi-branch feature extraction: For any input image, features are extracted in two dimensions: color block and frequency block. In the processing of frequency block, the Laplacian of Gaussian (LoG) operator is applied to the CNN feature map to effectively reveal the image artifacts hidden in the RGB domain and frequency domain. The features extracted from the color block and the frequency block are concatenated as the input of the multi-branch feature extractor.
[0035] Define the branches of the feature extractor as , . Feature maps of different resolutions are generated for the input features on each branch, which are used to classify the image at that branch level. For the finest level (i.e., identifying a single forgery attack method), content modeling is required at all spatial locations to generate high-resolution feature maps. On the contrary, for the coarsest level (i.e., binary) classification, only low-resolution feature maps need to be generated to improve processing efficiency.
[0036] S200, malicious sample location: Given that different malicious sample forgery methods produce manipulated areas with different distributions and patterns, the localization module is placed at the end of the branch that generates the highest resolution in the multi-branch feature extractor. The module architecture is designed as follows: Figure 2 shown.
[0037] Defining Characteristics For a size of A tensor of and They represent the height and width of the feature respectively, and 512 is the depth of the feature, which is mapped to the mask to locate the forgery attack in the sample.
[0038] In order to simulate the dependency and interaction of pixels in the spatial domain, the positioning module introduces a self-attention mechanism and combines it with the convolutional layer. , Activate Layer And the transpose layer , the input feature Convert to , as well as .
[0039] For the convolutional layer , Activate Layer The output of is normalized with the nonlinear activation function softmax, and the normalized result is combined with the transposed layer The output is multiplied by a dot, and the output is still Tensor , represents the global feature map, which not only carries the important information of the previous layer, but also transmits its influence to the subsequent layers.
[0040] Final output of positioning module Tensor , used to identify whether a pixel is real or fake.
[0041] In order to further enhance the model's ability to distinguish between real pixels and forged pixels, a metric learning approach is used to build a wider boundary between real pixels and forged pixels. First, a reference center is obtained by averaging all pixel features of the real image in the training set. , represents a D-dimensional vector in the real space, where D corresponds to the dimension of the eigenvector, and is defined For the boundary, define is the pixel of the final mask prediction layer, then the objective function is expressed as:
[0042] in, Indicates the row number where the pixel is located, ranging from 1 to H ; Indicates the column number where the image is located, ranging from 1 to W ; Indicates the image i Row, No. j Whether the element at the column position is judged to be real or forged, its value is 0 or 1, where 1 means the pixel is judged to be real and 0 means the pixel is judged to be forged; when a pixel is judged to be real, the objective function tries to make its feature as close to the reference center as possible , when a pixel is judged to be forged, the objective function tries to make its feature as far away from the reference center as possible .
[0043] By optimizing the objective function, the model’s ability to distinguish between real and forged pixels can be improved, making it easier to distinguish between real and fake pixels when recognizing new images.
[0044] S300, malicious sample classification: Different from the traditional method that only focuses on the location of the counterfeit mask, the use of the counterfeit mask in this embodiment not only enables the model to accurately capture the characteristics of the tampered or forged area, but also adopts a multi-level path prediction mechanism to analyze the dependencies between different counterfeiting methods, thereby improving its classification accuracy and performance.
[0045] First, a binary mask is generated and superimposed with the input image to obtain a mask image; Using the partial convolution operator, the convolution kernel is renormalized so that the convolution operation is only applied to pixels not covered by the mask, that is, the feature map only describes the information of the manipulated or forged area; the convolution operator is regarded as a conditional dot product operation, expressed as:
[0046] in, Represents the convolution operation; Represents the output feature map after partial convolution operation; Represents the input feature map, that is, the original image or the output feature map of the previous layer; Represents the convolution kernel, which is used to perform convolution operation on the input feature map; It represents a binary mask, which is used to capture the characteristics of the tampered or forged area. Its value is 0 or 1, where 0 represents the tampered or forged pixel and 1 represents the untampered pixel. Using mask update functions between different layers , a new mask is generated based on the output feature map of the current layer and the mask of the previous layer, and the new mask is used for propagation, which is expressed as:
[0047] in, represents the updated mask, which is propagated between different layers to highlight the forged areas of the image; Represents the output feature map of the current layer, which is used to calculate the new mask.
[0048] Mask It is used to highlight the forged areas of the image and enhance the model's ability to identify forgery techniques, so that the model can understand and classify different forgery methods more accurately.
[0049] In order to optimize the detection process, in this embodiment, before performing multi-branch feature extraction, a malicious sample purification and denoising step based on the attention enhancement network is also performed. The overall process is as follows Figure 3 As shown in the figure, the denoising module is integrated with the attention enhancement network to guide the model to focus on the key features of malicious samples and shield interference factors during the detection process. Improve the detection and classification accuracy. After successfully locating malicious samples, this fusion strategy significantly enhances the denoising performance in shallow networks, ensuring that the model can still accurately extract semantic features when facing adversarial perturbations, and effectively curb the propagation of disturbance signals. It not only ensures the authenticity of the original signal, but also significantly improves the robustness of the network, providing a more accurate and reliable basis for the classification of forged attributes of malicious samples. The specific method is: In the feature extraction stage, channel importance-based feature selection (CIFS) is introduced to optimize the contribution of each channel to the model performance. As a feature selection method for the middle layer of the neural network, CIFS quantifies the importance of each channel by calculating the sum of the gradients of channel activations, and dynamically adjusts the network weights based on these importance scores, so that the model focuses on its most critical features.
[0050] Given that adversarial samples can cause pixel-level feature perturbations and gradually amplify them to the feature level in the deep layers of the network, leading to model misjudgment, it is necessary to implement denoising operations to enhance the model's defense capabilities.
[0051] First, compare the performance of real samples and adversarial samples at the feature map level. Over-activated areas usually represent semantic features related to the image content, and the activated areas in the adversarial samples indicate the source of misclassification, that is, how the adversarial samples affect the model decision. In order to weaken the impact of these misleading features, this embodiment combines median filtering with mean filtering to implement denoising at the feature map level. Mean filtering smoothes the image by averaging local pixel values, while median filtering suppresses noise by selecting the median in the neighborhood while better preserving image edge details. This dual denoising strategy effectively removes redundant noise in the feature map, allowing the model to focus more on the core content of the image.
[0052] Subsequently, the feature map after preliminary denoising is fed into the residual block structure, which directly transmits input information to output through cross-layer connections, effectively alleviating the gradient vanishing problem in deep networks. With multiple iterations of the denoising module, the noise in the image or feature vector is further removed, and finally a purer and more informative representation is output for subsequent classification tasks.
[0053] In addition to using the attention enhancement network to purify and denoise malicious samples, this embodiment also proposes an adversarial sample purification method based on information masking. The overall process is as follows: Figure 4 As shown in the figure, the image block parallel reconstruction advantage of the regional cross autoencoder (RIAE) and the random combination module (RCM) are combined to generate a purified image that can resist adversarial attacks and reduce the impact of adversarial perturbations. The specific method is: In view of the complexity of perturbation control of the entire image, RIAE adopts a segmentation and reorganization strategy to divide the image into several small blocks and process these small blocks separately, so that the network can focus on repairing the areas affected by the perturbation while keeping the rest unchanged.
[0054] These small blocks are transformed into embedding blocks through block embedding and position embedding, where the position embedding adopts a fixed two-dimensional sine-cosine encoding to simplify the training process.
[0055] The embedding blocks are divided into several non-overlapping subsets, each containing evenly sampled embedding blocks, ensuring that there is no intersection between the subsets. This division mimics uniform image sampling and ensures that adversarial perturbations between different subsets do not affect each other.
[0056] For each subset, RIAE independently applies a series of Transformer blocks to extract features and obtain a feature set. Subsequently, a subset is selected for masking, and the remaining subsets are sent to the decoder to reconstruct the masked small blocks. This process is repeated for all subsets, and finally all reconstruction results are integrated to form a complete reconstructed image.
[0057] The features of the masked dataset are replaced with mask markers, position embedding is added, and reconstruction is completed through a series of Transformer blocks. Through the above process, RIAE can assist the reconstruction process with the help of unaffected image areas, effectively reduce disturbances and restore the original features of the image, maintain image quality and integrity, and lay the foundation for subsequent robustness evaluation and classification tasks.
[0058] The original adversarial image Compared with the image after RIAE purification Input to the random combination module, perform weighted combination, and output the combined image after weighted combination, which is expressed as:
[0059] in, is the output combined image, is the original adversarial image, For the purified image, is a weight vector used to control the contribution ratio of the original adversarial image and the purified image in the output combined image. Represents element-by-element multiplication, which is used to perform element-by-element multiplication of two matrices or vectors of the same size.
[0060] It ensures that within the region specified by the mask matrix, the perturbation of the original image is preserved, while other regions are composed of the purified image. This design allows the model to learn accurate feature extraction and classification in the presence of residual perturbations, thereby enhancing the model's generalization ability to unknown attacks.
[0061] The random combination module (RCM) enables the model to adapt to the perturbation patterns it has seen, and also enhances its resistance to new, unknown perturbations. Even if the adversarial perturbations show subtle similarities in different regions of the image, the model trained with RCM can effectively handle them and generate cleansed images with enhanced defense properties, which can also maintain a certain stability in the face of strong adversarial attacks.
[0062] The following effects are achieved by the method of this embodiment: 1. Accurate detection and positioning of malicious samples: This embodiment is based on a malicious sample detection and positioning method based on a hierarchical fine-grained network. Through a multi-branch feature extraction and positioning module, multiple hierarchical labels are defined to achieve accurate detection of malicious samples and positioning and classification of forged areas.
[0063] 2. Purification and denoising of malicious samples: This embodiment integrates the denoising module with the attention enhancement network. Through channel importance-based feature selection (CIFS) and double denoising strategies, it enhances the denoising performance of the model in shallow networks and effectively curbs the spread of adversarial perturbations.
[0064] 3. Purification and defense of adversarial samples: This embodiment combines the regional cross autoencoder (RIAE) and the random combination module (RCM) to generate purified images that can resist adversarial attacks and significantly reduce the impact of adversarial perturbations.
[0065] 4. Closed-loop detection and defense system: This embodiment forms a closed-loop detection and defense system from data input, preprocessing, feature extraction, positioning to traceability analysis, ensuring efficient and accurate detection and traceability of malicious samples in the context of the computing power network, improving system robustness and detection accuracy, and providing strong security protection for the computing power network.
[0066] Embodiment 2: A system for detecting and locating malicious samples in a computing network, comprising: Feature extraction module: Construct a hierarchical fine-grained network to perform multi-branch feature extraction on the input image, including extracting features in the color block and frequency block dimensions respectively, and concatenating the extracted features and inputting them into the multi-branch feature extractor to generate a multi-resolution feature map.
[0067] Localization module: Set at the end of the branch that generates the highest resolution feature map, it converts the feature map into a global feature map through a self-attention mechanism and a convolutional layer, generates a mask to identify the authenticity of the pixels, and constructs the boundary between real pixels and forged pixels through metric learning.
[0068] Classification module: It is used to capture the features of tampered or forged areas using forgery masks, and adopt a multi-level path prediction mechanism to analyze the dependencies between different forgery methods and classify different forgery methods.
[0069] In addition, the system of this embodiment also includes a preprocessing module, which is used to perform malicious sample purification and denoising processing based on the attention enhancement network on the input sample before performing multi-branch feature extraction. The preprocessing module implements: Channel importance-based feature selection (CIFS), which quantifies the importance of each channel by calculating the sum of the gradients of the channel activations and dynamically adjusts the network weights based on these importance scores; Use a combination of median filtering and mean filtering to implement denoising at the feature map level; The denoised feature map is fed into the residual block structure to further remove the noise and finally output a purer and more informative feature representation.
[0070] The system of this embodiment further includes a purification module, which is used to perform adversarial sample purification processing based on information mask on the input sample before performing multi-branch feature extraction. The purification module implements: Divide the image into several small blocks and process these small blocks separately; The small blocks are transformed into embedded blocks through block embedding and position embedding; The embedded patches are divided into several non-overlapping subsets, each of which contains uniformly sampled patches; For each subset, use the Transformer block to extract features and obtain a feature set; A subset is selected for masking, and the remaining subset is fed into the decoder to reconstruct the masked small blocks; Integrate all reconstruction results to form a complete cleansed image; The original adversarial image and the image purified by RIAE are input into the random combination module for weighted combination to generate a purified image with enhanced defense properties.
[0071] Embodiment 3: This embodiment provides a non-transitory computer-readable storage medium on which computer instructions are stored. The computer instructions enable a computer to execute a method for detecting and locating malicious samples in a computing network. The method includes the following steps: S100, performing multi-branch feature extraction on the input image based on a hierarchical fine-grained network, including extracting features in the color block and frequency block dimensions respectively, and concatenating the extracted features and inputting them into a multi-branch feature extractor to generate a multi-resolution feature map; S200, setting a localization module at the end of the branch that generates the highest resolution feature map, converting the feature map into a global feature map through a self-attention mechanism and a convolutional layer, and generating a mask to identify the authenticity of the pixel, while constructing the boundary between the real pixel and the forged pixel through metric learning; S300, using a forgery mask to capture the features of the tampered or forged area, and using a multi-level path prediction mechanism to analyze the dependencies between different forgery methods and classify different forgery methods.
[0072] Embodiment 4: This embodiment provides an electronic device, which may include: a processor, a communications interface, a memory, and a communications bus, wherein the processor, the communications interface, and the memory communicate with each other via the communications bus. The processor may call the logic instructions in the memory to execute a method for detecting and locating malicious samples in a computing network, the method comprising the following steps: S100, performing multi-branch feature extraction on the input image based on a hierarchical fine-grained network, including extracting features in the color block and frequency block dimensions respectively, and concatenating the extracted features and inputting them into a multi-branch feature extractor to generate a multi-resolution feature map; S200, setting a localization module at the end of the branch that generates the highest resolution feature map, converting the feature map into a global feature map through a self-attention mechanism and a convolutional layer, and generating a mask to identify the authenticity of the pixel, while constructing the boundary between the real pixel and the forged pixel through metric learning; S300, using a forgery mask to capture the features of the tampered or forged area, and using a multi-level path prediction mechanism to analyze the dependencies between different forgery methods and classify different forgery methods.
[0073] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program code.
[0074] Embodiment 5: This embodiment provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute a method for detecting and locating malicious samples in a computing network. The method includes the following steps: S100, performing multi-branch feature extraction on the input image based on a hierarchical fine-grained network, including extracting features in the color block and frequency block dimensions respectively, and concatenating the extracted features and inputting them into a multi-branch feature extractor to generate a multi-resolution feature map; S200, setting a localization module at the end of the branch that generates the highest resolution feature map, converting the feature map into a global feature map through a self-attention mechanism and a convolutional layer, and generating a mask to identify the authenticity of the pixel, while constructing the boundary between the real pixel and the forged pixel through metric learning; S300, using a forgery mask to capture the features of the tampered or forged area, and using a multi-level path prediction mechanism to analyze the dependencies between different forgery methods and classify different forgery methods.
[0075] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0076] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0077] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for detecting and locating malicious samples in a computing network, characterized in that: The following steps are involved: S100, performing multi-branch feature extraction on the input image based on a hierarchical fine-grained network, including extracting features in the color block and frequency block dimensions respectively, and concatenating the extracted features and inputting them into a multi-branch feature extractor to generate a multi-resolution feature map; S200, setting a localization module at the end of the branch that generates the highest resolution feature map, converting the feature map into a global feature map through a self-attention mechanism and a convolutional layer, and generating a mask to identify the authenticity of the pixel, while constructing the boundary between the real pixel and the forged pixel through metric learning; S300, using a forgery mask to capture the features of the tampered or forged area, and using a multi-level path prediction mechanism to analyze the dependencies between different forgery methods and classify different forgery methods.
2. The method for detecting and locating malicious samples in a computing network according to claim 1, characterized in that: When extracting features in the frequency block dimension in step S100, the Laplacian of Gaussian operator is applied to the CNN feature map to reveal image artifacts hidden in the RGB domain and the frequency domain.
3. The method for detecting and locating malicious samples in a computing network according to claim 1, characterized in that: In step S100, when the multi-branch feature extractor generates a multi-resolution feature map, each branch of the feature extractor is defined as , , each branch generates feature maps of different resolutions for the input features, which are used for the branch to classify the image at different levels; at the finest level, content modeling is performed at all spatial locations to generate high-resolution feature maps; for the coarsest level classification, only low-resolution feature maps are generated.
4. The method for detecting and locating malicious samples in a computing network according to claim 1, characterized in that: In step S200, the feature map is converted into a global feature map through a self-attention mechanism and a convolutional layer, and a mask is generated to identify the authenticity of the pixels, specifically: Defining Characteristics For a size of A tensor of and Represent the height and width of the feature respectively, 512 is the depth of the feature, which is mapped to the mask; The positioning module introduces a self-attention mechanism and combines it with the convolutional layer , Activate Layer And the transpose layer , the input feature Convert to , as well as ; For the convolutional layer , Activate Layer The output of is normalized with the nonlinear activation function softmax, and the normalized result is combined with the transposed layer The output is multiplied by a dot, and the output is still Tensor , represents the global feature map; Final Output Tensor , used to identify whether a pixel is real or fake.
5. The method for detecting and locating malicious samples in a computing network according to claim 4, characterized in that: In step S200, the boundary between the real pixel and the forged pixel is constructed by metric learning, and the specific method is as follows: First, a reference center is obtained by averaging all pixel features of the real image in the training set. , represents a D-dimensional vector in the real space, where D corresponds to the dimension of the eigenvector, and is defined For the boundary, define is the pixel of the final mask prediction layer, then the objective function is expressed as: ; in, Indicates the row number where the pixel is located, ranging from 1 to H ; Indicates the column number where the image is located, ranging from 1 to W ; Indicates the image i Row, No. j Whether the element at the column position is judged to be real or forged, its value is 0 or 1, where 1 means the pixel is judged to be real and 0 means the pixel is judged to be forged; when a pixel is judged to be real, the objective function tries to make its feature as close to the reference center as possible , when a pixel is judged to be forged, the objective function tries to make its feature as far away from the reference center as possible ; By optimizing the objective function, the model’s ability to distinguish the boundaries between real pixels and forged pixels is improved.
6. The method for detecting and locating malicious samples in a computing network according to claim 1, characterized in that: In step S300, a forged mask is used to capture the features of the tampered or forged area, specifically: First, a binary mask is generated and superimposed with the input image to obtain a mask image; Using the partial convolution operator, the convolution kernel is renormalized so that the convolution operation is only applied to pixels not covered by the mask, that is, the feature map only describes the information of the manipulated or forged area; the convolution operator is regarded as a conditional dot product operation, expressed as: ; in, Represents the convolution operation; Represents the output feature map after partial convolution operation; Represents the input feature map, that is, the original image or the output feature map of the previous layer; Represents the convolution kernel, which is used to perform convolution operation on the input feature map; Represents a binary mask, which is used to capture the features of tampered or forged areas. Its value is 0 or 1, where 0 represents tampered or forged pixels and 1 represents untampered pixels; Using mask update functions between different layers , a new mask is generated based on the output feature map of the current layer and the mask of the previous layer, and the new mask is used for propagation, which is expressed as: ; in, represents the updated mask, which is propagated between different layers to highlight the forged areas of the image; Represents the output feature map of the current layer, which is used to calculate the new mask.
7. The method for detecting and locating malicious samples in a computing network according to claim 1, characterized in that: Before multi-branch feature extraction, the malicious sample purification and denoising steps based on the attention enhancement network are also included, including: Channel importance-based feature selection quantifies the importance of each channel by calculating the sum of the gradients of the channel activations and dynamically adjusts the network weights based on these importance scores; Use a combination of median filtering and mean filtering to implement denoising at the feature map level; The denoised feature map is fed into the residual block structure to further remove the noise.
8. The method for detecting and locating malicious samples in a computing network according to claim 1, characterized in that: Before multi-branch feature extraction, an adversarial sample purification step based on information mask is also included, which combines the image block parallel reconstruction and random combination module of the region cross autoencoder to generate a purified image for resisting adversarial attacks.
9. The method for detecting and locating malicious samples in a computing network according to claim 1, characterized in that: The adversarial sample purification steps based on information masking include: The image is divided into several small blocks using segmentation and reorganization strategies; Each small block is converted into an embedded block through block embedding and position embedding, wherein the position embedding adopts a fixed two-dimensional sine-cosine coding; Divide the embedding blocks into several non-overlapping subsets, each of which contains uniformly sampled embedding blocks; For each subset, use the Transformer block to extract features and obtain a feature set; Select a subset to mask, and send the remaining subsets to the decoder to reconstruct the masked small blocks; loop through all subsets, and finally integrate all reconstruction results to form a complete purified image; The original adversarial image and the purified image are input into the random combination module for weighted combination. After weighted combination, the combined image is output, which is expressed as: ; in, is the output combined image, is the original adversarial image, For the purified image, is a weight vector used to control the contribution ratio of the original adversarial image and the purified image in the output combined image. Represents element-by-element multiplication, which is used to perform element-by-element multiplication of two matrices or vectors of the same size.
10. A detection and location system for malicious samples in computing networks, characterized in that: include: Feature extraction module: constructs a hierarchical fine-grained network to perform multi-branch feature extraction on the input image, including extracting features in the color block and frequency block dimensions respectively, and concatenating the extracted features and inputting them into the multi-branch feature extractor to generate a multi-resolution feature map; Localization module: It is set at the end of the branch that generates the highest resolution feature map. It converts the feature map into a global feature map through a self-attention mechanism and a convolutional layer, generates a mask to identify the authenticity of the pixels, and constructs the boundary between real pixels and forged pixels through metric learning. Classification module: It is used to capture the features of tampered or forged areas using forgery masks, and adopt a multi-level path prediction mechanism to analyze the dependencies between different forgery methods and classify different forgery methods.
Citation Information
Patent Citations
Deep fake face detection method based on frequency learning
CN114898437A
Social network deep counterfeit video detection method and system based on deep learning
CN118097502A
Deep fake face evidence obtaining method based on reconstruction learning
CN118781665A
Cited By
Face anti-counterfeiting detection method and device based on Transform domain information fusion
CN121214527A
Face anti-counterfeiting detection method and device based on transformer domain information fusion
CN121214527B
Double-flow and confidence coefficient calibration-based forged image detection and positioning method
CN122222988A