Hepatitis B antibody pattern classification method based on plasma protein profile
By employing locality-sensitive hashing and low-rank tensor decomposition, the problems of memory peaks and cache hit rates in high-dimensional sparse plasma protein profile data were solved, achieving stable multi-label mode output and improved computational efficiency.
Patent Information
- Application Number
- CN202610433940.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-03
- Publication Date
- 2026-06-30
AI Technical Summary
Existing technologies suffer from high memory peaks, low cache hit rates, and unstable multi-label output when processing high-dimensional sparse plasma protein profile data, making it difficult to adapt to different hardware environments and variations in sample sparsity.
By acquiring host hardware information, the local dense matrix is reconstructed using the Locality Sensitive Hash algorithm, sub-blocks are dynamically cut and low-rank tensor decomposition is performed in the secondary cache, and feature weighting and classification are performed in combination with a single-layer attention network. The cutting dimension is dynamically adjusted to adapt to the cache miss rate.
It achieves low memory peak, high cache hit rate and stable multi-label mode output, improving the computational efficiency and accuracy of high-dimensional sparse data and adapting to changes in different hardware environments.
Smart Images

Figure CN122310281A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of bioinformatics processing and medical laboratory data analysis, specifically a method for classifying hepatitis B antibody patterns based on plasma protein profiles. Background Technology
[0002] In edge computing scenarios for high-throughput screening equipment, classifying hepatitis B antibody patterns based on high-dimensional sparse data formed by plasma protein profiles has gradually become an important technical direction for achieving rapid sample interpretation and multi-label result output. Currently, the common approach for classifying such high-dimensional sparse arrays is to first perform uniform compensation, global dimensionality reduction, or expansion in a fixed order on the original data, and then input the overall features into the classification model to obtain the pattern recognition results of the corresponding samples. However, processing plasma protein profile data using the above methods typically requires global scanning and unified calculation of a large number of zero values, missing values, and scattered non-zero features. This leads to non-contributing dimensions occupying storage and computing resources for extended periods, making it impossible to dynamically adjust data reconstruction and block granularity based on host machine cache capacity. Furthermore, it is difficult to centrally arrange non-zero features with high co-occurrence or local correlation in memory, resulting in frequent main memory access and low cache hit rates. Additionally, this processing method often relies on unified decomposition or equal-weighted aggregation at the whole matrix level during local feature extraction, making it difficult to balance missing value preservation, local implicit feature expression, and differences in importance between sub-blocks. This results in high memory peaks and poor stability in continuous batch processing. Moreover, it is difficult to adjust subsequent segmentation dimensions based on runtime cache misses, making it unable to adapt well to different hardware environments and variations in sample sparsity, and limiting the efficiency and accuracy of multi-label output. Summary of the Invention
[0003] The purpose of this invention is to provide a twin simulation method for the strength of a steering gear housing, thereby solving the following technical problems: It overcomes the limitations imposed by high-dimensional sparse structures and main memory access bottlenecks, and achieves lower memory peaks, higher cache hit rates, and stable multi-label mode output capabilities by transforming global classification into a cache-aware local computation process.
[0004] The objective of this invention can be achieved through the following technical solutions: Hepatitis B antibody pattern classification methods based on plasma protein profiles include: Obtain the host hardware information of the execution environment and extract the cache parameters of the host CPU; Obtain a high-dimensional sparse one-dimensional array and extract the non-zero feature indices from the high-dimensional sparse one-dimensional array; The non-zero feature indexes are mapped using the locality-sensitive hashing algorithm, and the data is reconstructed into a locally dense two-dimensional matrix according to the mapping result. According to the cache parameters and the initial cutting dimension, the two-dimensional matrix is dynamically cut to obtain independent sub-blocks, ensuring that the memory usage of each independent sub-block is less than the capacity corresponding to the cache parameters; The independent sub-blocks are subjected to low-rank tensor decomposition to extract local latent feature vectors; The local latent feature vectors are concatenated, and the features are weighted through a single-layer attention network. The weighted features are then input into a classifier function to output a target classification pattern vector. A dimension update instruction is generated based on a preset dynamic adjustment mechanism to adjust the cutting dimensions of subsequent cuts.
[0005] Preferably, obtaining a high-dimensional sparse one-dimensional array includes: Receive the original high-dimensional sparse one-dimensional array and perform preprocessing to obtain the high-dimensional sparse one-dimensional array, wherein the preprocessing includes removing pure zero columns and skipping global interpolation calculations; The step of mapping the non-zero feature indexes using a locality-sensitive hashing algorithm and reconstructing the data into a locally dense two-dimensional matrix according to the mapping result includes: The locality-sensitive hashing algorithm is used to map non-zero feature indices with co-occurrence probabilities to adjacent memory addresses, thus obtaining an index mapping table. Based on the index mapping table, the high-dimensional sparse one-dimensional array is reconstructed into the locally dense two-dimensional matrix.
[0006] Preferably, the two-dimensional matrix is dynamically divided according to the cache parameters and the initial cutting dimension to obtain independent sub-blocks, ensuring that the memory usage of each independent sub-block is less than the capacity corresponding to the cache parameters, including: The host CPU's hardware configuration register instruction is read to obtain the L2 cache capacity parameter as the cache parameter; Obtain the pre-set safety factor, and calculate and generate the initial cutting dimension based on the second-level cache capacity parameter and the safety factor; Based on the initial cutting dimension, the two-dimensional matrix is dynamically cut into the independent sub-blocks, ensuring that the memory usage of each independent sub-block is strictly less than the product of the secondary cache capacity parameter and the safety coefficient.
[0007] Preferably, the independent sub-blocks are subjected to low-rank tensor decomposition to extract local latent feature vectors, including: The independent sub-blocks are loaded into the L2 cache of the host CPU; Within the secondary cache, a closed-loop low-rank tensor decomposition is performed independently on each independent sub-block to extract the local latent feature vector, wherein the low-rank tensor decomposition process does not require access to main memory.
[0008] Preferably, the local latent feature vectors are concatenated, weighted using a single-layer attention network, and the weighted features are input into a classifier function to output a target classification pattern vector, including: The local latent feature vectors extracted from all the independent sub-blocks are concatenated to obtain the global concatenated feature vector; The global concatenated feature vector is input into the single-layer attention network for feature cross-interaction and dimensionality reduction optimization to obtain the weighted features. The weighted features are input into the classifier function, and the target classification pattern vector is output, wherein the target classification pattern vector is a low-dimensional discrete state vector.
[0009] Preferably, a dimension update instruction is generated according to a preset dynamic adjustment mechanism to adjust the cutting dimensions of subsequent cuts, including: Monitor the current cache miss rate of the host machine's central processing unit; When the current cache miss rate is higher than the preset cache miss threshold, the safety factor is reduced, and the cutting dimension is recalculated based on the reduced safety factor to generate the dimension update instruction; When the current cache miss rate is lower than or equal to the preset cache miss threshold, the current security factor remains unchanged, and the current cutting dimension is maintained.
[0010] Preferably, preprocessing is performed, including: Identify missing values in the original high-dimensional sparse one-dimensional array; The missing values are retained and the global interpolation calculation is skipped. The original high-dimensional sparse one-dimensional array containing the missing values is directly used as the high-dimensional sparse one-dimensional array to reduce the peak system memory usage.
[0011] Preferably, the locality-sensitive hashing algorithm is used to map non-zero feature indices with co-occurrence probabilities to adjacent memory addresses to obtain an index mapping table, including: Calculate the local topological correlation degree between each non-zero feature in the high-dimensional sparse one-dimensional array; Based on the local topological correlation, the locality-sensitive hash algorithm is used to map non-zero feature dimensions with local topological correlation greater than a preset correlation threshold to the same physical memory block, thereby generating the index mapping table.
[0012] Preferably, in the process of independently performing low-rank tensor decomposition on each independent sub-block within the secondary cache to extract the local latent feature vector, the method further includes: The underlying matrix operation interface is called to perform matrix multiplication operations in the secondary cache, eliminating main memory read latency.
[0013] Preferably, the original high-dimensional sparse one-dimensional array is a continuous digital array output by a high-throughput screening device, wherein the continuous digital array includes feature identifiers and floating-point values; The target classification pattern vector is used to indicate the multi-label nonlinear mapping state of the detected sample.
[0014] The beneficial effects of this invention are: 1. This invention extracts non-zero feature indices from a high-dimensional sparse array and uses a locality-sensitive hashing algorithm to reconstruct non-zero feature maps with co-occurrence probabilities into a locally dense matrix. This method avoids invalid scanning and global interpolation of all zero values, reduces peak system memory usage, and centralizes associated features in memory, significantly reducing main memory access frequency. 2. This invention dynamically cuts a two-dimensional matrix based on the host machine's central processing unit cache parameters and performs low-rank tensor decomposition on independent sub-blocks in a closed loop within the secondary cache. This mechanism ensures that the memory usage of data blocks is strictly adapted to the hardware physical cache. By calling the underlying interface inside the cache to perform matrix operations, the repeated read delays of the decomposition process on the main memory are completely eliminated, and the local computation efficiency is greatly improved. 3. This invention concatenates local latent feature vectors, performs feature cross-linking and dimensionality reduction optimization through a single-layer attention network, and then inputs the data into a classifier to output the target classification pattern vector. This design breaks through the limitations of traditional equal-weight aggregation, accurately amplifies the contribution of highly correlated feature sub-blocks and reduces the influence of blank blocks within a lightweight computing framework, ensuring the accuracy of multi-label pattern determination under high-dimensional sparse data. 4. This invention monitors the current cache miss rate of the host CPU. When it exceeds a preset threshold, it dynamically reduces the safety factor and recalculates the subsequent cutting dimensions. This runtime adaptive mechanism enables the system to provide real-time feedback and adjust the block granularity according to changes in sample morphology, effectively maintaining a high cache hit rate and improving throughput and hardware adaptability in continuous batch processing environments. Attached Figure Description
[0015] The invention will now be further described with reference to the accompanying drawings.
[0016] Figure 1 This is a flowchart illustrating the hepatitis B antibody pattern classification method based on plasma protein profiles provided in this application embodiment. Detailed Implementation
[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] Please see Figure 1 A method for classifying hepatitis B antibody patterns based on plasma protein profiles includes: acquiring host hardware information of the execution environment and extracting cache parameters of the host CPU; acquiring a high-dimensional sparse one-dimensional array and extracting non-zero feature indices from the high-dimensional sparse one-dimensional array; performing mapping calculations on the non-zero feature indices using a locality-sensitive hashing algorithm and reconstructing the data into a locally dense two-dimensional matrix according to the mapping results. According to the cache parameters and initial cutting dimension, ensure that the memory usage of each independent sub-block is less than the capacity corresponding to the cache parameters; perform low-rank matrix factorization on the independent sub-block to extract local latent feature vectors; concatenate the local latent feature vectors, perform feature weighting through a single-layer attention network, and input the weighted features into a classifier function to output the target classification pattern vector; generate dimension update instructions according to a preset dynamic adjustment mechanism to adjust the cutting dimension of subsequent cuts.
[0019] This embodiment provides a pattern classification mechanism for the edge computing module of a high-throughput screening device. Specifically, the detection instrument continuously outputs a continuous digital array arranged in the order of samples. Each array can be regarded as a high-dimensional sparse one-dimensional array. The position in the array represents the feature identifier, and the floating-point value at the position represents the numerical response of the feature. Most positions are zero or empty. After receiving the array, the edge computing module does not perform global dimensionality reduction first. Instead, it reads the hardware information of the current host, extracts the cache parameters of the central processing unit, and then organizes the subsequent data rearrangement, block division and local calculation process based on the cache parameters. The continuous digital array described herein corresponds to the numerical expression of plasma protein spectrum detection results in the application scenario of this application; in other words, the feature identifiers in the array are used to correspond to different protein peak positions, protein fragments, protein combination features, or derived feature sites generated after protein spectrum preprocessing, and the floating-point values at the positions are used to represent the response intensity, relative abundance, or normalized spectral intensity of the corresponding protein feature. Since the raw plasma protein profile data usually has the characteristics of high dimensionality, dispersed effective response, and incomplete consistency of non-zero sites among different samples, it can be naturally represented as a high-dimensional sparse one-dimensional array after entering the edge computing module; accordingly, the target classification pattern vector output later is used to indicate the classification result of hepatitis B antibody-related patterns. This pattern vector can correspond to a single antibody pattern or a multi-label state where multiple antibody patterns coexist. To elaborate, a simplified sandbox example can be provided. Assume the original one-dimensional array of a sample to be processed has a length of 16, with non-zero values only at indices 2, 3, 9, and 10, which are 0.8, 0.7, 1.1, and 0.9 respectively; the remaining positions are zero. The system extracts the set of non-zero feature indices. Perform locality-sensitive hashing. If the algorithm determines that indices 2 and 3, and 9 and 10 have a high co-occurrence probability, then map them to adjacent address regions. For example, the original 16-dimensional array can be reconstructed into a... In a two-dimensional matrix, the first and second rows are preferentially placed with data blocks corresponding to indices 2 and 3, and the third and fourth rows are preferentially placed with data blocks corresponding to indices 9 and 10. This makes the originally scattered non-zero elements more densely clustered in local regions. The resulting matrix may not be completely dense, but compared to the original one-dimensional distribution, it already has a locally dense and globally separable structure. Based on this, the system adjusts the above according to the host cache parameters and the preset initial split dimension. Dynamically cut the matrix; continue with the above. Taking a matrix as an example, if the initial cutting dimension is 2, then the matrix is cut into 4 parts. The independent sub-blocks S1, S2, S3, and S4; the memory usage of each sub-block is controlled within the allowable range of the cache capacity, and low-rank tensor decomposition is performed in the local range to extract local latent feature vectors. For example, S1 decomposition yields local vectors. S3 decomposition yields local vectors The all-zero or near-all-zero sub-blocks can be converted into zero vectors, or directly marked as low-contribution sub-blocks; then, the local vectors are concatenated to form a global concatenated feature vector:
[0020] A single-layer attention network assigns weights based on the effectiveness of each local vector. For example, it assigns higher weights to sub-blocks containing continuous non-zero clusters and lower weights to empty sub-blocks. Finally, it outputs weighted features, which are fed into a classifier function to obtain the target classification pattern vector. This target vector can be a multi-dimensional discrete state vector, such as... This is used to indicate that the sample falls into class 1 and class 3 of the three candidate patterns; To avoid symbol ambiguity in the above examples, S1, S2, S3, and S4 are used here only to sequentially identify the independent sub-blocks obtained after dynamic cutting. Indicates the first Each independent sub-block; accordingly, , , , Let S1, S2, S3, and S4 represent the local latent feature vectors extracted respectively. Indicates the first Local vectors corresponding to each independent sub-block; This represents the global concatenated feature vector formed by concatenating all local latent feature vectors in a predetermined order; the aforementioned This is merely a schematic representation of the output pattern vector, where 0 or 1 at each position indicates whether the corresponding candidate pattern is not triggered or is triggered, and there is no additional limit on the specific number of tags. Furthermore, in the hepatitis B antibody model scenario, the above candidate models are predefined in the training phase and can correspond to, for example, response models related to surface antibodies, response models related to core antibodies, and response models related to combined antibody profiles. In other words, the classifier function in this embodiment does not directly interpret individual protein features, but performs pattern mapping on the implicit features of the plasma protein spectrum after local rearrangement, local decomposition, and weighted aggregation, and outputs a discrete vector representing the hepatitis B antibody pattern; in this way, the continuous response of the front-end plasma protein spectrum can be converted into a pattern result that can be stored, retrieved, and linked to business rules in the back-end. Furthermore, the system does not use the same cutting dimension during the continuous processing of the sample stream, but generates dimension update instructions based on a preset dynamic adjustment mechanism; if the cache miss rate is detected to increase during the current batch processing, it indicates that the current sub-block size is too large and the subsequent cutting dimension needs to be reduced. If the cache hit is relatively stable, the current cutting dimension remains unchanged to avoid the additional overhead caused by frequent reconstruction; thus forming a closed loop of hardware state awareness - data reconstruction - local decomposition - classification output - parameter callback. As a fallback, if a sample has very few non-zero features, such as only one or two non-zero positions, then after local sensitive hashing, only one valid block may be formed, and the rest of the sub-blocks will be empty. In this case, the system allows skipping meaningless decomposition calculations, generating local vectors only for the valid blocks, and padding the missing sub-blocks with zeros before splicing them together. If the non-zero features of a sample are abnormally dense, causing the local region of the mapped two-dimensional matrix to be too crowded, the dynamic cutting mechanism will automatically reduce the cutting dimension in subsequent batches to keep the memory usage of a single block within the cache's capacity. If the classifier outputs multiple mode scores that are close, the system can output multiple label vectors simultaneously without forcibly compressing them into a single label. For example, in an integrated high-throughput screening device in a hospital testing center, hundreds of samples are continuously input into the digital array in the morning batch; the edge computing host first reads the cache information of the local central processing unit, and then performs non-zero index extraction and address rearrangement on the high-dimensional sparse array of each sample; For sample A17, only a few feature locations in the raw data uploaded by the instrument have valid floating-point values. The system rearranges these non-zero locations into a local lumped matrix and then performs block processing. It completes local low-rank decomposition within the cache range, and then concatenates the resulting local features and inputs them into the attention network and classifier to finally output the pattern vector corresponding to the sample. If a significant increase in the cache miss rate is detected when processing sample A53, the system automatically issues a new dimension update instruction to adjust the granularity of subsequent samples without interrupting the entire batch processing task. The purpose of this step is to transform the global classification process, which was originally constrained by high-dimensional sparse structures and main memory access bottlenecks, into a cache-aware local computation process, thereby achieving lower memory peaks, higher cache hit rates, and stable multi-label mode output capabilities.
[0021] In a preferred embodiment of the present invention, obtaining a high-dimensional sparse one-dimensional array includes: receiving the original high-dimensional sparse one-dimensional array and performing preprocessing to obtain the high-dimensional sparse one-dimensional array, wherein the preprocessing includes removing pure zero columns and skipping global interpolation calculations. The step of mapping the non-zero feature indices using the Locality Sensitive Hashing (LSH) algorithm and reconstructing the data into a locally dense two-dimensional matrix according to the mapping result includes: mapping non-zero feature indices with co-occurrence probabilities to adjacent memory addresses using the LSH algorithm to obtain an index mapping table; and reconstructing the high-dimensional sparse one-dimensional array into the locally dense two-dimensional matrix based on the index mapping table.
[0022] This embodiment provides a lightweight preprocessing and reconstruction mechanism for original high-dimensional sparse arrays. Specifically, in the previous embodiment, although the input array can be directly rearranged and divided into blocks, in the scenario of continuous output from high-throughput devices, if pure zero columns are not removed first, dimensions that do not contribute any actual features will be retained for a long time. If global interpolation is performed on all missing positions, additional memory copying and computation waiting will be introduced. Therefore, this embodiment first completes the structure compression at a lower cost, and then establishes an index mapping table for address rearrangement. The pure zero column mentioned here refers to the column dimension of the statistical view formed after multiple samples are aligned according to a unified feature index, rather than changing the basic form of the original one-dimensional array of a single sample stored according to the index; in other words, the system can align multiple original high-dimensional sparse one-dimensional arrays according to the position of common features within the current batch, sliding window or preset statistical window to form a logical sample × feature view. If a feature dimension is all zeros within the statistical range and there are no valid floating-point values, then the feature dimension is identified as a pure zero column and removed from the subsequent set of valid dimensions. Accordingly, a single sample is not generated as a new column in the subsequent processing, but its one-dimensional representation is compressed based on the set of valid dimensions. Furthermore, if a feature position only has missing values rather than a clear zero value, then the position is not classified as a pure zero column, but its index status is retained according to the missing value retention rule to avoid misjudging the unknown as a zero response. To elaborate further, let's take the sample stream in the same batch testing scenario as an example; there is a small sandbox matrix consisting of 3 samples: the first sample is [0,1.2,0,gone,0,0,0,0], the second sample is [0,0.9,0,0.5,0,0,0,0], and the third sample is [0,1.1,0,gone,0,0,0,0]. In this example, columns 1, 3, 5, 6, 7, and 8 are all zero in all samples, and can be directly identified as pure zero columns and removed, leaving only columns 2 and 4. After removal, the representation length of each sample is significantly shortened. For missing values in column 4, global interpolation is not performed at this stage, but the original state is maintained to avoid re-expanding the full-dimensional scan of all samples due to the need for filler values. After compression, the system extracts non-zero feature indices and calculates the co-occurrence relationship between indices. If indices 2 and 4 are frequently observed to appear together in historical samples or the current small batch, it is considered that the two have a high co-occurrence probability. Based on this, the locality-sensitive hashing algorithm maps these two indices to adjacent addresses and generates an index mapping table. Specifically, the locality-sensitive hashing algorithm employs a weighted min-hash construction method based on feature co-occurrence frequency as the weight function, and calculates the local topological correlation degree. Mapped to the physical address offset of the hash bucket, ensuring that highly correlated features are clustered in the logical address space; For example, the original compressed index order might be [2,4]. The mapping table can be directly set so that new address 0 corresponds to the original index 2, and new address 1 corresponds to the original index 4. If the number of compressed indices is large, the mapping table will arrange a group of highly co-occurring indices in the same address range. Based on this mapping table, the system backfills the one-dimensional array into the two-dimensional matrix according to the new address order. For example, a sparse array of length 8 can be compressed and mapped to a... A small matrix is formed by placing highly co-occurring index pairs in the first row and the remaining index pairs in the second row, thus obtaining a locally dense matrix. Furthermore, to ensure traceability of the preceding and following steps, the system can maintain an effective dimension lookup table after removing pure zero columns, which is used to record the correspondence between the compressed position and the original feature index; the index mapping table is the correspondence between the compressed position and the rearranged address generated on the basis of the effective dimension lookup table; thus, a two-level mapping link is formed from the original feature index to the compressed position and then to the rearranged address. Regardless of which set of protein profile features the classifier output needs to trace back to, it can be located through this mapping link without losing feature identity information due to the removal of pure zero columns and address rearrangement. For a single sample in a streaming scenario, if the set of pure zero columns in the current window has not been recalculated when it arrives, the system can directly call the most recent valid dimension lookup table for compression. When the window is updated, the valid dimension set used by subsequent samples will be refreshed uniformly. During this process, the index mapping table is not required to be permanently fixed; if the co-occurrence relationship of samples in subsequent batches changes significantly, for example, the index groups that used to appear together begin to separate, while another group of indexes appears together more frequently, the system can regenerate the mapping table to maintain the memory layout of storing highly correlated features adjacently. As a fallback, if the number of valid columns remaining after removing pure zero columns is too small, such as only one column, the system can stop forcibly reconstructing it into a standard square matrix and instead generate a single-column matrix or a degenerate one-dimensional block, and process it according to the minimum size in subsequent block-sharing stages; if the number of samples in a certain small batch is insufficient, resulting in unstable co-occurrence statistics, the mapping table retained from the previous batch can be called as a fallback solution; if even the historical mapping table is unavailable, a conservative reconstruction is performed according to the original index order to ensure that the process is not interrupted. For example, in the morning batch processing of the same high-throughput screening device, the original digital arrays of samples A17, A18, and A19 have a large number of all-zero dimensions. The system first deletes these pure zero columns, shrinking the original tens of thousands of-dimensional arrays into hundreds of effective arrays, and then retains the empty positions without interpolation. An index mapping table is established based on the probability relationship of the co-occurrence of each non-zero feature in the current batch, and the compressed array of sample A17 is rearranged into a locally dense two-dimensional matrix for direct use by the cache-aware block divider in the next stage. The purpose of this step is to first eliminate non-contributing dimensions, and then drive memory rearrangement based on co-occurrence relationships, thereby achieving simultaneous improvement in input size compression and subsequent local computation efficiency.
[0023] In a preferred embodiment of the present invention, the two-dimensional matrix is dynamically divided according to the cache parameters and the initial cutting dimension to obtain independent sub-blocks, ensuring that the memory occupation of each independent sub-block is less than the capacity corresponding to the cache parameters, including: reading the hardware configuration register instruction of the host central processing unit to obtain the secondary cache capacity parameter as the cache parameter; Obtain a pre-set safety factor, and calculate the initial cutting dimension based on the L2 cache capacity parameter and the safety factor; dynamically cut the two-dimensional matrix into independent sub-blocks according to the initial cutting dimension, ensuring that the memory usage of each independent sub-block is strictly less than the product of the L2 cache capacity parameter and the safety factor.
[0024] This embodiment provides a cache-aware dynamic partitioning mechanism. Specifically, the previous implementation solved the problem of input array compression and rearrangement. However, if fixed-size sub-blocks are still used subsequently, two types of defects are likely to occur on different hardware: on hosts with small caches, excessively large sub-blocks will lead to frequent swapping in and out; on hosts with large caches, excessively small sub-blocks will result in too much fragmentation and increased management overhead. Therefore, this embodiment establishes a direct correlation between the partitioning dimension and the capacity of the CPU's L2 cache. Specifically, after the system starts up, it reads the hardware configuration register instruction of the host's central processing unit to obtain the L2 cache capacity parameter; for ease of explanation, let's assume the L2 cache capacity of a certain edge host is... 1MB, with a pre-set security level. If the value is 0.5, then the safe upper limit for a single independent sub-block is... If matrix elements are stored as 4-byte floating-point numbers, then the side length of the sub-blocks is... In order to unify dimensional calculations, the following equivalence constraints should be satisfied when expressing these quantities:
[0025] Based on this constraint, it can be calculated that The upper limit is approximately 362; in engineering implementation, it can be rounded down to 256 or 320 to align with the block scheduling granularity of the underlying matrix operation interface; thus, the system divides the reconstructed two-dimensional matrix into several independent sub-blocks based on this dimension. Here This is used to represent the side length of a single independent sub-block, which is the cutting dimension derived from the cache capacity in this embodiment; when the matrix is cut into approximately square sub-blocks, the row dimension and column dimension of the sub-block are uniformly taken as 1. Therefore, the number of elements in a single block can be written as If irregular cutting is subsequently used for non-square arrays or tail blocks, then It still represents the reference edge length of the current main cutting particle size, while the insufficient edge part can be handled separately as long as it does not exceed the safety limit; To illustrate with a smaller sandbox example; suppose the mapped two-dimensional matrix is... Elements are stored using 4 bytes. The current demonstration environment specifies a single block limit of 64 bytes, thus satisfying the relation... , can be obtained Therefore, the initial cutting dimension is 2; The matrix will be divided into 16 parts. Independent sub-blocks; If you switch to another host with a larger cache, the single block limit becomes 256 bytes, then... This can increase the initial cutting dimension to 4, so the matrix only needs to be cut into 4 parts. Sub-blocks; it can be seen that the cutting dimension is not a constant hard-coded in the algorithm, but is derived from the hardware capacity; This embodiment also emphasizes the strict less than constraint; that is, the memory usage of a single block should not exactly fill the safety limit, but should reserve buffer space to accommodate temporary variables, intermediate vectors or operation context generated during decomposition; this can reduce cache thrashing triggered by critical fullness. As a fallback, if reading the hardware configuration register fails, the system can fall back to a set of conservative default values, such as using the smaller cache host preset split dimensions to prioritize executability; If the calculated initial cutting dimension is greater than the matrix side length, the system will not continue cutting and will treat the entire matrix as a single sub-block. If the matrix width and height are inconsistent, the cutter can use different boundary controls for rows and columns respectively, and use zero padding or irregular tail blocks to process data that is not a whole block at the edge, but still need to ensure that the tail block occupancy does not exceed the safety limit. For example, after the hospital's testing center switched to the backup edge host in the morning batch, the system reread the secondary cache capacity of the backup host and found that its cache was smaller than that of the primary device. Therefore, when faced with the same sample A17 reconstructed two-dimensional matrix, the cutter automatically adopted a smaller initial cutting dimension to split the matrix into more but lighter independent sub-blocks, so that each block could stably fall within the product of the secondary cache capacity and the safety factor, without modifying the upper-level classification process. The purpose of this step is to dynamically match the data block granularity with the host machine's physical caching capabilities, thereby achieving stable execution across hardware environments and reducing the risk of cache mismatch.
[0026] In a preferred embodiment of the present invention, performing low-rank tensor decomposition on the independent sub-blocks to extract local latent feature vectors includes: loading the independent sub-blocks into the L2 cache of the host CPU; performing low-rank tensor decomposition independently on each independent sub-block within the L2 cache to extract the local latent feature vectors, wherein the low-rank tensor decomposition process does not require accessing main memory.
[0027] This embodiment provides a local low-rank decomposition mechanism that is completed in a closed loop within the secondary cache. Specifically, although the previous implementation has controlled the size of each sub-block, if the main memory is frequently accessed during the decomposition process, the data migration delay will still lengthen the end-to-end classification time. Therefore, this embodiment further constrains the computation location: after each independent sub-block is loaded into the secondary cache, the entire low-rank tensor decomposition and local vector extraction process is completed within the cache as much as possible. The low-rank tensor decomposition process described here does not require access to main memory. This means that within one decomposition iteration cycle for a single independent sub-block, the original sub-block data, decomposition factors, temporary vectors, and intermediate update quantities involved in the operation are all pre-loaded and kept within the capacity of the L2 cache. During the decomposition process, main memory is no longer repeatedly accessed in order to read the original data of the sub-block. Correspondingly, after the sub-block decomposition is completed, the derived local latent feature vector can be written back to a higher-level cache or main memory for subsequent concatenation. This write-back operation occurs after the single-block decomposition is completed and does not change the technical meaning that the decomposition process does not need to access the main memory. In other words, the embodiment limits the decomposition calculation stage to not relying on main memory round-trip reading, rather than excluding the output of the result after the calculation is completed. Furthermore, when an independent sub-block contains missing positions retained from the previous preprocessing stage, the system can load the corresponding missing mask information along with the independent sub-block. The missing mask information is used to identify whether each element belongs to a valid observation, a true zero value, or a missing value. Subsequently, when performing local low-rank tensor decomposition in the second-level cache, only valid observations are used to participate in error updates or factor updates, and missing value positions are not treated as true zero values for fitting. In other words, the sub-block data and the missing value mask together constitute the input context for closed-loop computation within the cache. The mask also resides in the secondary cache working area, thus making this implementation consistent with the missing value retention preprocessing mechanism in terms of semantics and execution path. Specifically, each independent sub-block can be viewed as a simplified representation of a local data tensor; for a sub-block The system first loads it into the second-level cache, and then performs a low-rank approximation in the cache. For ease of explanation, a simplified derivation using the rank-1 approximation can be adopted: the low-rank tensor decomposition in implementation employs CP decomposition based on alternating least squares (ALS); this algorithm decomposes each independent sub-block It is decomposed into the sum of several rank-1 tensors. By iteratively optimizing the factor matrix in a closed loop within the secondary cache, the feature vector that best represents the feature distribution of the local region is extracted. This decomposition method, compared to global SVD decomposition, significantly reduces the computational complexity of scanning non-zero elements and is perfectly suited to the aforementioned block-based caching requirements; the system finds two local decomposition factor vectors:
[0028]
[0029] Make its outer area Approximate the atomic block as closely as possible; after several rounds of local updates, an approximate representation is obtained, for example... , At this time, it is advisable to take , The main components or their combinations constitute the local latent feature vector. For another near-zero sub-block After decomposition, weaker local vectors can be obtained. In attention networks, these tend to have lower weights. To avoid ambiguity in the interpretation of symbols, here and This represents a set of local decomposition factor vectors obtained for the current independent sub-block, where , Representing vectors The first and second components, , Representing vectors The first and second components; This represents the local latent feature vector derived from the decomposition result of the current sub-block. This represents the local latent feature vector corresponding to another independent sub-block. The apostrophe is only used to distinguish vector instances derived from different sub-blocks and does not indicate differentiation, transpose or other special operations. If we further consider small blocks containing missing values, for example When the system reads the sub-block from the cache, it also reads the corresponding mask, where the first row and second column are marked as unavailable elements. At this point, the decomposition update only makes local approximations based on the three known positions of 0.8, 0.1, and 0. Missing positions do not participate in the current round's error accumulation, nor are they directly filled with 0. This maintains the previous principle of skipping global interpolation and avoids misinterpreting missing values as low response values in the local decomposition stage. The so-called closed loop refers to the entire process, from loading sub-blocks, initializing temporary matrices, iteratively updating, to exporting local latent feature vectors, being completed in the L2 cache as much as possible, without relying on repeatedly reading the original block data from main memory. In engineering, this can be achieved by allocating an independent cache workspace for each thread to avoid multiple sub-blocks competing for cache space. Since the independent sub-blocks are decoupled from each other, they can be processed sequentially or in parallel on multiple cores, but each core still maintains the execution mode of loading a single block and completing it locally. Furthermore, in order to ensure that the above closed-loop conditions are met, a portion of the cache space can be reserved for decomposition factors and temporary variables during actual scheduling, instead of allowing only the original sub-blocks to fill the cutting limit; that is, the safety factor in the previous implementation not only covers the sub-blocks themselves, but also the auxiliary working area required for local low-rank decomposition. In this way, after a single block is loaded, the original sub-block, update vector, intermediate results, and the missing mask can all reside in the second-level cache, thereby avoiding the situation where the sub-block meets the cutting conditions but the temporary amount is forced to overflow into the main memory during calculation. Compared to performing a global decomposition on the entire two-dimensional matrix, this local decomposition method only sees a local region each time. However, since the highly correlated non-zero features have been clustered into the same block as much as possible through address rearrangement in the previous stage, the local block retains highly influential interaction information. Overall, it can achieve a balance between computational overhead and expressive power. As a fallback, if a sub-block detects that all elements are zero after loading, the system can directly output the zero local vector without entering the iterative decomposition process; if the numerical distribution of a sub-block is extremely unstable, causing it to fail to converge within the preset iteration rounds, it can be truncated directly after reaching the upper limit, and the local vector corresponding to the current best approximation can be output to avoid individual abnormal blocks slowing down the entire batch processing. If multiple threads running simultaneously intensifies contention in the second-level cache, the number of concurrent blocks can be reduced or the partitioning dimension can be decreased to maintain closed-loop computation. For example, in the morning batch processing, after sample A18 is rearranged and divided into multiple independent sub-blocks, the computing core loads one of the highly active sub-blocks into the second-level cache of the core, performs low-rank decomposition in the cache and extracts local latent feature vectors; the other nearly blank sub-block is quickly determined to be a low contribution block, and only outputs local vectors close to zero. Throughout the process, each sub-block of sample A18 is processed by loading once, calculating locally, and deriving vectors, thereby reducing the additional latency of round trips to main memory; The purpose of this step is to converge the local feature extraction process into the cache, thereby achieving higher data reuse and lower main memory access overhead.
[0030] In a preferred embodiment of the present invention, the local latent feature vectors are concatenated, and the features are weighted using a single-layer attention network. The weighted features are then input into a classifier function to output a target classification pattern vector. This includes: concatenating the local latent feature vectors extracted from all the independent sub-blocks to obtain a global concatenated feature vector; inputting the global concatenated feature vector into the single-layer attention network for feature cross-interaction and dimensionality reduction optimization to obtain the weighted features; and inputting the weighted features into the classifier function to output the target classification pattern vector, wherein the target classification pattern vector is a low-dimensional discrete state vector.
[0031] This embodiment provides a local vector aggregation and pattern output mechanism. Specifically, the previous implementation can extract local latent feature vectors for each independent sub-block. However, if these vectors are directly added with equal weights or simply averaged, a defect will easily occur, namely, high-influence sub-blocks and blank sub-blocks are treated equally, resulting in the dilution of the final feature expression. Therefore, this embodiment introduces a single-layer attention network to weight the concatenated global vectors while keeping the network lightweight. The single-layer attention network used here for feature cross-cutting and dimensionality reduction optimization refers to completing local vector importance estimation and weighted aggregation within a single-layer attention scoring structure, rather than introducing multiple deep networks. Specifically, the single-layer attention network consists of a linear mapping layer and a Softmax normalization layer. Its core logic is to concatenate the global feature vector... A learnable transformation matrix is used to map to the attention space, generating an association representation of query vectors and key vectors; this structure does not rely on multiple deep stacks, but rather on computation... With weight matrix The dot product is used to capture the nonlinear collaborative relationship between local blocks, thereby preserving the feature response of key feature sub-blocks while reducing dimensionality; Specifically, the following two equivalent expressions can be used: First, calculate a block-level weight for each local latent feature vector, and then apply the block-level weight to all components of the corresponding local vector; Second, after completing the vector concatenation, directly give element-level weights to each component in the concatenated vector. The former emphasizes the differences in importance between sub-blocks, while the latter is more convenient for unified tensor operations in engineering implementation. As long as the element-level weights come from the same round of attention scores or their linear expansions of the local vectors, both are implementations of feature weighting through a single-layer attention network in this application and do not constitute a conflict in technical solutions. Specifically, suppose a sample, after local decomposition, yields four local latent feature vectors: , , , ; The system first concatenates the data in a predetermined order to obtain a global concatenated feature vector:
[0032] After receiving the vector, the single-layer attention network calculates the attention score of the input vector using its internal learnable weight parameters, and then assigns attention weights to different positions after normalization. Specifically, the single-layer attention network contains a weight matrix. and bias vector For globally concatenated feature vectors Its attention weight vector The calculation logic is as follows:
[0033] In the training phase before model deployment, this embodiment pre-constructs a plasma protein profile sample set containing 5000 clinically known hepatitis B antibody pattern tags; the training process adopts a supervised learning mode, and its loss function is... The multi-label binary cross-entropy loss is used, and the formula is defined as follows:
[0034] in, For sample size, This represents the number of candidate patterns for hepatitis B antibodies. For real labels, The probability score output by the classifier; the Adam optimizer iterates with an initial learning rate of 0.001 to adjust the weight matrix of the single-layer attention network. and the weight matrix of the classifier Reaching convergence ensures that the model can accurately identify the contribution weights of different protein feature clusters to the classification results; For example, the weights can be obtained:
[0035] The new feature vector obtained after weighting:
[0036] Will Input the classifier function and output the target classification pattern vector; the single-layer attention network here can be understood as a lightweight feature re-scoring process based on linear transformation and normalization. It does not pursue deep and complex modeling, but focuses on preserving the importance differences between local blocks. This not only compensates for the information fragmentation that may result from local independent processing, but also avoids the large-scale parameter expansion caused by deep fully connected networks under high-dimensional input. Furthermore, the so-called feature cross-optimization refers to comprehensively considering the collaborative information between adjacent local vectors, local vectors within the same high co-occurrence cluster, or concatenation positions when scoring the single-layer attention, in order to produce a weighted result that is more suitable for the classifier input; The so-called dimensionality reduction optimization refers to retaining high-contribution components and suppressing low-contribution components after weighting. This step requires a layer of global average pooling or adaptive max pooling. After the weighted output of the single-layer attention network, the adaptive global average pooling operator is called to dynamically adjust the pooling window step size according to the total number of independent sub-blocks. This forces the variable-length weighted feature sequence to be downsampled into a fixed-length vector with a length equal to the dimension of the classifier input layer. The variable-length local feature sequence is then uniformly mapped to a preset fixed-dimensional classification input representation. The classifier function consists of a fully connected layer structure and an activation function, and can take the form suitable for multi-label output; for example, it includes a pre-defined weight matrix of fixed dimensions. and bias The fully connected layer maps the pooled and aligned features into feature vectors with dimensions equal to the number of candidate patterns, and then compresses the values of each dimension to a minimum using the Sigmoid activation function. Within the interval; for the four candidate modes, four independent probability scores can be generated respectively, and then a low-dimensional discrete state vector is obtained by threshold determination; if the score of a certain mode exceeds 0.5, it is set to 1, otherwise it is set to 0; if multiple modes exceed the threshold at the same time, multiple labels are allowed to coexist. As a fallback, if all local vectors are close to zero, it indicates that the effective features of the sample are extremely weak. The system can output an all-zero pattern vector or mark it as a state to be reviewed for processing by the backend process. If the weights calculated by a single-layer attention network are highly concentrated, for example, almost all the weights are applied to a single local vector, the system can impose an upper limit constraint on the weights to prevent the model from becoming unstable due to individual local outliers; if a local vector of a certain sub-block is missing during the concatenation process, it is filled with a zero vector to ensure that the input length is consistent. For example, in the continuous sample processing of the same screening device, sample A19 is decomposed locally to form multiple local latent feature vectors. Among them, the two sub-blocks from the high co-occurrence feature clusters contribute significantly more than the other sub-blocks. The system concatenates all local vectors and sends them to a single-layer attention network. This network increases the contribution of key sub-blocks and reduces the influence of blank sub-blocks. The classifier outputs the target classification pattern vector of sample A19 for subsequent device display module and result caching module to call. The purpose of this step is to reconstruct the importance relationships between local blocks within a lightweight computing framework, thereby achieving stable multi-label pattern determination output.
[0037] In a preferred embodiment of the present invention, a dimension update instruction is generated according to a preset dynamic adjustment mechanism to adjust the subsequent cutting dimension, including: monitoring the current cache miss rate of the host CPU; when the current cache miss rate is higher than a preset cache miss threshold, reducing the safety factor and recalculating the cutting dimension based on the reduced safety factor, and generating the dimension update instruction; when the current cache miss rate is lower than or equal to the preset cache miss threshold, keeping the current safety factor unchanged and maintaining the current cutting dimension.
[0038] This embodiment provides a block adaptive adjustment mechanism based on cache miss rate. Specifically, although the initial cutting dimension in the previous embodiment was derived from the cache capacity, the sample sparsity will change and the thread load will fluctuate during actual continuous batch processing, so the initial dimension is not always optimal. If the same cutting dimension is maintained for a long time, the cache miss rate may increase and the local decomposition efficiency may decrease in some batches. Therefore, this embodiment introduces runtime feedback adjustment logic. Specifically, the system periodically monitors the current cache miss rate of the central processing unit when processing the sample stream; this can be done once after each batch of samples is processed or after each fixed time window. For example, the default cache miss threshold is 8%; if the actual miss rate reaches 12% within a certain statistical window, it indicates that the current sub-block may be too large and the cache reuse is insufficient; at this time, the system reduces the safety factor, for example, from 0.5 to 0.4, and then recalculates the cutting dimension based on the new safety factor. To prevent parameter adjustment from getting stuck in an infinite loop or causing calculation overflow, this embodiment sets a safety factor. The dynamic adjustment range is When a sustained increase in cache miss rate is detected, the system will reduce the cache miss rate by a fixed decay step. Decrease step by step The value will be maintained until the cache miss rate falls below the preset threshold. like If the high miss rate cannot be eliminated even after reaching the lower limit of 0.2, an abnormal interrupt instruction is triggered. The memory layout is forcibly changed by recalculating the index mapping table to ensure the stability of the system under extreme high-dimensional sparse load. If the previous cutting dimension was 320, it may be reduced to 256 after recalculation, and a dimension update instruction will be generated to apply to subsequent unprocessed samples; conversely, if the current miss rate is 5%, which is not higher than the threshold, the original safety factor and cutting dimension will remain unchanged. With this approach, the cutter does not need to recalculate the dimensions for each sample, but adjusts it window by window according to the running status, thus balancing stability and responsiveness; the dimension update command can be recorded as a simple control parameter, such as reducing the cutting dimension by one level in the next batch; or it can directly carry a new specific dimension value. Here's a sandbox example; suppose in sample batch B1, the rearranged matrix is generally quite dense, using... When the cache miss rate rose to 15% during sub-block operations, the system reduced the safety factor from 0.6 to 0.45, and subsequent batches of B2 switched to using [a different safety factor]. Sub-block; when processing B2, the miss rate dropped to 6%, indicating that the adjustment has been effective, so the setting is maintained and operation continues; if the load decreases further, the status quo can be maintained without aggressive pullback to avoid frequent oscillations; As a fallback, if the monitoring module is unable to obtain the cache miss rate for a short period of time, for example, if the performance counter is occupied by other processes, the system can use the most recent valid statistical result or temporarily freeze the safety factor. If the miss rate is still higher than the threshold after repeatedly reducing the safety factor, it indicates that the problem may not only come from the size of the sub-block, but also from excessive thread concurrency or excessive concentration of mapping results. In this case, auxiliary strategies can be triggered, such as reducing the number of concurrent cores or regenerating the index mapping table. If the miss rate is extremely low but the cutting dimension is already very small, the system will not forcibly increase the dimension to avoid repeated parameter tuning causing system jitter. For example, in the morning batch processing of samples A17 to A40 in the same hospital's testing center, the processing was stable. However, starting from A41, due to a significant increase in non-zero features in a certain batch of samples, the edge host detected that the cache miss rate was consistently higher than the threshold. Based on this, the system issued a new dimension update instruction, reducing the cutting dimension of subsequent samples A42 to A80, making it easier for subsequent independent sub-blocks to reside completely in the secondary cache. When the afternoon batch of samples returned to a sparse distribution, the miss rate dropped, and the system maintained the current setting without further reducing the dimension. The purpose of this step is to upgrade static cache-aware segmentation to runtime adaptive segmentation, thereby enabling real-time response to changes in sample morphology and hardware load.
[0039] In a preferred embodiment of the present invention, preprocessing is performed, including: identifying missing values in the original high-dimensional sparse one-dimensional array; retaining the missing values and skipping the global interpolation calculation, and directly using the original high-dimensional sparse one-dimensional array containing the missing values as the high-dimensional sparse one-dimensional array, so as to reduce the peak system memory usage.
[0040] This embodiment provides a missing value retention preprocessing mechanism. Specifically, the previous embodiment mentioned skipping global interpolation. However, in a continuous data stream environment, missing values need to be identified and retained using specific identifiers to ensure that they do not affect subsequent rearrangement and block operations. If all missing values are imputed first using the traditional method, a significant drawback will occur: not only will the entire array need to be traversed, but new intermediate copies will also be generated, leading to a rise in system memory peaks. Therefore, this embodiment explicitly adopts a method of identification and retention to handle missing values. Specifically, when the system receives the original high-dimensional sparse one-dimensional array, it distinguishes three types of positions: positions with zero values, positions with explicit floating-point values, and positions with missing values. Missing values can be represented by specific markers in the device protocol, such as empty fields, special codes, or NOT numeral markers. For missing values, the system does not convert them to 0, nor does it perform mean complementation, median complementation, or neighborhood interpolation, but retains them as is. For example, if an array is [0, 1.3, missing, 0, 0.8, missing], then after subsequent preprocessing, it will still maintain the structure [0, 1.3, missing, 0, 0.8, missing], but the missing site indices will be recorded as 3 and 6 in the metadata; When extracting non-zero indices, the system only extracts positions that are clearly non-zero and not missing, such as extracting indices 2 and 5 in the example above; missing positions are not included in the non-zero set, but their coordinate information is retained so that the original sparse shape can be maintained during subsequent reconstruction; the advantage of doing so is that no additional pseudo-values are introduced to fill the gaps, and no additional full buffer is opened for the interpolation algorithm. When reconstructing a two-dimensional matrix, missing positions can be encoded as a special placeholder state; for example, they can be recorded as unavailable elements at the internal labeling level, so that the low-rank decomposition stage can choose to skip the position or participate in the operation in a masked manner, instead of mistakenly treating it as a real zero value; thus avoiding confusion between missing values and zero values. As a fallback, if the missing percentage in a certain array is too high, for example, exceeding the preset threshold of 70%, then even without interpolation, there may be insufficient effective information. In this case, the system can directly add a low confidence flag to the sample and include the flag in the classifier output for backend verification. If a missing value is encoded abnormally in the data uploaded by a device, making it impossible to distinguish from the actual value, the system will first perform verification based on the device protocol table; if the verification fails, the sample can be temporarily stored in the abnormal queue instead of being included in the normal batch. For example, in sample A23 of the same screening device, several positions of the original digital array are marked as empty due to momentary reading interference; after the edge computing module identifies these empty positions, it does not trigger global interpolation, but directly retains the original array structure and only extracts the non-zero features that clearly have values to participate in subsequent hash rearrangement and block calculation; in this way, sample A23 continues to enter the classification pipeline without adding extra memory copies; The purpose of this step is to avoid introducing additional global computations and large-scale memory usage during the missing value handling phase, thereby achieving lower peak system resource consumption.
[0041] In a preferred embodiment of the present invention, the locality-sensitive hashing algorithm is used to map non-zero feature indices with co-occurrence probabilities to adjacent memory addresses to obtain an index mapping table. This includes: calculating the local topological correlation degree between each non-zero feature in the high-dimensional sparse one-dimensional array; and based on the local topological correlation degree, using the locality-sensitive hashing algorithm to map the dimensions of non-zero features with local topological correlation degrees greater than a preset correlation threshold to the same physical memory block to generate the index mapping table.
[0042] This embodiment provides an index mapping generation mechanism based on local topological correlation. Specifically, the previous embodiment has explained that an index mapping table can be established based on co-occurrence relationships. However, in complex sample streams, the number of co-occurrences alone may not be sufficient to reflect the closeness between features. For example, although two features may appear with similar frequencies, if they are always far apart or only co-occur in a few abnormal samples, they are not suitable to be forcibly mapped to the same address block. Therefore, this embodiment further introduces local topological correlation as the mapping basis. Specifically, the system can statistically analyze the distribution of non-zero features of multiple samples within a sliding window; it has four non-zero feature indices. , , , In recent samples, the following has been observed: and They often appear simultaneously and maintain good proximity before and after rearrangement; and They also often appear at the same time; and and Although they occasionally co-occur, their stability is poor; therefore, the system calculates the local topological correlation degree for each feature pair; specifically, the local topological correlation degree... The calculation logic is as follows:
[0043] in, Features and characteristics The number of samples that are all non-zero within the statistical window. and These represent the number of non-zero samples, respectively. For a preset minimum constant, such as It is used to provide smooth protection when the denominator approaches zero due to extreme sparsity or insufficient statistical samples, thus ensuring the runtime stability of the mapping algorithm; This is the distance decay weight, used to penalize feature combinations that are too far apart in the original sequence; for ease of explanation, it can be set as follows: and The correlation coefficient was 0.87. and It is 0.82. and It is 0.31; in, The symbol represents a non-zero feature index, and the number to its right is used to distinguish different feature position numbers; The so-called same physical memory block does not require two features to be absolutely adjacent to the same address unit, but rather that they are located in the same local address segment, so that they are more likely to fall into the same independent sub-block during subsequent cutting; in this way, during local low-rank decomposition, these features with high local topological correlation can be jointly modeled in the same computational context. In the sandbox example, the original index order can be [2,9,3,10]; after correlation calculation and hash mapping, the new address order can be adjusted to [2,3,9,10]; when it is written into the two-dimensional matrix, 2 and 3 will enter the same area first, and 9 and 10 will enter another area; in this way, the problem of related features scattered in the global space is transformed into the problem of related features appearing jointly in local blocks; As a fallback, if the correlation between multiple feature pairs is below the threshold, it indicates that there is no stable local topology within the current sample window. In this case, the system can degenerate into mapping according to the original index order, or adopt a lower-intensity hash bucketing method, instead of forcibly creating clusters. If a feature has a high correlation with multiple sets of features, resulting in mapping conflicts, the system can prioritize retaining the set with the highest correlation and postpone the processing of the remaining conflicting relationships to adjacent address segments. If the sliding window is too short, resulting in large noise in the correlation estimation, the statistical window can be expanded or historical mapping results can be merged. For example, when samples A24 to A40 from the same device enter the system consecutively, the control module discovers a stable common occurrence pattern of several feature indices within this time period; the system then calculates the local topological correlation between these features and maps groups of indices exceeding a preset threshold to adjacent address regions, generating a new index mapping table for the reconstruction of the two-dimensional matrix and local block processing of subsequent samples. The purpose of this step is to guide address rearrangement with finer-grained local associations, thereby enabling the concentrated presentation of highly active non-zero features in subsequent sub-blocks.
[0044] In a preferred embodiment of the present invention, during the process of independently performing low-rank tensor decomposition on each independent sub-block within the secondary cache to extract the local latent feature vector, the method further includes: calling the underlying matrix operation interface to perform matrix multiplication operations in the secondary cache to eliminate main memory read latency.
[0045] This embodiment provides a low-level matrix operation call mechanism for local decomposition within the cache. Specifically, the previous implementation has limited the low-rank decomposition to closed-loop execution within the L2 cache. However, if matrix multiplication is still processed element-by-element by the upper-level interpreted code, another drawback will occur: although main memory access is reduced, the operator itself does not fully utilize the underlying vectorization capability, resulting in low computation efficiency within the cache. Therefore, this embodiment calls the underlying matrix operation interface to complete the key multiplication steps during the local decomposition process. Specifically, in the iteration of local low-rank decomposition, it is usually necessary to repeatedly perform small-scale matrix multiplications, vector multiplications, or transpose multiplications; with a Taking a sub-block as an example, suppose the current decomposition process requires calculation , where the matrix sum vector All are now residing in the second-level cache; Instead of using an element-wise double loop, the system calls the underlying matrix operation interface, supporting sparse underlying matrix operation interfaces that support irregular mask parsing, such as a custom Sparse-BLAS operator group. Alternatively, it injects minimal neutral values that do not contribute to the fitted gradient into missing placeholders before calling the standard dense interface. This interface uses aligned memory, vector registers, and small-block optimization strategies to directly complete the multiplication calculation in the cache. Since the data involved in the calculation is already in the cache, it is not necessary to read the original sub-block from main memory again after calling the interface, thus concentrating the main overhead of multiplication on the calculation itself rather than the data transfer process. Consider a sandbox example: Suppose that when approximating the decomposition of a certain independent sub-block, the local matrix needs to be:
[0046] Local vectors:
[0047] Get the update vector The system directly calls the underlying matrix operation interface from the second-level cache to obtain... ; Continue using it for this round of local parameter updates, instead of first... or Write back to main memory, and then read it again from the upper layer; this avoids the idle time caused by frequent main memory round trips. In terms of implementation, the underlying matrix operation interface can be an adaptation layer of the standard linear algebra library or an internal interface optimized for small matrix blocks. The key is not the interface name, but its execution conditions: the input blocks, temporary blocks and result blocks involved in the operation are all kept within the controllable range of the second-level cache, and the operation scheduling follows the current cutting dimension. As a fallback, if a certain independent sub-block is too small, so small that the scheduling overhead of calling the underlying matrix operation interface is higher than direct calculation, then the system can take the fast scalar path for such extremely small sub-blocks. If the underlying interface is temporarily unavailable, the system can revert to the basic matrix multiplication implementation, but still prioritize execution within the cache and maintain the general principle of minimizing access to main memory; if the cache capacity is found to be close to the limit during the operation, the number of temporary matrices residing at the same time can be reduced, and the multiplication can be completed in steps; For example, during the local decomposition stage of sample A25, after a valid sub-block is loaded into the second-level cache of the edge host, multiple small-scale matrix multiplications are required to update the local decomposition factors. At this time, the system calls the underlying matrix operation interface to complete these multiplication and vector update operations inside the cache, instead of having the upper-level process traverse the elements one by one. Thus, the local block of sample A25 completes the main numerical calculations within one cache residency cycle. The purpose of this step is to use low-level optimization operators to take over the core multiplication steps of local decomposition within the cache, thereby achieving lower computation latency and better cache utilization.
[0048] In a preferred embodiment of the present invention, the original high-dimensional sparse one-dimensional array is a continuous digital array output by a high-throughput screening device, wherein the continuous digital array includes feature identifiers and floating-point values; the target classification pattern vector is used to indicate the multi-label nonlinear mapping state of the detected sample.
[0049] This embodiment provides an engineering implementation mechanism for input and output data formats. Specifically, to make the aforementioned implementation methods easier to deploy on real devices, this embodiment further clarifies that the input comes from a continuous digital array output by a high-throughput screening device, and the output is a multi-label discrete pattern vector that can be directly called by subsequent modules. In this way, the entire process forms a closed loop from device data access to pattern result generation. Specifically, the continuous digital array output by the screening device can contain two basic types of content: one is feature identifiers, which indicate which feature position the current value corresponds to; the other is floating-point values, which represent the response magnitude of the feature. For example, the device can output several tuples, such as feature ID=102, value=0.83; feature ID=587, value=1.14; feature ID=921, value=0.00. After receiving the data, the edge computing module restores these binary pairs into a high-dimensional sparse one-dimensional array, where the positions of features that do not appear are defaulted to zero or empty; and performs the pure zero column removal, missing value retention, local sensitive hash rearrangement, cache-aware cutting, local decomposition within the cache, attention aggregation, and classification output according to the aforementioned process. Furthermore, in the plasma protein spectrum application scenario of this application, the feature identifier preferably corresponds to the peak number, peak cluster number, peptide segment or protein marker number in the plasma protein spectrum, or corresponds to the derived feature dimension formed after peak extraction, alignment and normalization of the original spectrum; The floating-point value preferably represents the peak intensity, peak area, relative abundance, or its standardized response value of the corresponding feature. Since there are significant differences in the number of effective protein peaks and response distribution among different detection samples, the continuous digital array output by the device side exhibits high-dimensional, sparse, and non-uniform distribution characteristics after recovery, which is consistent with the input form of the aforementioned high-dimensional sparse one-dimensional array. Regarding the output, the target classification pattern vector does not carry a biological interpretation action, but rather serves as a multi-label nonlinear mapping state result; for example, suppose the system defines four pattern states, and the output vector is... When the condition is met, it indicates that the sample simultaneously satisfies the judgment conditions of both Mode 1 and Mode 3; if the output is... If the output is..., it means no mode was triggered; if the output is... This indicates that the sample is mapped to multiple pattern regions simultaneously in the low-dimensional state space; this vector can be directly stored in the result cache, transmitted to the host computer, or used as an index condition for subsequent processes. Furthermore, in engineering implementation, the hepatitis B antibody pattern can be represented as a set of discrete labels. The classifier does not directly output a single value, but outputs the status of multiple candidate patterns related to hepatitis B antibodies. For example, pattern 1, pattern 2, pattern 3, and pattern 4 can be preset to correspond to different antibody combination states, different antibody reaction types, or different plasma protein spectrum mapping partitions. When the protein profile features of a sample simultaneously satisfy multiple pattern regions, the target classification pattern vector allows multiple label bits to be 1 at the same time; thus, the continuous response of the plasma protein profile can be converted into a multi-label discrete expression of the hepatitis B antibody pattern, which is convenient for interfacing with subsequent equipment display, report generation or result verification modules. A sandbox simulation can be further provided; assuming a sample uploads four valid binary pairs from the device: 2, 0.8; 3, 0.7; 9, 1.1; 10, 0.9, the system constructs the corresponding sparse one-dimensional array, obtains the global features after rearrangement and local decomposition, and then outputs the pattern vector by the classifier. This result does not require a one-to-one correspondence with a single label, but allows multiple mode states to be indicated simultaneously, reflecting the multi-label property after nonlinear mapping. As a fallback, if the data uploaded by the device is incomplete, such as only uploading numerical values without feature identifiers, the system cannot correctly refill the high-dimensional array. In this case, the sample should be placed in the exception queue and a re-collection should be requested. If the feature identifier is valid but the floating-point value is out of bounds, such as an outlier value that exceeds the device's defined range, then the feature can be pruned or an anomaly can be marked during the preprocessing stage. If the length of the output pattern vector does not match the current deployed model version, the system will use the model version number as the standard and refuse to write the result to the old format cache in order to avoid parsing errors in the upstream and downstream. For example, during the operation of a high-throughput screening device in the same hospital's testing center, sample A26 uploaded a continuous array of numbers containing feature identifiers and floating-point values through the device interface; The edge computing host recovers the high-dimensional sparse representation of the sample based on these tuples, and completes rearrangement, block division, decomposition and weighting using the aforementioned processing link; the final output target classification pattern vector is written to the local result queue for the display terminal and batch export module to read. The purpose of this step is to clarify the input sources and output formats of the algorithm chain, so as to achieve data interface docking with high-throughput screening equipment and stable expression of multi-label mode results.
[0050] The foregoing has provided a detailed description of one embodiment of the present invention, but this description is merely a preferred embodiment and should not be construed as limiting the scope of the invention. All equivalent variations and modifications made within the scope of the claims of this invention should still fall within the patent coverage of this invention.
Claims
1. A method for classifying hepatitis B antibody patterns based on plasma protein profiles, characterized in that, include: Obtain the host hardware information of the execution environment and extract the cache parameters of the host CPU; Obtain a high-dimensional sparse one-dimensional array and extract the non-zero feature indices from the high-dimensional sparse one-dimensional array; The non-zero feature indexes are mapped using the locality-sensitive hashing algorithm, and the data is reconstructed into a locally dense two-dimensional matrix according to the mapping result. According to the cache parameters and the initial cutting dimension, the two-dimensional matrix is dynamically cut to obtain independent sub-blocks, ensuring that the memory usage of each independent sub-block is less than the capacity corresponding to the cache parameters; The independent sub-blocks are subjected to low-rank tensor decomposition to extract local latent feature vectors; The local latent feature vectors are concatenated, and the features are weighted through a single-layer attention network. The weighted features are then input into a classifier function to output a target classification pattern vector. A dimension update instruction is generated based on a preset dynamic adjustment mechanism to adjust the cutting dimensions of subsequent cuts.
2. The method for classifying hepatitis B antibody patterns based on plasma protein profiles according to claim 1, characterized in that, The process of obtaining a high-dimensional sparse one-dimensional array includes: Receive the original high-dimensional sparse one-dimensional array and perform preprocessing to obtain the high-dimensional sparse one-dimensional array, wherein the preprocessing includes removing pure zero columns and skipping global interpolation calculations; The step of mapping the non-zero feature indexes using a locality-sensitive hashing algorithm and reconstructing the data into a locally dense two-dimensional matrix according to the mapping result includes: The locality-sensitive hashing algorithm is used to map non-zero feature indices with co-occurrence probabilities to adjacent memory addresses, thus obtaining an index mapping table. Based on the index mapping table, the high-dimensional sparse one-dimensional array is reconstructed into the locally dense two-dimensional matrix.
3. The method for classifying hepatitis B antibody patterns based on plasma protein profiles according to claim 1, characterized in that, The step of dynamically cutting the two-dimensional matrix according to the cache parameters and the initial cutting dimension to obtain independent sub-blocks, ensuring that the memory usage of each independent sub-block is less than the capacity corresponding to the cache parameters, includes: The host CPU's hardware configuration register instruction is read to obtain the L2 cache capacity parameter as the cache parameter; Obtain the pre-set safety factor, and calculate and generate the initial cutting dimension based on the second-level cache capacity parameter and the safety factor; Based on the initial cutting dimension, the two-dimensional matrix is dynamically cut into the independent sub-blocks, ensuring that the memory usage of each independent sub-block is strictly less than the product of the secondary cache capacity parameter and the safety coefficient.
4. The method for classifying hepatitis B antibody patterns based on plasma protein profiles according to claim 3, characterized in that, The step of performing low-rank tensor decomposition on the independent sub-blocks and extracting local latent feature vectors includes: The independent sub-blocks are loaded into the L2 cache of the host CPU; Within the secondary cache, a closed-loop low-rank tensor decomposition is performed independently on each independent sub-block to extract the local latent feature vector, wherein the low-rank tensor decomposition process does not require access to main memory.
5. The method for classifying hepatitis B antibody patterns based on plasma protein profiles according to claim 1, characterized in that, The process of concatenating the local latent feature vectors, weighting the features through a single-layer attention network, and inputting the weighted features into a classifier function to output a target classification pattern vector includes: The local latent feature vectors extracted from all the independent sub-blocks are concatenated to obtain the global concatenated feature vector; The global concatenated feature vector is input into the single-layer attention network for feature cross-interaction and dimensionality reduction optimization to obtain the weighted features. The weighted features are input into the classifier function, and the target classification pattern vector is output, wherein the target classification pattern vector is a low-dimensional discrete state vector.
6. The method for classifying hepatitis B antibody patterns based on plasma protein profiles according to claim 3, characterized in that, The step of generating dimension update instructions based on a preset dynamic adjustment mechanism to adjust the cutting dimensions of subsequent cuts includes: Monitor the current cache miss rate of the host machine's central processing unit; When the current cache miss rate is higher than the preset cache miss threshold, the safety factor is reduced, and the cutting dimension is recalculated based on the reduced safety factor to generate the dimension update instruction; When the current cache miss rate is lower than or equal to the preset cache miss threshold, the current security factor remains unchanged, and the current cutting dimension is maintained.
7. The method for classifying hepatitis B antibody patterns based on plasma protein profiles according to claim 2, characterized in that, The preprocessing includes: Identify missing values in the original high-dimensional sparse one-dimensional array; The missing values are retained and the global interpolation calculation is skipped. The original high-dimensional sparse one-dimensional array containing the missing values is directly used as the high-dimensional sparse one-dimensional array to reduce the peak system memory usage.
8. The method for classifying hepatitis B antibody patterns based on plasma protein profiles according to claim 2, characterized in that, The step of mapping non-zero feature indices with co-occurrence probabilities to adjacent memory addresses using the locality-sensitive hashing algorithm to obtain an index mapping table includes: Calculate the local topological correlation degree between each non-zero feature in the high-dimensional sparse one-dimensional array; Based on the local topological correlation, the locality-sensitive hash algorithm is used to map non-zero feature dimensions with local topological correlation greater than a preset correlation threshold to the same physical memory block, thereby generating the index mapping table.
9. The method for classifying hepatitis B antibody patterns based on plasma protein profiles according to claim 4, characterized in that, The process of independently performing low-rank tensor decomposition on each independent sub-block within the second-level cache to extract the local latent feature vector further includes: The underlying matrix operation interface is called to perform matrix multiplication operations in the secondary cache, eliminating main memory read latency.
10. The method for classifying hepatitis B antibody patterns based on plasma protein profiles according to claim 2, characterized in that, The original high-dimensional sparse one-dimensional array is a continuous digital array output by a high-throughput screening device, and the continuous digital array includes feature identifiers and floating-point values; The target classification pattern vector is used to indicate the multi-label nonlinear mapping state of the detected sample.
