A method for searching for a minimum value to increase quantization accuracy of a lookup table

CN122986132APending Publication Date: 2026-10-27INGENIC SEMICON CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510535866.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-27
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0008]1.量化过程中可能会出现精度损失,尤其是在复杂激活函数和非线性变换的情况下

Benefits of technology

[0079]提供了一种对构建查找表表项的方法,通过对最小值的重新设置,让构建的查表项在网络中的损失降低。且不增加额外的计算步骤和扩大表项来增加精度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122986132A_ABST
    Figure CN122986132A_ABST
Patent Text Reader

Abstract

The application provides a method for searching a minimum value to improve quantization precision of a lookup table, comprising the following steps: S1, constructing a lookup table entry; S2, calculating a quantization error of the lookup table; S3, searching an optimal minimum value: dynamically adjusting a minimum value of an input range to reduce a segmentation granularity of a core region; and selecting an input range with the minimum error as an optimal solution by iteratively calculating quantization errors under different minimum values. By resetting the minimum value, the loss of the constructed lookup table entry in the network is reduced, and no additional calculation steps are added and the table entry is not expanded to increase the precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of deep neural network processing technology, and specifically relates to a method for improving the quantization accuracy of lookup tables by searching for the minimum value. Background Technology

[0002] In existing technologies, lookup tables (LUTs) are data structures and techniques used to improve query efficiency. They are typically used to pre-compute and store results, avoiding repetitive calculations at runtime, thus significantly accelerating program execution. Lookup table technology is widely used in various fields of computer science, such as digital signal processing (DSP), graphics processing, database optimization, and cryptography. In machine learning, especially deep learning, the combination of model quantization and lookup tables is an effective means to improve model inference speed and reduce computational resource consumption. For lookup tables with complex activations (LUTs), model quantization primarily reduces the precision in the model (e.g., reducing the bit width of floating-point numbers), enabling hardware to perform inference tasks more efficiently, especially on resource-constrained devices.

[0003] The purpose of lookup tables is to transform complex computational problems into fast indexed lookup processes. By pre-compiling and storing the results of functions or activation values, lookup tables can significantly accelerate the inference process. In model quantization, lookup tables are often used to handle the computation of activation functions or other nonlinear functions (such as ReLU, Sigmoid, Tanh, etc.), which typically involve floating-point calculations but can be optimized using lookup tables.

[0004] In deep neural networks, activation functions are often a computational bottleneck, especially complex ones (such as ReLU, Sigmoid, and Tanh). During quantization, the range of activation functions is typically compressed to a smaller integer range. To further improve inference efficiency, lookup tables are often used to replace the computation of these activation functions.

[0005] By quantizing, the input range of the activation function can be mapped to a smaller range of integers (e.g., 8 bits or less), and a lookup table maps these input values ​​to the corresponding activation values. In this way, calculating the activation function becomes a simple array lookup rather than complex mathematical operations.

[0006] For example, for a quantized sigmoid function, the input value can be an integer index, and the lookup table contains the corresponding value of the sigmoid function, avoiding the complexity of calculating the sigmoid function every time.

[0007] However, the shortcomings of existing technologies are:

[0008] 1. Precision loss may occur during quantization, especially with complex activation functions and nonlinear transformations. The precision of the lookup table needs careful consideration, as it affects the overall performance of the model. This typically leads to a decrease in model accuracy.

[0009] 2. To cover the entire input range, the lookup table size can become very large, especially when dealing with multiple complex activation functions. Managing and optimizing the storage of the lookup table is an important issue.

[0010] In summary, with a limited number of stored entries, the insufficient precision of lookup tables can lead to inaccurate results. Low-precision lookup tables may result in imprecise calculations, especially in applications requiring high-precision calculations, where errors can accumulate and significantly impact the final outcome. Furthermore, compensating for insufficient lookup table precision may require introducing additional calculation steps for error correction or compensation, increasing the workload and reducing efficiency.

[0011] In addition, the technical terms in this field include:

[0012] A lookup table (LUT) is a data structure and technique used to improve query efficiency.

[0013] Quantization refers to converting the parameters and activation values ​​in a neural network from floating-point numbers to fixed-point numbers or lower-bit-width integers. This technique can significantly reduce the storage space and computational cost of the model, making the deployment of neural networks on embedded and mobile devices more efficient. Summary of the Invention

