Security classification method, system and equipment for electronic archives

By employing scale-adaptive feature encoding and spatially guided attention mechanisms, the problem of insufficient accuracy in electronic archive classification has been solved, enabling efficient identification and classification of security classification markers in images.

CN121837752APending Publication Date: 2026-04-10GUANGZHOU UNIVERSITY +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGZHOU UNIVERSITY
Filing Date
2025-12-29
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing technologies lack accuracy in classifying electronic archives, especially when dealing with complex and diverse electronic archive scenarios, making it difficult to achieve high accuracy and robustness in classification. This is mainly due to the lack of recognition of encrypted seals and specific format classification marks in images.

Method used

We employ a scale-adaptive feature encoding strategy and a spatially guided attention mechanism. Through size normalization, image segmentation, and feature encoding, we construct a spatial decay matrix using two-dimensional spatial coordinates, inject a self-attention mechanism, extract image-level feature representations, and perform classification.

Benefits of technology

It significantly improves the accuracy of electronic archive classification, effectively distinguishes between classified information and interfering text, and enhances the model's ability to capture key discriminative features and its recognition accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121837752A_ABST
    Figure CN121837752A_ABST
Patent Text Reader

Abstract

The invention discloses a security classification method, system and equipment for electronic archives, and the method comprises the steps: obtaining a to-be-recognized electronic archive image, carrying out the size normalization processing of the electronic archive image, and obtaining target archive images corresponding to a plurality of size intervals; partitioning the target archive image to obtain a plurality of first image blocks, and performing feature coding on each first image block to obtain a coding sequence; inputting the coding sequence into a preset secret-related level identification model, distributing two-dimensional space coordinates for each code in the coding sequence, constructing a space attenuation matrix based on the two-dimensional space coordinates, and fusing the space attenuation matrix into a space attention guiding mechanism in the secret-related identification model so as to perform secret-related feature extraction on the coding sequence, according to the method, the image-level feature representation is obtained, and the image-level feature representation is mapped to the confidential level classification space to obtain the confidential level identification result of the electronic file image, so that the accuracy of electronic file confidential level classification can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of archives processing, and in particular to a method, system and device for classifying electronic archives by security level. BACKGROUND

[0002] With the acceleration of the digitization of archives, the number of electronic archives accumulated by institutions at all levels has reached millions, and often mixed storage of secret (such as marked "secret", "confidential", "top secret") and non-secret, lack of clear directory identification, intelligent identification and classification of electronic archives by security level, has great practical significance for improving the security and efficiency of archives management.

[0003] The prior art mainly relies on text content matching or traditional deep learning models for security level judgment, which has obvious limitations in accuracy. The pure text matching method compares through a sensitive word library, completely ignoring the key visual features such as encrypted seals and specific format security level identifiers in the archive image, and cannot process pure image or mixed image and text archives, and is severely limited by the completeness of the word library, with poor generalization ability. Deep learning methods based on visual features, such as convolutional neural networks (CNN), have limited receptive fields and are difficult to model semantic associations and long-distance dependencies across regions in images, which can easily misjudge interference words such as "security awareness" in non-secret documents as secret document identifiers; these defects jointly restrict the existing technology to achieve high accuracy and high robustness in the classification of complex and diverse electronic archives. SUMMARY

[0004] The present application provides a method, system and device for classifying electronic archives by security level, which can improve the accuracy of electronic archive security level classification.

[0005] The present application provides a method for classifying electronic archives by security level, comprising: Obtaining an electronic archive image to be identified, and performing size normalization processing on the electronic archive image to obtain target archive images corresponding to a plurality of size intervals; Using an image block size corresponding to the size interval, the target archive image is divided into a plurality of first image blocks, and each first image block is encoded to obtain an encoding sequence; The encoding sequence is input into a preset security level recognition model, a two-dimensional spatial coordinate is assigned to each encoding in the encoding sequence, a spatial decay matrix is constructed based on the two-dimensional spatial coordinate, the spatial decay matrix is integrated into a spatial guidance attention mechanism in the security recognition model, the encoding sequence is extracted for security features to obtain an image-level feature representation, and the image-level feature representation is mapped to a security level classification space to obtain a security level recognition result of the electronic archive image.

[0006] This invention, through size normalization of the electronic archival images, eliminates image distortion, detail loss, or the introduction of invalid noise caused by direct scaling, providing a crucial preprocessing foundation for improving classification accuracy. By adaptively selecting the optimal image block size for different size ranges, it achieves a match between processing granularity and image content. This scale-adaptive feature encoding strategy ensures the extraction of the most suitable feature vectors representing classification information from diverse archival images, significantly enhancing the model's ability to capture key discriminative features and directly improving recognition accuracy. By assigning two-dimensional spatial coordinates to the feature encoding and constructing a spatial attenuation matrix, prior knowledge of the spatial distribution of classification markers in the archival images is explicitly injected into the self-attention mechanism, forming a spatially guided attention mechanism. This allows the model to not only focus on the semantic relevance of the content but also strengthen the learning of discriminative spatial structural patterns, effectively distinguishing genuine classification markers from similar interfering text within the content. Finally, this mechanism guides the model to extract an "image-level feature representation" that deeply integrates semantic content and spatial layout information, and accurately outputs the results through classification mapping. Compared with existing technologies, this invention can improve the accuracy of electronic archival classification.

