Precision-sensitive fine-grained recognition method based on posit-driven symbolic pattern shaping super-dimensional computation
By employing a Posit-driven symbolic pattern shaping hyperdimensional computation method, combined with Posit non-uniform quantization and quantization-aware learnable projection matrix, the problem of accuracy saturation in the HDC scheme at low bit widths is solved, achieving efficient electronic component identification, suitable for FPGA or ASIC platforms.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
- Filing Date
- 2026-04-27
- Publication Date
- 2026-06-02
AI Technical Summary
Existing HDC schemes exhibit weak bit-width sensitivity when the quantization bit width is increased, making it difficult to trigger stable and discriminative sign changes at low bit widths. This leads to the accuracy quickly saturating, making it difficult to achieve high-precision and real-time electronic component identification in automated warehousing and intelligent manufacturing.
The Posit-driven symbol pattern shaping hyperdimensional computation method is adopted. By freezing the pre-activated GAP semantic features of the pre-trained CNN, and combining the Posit-centered dense non-uniform quantization and quantization-aware learnable bipolar projection matrix, bipolar hyperdimensional vectors are generated by taking symbols dimension by dimension. High-speed bit counting is performed through XOR gate array and addition tree circuit to achieve precision-sensitive fine-grained recognition.
While maintaining bitwise inference efficiency, it significantly improves the separability of fine-grained visual classification, reduces low-bit-width quantization error, expands inter-class Hamming separation, improves recognition accuracy, and reduces computational and storage overhead, making it suitable for implementation on FPGA or ASIC platforms.
Smart Images