[0014] In order to solve the above problems, the purpose of this application is:

[0015] This paper proposes a method to improve the quantization accuracy of lookup tables, which can improve the quantization accuracy and running efficiency based on the T41 / A1 model.

[0016] Specifically, the present invention provides a method for improving the quantization accuracy of a lookup table by searching for the minimum value, the method comprising the following steps:

[0017] S1: Construct the lookup table entries

[0018] Generate a lookup table based on the original range [min, max] of the input X;

[0019] Divide the input range into equal parts, calculate the function value at each division point, and store it.

[0020] S2: Calculate the lookup table quantization error

[0021] The lookup table is subjected to a quantitative error assessment;

[0022] The quantization error is calculated by comparing the difference between the original value and the lookup table value.

[0023] S3: Search for the optimal minimum value

[0024] The minimum value of the input range is dynamically adjusted to reduce the granularity of the core region segmentation.

[0025] By iteratively calculating the quantization error under different minimum values, the input range with the smallest error is selected as the optimal solution. That is, by iteratively adjusting the minimum value of input X, the optimal minimum value new_min that minimizes the quantization error is searched within the range [new_min,max].

[0026] The optimal minimum value, new_min, is determined by gradually adjusting the minimum value and evaluating the quantization error.

[0027] In step S1, it is assumed that a lookup table for the sigmoid function is constructed:

[0028] The input range is divided into several equal parts, the function value corresponding to each division point is calculated and quantized, and two tables are generated:

[0029] Tabel_y0: Stores the quantized function value;

[0030] Tabel_dy: Stores the difference between adjacent function values;

[0031] The final result is calculated using the linear interpolation formula y = y0 + dxdy, where dx is the ratio of the relative distance between the input value and the split point.

[0032] Step S1 further includes:

[0033] The experimental data was used as the model input activation range of [-30, 6], with a minimum value of -30 and a maximum value of 6; that is, the input range is [-30, 6], which is divided into 32 equal parts; the function value is the output of the Sigmoid function, quantized to an 8-bit fixed-point number;

[0034] (1) Divide the input range of -30 and 6 into 32 equal parts, denoted as x[x0,x1,x2,x3......x31];

[0035] (2) Calculate the corresponding Sigmoid result for all x values, denoted as y[y0,y1,y2,y3......y31]; (3) Quantize all y values ​​into 8-bit numbers, denoted as y_int[qy0,qy1,qy2,qy3......qy31]; (4) Save all y_int values ​​as a Tabel_y0 table, and subtract the previous term from each fixed-point converted term, i.e., [qy1-qy0,qy2-qy1,....qy31-qy30], denoted as Tabel_dy.

[0036] In step S2, multiple points are uniformly sampled within the input range, and the average absolute error between the original quantization result and the lookup table quantization result is calculated. The accuracy of the lookup table is evaluated based on the error. It is assumed that the number of sampling points is 2000. The error calculation includes taking the absolute value of the difference between the original quantization result and the lookup table result and averaging it. Further steps include:

[0037] (1). The input range of -30 and 6 is sampled at 2000 points on average, and the result is obtained by the activation function. The original result is then quantized.

[0038] (2). Construct table entries for the inputs of -30 and 6, and calculate the table lookup quantization results;

[0039] (3) Subtract the original quantification result from the table lookup result, obtain the absolute value of the difference, and calculate the average deviation.

[0040] In step S3, iterative optimization includes:

[0041] The initial minimum value is -30, and the step size is increased by a fixed step size in each iteration until it becomes a positive value;

[0042] The core region is the interval [-10, 10] where the Sigmoid function changes significantly;

[0043] The optimal minimum value is the lower limit of the input range that minimizes the average quantization error.

[0044] The iterative optimization process, used to find the lower bound x_min_v of the input range that minimizes the deviation between the lookup table (LUT) and the target activation function, further includes:

[0045] 1) Initialization Phase

[0046] Initial deviation value:

[0047] avg_deviation_value is initialized to 2^31, which is a maximum value, used for subsequent comparisons and to store the minimum deviation.

[0048] Input sampling:

[0049] Generate a linear space array x_input, ranging from the current min_value to the max_value, with a total of SAMPLE_NUM points, excluding the max_value, to evaluate the bias;

[0050] Termination conditions:

[0051] stop_min_value = 0.0, the loop ends when x_min_v exceeds this value;

[0052] Initial search value:

[0053] x_min_v is adjusted step by step starting from min_value;

[0054] 2). Iterative optimization process

[0055] Loop condition:

[0056] As long as x_min_v < stop_min_value, the loop continues, where it is assumed that min_value is negative and stop_min_value is 0;

[0057] Key operations:

[0058] Generate LUT:

[0059] Call the generate_lut function to generate a lookup table according to the current x_min_v, max_value, and quantization parameters;

[0060] The parameters include the quantization bit width QUANTIZE_BITWIDTH and the activation function name activate_name, which can be used for non-linear quantization or specific function approximation;

[0061] Calculate deviation:

[0062] Call compute_deviation to calculate the deviation value lut_pos_deviation_val between the current LUT and x_input;

[0063] Mean Squared Error MSE or maximum error can be used as the indicator;

[0064] Update the optimal value:

[0065] If the current deviation ≤ avg_deviation_value_, update avg_deviation_value_ and the optimal lower limit new_input_min;

[0066] Iteration step size:

[0067] x_min_v increases by a fixed step size each time, assuming the fixed step size is 1.0, until the loop exits;

[0068] 3). Output result

[0069] Optimal solution:

[0070] After the loop ends, new_input_min is the lower limit of the input range that minimizes the LUT deviation, and avg_deviation_value_ is the minimum deviation value.

[0071] The method further includes step S0:

[0072] Input the original data X, whose original range is [min, max];

[0073] Input the target range [new_min, max], where new_min is the minimum value to be optimized.

[0074] The method further includes step S4:

[0075] Based on the optimal minimum value new_min, the entries of the lookup table are reconstructed.

[0076] The method is applicable to the quantization lookup table optimization of activation functions, including but not limited to the Sigmoid function.

[0077] The method is applicable to the fields of image processing, signal processing, or data compression.

[0078] Therefore, the advantage of this solution is:

[0079] This paper presents a method for constructing lookup table entries that reduces network loss by resetting the minimum value, without adding extra computational steps or expanding the table entries to increase accuracy. Attached Figure Description

[0080] The accompanying drawings, which are provided to further illustrate the invention and form part of this application, are not intended to limit the scope of the invention.

[0081] Figure 1 This is a flowchart of the method described in this application.

[0082] Figure 2 This is a schematic diagram of the main code implementation of step S1 of this method.

[0083] Figure 3 This is a schematic diagram of the main code implementation of step S2 of this method.

[0084] Figure 4 This is a diagram of the sigmoid activation function.

[0085] Figure 5 This is a schematic diagram of the main code implementation of step S3 of this method. Detailed Implementation

[0086] To better understand the technical content and advantages of the present invention, the present invention will now be described in further detail with reference to the accompanying drawings.

[0087] This application relates to a method for improving the quantization accuracy of lookup tables by searching for minimum values, combining the ideas of lookup tables and linear interpolation:

[0088] When the values ​​in a lookup table are not precise enough, linear interpolation can compensate for this deficiency. Specifically, for a given input value, the corresponding values ​​in the lookup table might be two points far removed from its true value. Linear interpolation allows for the calculation of a more accurate result based on the values ​​at these two points.

[0089] like Figure 1 As shown, the overall process is a loop, ending with the search table entry built from the found optimal minimum value. This includes:

[0090] Input raw data

[0091] Input variable X, whose original range is [min, max];

[0092] Enter target range

[0093] Specify the target range [new_min,max] for subsequent lookup table adjustments;

[0094] Step S1: Construct lookup table entries

[0095] The lookup table (LUT) entries are initially constructed based on the original range [min, max].

[0096] Step S2: Calculate the lookup table quantization error

[0097] Perform a quantitative error analysis on the current lookup table to assess whether its accuracy meets the requirements;

[0098] Step S3: Search for the optimal minimum value (new_min)

[0099] The quantization error was minimized by optimizing and adjusting new_min.

[0100] Determine the optimal new_min value, find the new_min value that minimizes the quantization error, and use it as the final adjustment parameter;