[0007] Further, the step of performing size normalization processing on the electronic archive image to obtain target archive images corresponding to several size ranges includes: Calculate the minimum side length based on the size parameters of the electronic archive image; Based on several predefined first size thresholds, the minimum side length is divided into several size intervals; A square region with a side length equal to the minimum side length is cropped from the electronic archive image; The target side length is determined based on the size range to which the minimum side length belongs; The side length of the square region corresponding to each of the size intervals is filled to the target side length to achieve size normalization, thereby obtaining the target file image.

[0008] By normalizing the size of the electronic archive images, image distortion, loss of detail, or introduction of invalid noise caused by direct scaling are eliminated, which is an important preprocessing basis for improving classification accuracy.

[0009] Further, the step of performing size normalization processing on the electronic archive image to obtain target archive images corresponding to several size ranges includes: Using the width of the electronic archive image as a partitioning index, the electronic archive image is divided into corresponding size ranges based on the partitioning index and a preset second size threshold; if the width of the electronic archive image exceeds the maximum value in the second size threshold, the electronic archive image is segmented into a plurality of archive sub-images along the width direction; each of the archive sub-images is divided into a corresponding size interval, and the electronic archive image or each of the sub-images is filled into a target size corresponding to the size interval to which the electronic archive image or each of the sub-images belongs, to obtain the target archive image.

[0010] In this way, by performing size normalization processing on the electronic archive image, image distortion, detail loss or introduction of invalid noise caused by direct scaling are eliminated, which is an important preprocessing basis for improving classification accuracy.

[0011] Further, the feature encoding of each of the first image blocks to obtain the encoding sequence comprises: determining the number of down-sampling levels according to the image block size, and dynamically configuring the output channel number of each layer of convolution in the multi-layer convolution down-sampling encoding module according to a preset channel ratio sequence to obtain a down-sampling network; sequentially performing feature down-sampling on the first image blocks through the down-sampling network to obtain a plurality of down-sampling results; performing feature enhancement on each of the down-sampling results to obtain a plurality of feature vectors, and rearranging the dimensions of each of the feature vectors to obtain the encoding sequence.

[0012] In this way, by adaptively selecting the optimal image block size for different size intervals, the processing granularity is matched with the image content, and this scale-adaptive feature encoding strategy ensures that the feature vectors most suitable for representing the secret level information are extracted from the diversified archive images, significantly enhancing the model's ability to capture key discriminative features, thereby directly improving the recognition accuracy.

[0013] Further, the constructing a spatial decay matrix based on the two-dimensional spatial coordinates comprises: calculating the Manhattan distance between any two encodings in the encoding sequence based on the two-dimensional spatial coordinates; generating a spatial decay matrix through an exponential decay function based on a preset spatial decay coefficient and the Manhattan distance.

[0014] In this way, by assigning two-dimensional spatial coordinates to feature encoding and constructing a spatial decay matrix, the spatial distribution prior knowledge of secret level marks in the archive image is explicitly injected into the self-attention mechanism, which facilitates subsequent effective differentiation of real secret marks and similar interference text in the content.

[0015] Further, the spatial attenuation matrix is integrated into the space-guided attention mechanism in the secret-related identification model to extract secret-related features from the encoded sequence and obtain image-level feature representation, including: The spatial attenuation matrix is fused with the attention weight matrix of the self-attention module in the secret-related identification model to construct a space-guided attention mechanism, wherein the spatial attention mechanism includes a first space-guided attention; The global calculation of the space-guided attention mechanism is decomposed into a second space-guided attention; Through the shallow attention layer in the secret-related identification model, the second space-guided attention is used for feature extraction to obtain shallow features of each layer; Through the deep attention layer in the secret-related identification model, the first space-guided attention is used to model the fine-grained semantic features of the shallow features to obtain deep features of each layer; The deep features are connected in residual to obtain image-level feature representation.

[0016] In this way, the spatial distribution prior knowledge of the secret level identifier in the archive image is explicitly injected into the self-attention mechanism to form a space-guided attention mechanism, which enables the model to not only focus on the semantic relevance of the content, but also to strengthen the learning of the discriminative spatial structure pattern, effectively distinguishing the real secret-related identifier from the similar interference text in the content. Finally, the mechanism guides the model to extract the "image-level feature representation" that deeply integrates semantic content and spatial layout information, and accurately outputs the result through classification mapping.

[0017] Further, the image-level feature representation is mapped to a secret-related level classification space to obtain the secret-related level identification result of the electronic archive image, including: The image-level feature representation is input into a fully connected layer to map the dimension of the image-level feature to a classification feature vector equal to the number of preset secret-related levels; The classification feature vector is input into a normalization exponential function to obtain the prediction probability distribution of the electronic archive image belonging to each preset secret-related level; According to the prediction probability distribution, the secret-related level identification result of the electronic archive image is determined.

[0018] In this way, by classifying and mapping the image-level feature representation, the secret-related level identification result of the electronic archive image can be accurately obtained.

[0019] Further, after the electronic archive image to be identified is obtained, it further includes: The electronic archive image is segmented into a plurality of second image blocks of a preset fixed size; respectively, to obtain a plurality of encoding results; input each of the encoding results into a corresponding secret identification model to obtain a block-level identification result of each of the second image blocks; determine a secret level identification result of the electronic archive image based on each of the block-level identification results.