Figure CN122133515A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of digital integrated circuit and artificial intelligence accelerator design technology, and in particular to a precision-sensitive fine-grained identification method based on Posit-driven symbolic pattern shaping hyperdimensional computation, which is applicable to HDC schemes that are sensitive to fine-grained differences on resource-constrained platforms such as FPGA and ASIC. Background Technology
[0002] In recent years, edge inference pipelines have increasingly relied on aggressive low-bit quantization to reduce arithmetic overhead and memory access pressure. However, when the decision logic is mainly dominated by "linear accumulation + sign thresholding", traditional numerical refinement often fails to translate into effective classification gains. The coupling relationship between numerical representation, quantization geometry, and decision boundaries becomes a key bottleneck limiting performance. With the advent of the Internet of Things (IoT) era, Convolutional Neural Networks (CNNs) have become the mainstream framework for tasks such as image classification, object detection, and speech recognition. However, deep CNN inference remains costly, mainly due to a large number of multiply-accumulate (MAC) operations and frequent memory accesses to weights and intermediate activations. Furthermore, the computational and storage overhead of the final fully connected (FC) layer typically increases approximately linearly with the number of classes C, further exacerbating the resource burden in multi-class scenarios. Therefore, combining CNN feature extraction with a lightweight hyperdimensional computation (HDC) backend has become a promising approach to achieve a trade-off between accuracy and efficiency.
[0003] HDC is a typical symbol-driven reasoning paradigm. Its reasoning is based on symbol encoding and prototype Hamming matching, and it has the advantage of decoupling bitwise operations and class numbers.
[0004] However, existing HDCs mostly employ data-independent random projection coding, which often exhibits weak bit-width sensitivity when the quantization bit width is increased: quantization perturbations often fail to cross the zero threshold of the projection response, thus failing to trigger stable and discriminative sign changes, and the accuracy quickly saturates. Even if non-uniform quantization (such as Posit) that better matches the center distribution can reduce errors at extremely low bit widths, it is still difficult to continuously expand the inter-class Hamming distance and improve the saturation accuracy level under fixed random projection.
[0005] Especially in the fields of automated warehousing and intelligent manufacturing, the task of identifying the model of electronic components usually faces extremely fine-grained challenges: different models of components (such as surface mount capacitors of different capacities or integrated circuits of different batches) have very small differences in appearance, packaging and silkscreen features. Moreover, the complex electromagnetic environment of industrial sites and the limited computing power resources at the edge make it difficult for traditional identification schemes based on high-bit deep neural networks to achieve both high accuracy and real-time performance.
[0006] Therefore, visual fine-grained classification requires a method that can directly shape the projective geometry and symbolic margin and expand inter-class separation under the target bit-width quantization constraint while maintaining bit-by-bit reasoning efficiency. Summary of the Invention
[0007] Purpose of the invention: To provide a precision-sensitive fine-grained identification method based on Posit-driven symbolic pattern shaping hyperdimensional computation, which achieves better accuracy and a trade-off in overhead while maintaining the bit-by-bit inference paradigm of hyperdimensional computation, so as to realize accurate identification of electronic component models in automated warehousing / intelligent manufacturing.
[0008] To achieve the above technical objectives, this invention proposes a precision-sensitive fine-grained identification method based on Posit-driven symbolic pattern shaping hyperdimensional computation, comprising the following steps: The image dataset is used as the original sample input to pre-train and freeze the feature extraction network, obtain the pre-activated output, extract the pre-activated GAP semantic features, and obtain a floating-point feature vector with dimension d, near-zero mean and positive and negative symmetry. Based on the target deployment bit width k, the floating-point feature vector is discretized by non-uniform quantization with Posit center density, mapped to k-bit quantization features, and saturated to the representable range when overflow occurs. The quantization features are input into the quantization-aware learnable bipolar projection matrix. A quantizer consistent with the deployment is inserted into the forward path and weight constraints are applied. After linear projection, the sign is taken dimension by dimension to obtain a bipolar hyperdimensional vector of dimension D. During the training phase, the bipolar hyperdimensional vectors of the same class are accumulated bitwise to form real-valued class centers, and the signs are taken dimension by dimension to generate bipolar class prototypes. A loss function is constructed based on the similarity between the sample and the bipolar class prototype to update the quantized perceptual learnable bipolar projection matrix, and the bipolar class prototype is periodically recalculated. During the inference phase, the bipolar hyperdimensional vector of the image dataset to be identified and the pre-stored bipolar category prototype are fed into a parallel XOR gate array, and high-speed bit counting is performed through an adder tree circuit to obtain the Hamming distance values for each path. The minimum value of the Hamming distance is searched by a hardware numerical comparator to lock the target category index and output the fine-grained recognition result of the quantization accuracy of the image dataset.
[0009] As a preferred embodiment, the feature extraction network is a convolutional neural network, a residual network, or a visual Transformer. The nonlinear activation layers at the ends are removed to retain the positive and negative values of the features, so that the floating-point feature vectors are centered near zero and symmetrically distributed with positive and negative values.
[0010] As a preferred approach, a robust metric is used to normalize and align the floating-point feature vectors by amplitude, and then the Posit non-uniform reconstruction set is quantized dimension by dimension to reduce the low-bit-width quantization error near zero.
[0011] As a preferred embodiment, the quantization-aware learnable bipolar projection matrix stores parameters with floating-point shadow weights, and during forward propagation, the sign of each element is taken to obtain ±1 bipolar weights, which are used to perform matrix-vector multiplication with the quantization features.
[0012] As a preferred approach, the projected response vector is obtained through linear projection, and a sign function is applied to the projected response vector dimension by dimension to generate a bipolar hyperdimensional vector with values of {-1,+1}.
[0013] As a preferred embodiment, the loss function is constructed by equating the inner product score of the original sample and the bipolar class prototype to the Hamming distance affine transformation result, and using this as the classification logits to construct the loss function.
[0014] As a preferred approach, a pass-through estimator is employed, which introduces an alternative gradient into the sign function during backpropagation, enabling the gradient of the loss function to be propagated to the floating-point shadow weights of the quantized-aware learnable bipolar projection matrix, and thereby updating the floating-point shadow weights.
[0015] As a preferred embodiment, the bipolar class prototype is pre-stored in the on-chip register group, and the bipolar hyperdimensional vector and the bipolar class prototype are XORed bit by bit. The sign matching result is converted into the Hamming distance value by bit counting.
[0016] As a preferred option, the above method is applicable to FPGA or ASIC platforms.
[0017] Furthermore, the present invention also proposes an electronic device, which includes a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, it implements the above-mentioned precision-sensitive fine-grained recognition method based on Posit-driven symbolic pattern shaping hyperdimensional calculation.
[0018] Beneficial Effects: This invention proposes a precision-sensitive fine-grained recognition method based on Posit-driven symbolic pattern shaping hyperdimensional computation, achieving better accuracy and a trade-off in overhead while maintaining the bitwise inference paradigm of hyperdimensional computation. This invention uses pre-activated GAP semantic features of a frozen pre-trained CNN as input and employs prototype Hamming matching for decision-making, significantly improving separability in fine-grained visual classification scenarios. Under the target deployment bit-width constraint, Posit non-uniform quantization is introduced to match the distribution of semantic features in the center set, reducing low-bit-width quantization errors and improving low-bit-width accuracy. Simultaneously, through quantization-aware learnable bipolar projection, symbol margin and dimensionality contribution are directly shaped in the projection-symbolization-prototype matching link, more reliably expanding inter-class Hamming separation and thus raising the achievable accuracy saturation level. Furthermore, the inference backend of this invention is entirely composed of an XOR gate array, an adder tree circuit, and a hardware numerical comparator, completely eliminating the dependence on high-overhead multipliers. Because hyperdimensional computing has the characteristic of class number decoupling, when the number of classes is expanded, only the on-chip storage resources and the number of parallel comparisons need to be increased linearly. Compared with traditional fully connected classification heads, it has better energy efficiency and resource scaling characteristics, which significantly improves the hardware implementation friendliness on FPGA or dedicated accelerator. Attached Figure Description
[0019] Figure 1 This is a schematic diagram of the overall process of the precision-sensitive fine-grained recognition method based on Posit-driven symbolic pattern shaping hyperdimensional calculation provided in an embodiment of the present invention.
[0020] Figure 2 This is a schematic diagram comparing the changes in data distribution before and after extracting the pre-activated GAP semantic features of the pre-trained CNN in this invention.
[0021] Figure 3 This is a schematic diagram comparing the inter-class distance performance of the target bit-width driven quantization-aware learnable bipolar projection proposed in this invention with that of traditional random projection.
[0022] Figure 4 Accuracy comparison curves of the proposed method provided in the embodiments of the invention on CIFAR-100 and Caltech-256.
[0023] Figure 5 Accuracy-cost tradeoff curves of the proposed method provided in the embodiments of the invention on CIFAR-100 and Caltech-256.
[0024] Figure 6 The proposed method provided in this invention relates to the inference energy consumption relationship of traditional fully connected systems as category C increases. Detailed Implementation
[0025] In the following description, numerous specific details are set forth in order to provide a more thorough understanding of the invention. However, it will be apparent to those skilled in the art that the invention can be practiced without one or more of these details. In other instances, certain technical features well-known in the art have not been described in order to avoid obscuring the invention.
[0026] The embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.
[0027] Example 1: See Figure 1 This embodiment discloses a precision-sensitive fine-grained identification method based on Posit-driven symbolic pattern shaping hyperdimensional computation, the steps of which are as follows: S1. Input the original sample into the pre-trained and frozen feature extraction network, remove the terminal activation layer before the GAP to obtain the pre-activated output, extract the semantic features of the pre-activated GAP, and obtain a floating-point feature vector with dimension d, near-zero mean and positive and negative symmetry. S2, based on the target bit width k, uses Posit-centered dense non-uniform quantization to discretize the d-dimensional features, mapping them to k-bit representation, and saturates them to the representable range when overflowing, so as to improve the reconstruction resolution near zero and reduce the low bit width quantization error; S3, input the quantized features into the quantized perceptual learnable bipolar projection matrix (QLBP), insert the quantizer consistent with the deployment in the forward pass and apply ±1 weight constraints, and after linear projection, take the sign dimension by dimension to obtain a bipolar hyperdimensional vector of dimension D. S4. During the training phase, real-valued class centers are formed by accumulating the same type of bipolar hyperdimensional vectors position by position, and the signs are taken to generate bipolar class prototypes. The loss is constructed based on the similarity between the samples and the prototypes to update the projection matrix, and the prototypes are periodically recalculated to stabilize the optimization. S5, during the inference phase, the bipolar hyperdimensional vector of the query sample and the prototypes of each category in the pre-stored on-chip register group are fed into the parallel XOR gate array, and the addition tree circuit is driven to perform high-speed bit counting operation to convert the symbol matching result into the Hamming distance value of each path. S6 drives the hardware numerical comparator to perform real-time polling and minimum value search on the Hamming distance of each path, locks the target category index, and outputs the recognition result to the external interface; it uses backend bitwise inference and comparison logic to realize the low-energy calculation process when expanding the number of categories.
[0028] In a further embodiment, step S1 is as follows: The input space is shifted from the original pixels to the semantic features of the intermediate layer of the convolutional neural network. By removing the terminal activation layer before global average pooling to retain the positive and negative values of the features, the d-dimensional floating-point features contain both positive and negative values and are centered around zero. This allows for the acquisition of a higher-level semantic representation than the pixel input while preserving the symbolic information.
[0029] In a further embodiment, step S2 is as follows: Based on the target bit width k, Posit non-uniform quantization discretization is performed on d-dimensional floating-point semantic features. A robust scale is used to normalize and align feature amplitudes, avoiding outliers from dominating the quantization dynamic range and compressing the effective resolution near zero. Subsequently, at this scale, quantization is performed dimension-wise according to the Posit non-uniform reconstruction set, mapping continuous features to a k-bit discrete representation. Since semantic features are more concentrated near zero, Posit provides a denser hierarchy near zero, which can reduce low-bit-width quantization errors and improve low-bit-width classification accuracy. When the bit width enters the accuracy saturation range, sign flips become scarce, and the gain of Posit relative to uniform quantization weakens accordingly. Therefore, this invention further shapes the sign margin at the target bit width using QLBP to improve the saturation accuracy level.
[0030] In a further embodiment, step S3 is as follows: The d-dimensional quantized features obtained in step S2 are input into the quantization-aware learnable bipolar projection matrix. A quantizer with the same bit width as the actual deployment is explicitly inserted in the forward path to ensure that the numerical representation of training and deployment inference is consistent with the quantization error. At the same time, a ±1 bipolar constraint is applied to the projection matrix weights, limiting the projection weight values to {-1, +1} and facilitating subsequent implementation with low-bit addition / subtraction and bitwise logic. Then, linear projection of the quantized features is performed using the bipolar projection matrix to obtain a projection response vector z of dimension D. A sign function is applied to z dimension by dimension to output a bipolar hyperdimensional vector H∈{-1, +1} of dimension D, which is used for subsequent prototype matching and distance measurement.
[0031] In a further embodiment, step S4 is as follows: During the training phase, an optimization objective is first constructed based on the similarity between the bipolar hyperdimensional vectors encoded from the training samples and the bipolar prototypes of each category. The inner product score between a sample and a category prototype is equivalent to the Hamming distance (difference only by affine transformation) and can be used as the classification logits for softmax. During backpropagation, a pass-through estimator (STE) is used to introduce a substitute gradient into the sign function during forward propagation. This allows the gradient of the loss function to be propagated to and updated in the floating-point shadow parameter of the bipolar projection matrix, thereby increasing the similarity between the sample and its true category prototype and decreasing the similarity with non-true category prototypes, thus improving class separability and decision stability. Subsequently, the bipolar hyperdimensional vectors of each training sample within the same category are accumulated bit-by-bit to form real-valued class centers, and the signs of these real-valued class centers are determinated dimension-by-dimensional to generate bipolar category prototypes.
[0032] In a further embodiment, step S5 is as follows: During the inference phase, the query sample is input into the bipolar projection matrix frozen after the training phase and encoded to obtain the corresponding bipolar hyperdimensional vector. Then, the bipolar hyperdimensional vector and the prototypes of each category in the pre-stored on-chip register group are fed into the XOR gate array in parallel for a dimension-by-dimensional bitwise XOR operation, and the addition tree circuit is driven to perform a high-speed bit counting operation on the bits of "1" in the XOR result, converting the matching relationship at the symbol level into the Hamming distance value corresponding to each category path.
[0033] In a further embodiment, step S6 is as follows: The driver hardware numerical comparator performs real-time polling and minimum value search on the Hamming distances of each path produced in step S5 to determine the target category index; then, a recognition instruction is generated based on the minimum value search result, and the final classification recognition result is pushed to the outside in real time through the output interface array; by utilizing the characteristic that the back-end is composed entirely of bit-based logic and comparison circuits, better energy consumption scaling characteristics and inference efficiency are maintained when the number of categories is expanded.
[0034] Example 2: Based on the aforementioned Embodiment 1, this embodiment discloses some specific details of the technical solution.
[0035] The first step is feature extraction and preprocessing. When performing multi-class recognition on N original samples, each sample is first sequentially input into a supervised-trained feature extraction network that is frozen in this method. The feature extraction network can be a convolutional neural network, a residual network, or a visual Transformer, etc., and its function is to map the high-dimensional, strongly correlated original pixel space to a semantic feature space of dimension d. To preserve the positive and negative sign information in the features and obtain a zero-centered numerical distribution, the non-linear activation layers such as Softmax and ReLU are removed before Global Average Pooling (GAP). The linear output at the end (pre-activated output) is directly truncated and then processed by GAP to obtain the feature vector (see [link to GAP] for changes in data distribution before and after GAP semantic features). Figure 2 (As shown). In this way, a total of N d-dimensional floating-point feature vectors are obtained. On the training data, this type of semantic feature usually exhibits a statistical form that is centered near zero, symmetrical with positive and negative values, and unimodal. This makes the input more suitable for subsequent non-uniform quantization and symbolic decision-making, and at the same time, it obtains a more discriminative intermediate semantic representation compared to pixel input.
[0036] Next, non-uniform quantization based on the Posit number system is performed. After obtaining N d-dimensional floating-point feature vectors, this invention constructs a non-uniform reconstruction set consistent with the Posit number system based on the target deployment bit width k. A robust scaling method is used to normalize and align the feature amplitudes to avoid outliers dominating the dynamic range and compress the effective resolution near zero. Subsequently, Posit non-uniform quantization is performed dimension-wise on the d-dimensional floating-point features of each sample, mapping continuous features to a d-dimensional k-bit quantized representation, and saturating to the representable range upon overflow. Since semantic features are more concentrated near zero, Posit provides a denser reconstruction hierarchy near zero, allowing more finite quantization levels to be allocated to high-density regions, thereby effectively reducing quantization errors and improving decision stability at low bit widths. After entering the precision saturation range, quantization perturbations are less likely to cross the zero threshold and trigger sign flipping. Simply increasing the bit width or only changing the quantization grid often fails to significantly improve the achievable precision. Therefore, this invention further combines QLBP with direct shaping projection and sign margin under the target bit width constraint to improve inter-class Hamming separation and increase the saturation precision level.
[0037] Further, optional bit-level ablation analysis is performed. To evaluate information redundancy in floating-point representation from a bit-level perspective, this invention can parse the d-dimensional floating-point features obtained in step S1 into sign bits, exponent bits, and mantissa bits according to the IEEE 754 standard format. Without changing the back-end projection structure, the mantissa bits are progressively truncated or perturbed, and the changes in classification accuracy are observed to quantify the relative contribution of different bit fields to the discrimination. This analysis is used to assist in selecting the target bit width and quantization strategy and does not constitute a mandatory requirement for steps S1–S5. In actual deployment, the unified input interface of the back-end is the k-bit Posit quantization feature output in step S2.
[0038] The subsequent process involves training and constructing the learnable hyperdimensional projection and category prototype for quantization perception. During multiple iterations of the training set, in each training round, steps S1 to S3 are executed sequentially for each training sample to obtain the corresponding d-dimensional k-bit quantized features and a D-dimensional bipolar hyperdimensional vector encoded by QLBP. The parameters of the projection matrix are stored in floating-point form as shadow weights. In each forward propagation, the shadow weights are first signed element-wise to obtain a bipolar weight matrix containing only ±1. A quantizer consistent with the deployment is then explicitly inserted into the forward path to ensure that the numerical representation and quantization error during training are consistent with the deployment. Subsequently, only the bipolar weights and quantized features are used to perform matrix-vector multiplication to obtain a real-valued projection result of dimension D, and then the sign of this result is taken dimension-wise to generate a D-dimensional bipolar hyperdimensional vector.
[0039] For samples of the same category, within the current training epoch, the real-valued prototype center of the category is formed by accumulating the corresponding bipolar hyperdimensional vectors of each sample along the sample dimension. When class decision or loss function construction is required, the sign of the real-valued prototype center is taken dimension by dimension to obtain the bipolar prototype vector of the category. Subsequently, a classification score is constructed based on the similarity between the sample and the bipolar prototypes of each category, and a loss function is constructed in combination with the true label. During backpropagation, the gradient of the sign function used in the forward calculation is approximated by a direct estimation method. The gradient calculated by the bipolar weights and the signified output is approximated and passed back to the corresponding floating-point shadow weights and iteratively updated. At the same time, the category prototypes are periodically recalculated or updated during training to stabilize optimization and suppress prototype drift. Through the above quantized perception training, the projection matrix learns a more suitable dimensional contribution allocation and sign margin under the ±1 constraint and the target bit width constraint, so that the geometric interval between categories gradually increases and the noise dimension is gradually suppressed. Thus, under the condition of given hyperdimensional dimension D and target bit width, the achievable accuracy saturation level is improved to a level higher than that of the fixed random projection scheme.
[0040] During the inference phase, this invention freezes the projection matrix obtained through the aforementioned quantized perception training, retaining only its symbolized bipolar weight matrix. Simultaneously, the fixed-length, low-bit bipolar category prototype vectors obtained by accumulating and renaming during the training phase are written into the prototype storage module. At this point, for any sample to be classified, only one forward computation from feature to hyperdimensional encoding and one similarity calculation with all category prototypes are required to complete the identification: first, the k-bit quantized features of the sample are obtained according to steps S1-S3, and bipolar hyperdimensional encoding is completed.
[0041] Subsequently, step S5 is executed, where the bipolar hyperdimensional vector generated from the query sample and the prototypes of each category pre-stored in the on-chip register group are fed in parallel into a parallel XOR gate array, driving the addition tree circuit to perform a high-speed bit counting operation (Popcount), converting the bit matching results at the symbol level into Hamming distance values corresponding to each path in real time. Next, step S6 is executed, driving the hardware numerical comparator to perform real-time polling and minimum value search on the Hamming distance of each path to lock the target category index, and pushing the final recognition result to the outside in real time through the output interface array.
[0042] During the inference phase, neither the hyperdimensional projection matrix nor the category prototypes are updated. The entire computation process mainly consists of low-bit matrix-vector multiplication, bitwise logic operations, and counting or comparison operations. Since the hyperdimensional dimension D and the quantization bit width of each step are fixed during the design phase, when the number of categories expands from ten levels to several thousand levels, only the storage quantity of the category prototypes and the number of bitwise comparisons need to be increased linearly, without increasing the size of the projection matrix. Compared to a d×C fully connected classification head following the same feature extraction network, its training and inference energy consumption increases significantly with the number of categories, making it suitable for high-energy-efficiency deployment on FPGAs or dedicated accelerators.
[0043] Based on the processing flow formed by the above-mentioned steps, this invention realizes an integrated fine-grained visual classification and recognition method from feature extraction, Posit non-uniform quantization, quantization-aware bipolar projection to prototype similarity calculation. This method uses CNN and other feature extraction networks as the preprocessing front end, improves numerical reconstruction under low bit width through Posit non-uniform quantization, and shapes symbolic patterns and inter-class Hamming separation under target bit width constraints using quantization-aware learnable bipolar projection. Finally, this invention transforms the recognition task into hardware-friendly logic gate array operations and parallel similarity decision-making, while ensuring accuracy superior to random projection HDC, and fully leverages the energy efficiency advantages of bitwise operations, pipelined decision-making, and prototype storage.
[0044] The following example illustrates the algorithm flow of the high-efficiency, learnable, quantized, perceptual hyperdimensional classification method for multi-class recognition according to the present invention.
[0045] Step S101, taking a typical visual image classification task as an example, the input is several sets of three-channel color images. For each original sample, it is first input into a feature extraction network that has been trained under supervision and frozen in this method. The feature extraction network can be a convolutional neural network, a residual network, or a visual Transformer, etc., used to map a high-dimensional, strongly correlated pixel space to a semantic feature space of dimension d. Before global average pooling (GAP), the non-linear activation layers such as Softmax and ReLU at the end are removed, and the linear output at the end is truncated and then processed by GAP to obtain pre-activated semantic features. After this processing, N d-dimensional floating-point feature vectors are obtained for each of the N training samples, providing a regular and consistent input basis for subsequent non-uniform quantization and hyperdimensional projection.
[0046] In step S102, after obtaining N d-dimensional floating-point feature vectors, this invention constructs a Posit non-uniform quantizer based on the target deployment bit width k, and can normalize and align the feature amplitudes using a robust scale. By performing Posit non-uniform quantization dimensionally on the d-dimensional floating-point features of each sample, a d-dimensional k-bit discrete feature representation can be obtained. By comparing the classification results with different bit widths and different quantization strategies, it can be observed that: at low bit widths, the center-dense reconstruction of Posit better matches the high-density semantic feature distribution near zero, which can generally reduce quantization errors and improve decision stability; when the bit width enters the precision saturation range, quantization differences are more difficult to convert into effective sign changes, thus requiring further improvement in saturation precision level by combining subsequent learnable projections.
[0047] Step S103 involves extracting redundant bits from the floating-point representation from a bit-level perspective. In this embodiment, the d-dimensional floating-point features obtained in step S101 are parsed according to the IEEE 754 standard format. Each dimension of the floating-point feature is decomposed into a sign bit, an exponent bit, and a mantissa bit. The impact of different bit fields on classification accuracy is evaluated by gradually truncating the mantissa bit or applying perturbations to help determine the target bit width and quantization strategy. This step is used for analysis and verification and is not a mandatory requirement for the unified deployment interface of this invention; the actual deployment still uses the k-bit Posit quantization features output in step S102 as the backend input.
[0048] Step S104: After completing the above-mentioned quantization feature preparation, this embodiment uses a learnable projection matrix to replace the traditional fixed random projection, and introduces a quantization perception mechanism and ±1 bipolar constraints during the training process (see the comparison between learnable bipolar projection and traditional random projection in terms of inter-class distance performance). Figure 3Specifically, the projection matrix parameters are stored as shadow weights in floating-point form. During each forward propagation, the shadow weights are signed element-wise to obtain a bipolar weight matrix. A quantizer consistent with the deployment is inserted into the forward path to ensure consistent quantization errors between the training and deployment phases. Subsequently, the bipolar weights are multiplied by the k-bit quantized features output from step S102 to obtain a real-valued result of dimension D, and the sign is taken dimension-wise to generate a D-dimensional bipolar hyperdimensional vector. For samples of the same class, the bipolar hyperdimensional vector is accumulated bit-wise within the current training round to form a real-valued prototype center, and the sign is taken to obtain the bipolar class prototype. A classification score is constructed based on the similarity between the sample and each class prototype, and the loss function is calculated. In backpropagation, the sign function is approximated using a pass-through estimation gradient approximation. The gradient approximation is then passed back to the floating-point shadow weights and iteratively updated. Simultaneously, the class prototypes are periodically recalculated for stable optimization, thereby improving inter-class separation and raising the accuracy saturation level under the given hyperdimensional dimension D and target bit width constraints.
[0049] In step S105, during the inference phase, this embodiment freezes the projection matrix obtained through the above-mentioned quantization perception training, retaining only its symbolized bipolar weight matrix, and writes the bipolar prototypes of each category obtained at the end of training into the prototype storage module. For any sample to be classified, only one forward computation from feature to hyperdimensional encoding and one similarity calculation with all category prototypes are required to complete the identification: First, the k-bit quantized features of the sample are obtained according to steps S101-S102, and then a D-dimensional bipolar hyperdimensional vector is obtained by projection and dimensional sign-by-dimensional extraction using a fixed bipolar weight matrix; subsequently, the bipolar hyperdimensional vector and each category prototype pre-stored in the on-chip register group are fed into a parallel XOR gate array, and the addition tree circuit is driven to perform a high-speed bit counting operation (Popcount). This step converts the bit matching relationship at the symbol level into Hamming distance values representing the similarity of each path in real time, completing the hardware mapping from the high-dimensional symbol space to the low-bit numerical space.
[0050] In automated warehousing systems, it is necessary to sort thousands of surface-mount inductors and capacitors with similar appearances. Using the method described in this embodiment, a front-end edge camera captures high-resolution images of the components. Pre-activated GAP features are extracted using a frozen lightweight convolutional neural network, and then mapped to the symbol space via Posit non-uniform quantization and QLBP hyper-dimensional projection. Because this method effectively amplifies the Hamming distance between fine-grained models, it maintains high-precision identification of components of different specifications even under noise interference in the electrical control environment or low-bit-width storage constraints. Furthermore, its class-number decoupling characteristic means that when a new component model is added to the warehouse, only the prototype storage module needs to be updated, without retraining a complex fully connected classification head, greatly improving the dynamic scalability of the warehousing system and the flexibility of the production line.
[0051] In step S106, after obtaining the Hamming distances for each path, the hardware numerical comparator is driven to perform real-time polling and minimum value search on all distance values to lock the target category index. This process is implemented entirely by combinational logic circuits and does not rely on complex software branch prediction. Subsequently, the system pushes the final recognition result to the outside in real time through the output interface array of the end-side device.
[0052] Figure 4 The figure shows the accuracy comparison curves of this method (QLBP) on CIFAR-100 and Caltech-256. Figure 5 The diagram shows the accuracy-cost trade-off curves of our proposed method on CIFAR-100 and Caltech-256. It can be seen that our method significantly outperforms the baseline method across all bit widths, especially in the low bit width range (k ≤ 6), where accuracy improves rapidly and quickly converges. Simultaneously, although the system cost increases significantly with increasing bit width, the model's accuracy essentially saturates around k = 6. In summary, our method maintains high recognition accuracy under low bit width conditions. In practical deployments, selecting a medium to low bit width allows for significant savings in computational and storage costs while achieving near-saturation accuracy, demonstrating an excellent trade-off between accuracy and cost.
[0053] Throughout the inference process, the hyperdimensional projection matrix and category prototypes are not updated. The computation process mainly consists of low-bit logic XOR, addition tree counting, and numerical comparison operations. Since the hyperdimensional dimension D is fixed, when the number of categories C expands, only the storage bit width of the prototype and the parallelism of the comparator array need to be increased linearly, without modifying the front-end projection structure. Compared to traditional fully connected (FC) classification heads, the inference energy consumption of the back-end of this invention increases significantly with the number of categories (see...). Figure 6 , Figure 6 It is known that the inference overhead of the traditional FC connection and the QLBP or HDC of this invention intersects at 54, and the inference overhead of both is reduced by about 78.6%, showing extremely high energy efficiency, which is suitable for high throughput deployment on FPGA or dedicated ASIC accelerators.
[0054] The method disclosed in this embodiment possesses extremely high symbol discrimination capability and energy efficiency at low bit widths, making it particularly suitable for real-time and accurate identification of massive amounts of electronic component models with subtle differences in automated warehousing and intelligent manufacturing production lines. By deploying this algorithm on resource-constrained edge computing nodes (such as robotic arm vision terminals), robust differentiation of minute silkscreen features, pin distributions, and packaging textures on component surfaces can be achieved with extremely low power consumption, supporting the needs of automated material sorting and refined inventory management.
[0055] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A precision-sensitive fine-grained recognition method based on Posit-driven symbolic pattern shaping hyperdimensional computation, characterized in that, Includes the following steps: The image dataset is used as the original sample input to pre-train and freeze the feature extraction network, obtain the pre-activated output, extract the pre-activated GAP semantic features, and obtain a floating-point feature vector with dimension d, near-zero mean and positive and negative symmetry. Based on the target deployment bit width k, the floating-point feature vector is discretized by non-uniform quantization with Posit center density, mapped to k-bit quantization features, and saturated to the representable range when overflow occurs. The quantization features are input into the quantization-aware learnable bipolar projection matrix. A quantizer consistent with the deployment is inserted into the forward path and weight constraints are applied. After linear projection, the sign is taken dimension by dimension to obtain a bipolar hyperdimensional vector of dimension D. During the training phase, the bipolar hyperdimensional vectors of the same class are accumulated bitwise to form real-valued class centers. The signs are taken dimension by dimension to generate bipolar class prototypes. A loss function is constructed based on the similarity between the original samples and the bipolar class prototypes to update the quantized perceptual learnable bipolar projection matrix. The bipolar class prototypes are periodically recalculated. During the inference phase, the bipolar hyperdimensional vector of the image dataset to be identified and the pre-stored bipolar category prototype are fed into a parallel XOR gate array, and high-speed bit counting is performed through an adder tree circuit to obtain the Hamming distance values for each path. The minimum value of the Hamming distance is searched by a hardware numerical comparator to lock the target category index and output the fine-grained recognition result of the quantization accuracy of the image dataset.
2. The precision-sensitive fine-grained recognition method based on Posit-driven symbolic pattern shaping hyperdimensional computation according to claim 1, characterized in that, The feature extraction network is a convolutional neural network, a residual network, or a visual Transformer. The terminal nonlinear activation layer is removed to retain the positive and negative values of the features, so that the floating-point feature vectors are concentrated near zero and symmetrically distributed.
3. The precision-sensitive fine-grained recognition method based on Posit-driven symbolic pattern shaping hyperdimensional computation according to claim 1, characterized in that, A robust metric is used to normalize and align the floating-point feature vectors, and then the Posit non-uniform reconstruction set is quantized dimension by dimension to reduce the low-bit-width quantization error near zero.
4. The precision-sensitive fine-grained recognition method based on Posit-driven symbolic pattern shaping hyperdimensional computation according to claim 1, characterized in that, The quantization perception learnable bipolar projection matrix stores parameters with floating-point shadow weights. During forward propagation, the sign of each element is taken to obtain ±1 bipolar weights, which are used to perform matrix-vector multiplication with the quantization features.
5. The precision-sensitive fine-grained recognition method based on Posit-driven symbolic pattern shaping hyperdimensional computation according to claim 1, characterized in that, The projection response vector is obtained by linear projection. A sign function is applied to the projection response vector dimension by dimension to generate a bipolar hyperdimensional vector with values of {-1,+1}.
6. The precision-sensitive fine-grained recognition method based on Posit-driven symbolic pattern shaping hyperdimensional computation according to claim 1, characterized in that, The loss function is constructed by equating the inner product score of the original sample and the bipolar class prototype to the Hamming distance affine transformation result, and using it as the classification logits to construct the loss function.
7. The precision-sensitive fine-grained recognition method based on Posit-driven symbolic pattern shaping hyperdimensional computation according to claim 4, characterized in that, A pass-through estimator is used to introduce an alternative gradient function to the sign function during backpropagation to update the floating-point shadow weights.
8. The precision-sensitive fine-grained recognition method based on Posit-driven symbolic pattern shaping hyperdimensional computation according to claim 1, characterized in that, The bipolar class prototype is pre-stored in the on-chip register group. The bipolar hyperdimensional vector and the bipolar class prototype are XORed bit by bit. The sign matching result is converted into the Hamming distance value by bit counting.
9. The precision-sensitive fine-grained recognition method based on Posit-driven symbolic pattern shaping hyperdimensional computation according to claim 1, characterized in that, The method is applicable to FPGA or ASIC platforms.
10. An electronic device, characterized in that, The electronic device includes: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, it implements the precision-sensitive fine-grained recognition method based on Posit-driven symbolic pattern shaping hyperdimensional calculation as described in any one of claims 1 to 9.