[0101] Reconstruct the lookup table entries:

[0102] A high-precision lookup table is regenerated using the optimized range [new_min,max].

[0103] Process Summary:

[0104] This process iteratively optimizes new_min to ensure that the lookup table has the best quantization accuracy within the target range.

[0105] Furthermore, specifically including:

[0106] Step S1: Construct lookup table entries

[0107] This invention is based on the idea of ​​combining lookup tables and linear interpolation, and explores better solutions based on that.

[0108] Conditions set: Considering the balance between storage space and precision of the lookup table, the unit of storage is 32 entries.

[0109] Suppose the input value x1 is within a certain range in the lookup table, find its two left and right neighboring points, x1 and x2 respectively, and the corresponding lookup table values ​​are y1 and y2 respectively;

[0110] Based on the linear interpolation formula:

[0111]

[0112] dy represents y2-y1;

[0113] dx represents (x-x1) / (x2-x1);

[0114] Simplify to y = y0 + dx * dy;

[0115] The y-value is the final result, and two tables are set up:

[0116] Tabel_dy stores y<i+1> -y That is, each subsequent term minus the preceding term;

[0117] Tabel_y0 stores y That is, each preceding term.

[0118] Taking the construction of a lookup table entry for the sigmoid function as an example:

[0119] Based on experimental data, the activation range of the model input is [-30, 6], with a minimum of -30 and a maximum of 6.

[0120] (1) Divide the input range of -30, 6 into 32 equal parts, denoted as x[x0,x1,x2,x3......x31].

[0121] (2) Calculate the corresponding Sigmoid result for all x values, denoted as y[y0,y1,y2,y3......y31];

[0122] (3) Quantize all y values ​​into 8-bit numbers (quantization is not the focus of this invention), denoted as y_int[qy0,qy1,qy2,qy3......qy31];

[0123] (4) Save all y_int values ​​as a table named Tabel_y0

[0124] Subtract the previous term from each term after the fixed-point transformation, i.e., [qy1-qy0,qy2-qy1,....qy31-qy30], denoted as Tabel_dy.

[0125] Main code implementation, such as Figure 2 As shown, the process includes:

[0126] 1) Initialization phase

[0127] Create two integer vectors, Tabel_dy and Tabel_y0, to store the difference value and the initial value, respectively. Generate 32 uniformly distributed sampling points x within the input range [x_input_min_value, x_input_max_value].

[0128] 2) Function calculation stage

[0129] For each sampling point x, the corresponding function value y is calculated using the specified activation function action_func;

[0130] The activation function type is specified by the parameter activate_name;

[0131] 3) Quantification Processing Stage

[0132] The calculated function value y is then quantized.

[0133] Each y value is multiplied by the quantize_param.scale(scaling factor);

[0134] In addition, there is the quantization parameter quantize_param.zero_point (zero offset);

[0135] Convert the quantized result into an integer for storage;

[0136] 4) Lookup table construction stage

[0137] Traverse the first 32 sampling points (assuming y contains 33 points):

[0138] Calculate the difference between adjacent points: y[index+1]-y[index];

[0139] Convert the difference value to int32_t type and store it in Tabel_dy;

[0140] Convert the function value at the current point to int32_t type and store it in Tabel_y0;

[0141] 5) Output Results

[0142] Ultimately, two lookup tables are generated:

[0143] Tabel_dy: Stores the difference between adjacent sampling points (used for linear interpolation);

[0144] Tabel_y0: Stores the initial function values ​​for each sampling point.

[0145] The technical features are explained below:

[0146] A uniform sampling strategy was adopted to generate 32 key points within a specified interval;

[0147] Supports multiple activation functions, specified via the activate_name parameter;

[0148] Includes a complete quantization process (scaling + zero-point offset);

[0149] The constructed difference table Tabel_dy can be used for subsequent linear interpolation calculations;

[0150] The initial value table Tabel_y0 provides the baseline function values;

[0151] Suitable for hardware acceleration scenarios that require efficient implementation of complex functions.

[0152] Step S2: Calculate the lookup table quantization error

[0153] The main purpose here is to calculate the error between the original input data and the value obtained from the lookup table. This error guides us to determine an evaluation criterion. The larger the error, the greater the precision loss caused by the constructed table, and vice versa.