[0020] Another embodiment of the present application also provides an electronic archive secret level classification system, comprising: An acquisition module is configured to acquire an electronic archive image to be identified, and perform size normalization processing on the electronic archive image to obtain a target archive image corresponding to a plurality of size intervals; An encoding module is configured to perform image blocking on the target archive image using an image blocking size corresponding to the size interval to obtain a plurality of first image blocks, and perform feature encoding on each of the first image blocks to obtain an encoding sequence; An identification module is configured to input the encoding sequence into a preset secret level identification model, assign a two-dimensional spatial coordinate to each encoding in the encoding sequence, construct a spatial decay matrix based on the two-dimensional spatial coordinate, and integrate the spatial decay matrix into a spatial guiding attention mechanism in the secret identification model to extract secret features from the encoding sequence, obtain an image-level feature representation, and map the image-level feature representation to a secret level classification space to obtain a secret level identification result of the electronic archive image.

[0021] Another embodiment of the present application also provides a terminal device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the steps of the electronic archive secret level classification method according to the present application when executing the computer program. BRIEF DESCRIPTION OF DRAWINGS

[0022] In order to more clearly illustrate the technical solutions of the present application, the following will briefly introduce the drawings needed in the embodiments. Obviously, the drawings described below are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.

[0023] Figure 1 is a flowchart of an embodiment of the electronic archive secret level classification method provided by the present application; Figure 2 is a flowchart of an embodiment of steps S201 to S203 provided by the present application; Figure 3 is a model structure diagram of the encoding module provided by the present application; Figure 4 is a flowchart of an embodiment of steps S401-S405 provided by the present application; Figure 5 is a model structure diagram of a confidential identification model provided by the present application; Figure 6 is a structure diagram of an embodiment of a classified system of electronic archives provided by the present application. DETAILED DESCRIPTION

[0024] In order to make the objects, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.

[0025] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms “include” and “have” and any variations thereof in the specification and claims of the present application and the above description of drawings are intended to cover non-exclusive inclusion.

[0026] In the description of the embodiments of the present application, the technical terms “first”, “second”, etc. are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of “a plurality of” is two or more, unless otherwise explicitly and specifically limited.

[0027] Reference herein to “an embodiment” means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The appearance of the phrase in various places in the specification does not necessarily all refer to the same embodiment, nor is it necessarily independent or alternative embodiments to other embodiments. Those skilled in the art explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.

[0028] In the description of the embodiments of the present application, the term “and / or” is only a description of the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent the three cases of A alone, A and B together, and B alone. In addition, the character “ / ” herein generally represents an “or” relationship between the associated objects.

[0029] In the description of the embodiments of the present application, the term "a plurality of" refers to two or more (including two), and similarly, "a plurality of groups" refers to two or more groups (including two groups), and "a plurality of pieces" refers to two or more pieces (including two pieces).

[0030] In the description of the embodiments of the present application, unless otherwise explicitly specified and limited, the technical terms "mounting", "connecting", "connecting", "fixing" and the like should be understood in a broad sense, for example, can be fixedly connected, or can be detachably connected, or can be integrated; can be mechanically connected, or can be electrically connected; can be directly connected, or can be indirectly connected through an intermediate medium; can be the internal communication of two elements or the interaction relationship between two elements. For those skilled in the art, the specific meanings of the above terms in the embodiments of the present application can be understood according to the specific circumstances.

[0031] Accurate classification of electronic archives is the core requirement of information security and modern management of archives. The existing technology mainly relies on text content matching or traditional deep learning model for classification of secret level, which has obvious limitations in accuracy.

[0032] Referring to Figure 1 To improve the accuracy of electronic archive classification, an embodiment of the present application provides a secret level classification method for electronic archives, comprising steps S101 to S103: Step S101, obtaining an electronic archive image to be identified, and performing size normalization processing on the electronic archive image to obtain a target archive image corresponding to a plurality of size intervals; In some embodiments, the original electronic archive data is received through a system access port. These original data support a plurality of mainstream formats including PDF, DOCX, JPG, PNG, CAD, TXT. For archives in non-image formats (such as PDF, DOCX, CAD), the system calls the corresponding format analysis and rendering engine to convert the content into an electronic archive image; for archives that are already in image format (such as JPG, PNG), the subsequent operations are directly performed.

[0033] In some embodiments, the step of performing size normalization processing on the electronic archival image to obtain target archival images corresponding to several size intervals includes: calculating the minimum side length based on the size parameters of the electronic archival image; dividing the minimum side length into several size intervals based on several predefined first size thresholds; cropping a square region from the electronic archival image with a side length equal to the minimum side length; determining the target side length according to the size interval to which the minimum side length belongs; and filling the side length of the square region corresponding to each size interval to the target side length to achieve size normalization processing, thereby obtaining the target archival image. Specifically, since actual archival images have varying sizes and aspect ratios, intelligent processing is required. First, the electronic archival image is acquired. The system takes the image height (H) and width (W) as its size parameters and calculates the minimum side length L = min(H,W). Simultaneously, based on the boundaries defined by several preset first size thresholds (e.g., W1, W2, W3, W4, etc.), the system precisely divides the calculated minimum side length L into the corresponding size interval. After interval division, considering that actual archive images are neatly arranged rectangles and that critical security classification markings are usually located in the upper half of the image, a cropping strategy from the bottom up is adopted, retaining the top area of ​​the image and cropping out a square region of size L × L. The cropping strategy is ,in, This indicates a cropping operation from the bottom up, retaining all content at the top of the image. Next, based on the size range to which the minimum side length L belongs, the corresponding normalized target side length operation is determined. The side lengths of the aforementioned square regions are then uniformly filled to the target side length, using the relevant filling formula: This generates a size-standardized target archive image.

