A SPAD histogram distance calculation method and system based on coarse-fine two-stage mixed processing
By employing a coarse-fine hybrid processing approach and machine learning regression methods, the problems of ranging accuracy and computational efficiency in complex environments of SPAD histogram processing were solved, resulting in a high-efficiency, low-power ranging system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- THE 44TH INST OF CHINA ELECTRONICS TECH GROUP CORP
- Filing Date
- 2026-04-08
- Publication Date
- 2026-05-29
AI Technical Summary
Existing SPAD histogram processing technology suffers from decreased ranging accuracy and stability in low signal-to-noise ratio environments or under multipath interference. Furthermore, high-precision algorithms have high computational complexity and high power consumption, making it difficult to balance ranging accuracy, computational efficiency, and power consumption control in complex environments.
A method based on coarse and fine hybrid processing is adopted. The first stage is fast target detection to obtain coarse distance information. The second stage is dynamically determined to activate high-precision peak position positioning. Combined with a lightweight convolutional neural network, accurate time-of-flight estimation is performed to achieve adaptive processing.
While ensuring ranging accuracy, it significantly improves computing efficiency and reduces power consumption, adapts to different ranging scenarios, and enhances the system's adaptability and overall performance.
Smart Images

Figure CN122110135A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of lidar ranging, specifically relating to a method and system for calculating distance using photon time-of-flight histograms based on SPAD (single-photon avalanche diode) and TCSPC (time-correlated single-photon counting) technologies. Background Technology
[0002] With the rapid development of lidar technology, time-of-flight ranging systems based on single-photon avalanche diode (SPAD) and time-correlated single-photon counting (TCSPC) technologies have been widely used in fields such as autonomous driving, robot navigation, and 3D imaging. This technology forms a histogram by statistically analyzing photon flight times and extracts target distance information through algorithmic processing, offering advantages such as high detection sensitivity and good ranging accuracy.
[0003] Existing time-of-flight distance measurement systems achieve large-scale, high-precision time-of-flight measurements by dynamically adjusting the time unit address to change the time resolution and time interval width of the histogram.
[0004] However, existing SPAD histogram processing techniques still suffer from the following technical problems: First, while traditional fast algorithms such as peak finding and centroid methods are computationally fast, their ranging accuracy and stability drop sharply in low signal-to-noise ratio environments, multipath interference, or time walk effects, making it difficult to meet the high-precision ranging requirements in complex environments. Second, while high-precision algorithms such as matched filtering and maximum likelihood estimation can provide high ranging accuracy, they require a large amount of numerical calculation within the entire histogram time window, resulting in high computational complexity and high power consumption, making it difficult to meet the real-time requirements of applications. Finally, existing technologies lack effective adaptive processing mechanisms and cannot dynamically select appropriate processing strategies based on signal quality, thus making it difficult to balance computational efficiency and power consumption control while ensuring ranging accuracy. Summary of the Invention
[0005] In view of this, the purpose of this invention is to provide a SPAD histogram distance calculation method and system based on coarse and fine two-level hybrid processing to solve the technical problem that existing histogram processing algorithms cannot simultaneously achieve ranging accuracy, calculation efficiency and power consumption control, so as to meet real-time requirements and power consumption control while ensuring ranging accuracy.
[0006] To achieve the above objectives, this invention provides a SPAD histogram distance calculation method based on a coarse-fine two-stage hybrid processing, the technical solution of which is as follows: S1. The photon time-of-flight histogram generated based on SPAD and TCSPC technologies is processed through the first-level processing to perform full-scale fast target detection and obtain the coarse distance information corresponding to the target. S2. Based on the signal characteristics corresponding to the coarse distance measurement information, dynamically determine whether to initiate the second-level processing for the target; S3. If it is determined that the second-level processing is to be initiated, then high-precision peak position positioning will be performed only within the target time window corresponding to the coarse distance measurement information to obtain the target's precise flight time information; if it is determined that the second-level processing is not to be initiated, then the flight time corresponding to the coarse distance measurement information will be directly used as the target's final flight time information. S4. Based on the target's final flight time information, the precise measured distance of the target is calculated and output through the preset mapping relationship between the speed of light and distance.
[0007] Preferably, in step S1, before performing full-frame fast target detection, the original photon time-of-flight histogram is first smoothed by a low-pass filter to reduce random noise in the histogram.
[0008] Furthermore, in step S1, the algorithm used for full-frame rapid target detection is the peak search method or the simplified centroid method. The algorithm is used to quickly scan the entire frame histogram to obtain the coarse distance information of the target.
[0009] Preferably, in step S2, the signal feature is the peak signal strength or signal-to-noise ratio corresponding to the coarse distance measurement information; when the peak signal strength or signal-to-noise ratio is higher than a preset threshold, it is determined that the second-level processing will not be started; when the peak signal strength or signal-to-noise ratio is lower than or equal to the preset threshold, it is determined that the second-level processing will be started.
[0010] Furthermore, in step S3, the target time window is a time interval set around the coarse distance measurement point corresponding to the coarse distance measurement information. The width of the time interval is greater than the width of the system laser pulse response and less than the total time span of the entire frame histogram.
[0011] Preferably, in step S3, the high-precision peak position positioning adopts a peak position positioning method based on machine learning regression. The machine learning regression model is pre-trained and uses histogram data within the target time window as input to output the target's precise flight time information end-to-end.
[0012] Furthermore, the machine learning regression model employs a lightweight convolutional neural network, which sequentially includes an input layer, a hidden layer, a fully connected layer, and an output layer. The number of neurons in the input layer matches the length of the histogram data within the target time window, the hidden layer uses a non-linear activation function, and the output layer outputs the estimated flight time of the corresponding target.
[0013] Preferably, the training dataset for the machine learning regression model is generated through a SPAD system simulation model; the SPAD system simulation model includes at least a laser pulse waveform module, a target and channel module, a noise module, and a histogram generation module, and generates labeled training data covering multiple scenarios by configuring different system parameters; the model training process uses mean squared error as the loss function, and performs loss minimization training through the Adam optimizer until the model converges.
[0014] Furthermore, in step S4, the preset mapping relationship between the speed of light and distance is realized by the following formula: d=c×bin / 2×x_cal, where d is the precise measurement distance of the target, c is the speed of light, bin is the sampling depth corresponding to the peak value, and x_cal is the time width corresponding to each sampling bin.
[0015] This invention also provides a SPAD histogram distance calculation system based on a coarse-to-fine hybrid processing approach, comprising a first-level processor module, a condition judgment module, a second-level processor module, and an output module connected in sequence. The first-level processor module is used to perform full-frame fast target detection on the photon time-of-flight histogram generated by SPAD acquisition to obtain coarse distance information of the target. The condition judgment module is used to dynamically determine whether to activate the second-level processor module based on the signal characteristics corresponding to the coarse distance information. The second-level processor module is used to perform high-precision peak position positioning only within the target time window corresponding to the coarse distance information when a activation command is received, to obtain precise time-of-flight information of the target. The output module is used to calculate and output the precise measured distance of the target based on the final time-of-flight information of the target through a preset mapping relationship between the speed of light and distance.
[0016] The beneficial effects of this invention are as follows: By adopting a coarse-fine hybrid processing architecture, the low accuracy and weak stability of ranging methods when directly using fast algorithms for histogram processing are effectively avoided, while the high computational complexity and high power consumption of high-precision algorithms are also solved. Through a dynamic condition judgment mechanism, the computational complexity is reduced and the adaptability of the SPAD histogram distance calculation algorithm is improved. Combined with a peak position localization method based on machine learning regression, it has strong adaptability and can adapt to different ranging scenarios, which is of great significance for ensuring the accurate distance output of ranging systems based on direct time-of-flight determination.
[0017] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description
[0018] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein: Figure 1 This is a flowchart illustrating the SPAD histogram distance calculation method based on coarse and fine two-stage hybrid processing according to the present invention. Figure 1 ; Figure 2 This is a diagram illustrating the overall architecture of the SPAD histogram distance calculation system based on coarse and fine two-stage hybrid processing according to the present invention. Figure 3 This is a flowchart illustrating the SPAD histogram distance calculation method based on coarse and fine two-stage hybrid processing according to the present invention. Figure 2 ; Figure 4 This is a flowchart illustrating the high-precision signal processing principle of the second-level processor module of the present invention. Figure 5 This is a schematic diagram of the specific structure of the lightweight convolutional neural network of the present invention. Detailed Implementation
[0019] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0020] The accompanying drawings are for illustrative purposes only and are schematic diagrams, not actual pictures. They should not be construed as limiting the invention. To better illustrate the embodiments of the invention, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions. It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.
[0021] In the accompanying drawings of the embodiments of the present invention, the same or similar reference numerals correspond to the same or similar components. In the description of the present invention, it should be understood that if terms such as "upper," "lower," "left," "right," "front," and "rear" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the terms used to describe positional relationships in the drawings are only for illustrative purposes and should not be construed as limiting the present invention. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.
[0022] Please see Figures 1-4 This is a SPAD histogram distance calculation method based on a coarse-fine two-level hybrid processing. This method significantly improves calculation efficiency while ensuring ranging accuracy through a hierarchical processing strategy.
[0023] Specifically, the SPAD histogram distance calculation method based on coarse and fine two-level hybrid processing includes: S1: The photon time-of-flight histogram generated based on SPAD and TCSPC technologies is processed in the first stage to perform full-frame fast target detection, obtaining the corresponding coarse distance information of the target. Before performing full-frame fast target detection, the original photon time-of-flight histogram is first smoothed by a low-pass filter to reduce random noise in the histogram. The histogram after filtering becomes a smooth and continuous curve, effectively reducing the impact of random noise in the system. Full-frame fast target detection uses the peak search method or the simplified centroid method. These algorithms are used to quickly scan the entire frame histogram, traversing the entire histogram data to find all local maximum points and obtain the coarse distance information of the target.
[0024] S2: Based on the signal characteristics corresponding to the coarse distance measurement information, dynamically determine whether to initiate second-level processing for the target. The signal characteristics are the peak signal strength or signal-to-noise ratio (SNR) corresponding to the coarse distance measurement information. When the peak signal strength or SNR is higher than a preset threshold, it is determined that second-level processing will not be initiated, and the preliminary peak result can be directly adopted; when the peak signal strength or SNR is lower than or equal to the preset threshold, it is determined that second-level processing will be initiated. This dynamic judgment mechanism avoids high-complexity processing for all targets, significantly improving overall computational efficiency.
[0025] S3: If the second-level processing is initiated, high-precision peak position positioning is performed only within the target time window corresponding to the coarse distance measurement information to obtain the target's precise flight time information. If the second-level processing is not initiated, the flight time corresponding to the coarse distance measurement information is directly used as the target's final flight time information. The target time window is a time interval set around the coarse distance measurement point corresponding to the coarse distance measurement information. The width of this time interval is greater than the width of the system laser pulse response and less than the total time span of the entire frame histogram. Specifically, a narrow window is defined around each coarse distance measurement point that requires fine processing, with a window width slightly larger than the width of the system pulse response.
[0026] High-precision peak position localization employs a peak position localization method based on machine learning regression. A pre-trained machine learning regression model takes histogram data within the target time window as input and outputs precise time-of-flight information of the target end-to-end. The machine learning regression model uses a lightweight convolutional neural network, which consists of an input layer, hidden layers, fully connected layers, and an output layer. The number of neurons in the input layer matches the length of the histogram data within the target time window. The hidden layers use non-linear activation functions such as ReLU, and the number of neurons in the hidden layers is selected within the range of 32 to 256. The output layer outputs the corresponding estimated time of flight of the target.
[0027] The training dataset for the machine learning regression model is generated using a SPAD system simulation model. The SPAD system simulation model includes a laser pulse waveform module, a target and channel module, a noise module, and a histogram generation module. The laser pulse waveform module generates Gaussian or double Gaussian emitted laser light; the target and channel module simulates target distance, reflectivity, and possible multipath effects; the noise module simulates background light noise conforming to a Poisson distribution and the dark count of the SPAD; the histogram generation module convolves and merges the above effects to generate the final histogram data. By configuring different system parameters, labeled training data covering multiple scenarios can be generated, enabling large-scale, low-cost generation of training datasets covering various scenarios. The model training process uses mean squared error as the loss function, and the Adam optimizer performs loss minimization training until the model converges. The training process continues until the loss function curve tends to plateau, indicating that the model has fully converged.
[0028] S4: Based on the target's final flight time information, the precise measured distance of the target is calculated and output using a preset mapping relationship between the speed of light and distance. The preset mapping relationship between the speed of light and distance is achieved using the formula d = c × bin / 2 × x_cal, where d is the precise measured distance of the target, c is the speed of light, bin is the sampling depth corresponding to the peak value, and x_cal is the time width corresponding to each sampling bin.
[0029] This method employs a two-stage coarse-to-fine hybrid processing strategy. The first stage quickly acquires coarse distance information for the target, while the second stage executes a high-precision algorithm only for targets requiring fine processing within a defined window. This approach ensures both ranging accuracy and computational efficiency. The machine learning-based peak positioning method can achieve high-precision time-of-flight estimation in complex noisy environments, significantly improving the overall performance of the SPAD lidar system.
[0030] Furthermore, the present invention provides a SPAD histogram distance calculation system based on coarse and fine two-level hybrid processing. The system comprises four core components that are electrically connected in sequence: a first-level processor module, a condition judgment module, a second-level processor module, and an output module.
[0031] The first-level processor module, serving as the system's primary processing unit, integrates filtering and peak detection circuits. The filtering circuit performs a filtering operation on the photon time-of-flight histogram generated by SPAD acquisition, achieving a slight smoothing effect and effectively reducing the impact of random noise in the system, making the processed histogram a smooth, continuous curve. The peak detection circuit performs a full-scale rapid scan of the filtered histogram data using either a peak-finding method or a centroid method, traversing the entire histogram data to find all local maxima points, thereby obtaining coarse distance information about the target. The function of this module is to quickly complete target detection, providing fundamental data support for subsequent precise processing.
[0032] The condition judgment module is electrically connected to the output of the first-level processor module and internally contains a signal strength analysis circuit and a window definition circuit. After receiving the coarse distance measurement information, the signal strength analysis circuit analyzes the corresponding signal characteristics and dynamically determines whether to activate the second-level processor module by evaluating the signal strength and signal-to-noise ratio (SNR) parameters. When the SNR of the initial peak value obtained from the first-level signal processing is extremely high, the system can directly use the initial peak value result without activating the second-level processing. When the second-level processing needs to be activated, the window definition circuit defines a narrow target time window around each coarse distance measurement point requiring fine processing. The window range is set to A units before and after the coarse distance measurement point, where A is a preset value, typically slightly larger than the width of the system impulse response.
[0033] The second-level processor module is activated upon receiving the start command from the conditional decision module. Internally, this module constructs a machine learning regression model based on a convolutional neural network. This model structure includes an input layer, hidden layers, fully connected layers, and an output layer. The number of neurons in the input layer corresponds to the length of the input data segment. The number of neurons in the hidden layer is selected from 32 to 256 and uses the ReLU non-linear activation function. The output layer contains one or more neurons for predicting the time of flight. The second-level processor module executes the high-precision peak position localization algorithm only within the target time window determined by the conditional decision module. It directly outputs accurate time-of-flight values through the trained machine learning regression model, obtaining precise time-of-flight information for the target. This module employs computationally complex algorithms to ensure ranging accuracy while effectively controlling the computational load by limiting the processing range.
[0034] The output module is electrically connected to both the second-level processor module and the condition judgment module. Internally, it includes a distance conversion circuit and a data output interface. The distance conversion circuit calculates the distance based on the target's final flight time information using a preset mapping relationship between the speed of light and distance. The conversion formula is d = c × bin / 2 × x_cal, where c is the speed of light, bin is the sampling depth corresponding to the peak value, and x_cal is the width of each bin. When the condition judgment module determines that the second-level processor module should be activated, the output module performs the distance conversion based on the precise flight time information provided by the second-level processor module. When the condition judgment module determines that the second-level processor module should not be activated, the output module directly performs the distance conversion based on the flight time corresponding to the coarsely measured distance information. After the conversion is complete, the precise measured distance of the target is output through the data output interface.
[0035] The system works as follows: The photon time-of-flight histogram acquired by the SPAD first enters the first-level processor module for rapid full-frame scanning, obtaining coarse distance information about the target. A conditional decision module intelligently decides whether further precise processing is needed based on signal characteristics. If the signal quality meets the requirements, the result is output directly; if higher precision is required, the second-level processor module is activated to perform precise positioning within a defined window. Finally, the output module calculates the precise target distance based on the obtained time-of-flight information. This coarse-to-fine two-level hybrid processing architecture ensures ranging accuracy while effectively controlling computational complexity, achieving a balance between high efficiency and high precision.
[0036] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A SPAD histogram distance calculation method based on coarse-fine two-stage hybrid processing, characterized in that, Includes the following steps: S1. The photon time-of-flight histogram generated based on SPAD and TCSPC technologies is processed through the first-level processing to perform full-scale fast target detection and obtain the coarse distance information corresponding to the target. S2. Based on the signal characteristics corresponding to the coarse distance measurement information, dynamically determine whether to initiate the second-level processing for the target; S3. If it is determined that the second-level processing is to be initiated, then high-precision peak position positioning will be performed only within the target time window corresponding to the coarse distance measurement information to obtain the target's precise flight time information; if it is determined that the second-level processing is not to be initiated, then the flight time corresponding to the coarse distance measurement information will be directly used as the target's final flight time information. S4. Based on the target's final flight time information, the precise measured distance of the target is calculated and output through the preset mapping relationship between the speed of light and distance.
2. The SPAD histogram distance calculation method based on coarse and fine two-stage hybrid processing according to claim 1, characterized in that, In step S1, before performing full-scale fast target detection, the original photon time-of-flight histogram is first smoothed by a low-pass filter to reduce random noise in the histogram.
3. The SPAD histogram distance calculation method based on coarse and fine two-stage hybrid processing according to claim 1 or 2, characterized in that, In step S1, the algorithm used for full-frame rapid target detection is either the peak search method or the simplified centroid method. The algorithm is used to quickly scan the entire frame histogram to obtain the coarse distance information of the target.
4. The SPAD histogram distance calculation method based on coarse and fine two-stage hybrid processing according to claim 1, characterized in that, In step S2, the signal feature is the peak signal strength or signal-to-noise ratio corresponding to the coarse distance measurement information; when the peak signal strength or signal-to-noise ratio is higher than a preset threshold, it is determined that the second-level processing will not be started; when the peak signal strength or signal-to-noise ratio is lower than or equal to the preset threshold, it is determined that the second-level processing will be started.
5. The SPAD histogram distance calculation method based on coarse and fine two-stage hybrid processing according to claim 1 or 4, characterized in that, In step S3, the target time window is a time interval set around the coarse distance measurement point corresponding to the coarse distance measurement information. The width of the time interval is greater than the width of the system laser pulse response and less than the total time span of the entire frame histogram.
6. The SPAD histogram distance calculation method based on coarse and fine two-stage hybrid processing according to claim 1, characterized in that, In step S3, the high-precision peak position positioning adopts a peak position positioning method based on machine learning regression. The machine learning regression model is pre-trained and uses histogram data within the target time window as input to output the target's precise flight time information end-to-end.
7. The SPAD histogram distance calculation method based on coarse and fine two-stage hybrid processing according to claim 6, characterized in that, The machine learning regression model employs a lightweight convolutional neural network, which sequentially includes an input layer, a hidden layer, a fully connected layer, and an output layer. The number of neurons in the input layer matches the length of the histogram data within the target time window. The hidden layer uses a non-linear activation function, and the output layer outputs the estimated flight time of the target.
8. The SPAD histogram distance calculation method based on coarse and fine two-stage hybrid processing according to claim 7, characterized in that, The training dataset for the machine learning regression model is generated through a SPAD system simulation model. The SPAD system simulation model includes at least a laser pulse waveform module, a target and channel module, a noise module, and a histogram generation module. Labeled training data covering multiple scenarios is generated by configuring different system parameters. The model training process uses mean squared error as the loss function, and the Adam optimizer performs loss minimization training until the model converges.
9. The SPAD histogram distance calculation method based on coarse and fine two-stage hybrid processing according to claim 1, characterized in that, In step S4, the preset mapping relationship between the speed of light and distance is realized by the following formula: d=c×bin / 2×x_cal, where d is the precise measurement distance of the target, c is the speed of light, bin is the sampling depth corresponding to the peak value, and x_cal is the time width corresponding to each sampling bin.
10. A SPAD histogram distance calculation system based on coarse-fine two-level hybrid processing, characterized in that, It includes a first-level processor module, a condition judgment module, a second-level processor module, and an output module that are connected in sequence. The first-level processor module is used to perform full-frame fast target detection on the photon time-of-flight histogram generated by SPAD acquisition, and obtain coarse distance information of the target; The condition judgment module is used to dynamically determine whether to activate the second-level processor module based on the signal characteristics corresponding to the coarse distance measurement information. The second-level processor module is used to perform high-precision peak position positioning only within the target time window corresponding to the coarse distance measurement information when a start command is received, so as to obtain the target's precise flight time information; The output module is used to calculate and output the precise measured distance of the target based on the target's final flight time information through a preset mapping relationship between the speed of light and distance; wherein, when the condition judgment module determines that the second-level processor module should not be started, the output module directly performs distance conversion based on the flight time corresponding to the coarse distance information.