[0154] (1). The input range of -30 and 6 is sampled at 2000 points on average, and the result is obtained by activation function. The original result is then quantized.

[0155] (2). Construct table entries for the inputs of -30 and 6, and calculate the table lookup quantization results.

[0156] (3) Subtract the original quantification result from the table lookup result, obtain the absolute value of the difference, and calculate the average deviation.

[0157] Main implementation code, such as Figure 3 As shown, it includes:

[0158] 1) Input data preparation stage

[0159] Generate 2000 uniformly distributed sampling points x_input within the given range [min_value, max_value].

[0160] For each sampling point x_input, the original output value y_ori is calculated using the specified activation function action_func;

[0161] 2) Quantification Processing Stage

[0162] The original output value y_ori is quantized to conform to the specified quantization bit width QUANTIZE_BITWIDTH;

[0163] The quantization process is handled using the quantize_param parameter;

[0164] 3) Lookup table calculation stage

[0165] Input data preprocessing:

[0166] Adjust the input x by offset: x[i] = x[i] + |x_input_min_value|;

[0167] Normalization: Map x[i] to the interval [0,1];

[0168] Fixed-point conversion: Converts the normalized value into a fixed-point representation with a bit width of INPUT_FIXPOINT_BITWIDTH;

[0169] Lookup table queries and calculations:

[0170] Decompose the fixed-point-scaled input x_new_quantize:

[0171] Take the high 10 bits as the lookup table index x_new_indices;

[0172] Take the remaining bits as the interpolation coefficient ceof;

[0173] The difference value dy and the initial value y0 are obtained from the lookup tables _dy and _y0 based on the index;

[0174] Perform linear interpolation calculation: y_new=ceof*dy+y0*2^10;

[0175] The interpolation result is dequantized and clipped to obtain the final output y_lut.

[0176] 4) Accuracy assessment stage

[0177] Calculate the absolute error between the raw quantized output y_ori and the lookup table output y_lut;

[0178] The average error of all sampling points is calculated to obtain the mean absolute error avg_deviation_value; this error value is used to evaluate the accuracy of the lookup table calculation.

[0179] 5) Output Results

[0180] The final output is the quantization result y_lut obtained by the lookup table calculation;

[0181] It also outputs the calculation accuracy evaluation index avg_deviation_value.

[0182] Technical Features Description

[0183] Fixed-point number calculation optimization is adopted to improve computational efficiency;

[0184] Use linear interpolation methods to improve the accuracy of lookup tables;

[0185] The output bit width is controlled by quantization parameters to adapt to different precision requirements. The built-in precision evaluation mechanism can quantify and calculate the error.

[0186] It is suitable for scenarios that require efficient implementation of complex functions, such as neural network activation function calculation.

[0187] Step S3: Search for the optimal minimum value

[0188] This step is the core step of the invention. The main idea is to search for a better input range to construct the entries of the lookup table.

[0189] Taking the sigmoid function as an example, such as Figure 4 As shown in the figure, it is the graph of the sigmoid activation function. It can be seen from the figure that the input x of the core region of the sigmoid function is in the interval of -10 to 10, the decimal part of the rest of the region approaches 0, and the large number part greater than 10 approaches 1. When the counted activation input of the model feature is in the range of -30 to 6, dividing this interval into 32 equal parts to construct a table will cause more error loss. When the interval range of this part of the input x is narrowed to allow finer-grained division in the core region, the loss will be greatly reduced.

[0190] The main implementation code is as Figure 5 shown, including:

[0191] 1). Initialization phase

[0192] Initial deviation value:

[0193] avg_deviation_value_ is initialized to 2^31 (a very large value), which is used for subsequent comparison and storage of the minimum deviation.

[0194] Input sampling:

[0195] Generate a linear space array x_input, ranging from the current min_value to max_value, with a total of SAMPLE_NUM points (excluding max_value), for evaluating the deviation.

[0196] Termination condition:

[0197] stop_min_value=0.0, the loop ends when x_min_v exceeds this value.

[0198] Initial search value:

[0199] x_min_v is gradually adjusted starting from min_value.

[0200] 2). Iterative optimization process

[0201] Loop condition:

[0202] As long as x_min_v < stop_min_value (usually min_value is negative and stop_min_value is 0), the loop continues.

[0203] Key operations:

[0204] Generate LUT:

[0205] Call the generate_lut function to generate a lookup table based on the current x_min_v, max_value, quantization parameters and other parameters.

[0206] Parameters include the quantization bit width (QUANTIZE_BITWIDTH), activation function name (activate_name), etc., which may be used for nonlinear quantization or approximation of specific functions.

[0207] Calculate the deviation:

[0208] The compute_deviation function is called to calculate the deviation value lut_pos_deviation_val between the current LUT and x_input.

[0209] Mean squared error (MSE) or maximum error may be used as indicators.

[0210] Update the optimal value:

[0211] If the current deviation is less than or equal to avg_deviation_value_, then update avg_deviation_value_ and new_input_min (optimal lower bound).

[0212] Iteration step size:

[0213] x_min_v increases by 1.0 each time (fixed step size) until the loop exits.

[0214] 3) Output Results

[0215] Optimal solution:

[0216] After the loop ends, new_input_min is the lower limit of the input range that minimizes the LUT deviation, and avg_deviation_value is the minimum deviation value.

[0217] This code flow describes an iterative optimization process for finding the lower bound (x_min_v) of the input range that minimizes the deviation between the lookup table (LUT) and the target activation function.

[0218] The compute_deviation function has already been implemented in step S2, which calculates the average deviation.

[0219] The minimum value is incremented by 1 each time until it becomes positive. The error is calculated by narrowing the input x region and the y-values ​​after function activation of the original x region. A minimum error is found, i.e., an optimal minimum value x_min is found. The table entries constructed using the newly found minimum value of the input x will improve the lookup accuracy.

[0220] In summary, the actual test data achievable by this invention are as follows:

[0221] Taking the YOLOv5S network as an example: Activation is performed using Silu.

[0222] If the minimum value is not searched, the test precision is:

[0223] mAP50 mAP50-95: 0.535 0.346

[0224] Precision of constructing lookup table entries by searching for the minimum value:

[0225] mAP50 mAP50-95: 0.557 0.364

[0226] As you can see, the accuracy of the result has improved by 2 points.

[0227] This technical solution can be applied to the Ingenic T40, T41, A1, T32 series chips and similar chips.

[0228] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, various modifications and variations can be made to the embodiments of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for improving the quantization accuracy of a lookup table by searching for the minimum value, characterized in that, The method includes the following steps: S1: Construct the lookup table entries Generate a lookup table based on the original range [min, max] of the input X; Divide the input range into equal parts, calculate the function value at each division point, and store it. S2: Calculate the lookup table quantization error The lookup table is subjected to a quantitative error assessment; The quantization error is calculated by comparing the difference between the original value and the lookup table value. S3: Search for the optimal minimum value The minimum value of the input range is dynamically adjusted to reduce the granularity of the core region segmentation. By iteratively calculating the quantization error at different minimum values, the input range with the smallest error is selected as the optimal solution. By iteratively adjusting the minimum value of input X, the optimal minimum value new_min that minimizes the quantization error is searched within the range [new_min,max]. The optimal minimum value, new_min, is determined by gradually adjusting the minimum value and evaluating the quantization error.

2. The method for improving the quantization accuracy of a lookup table by searching for the minimum value according to claim 1, characterized in that, In step S1, it is assumed that a lookup table for the sigmoid function is constructed: The input range is divided into several equal parts, the function value corresponding to each division point is calculated and quantized, and two tables are generated: Tabel_y0: Stores the quantized function value; Tabel_dy: Stores the difference between adjacent function values; The final result is calculated using the linear interpolation formula y = y0 + dxdy, where dx is the ratio of the relative distance between the input value and the split point.

3. The method for improving the quantization accuracy of a lookup table by searching for the minimum value according to claim 2, characterized in that, Step S1 further includes: The experimental data was used as the model input activation range [-30, 6], with a minimum value of -30 and a maximum value of 6; that is, the input range was [-30, 6], and it was divided into 32 equal parts; the function value was the output of the Sigmoid function, quantized to an 8-bit fixed-point number; (1) Divide the input range of -30 and 6 into 32 equal parts, denoted as x[x0,x1,x2,x3......x31]; (2) Calculate the corresponding Sigmoid result for all x values, denoted as y[y0,y1,y2,y3......y31]; (3) Quantize all y values ​​into 8-bit numbers, denoted as y_int[qy0,qy1,qy2,qy3......qy31]; (4) Save all y_int values ​​as Table_y0, and subtract the previous term from each fixed-point transformed term, i.e., [qy1-qy0,qy2-qy1,....qy31-qy30] is denoted as Table_dy.