[0034] In some embodiments, the relevant formula for accurately dividing an image into five intervals based on the image size, i.e., the minimum side length L, is as follows: Small size range: L≤W1; Medium size range: W1 < L ≤ W2; Medium to large size range: W2 < L ≤ W3; Large size range: W3 < L ≤ W4; Extra Large Size Range: W4 <L。

[0035] In some embodiments, the relevant formula for determining the target side length based on the size range to which the minimum side length L belongs is: ; In this way, the integrity of the key secret level identifier in the archive image is effectively guaranteed through the targeted bottom pruning strategy, and the image size in the same interval is unified, thereby providing a standardized input for subsequent text feature extraction and classification recognition.

[0036] In some embodiments, the size normalization processing of the electronic archive image to obtain a target archive image corresponding to a size interval comprises: taking the width of the electronic archive image as a partition index, and dividing the electronic archive image into a corresponding size interval based on the partition index and a preset second size threshold; if the width of the electronic archive image exceeds the maximum value of the second size threshold, the electronic archive image is divided into a plurality of archive sub-images along the width direction; each archive sub-image is divided into a corresponding size interval, and the electronic archive image or each sub-image is filled into a target size corresponding to the size interval according to the size interval to which the electronic archive image or each sub-image belongs, to obtain the target archive image. Specifically, first, the original width of the electronic archive image is taken as the core partition index, which is compared with a group of preset second size thresholds, so that it is divided into a corresponding standardized size interval. For example, the interval can be set to five grades, corresponding to different target square sizes (such as 512*512, 1024*1024, 2048*2048, 2688*2688, 3584*3584 five interval sizes, etc.). For each divided size interval, the system further configures a series of processing parameters matched therewith: not only determines the target size after padding, but also adapts the optimal image patch size (such as 8*8, 16*16, 32*32, 48*48 and 64*64, etc.), and sets the corresponding initial convolution kernel size and step for the subsequent feature encoding module. The first layer convolution kernel size corresponding to the five intervals is 3, 5, 7, 9, and 11, and the corresponding stride is 2, 4, 6, 8, and 10. If the original width of the electronic archive image exceeds the upper limit of all preset intervals (for example, greater than 3584), the electronic archive image is divided along the width direction, two archive sub-images are generated, and then the above partition and parameter matching process is independently performed on each sub-image. Finally, according to the specific interval to which the image (or sub-image) belongs, it is filled into the target size corresponding to the interval, thereby outputting the target archive image with unified scale and high adaptation to the subsequent processing module, laying a foundation for efficient and high-precision hierarchical processing.

[0037] It should be noted that 5000 samples are collected for each interval, and 5 ViT models are trained using the constructed sample set. When testing, different models are called for different inputs to perform identification respectively, and finally the secret level identification result is obtained.

[0038] In some embodiments, the size normalization processing of the electronic archive image to obtain a target archive image corresponding to a plurality of size intervals further comprises: the size normalization processing is realized by setting a predefined normalized target width D and a division size S adapted to the ViT model, wherein D and S satisfy a modulo relationship: Mod(D, S) = 0, to ensure the integrity of subsequent blocking operations. During processing, first determine the relationship between the original width W of the electronic archive image and D: if W is greater than D, the image is equally divided into two sub-images along the width direction, and each sub-image is recursively processed in the subsequent process flow with a width equal to or less than D; if W is equal to D, further determine the height H: when H is greater than D, crop from the bottom of the image to the height D; when H is less than D, symmetrically pad to the height D at the top and bottom of the image; if W is less than D, symmetrically pad to the width D on the left and right sides of the image, and similarly determine and process the height - crop from the bottom to D when the height is greater than D, and symmetrically pad to D at the top and bottom when the height is less than D. Through the above conditional branch processing, all input images are finally normalized to target archive images with a size of DxD, forming a unified standardized data structure input.

[0039] Thus, by performing size normalization processing on the electronic archive image, image distortion, detail loss or introduction of invalid noise caused by direct scaling are eliminated, which is an important preprocessing basis for improving classification accuracy.

[0040] In step S102, the target archive image is blocked using an image blocking size corresponding to the size interval to obtain a plurality of first image blocks, and each first image block is feature encoded to obtain an encoding sequence. In some embodiments, the target archive image is blocked using an image blocking size corresponding to the size interval to obtain a plurality of first image blocks. Specifically, first, according to the size interval to which the target archive image belongs, obtain the unique blocking size parameter Patchsize corresponding to the interval from the preset interval-blocking size mapping table. Then, the target archive image is uniformly divided into a plurality of non-overlapping regular grids in the height and width directions using the obtained blocking size as a unit, and each grid covers an image area which constitutes a first image block.

[0041] In some embodiments, the interval-blocking size mapping table is specifically: Small size image (L )→ Patchsize=S1; Medium size image (L < L ≤ → Patchsize=S2; Medium and large size images ( <L ≤ → Patchsize=S3; Large images ( <L ≤ → Patchsize=S4; Extra large images ( <L ≤ → Patchsize=S5.

[0042] It should be noted that small images typically have high information density and require a smaller patch size to capture fine features; medium-sized images use a moderate patch size to balance details and noise; medium-large and large images use a larger patch size to further balance coarse-grained details and noise; and very large images use the largest patch size to control computational complexity while preserving global structure.

[0043] Please refer to Figure 2 In some embodiments, the step of feature encoding each of the first image blocks to obtain an encoding sequence includes steps S201 to S203: Step S201: Determine the number of downsampling layers based on the image block size, and dynamically configure the number of output channels of each convolutional layer in the multi-layer convolutional downsampling coding module according to a preset channel ratio sequence to obtain the downsampling network; In some embodiments, the required number of downsampling levels is determined based on the image patch size (Patchsize) set for the current image patch. downsampling levels The calculation formula is: Subsequently, the system determines the level based on the number of levels. And a preset sequence of channel scaling factors corresponding to different patch sizes, dynamically calculating and configuring the number of output channels for each convolutional layer in the multi-layer convolutional downsampling coding module, specifically... ,in Embed dimensions for the target. is the channel scaling factor for the i-th layer.

[0044] Step S202: Through the downsampling network, the first image block is sequentially downsampled to obtain several downsampling results; In some embodiments, the first image block, i.e., the one with a size of × Input tensor Where B is , H represents the number of input channels, and W represents the input dimensions. These are input to the downsampling network, which consists of N cascaded processing units. Each unit i first performs a feature downsampling operation with a step size of 2, resulting in several downsampling results. .

[0045] In some embodiments, the relevant formula for feature downsampling is: ; in, The kernel is a downsampled convolution kernel (stride=2), and BN represents batch normalization. For GELU activation function, and Use a feature-enhancing convolution kernel (stride=1).

[0046] In some embodiments, for the five Patchsizes S1 / S2 / S3 / S4 / S5, with embed_dim = D, the number of output channels of each layer in a multi-layer convolutional progressive downsampling network is: Patchsize=S1 ( (subsampled again): [0.5D, D]; Patchsize=S2 ( (subsampled again): [0.5D, 0.75D, D]; Patchsize=S3 ( (subsampled): [0.5D, 0.67D, 0.83D, D]; Patchsize=S4 (subsampled): [0.5D, 0.625D, 0.75D, 0.875D, D]; Patchsize=S5 ( Subsampling): [0.5D, 0.6D, 0.7D, 0.85D, 0.9D, D].

[0047] Step S203: Perform feature enhancement on each of the downsampling results to obtain several feature vectors, and rearrange the dimensions of each feature vector to obtain the encoding sequence.

[0048] In some embodiments, the downsampling results of the first N-1 non-final layers Further, using a convolution kernel with a stride of 1 Feature enhancement is performed, and the relevant formula is: Finally, the feature tensors output by all processing units are integrated and transformed through dimension rearrangement. , shape the feature map is converted into an encoded sequence with shape , where is the sequence length (number of tokens), is the embedding dimension of each token, so as to obtain an encoded sequence suitable for subsequent processing by a Transformer model.

[0049] It should be noted that the model structure of the encoding module is shown in Figure 3 The module is composed of a plurality of processing units connected in series, and each unit performs a sequence of convolution, batch normalization (BN) and GELU activation function. This process is repeated according to the target down-sampling depth, and finally the image is efficiently converted and compressed from the original spatial resolution to a high-dimensional feature representation, preparing for subsequent processing by the Transformer.

[0050] In this way, by adaptively selecting the optimal image block size for different size intervals, the processing granularity is matched with the image content. This scale-adaptive feature encoding strategy ensures that the most suitable feature vectors representing the secret level information are extracted from the diversified archival images, significantly enhancing the model's ability to capture key discriminative features, thereby directly improving the accuracy of recognition.

[0051] In step S103, the encoded sequence is input into a preset secret level recognition model, a two-dimensional spatial coordinate is assigned to each encoding in the encoded sequence, and a spatial decay matrix is constructed based on the two-dimensional spatial coordinate. The spatial decay matrix is integrated into the spatial guided attention mechanism in the secret recognition model to extract secret features from the encoded sequence, obtain an image-level feature representation, and map the image-level feature representation to a secret level classification space to obtain a secret level recognition result of the electronic archival image.

[0052] In some embodiments, the encoded sequence is input into a preset secret level recognition model, and a two-dimensional spatial coordinate corresponding to the original image space is assigned to each encoding in the encoded sequence. .

[0053] It should be noted that according to the row and column positions encoded in the grid, it can be mapped back to the center coordinates or the area range in the original image.

[0054] In some embodiments, the construction of the spatial decay matrix based on the two-dimensional spatial coordinates includes: calculating the Manhattan distance between any two encodings in the encoded sequence based on the two-dimensional spatial coordinates; and generating a spatial decay matrix by an exponential decay function based on a preset spatial decay coefficient and the Manhattan distance. Specifically, first, based on the two-dimensional spatial coordinates calculating the Manhattan distance between any two of the code m and n in the code sequence , the calculation formula is: , wherein γ is an attenuation parameter; then, by using a preset spatial attenuation coefficient γ (0< γ <1), an element of the spatial attenuation matrix is generated by an exponential attenuation function, and the related formula is: , wherein each element in the matrix reflects the spatial correlation attenuation weight between the code m and the code n, and the farther the distance between the codes, the greater the attenuation weight obtained. Finally, the matrix D composed of all elements is the spatial attenuation matrix, which will be integrated into the subsequent attention calculation as spatial prior information.

[0055] In this way, by assigning two-dimensional spatial coordinates to feature codes and constructing a spatial attenuation matrix, the spatial distribution prior knowledge of the secret level identifier in the archive image is explicitly injected into the self-attention mechanism, and then the truly secret identifier and the similar interference text in the content are effectively distinguished.

[0056] Please refer to Figure 4 In some embodiments, the spatial guidance attention mechanism of the spatial attenuation matrix into the secret identification model is used to extract secret features from the code sequence to obtain an image-level feature representation, including steps S401 to S405: Step S401, the spatial attenuation matrix is fused with the attention weight matrix of the self-attention module in the secret identification model to construct a spatial guidance attention mechanism, wherein the spatial attention mechanism includes a first spatial guidance attention; In some embodiments, the spatial attenuation matrix D is fused with the attention weight matrix in the self-attention module, for example, by element-by-element multiplication or addition operation, thereby forming a first spatial guidance attention mechanism with spatial position perception, providing spatial prior guidance for subsequent feature extraction.

[0057] Step S402, the global calculation of the spatial guidance attention mechanism is decomposed into a second spatial guidance attention; In some embodiments, the attention calculation originally performed on the two-dimensional feature map is decomposed into two one-dimensional global attention calculations along the horizontal direction first and then along the vertical direction (or in the opposite order), respectively modeling the long-range dependency relationship between rows and columns. Thus, the computational complexity is reduced from quadratic to linear, significantly improving the processing efficiency.

[0058] Step S403, the second spatial guidance attention is used for feature extraction by the shallow attention layer in the secret identification model to obtain shallow features of each layer; In some embodiments, in the shallow layers of the network (such as the first few Transformer Blocks), that is, in each shallow attention layer, the second spatially-guided attention mechanism after decomposition, that is, the decomposed Manhattan self-attention (MaSA, Manhattan Self-Attention) is used to extract features from the input features one by one to obtain the shallow features of each layer. This mechanism can efficiently capture the context information across rows and columns in the image by performing one-dimensional global attention calculation along the horizontal and vertical directions, while significantly reducing the computational complexity.

[0059] In step S404, the first spatially-guided attention is used to model the fine-grained semantic features of the shallow features through the deep attention layers in the secret-related identification model to obtain the deep features of each layer. In some embodiments, in the deep layers of the network (such as the later Transformer Blocks), the first spatially-guided attention mechanism is switched to the complete Manhattan self-attention (MaSA, Manhattan Self-Attention) for feature modeling. At this time, the attention calculation is no longer decomposed, but is directly based on the two-dimensional global self-attention that fuses the spatial decay matrix D to model the fine-grained semantic relationship of the shallow features, and the deep features of each layer are obtained.

[0060] In step S405, the deep features are connected in residual to obtain the image-level feature representation.

[0061] In some embodiments, after all the deep attention layers are processed, the output of each deep attention module is added element by element to its input to realize feature reuse and gradient effective propagation, avoid deep network degradation, and obtain the fused feature map. Finally, the fused feature map is subjected to global average pooling (Global Average Pooling) to aggregate the feature information of all spatial positions into a global feature vector, that is, the image-level feature representation, which comprehensively fuses the multi-scale spatial and semantic information from the shallow to the deep and from the local to the global.

[0062] In this way, the spatial distribution prior knowledge of the secret level identification in the archive image is explicitly injected into the self-attention mechanism to form a spatially-guided attention mechanism, which enables the model not only to focus on the semantic relevance of the content, but also to strengthen the learning of the discriminative spatial structure pattern, effectively distinguishing the real secret-related identification from the similar interference text in the content. Finally, the mechanism guides the model to extract the "image-level feature representation" that deeply fuses the semantic content and spatial layout information, and accurately outputs the result through classification mapping.

[0063] In some embodiments, the mapping of the image-level feature representation to a classified space of the classified level, to obtain the classified level identification result of the electronic archive image, comprises: inputting the image-level feature representation into a fully connected layer to map the dimension of the image-level feature to a classification feature vector equal to the number of preset classified levels; inputting the classification feature vector into a normalized exponential function to obtain a predicted probability distribution of the electronic archive image belonging to each preset classified level; and determining the classified level identification result of the electronic archive image according to the predicted probability distribution. Specifically, first, the image-level feature representation is mapped to a classification feature vector equal to the number of preset classified levels (for example, four dimensions, corresponding to four levels: non-secret, secret, confidential, and top secret) through a fully connected layer; then, the classification feature vector is input into a normalized exponential function (Softmax) to obtain a predicted probability distribution of the electronic archive image belonging to each preset classified level; and finally, according to the predicted probability distribution, the level with the maximum probability is selected as the classified level identification result of the electronic archive image.

[0064] It should be noted that the model structure diagram of the classified identification model is as shown in Figure 5 The network starts from a preprocessing (Pre) stage, and performs preliminary feature extraction through a convolution layer. Then, the feature enters Stage1 composed of multiple RMT Blocks. Each RMT Block integrates a deep separable convolution (DWConv 3x3) and a Manhattan self-attention (Manhattan Self-Attention, MaSA for short) mechanism, which is used to model long-distance dependencies while introducing spatial priors. After deep feature processing by L1 such blocks, the feature passes through a classification head (Cls Head), usually composed of global pooling and fully connected layers, and finally outputs the classified level classification result of the archive.

[0065] In this way, by classifying and mapping the image-level feature representation, the classified level identification result of the electronic archive image can be accurately obtained.

[0066] In some embodiments, after the electronic file image to be identified is obtained, the method further comprises: dividing the electronic file image into a plurality of second image blocks of a preset fixed size; respectively performing feature coding on each of the second image blocks to obtain a plurality of coding results; inputting each of the coding results into a corresponding classified information identification model to obtain a block-level identification result of each of the second image blocks; and determining a classified information level identification result of the electronic file image based on the block-level identification results. Specifically, first, the electronic file image is divided into a plurality of non-overlapping second image blocks of a preset fixed size in the order from left to right and from top to bottom, where the preset fixed size is 224x224. For the part of the edge area located on the right side or the bottom of the image that is insufficient in size, padding operation is performed to expand it to 224x224. Then, each of the second image blocks is respectively subjected to feature coding to be converted into a corresponding coding result (i.e., a feature vector). Subsequently, each of the coding results is inputted into a trained classified information identification model (i.e., a Vision Transformer model) to obtain a block-level identification result of each of the second image blocks, which is determined to belong to "classified information" or "non-classified information". Finally, based on the block-level identification results of all the second image blocks, a whole-file aggregation determination is performed: if all the second image blocks are identified as "non-classified information", it is determined that the classified information level identification result of the electronic file image is "non-classified information"; if there is at least one second image block identified as "classified information", it is determined that the classified information level identification result of the electronic file image is "classified information".

[0067] In this way, through the strategy of first block identification and then aggregation decision, efficient classified information screening of large-format and multi-page electronic files is realized.

[0068] This invention, through size normalization of the electronic archival images, eliminates image distortion, detail loss, or the introduction of invalid noise caused by direct scaling, providing a crucial preprocessing foundation for improving classification accuracy. By adaptively selecting the optimal image block size for different size ranges, it achieves a match between processing granularity and image content. This scale-adaptive feature encoding strategy ensures the extraction of the most suitable feature vectors representing classification information from diverse archival images, significantly enhancing the model's ability to capture key discriminative features and directly improving recognition accuracy. By assigning two-dimensional spatial coordinates to the feature encoding and constructing a spatial attenuation matrix, prior knowledge of the spatial distribution of classification markers in the archival images is explicitly injected into the self-attention mechanism, forming a spatially guided attention mechanism. This allows the model to not only focus on the semantic relevance of the content but also strengthen the learning of discriminative spatial structural patterns, effectively distinguishing genuine classification markers from similar interfering text within the content. Finally, this mechanism guides the model to extract an "image-level feature representation" that deeply integrates semantic content and spatial layout information, and accurately outputs the results through classification mapping. Compared with existing technologies, this invention can improve the accuracy of electronic archival classification.

[0069] like Figure 6 As shown, based on the above method embodiments, corresponding apparatus embodiments are provided; An embodiment of the present invention provides a security classification system for electronic archives, comprising: The acquisition module 100 is used to acquire the electronic archive image to be identified and perform size normalization processing on the electronic archive image to obtain target archive images corresponding to several size ranges; The encoding module 200 is used to divide the target file image into blocks using an image block size corresponding to the size range, to obtain a plurality of first image blocks, and to perform feature encoding on each first image block to obtain an encoding sequence; The identification module 300 is used to input the encoded sequence into a preset classification level identification model, assign two-dimensional spatial coordinates to each code in the encoded sequence, construct a spatial attenuation matrix based on the two-dimensional spatial coordinates, integrate the spatial attenuation matrix into the spatial guided attention mechanism in the classification identification model, extract classification features from the encoded sequence to obtain image-level feature representation, and map the image-level feature representation to the classification level classification space to obtain the classification level identification result of the electronic archive image.

[0070] It is understood that the above-described device embodiments correspond to the method embodiments of the present invention, and can implement the electronic archive classification method provided by any of the above-described method embodiments of the present invention.

[0071] It should be noted that the apparatus embodiments described above are only illustrative, and part or all of the modules can be selected to achieve the purpose of the embodiment of the present embodiment. In addition, in the apparatus embodiment provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which can be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement it without creative labor.

[0072] On the basis of the above-mentioned electronic file classification method, another embodiment of the present application provides a terminal device, which comprises a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, the electronic file classification method of any one of the embodiments of the present application is realized.

[0073] For example, in this embodiment, the computer program can be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present application. The one or more modules can be a series of computer program instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program in the terminal device.

[0074] The terminal device can be a desktop computer, a notebook computer, a palm computer, a cloud server and other computing devices. The terminal device can include, but is not limited to, a processor and a memory.

[0075] The processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal device, and connects all parts of the terminal device through various interfaces and lines.

[0076] On the basis of the above method embodiment, another embodiment of the present application provides a computer readable storage medium, comprising a stored computer program, wherein the computer readable storage medium controls the device to execute the electronic file classification method of any one of the above method embodiments of the present application when the computer program runs.

[0077] The modules / units integrated in the device / terminal equipment, if realized in the form of software function units and sold or used as independent products, can be stored in a computer readable storage medium. Based on this understanding, all or part of the processes in the above-mentioned embodiment methods can also be completed by a computer program instructing related hardware, and the computer program can be stored in a computer readable storage medium. When the processor executes the computer program, the steps of each method embodiment can be realized. The computer program includes computer program code, which can be in the form of source code, object code, executable files or some intermediate forms, etc. The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0078] The above is the preferred embodiment of the present application. It should be noted that, for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, which are also considered within the scope of protection of the present application.

Claims

1. A method for classifying the security level of an electronic file, characterized in that, The method comprises the following steps: An electronic archive image to be identified is acquired, and size normalization processing is performed on the electronic archive image to obtain target archive images corresponding to a plurality of size intervals; An image block size corresponding to the size interval is used to block the target archive image to obtain a plurality of first image blocks, and feature coding is performed on each first image block to obtain a coding sequence; The coding sequence is input into a preset classified identification model of classified information, two-dimensional spatial coordinates are assigned to each code in the coding sequence, a spatial attenuation matrix is constructed based on the two-dimensional spatial coordinates, the spatial attenuation matrix is integrated into a spatial guided attention mechanism in the classified identification model, classified information feature extraction is performed on the coding sequence, image-level feature representation is obtained, and the image-level feature representation is mapped to a classified information classification space to obtain a classified information identification result of the electronic archive image.

2. The method of classifying the electronic file according to claim 1, wherein, The size normalization processing on the electronic archive image to obtain target archive images corresponding to a plurality of size intervals comprises the following steps: A minimum side length is calculated according to a size parameter of the electronic archive image; The minimum side length is divided into a plurality of size intervals based on a plurality of first size thresholds predefined; A square region with a side length equal to the minimum side length is cropped from the electronic archive image; A target side length is determined according to the size interval to which the minimum side length belongs; The side length of the square region corresponding to each size interval is filled to the target side length to realize size normalization processing, and the target archive image is obtained.

3. The method of classifying electronic files according to claim 1, wherein, The size normalization processing on the electronic archive image to obtain target archive images corresponding to a plurality of size intervals comprises the following steps: The width of the electronic archive image is used as a partition index, and the electronic archive image is divided into corresponding size intervals based on the partition index and a second size threshold predefined; If the width of the electronic archive image exceeds the maximum value in the second size threshold, the electronic archive image is divided into a plurality of archive sub-images along the width direction; Each archive sub-image is divided into a corresponding size interval, and the electronic archive image or each sub-image is filled to a target size corresponding to the size interval according to the size interval to which the electronic archive image or each sub-image belongs, and the target archive image is obtained.

4. The method of classifying the electronic file according to claim 1, wherein, The feature coding on each first image block to obtain a coding sequence comprises the following steps: A down-sampling level number is determined according to the image block size, and the output channel number of each layer convolution in a multi-layer convolution down-sampling coding module is dynamically configured according to a preset channel proportion sequence to obtain a down-sampling network; Feature down-sampling is sequentially performed on the first image block through the down-sampling network to obtain a plurality of down-sampling results; Feature enhancement is performed on each down-sampling result to obtain a plurality of feature vectors, and the dimension of each feature vector is rearranged to obtain the coding sequence.

5. The method for classifying the security level of an electronic file according to claim 1, wherein, The construction of the spatial attenuation matrix based on the two-dimensional spatial coordinates comprises the following steps: The Manhattan distance between any two codes in the coding sequence is calculated based on the two-dimensional spatial coordinates; The spatial attenuation matrix is generated by an exponential attenuation function based on a preset spatial attenuation coefficient and the Manhattan distance.

6. The method for classifying the security level of an electronic file according to claim 1, wherein, The spatial attenuation matrix is integrated into the spatial guided attention mechanism in the classified information recognition model to extract classified information features from the encoded sequence, to obtain image-level feature representation, including: The spatial attenuation matrix is integrated with the attention weight matrix of the self-attention module in the classified information recognition model to construct a spatial guided attention mechanism, wherein the spatial attention mechanism includes a first spatial guided attention; The global calculation of the spatial guided attention mechanism is decomposed into a second spatial guided attention; The second spatial guided attention is used for feature extraction by the shallow attention layer in the classified information recognition model to obtain shallow features of each layer; The first spatial guided attention is used to model the fine semantic features of the shallow features by the deep attention layer in the classified information recognition model, to obtain deep features of each layer; The deep features are connected in residual to obtain image-level feature representation.

7. The method for classifying the security level of an electronic file according to claim 1, wherein, The image-level feature representation is mapped to a classified information level classification space to obtain the classified information level recognition result of the electronic archive image, including: The image-level feature representation is input into a fully connected layer to map the dimension of the image-level feature to a classification feature vector equal to the number of preset classified information levels; The classification feature vector is input into a normalized exponential function to obtain a prediction probability distribution of the electronic archive image belonging to each preset classified information level; According to the prediction probability distribution, the classified information level recognition result of the electronic archive image is determined.

8. The method of classifying the security level of an electronic file according to any one of claims 1 to 7, characterized in that, After the electronic archive image to be recognized is obtained, the method further includes: The electronic archive image is segmented into a plurality of second image blocks of a preset fixed size; Each of the second image blocks is encoded to obtain a plurality of encoded results; Each of the encoded results is input into a corresponding classified information recognition model to obtain a block-level recognition result of each of the second image blocks; The classified information level recognition result of the electronic archive image is determined based on the block-level recognition results.

9. A system for classifying the security level of electronic files, characterized in that It includes: An acquisition module is configured to acquire an electronic archive image to be recognized and perform size normalization processing on the electronic archive image to obtain target archive images corresponding to a plurality of size intervals; An encoding module is configured to perform block segmentation on the target archive images using image block sizes corresponding to the size intervals to obtain a plurality of first image blocks, and encode each of the first image blocks to obtain an encoded sequence; An identification module is configured to input the encoded sequence into a preset classified information level recognition model, assign two-dimensional spatial coordinates to each encoding in the encoded sequence, construct a spatial attenuation matrix based on the two-dimensional spatial coordinates, integrate the spatial attenuation matrix into a spatial guided attention mechanism in the classified information recognition model to extract classified information features from the encoded sequence, obtain image-level feature representation, and map the image-level feature representation to a classified information level classification space to obtain a classified information level recognition result of the electronic archive image.

10. A terminal device, comprising: It includes: One or more processors; a memory coupled to the processors, storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors realize the steps of the method for classifying the security level of electronic files according to any one of claims 1-8.