4. The method for improving the quantization accuracy of a lookup table by searching for the minimum value according to claim 3, characterized in that, In step S2, multiple points are uniformly sampled within the input range, and the average absolute error between the original quantization result and the lookup table quantization result is calculated; the accuracy of the lookup table is evaluated through the error assessment. Assuming the number of sampling points is 2000; error calculation includes taking the absolute value of the difference between the original quantization result and the lookup table result and averaging it; further including: (1) The input range of -30 and 6 is sampled at 2000 points on average, and the result is obtained through the activation function. The original result is then quantized. (2) Construct table entries for the inputs of -30 and 6, and calculate the table lookup quantization results; (3) Subtract the original quantification result from the table lookup result, obtain the absolute value of the difference, and calculate the average deviation.

5. The method for improving the quantization accuracy of a lookup table by searching for the minimum value according to claim 4, characterized in that, In step S3, iterative optimization includes: The initial minimum value is -30, and a fixed step size is added in each iteration until it becomes a positive value; The core region is the interval [-10, 10] where the Sigmoid function changes significantly; The optimal minimum value is the lower limit of the input range that minimizes the average quantization error.

6. The method for improving the quantization accuracy of a lookup table by searching for the minimum value according to claim 5, characterized in that, The iterative optimization process, which is used to find the lower limit x_min_v of the input range that minimizes the deviation between the lookup table LUT and the target activation function, further comprises: 1) Initialization phase Initial deviation value: avg_deviation_value_ is initialized to 2^31, which is a very large value, for subsequent comparison and storage of the minimum deviation; Input sampling: Generate a linear space array x_input, ranging from the current min_value to max_value, with a total of SAMPLE_NUM points and excluding max_value, for deviation evaluation; Termination condition: stop_min_value=0.0, and the loop ends when x_min_v exceeds this value; Initial search value: x_min_v is adjusted step by step starting from min_value; 2] Iterative optimization process Loop condition: As long as x_min_v < stop_min_value, the loop continues, where it is assumed that min_value is negative and stop_min_value is 0; Key operations: Generate LUT: Call the generate_lut function to generate the lookup table according to the current x_min_v, max_value and quantization parameters; The parameters include the quantization bit width QUANTIZE_BITWIDTH and the activation function name activate_name, which can be used for non-linear quantization or specific function approximation; Calculate deviation: Call compute_deviation to calculate the deviation value lut_pos_deviation_val between the current LUT and x_input; Mean square error MSE or maximum error can be used as the indicator; Update optimal values: If the current deviation is ≤ avg_deviation_value_, update avg_deviation_value_ and the optimal lower limit new_input_min; Iteration step size: x_min_v increases by a fixed step size each time, and it is assumed that the fixed step size is 1.0, until the loop exits; 3] Output result Optimal solution: After the loop ends, new_input_min is the lower limit of the input range that minimizes the LUT deviation, and avg_deviation_value_ is the minimum deviation value.

7. The method for improving the quantization accuracy of a lookup table by searching for the minimum value according to claim 1, characterized in that, The method further comprises step S0: Input original data X, whose original range is [min, max]; Input a target range [new_min, max], where new_min is the minimum value to be optimized.

8. The method for improving the quantization accuracy of a lookup table by searching for the minimum value according to claim 1, characterized in that, The method further comprises step S4: Reconstruct the entries of the lookup table based on the optimal minimum value new_min.

9. The method for improving the quantization accuracy of a lookup table by searching for the minimum value according to claim 1, characterized in that, The method is applicable to quantization lookup table optimization of activation functions, including but not limited to the Sigmoid function.

10. A method for improving the quantization accuracy of a lookup table by searching for the minimum value according to claim 1, characterized in that, The method is applicable to the fields of image processing, signal processing or data compression.