An ophthalmic device autofocusing method, system, and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-28
- Publication Date
- 2026-08-11
AI Technical Summary
这些方法在应对眼部复杂结构与环境时常常失效,例如容易受到角膜表面泪膜反光的干扰,在晶状体混浊(白内障)条件下难以找到有效对比边缘,对视网膜血管纹理等低对比度组织不敏感,并且在手术器械(如镊子、玻切头)进入视野造成遮挡时失去对焦目标
1.通过使用时序AI模型对视频序列进行时空联合特征提取,并行的场景识别分类头和对焦区域检测头能够理解诊疗意图与解剖结构,智能输出场景类别概率和对焦区域回归框,实现了从依赖经验的手动对焦到基于场景理解的自动对焦的转变;
Smart Images

Figure CN122552074A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of medical devices, and in particular to an automatic focusing method, system and storage medium for ophthalmic devices. Background Technology
[0002] In ophthalmic clinical practice and surgery, obtaining clear images of the anterior segment (such as the cornea, iris, and lens) or posterior segment (such as the retina) is crucial. Currently, the focusing methods of mainstream ophthalmic equipment have the following limitations: Traditional manual focusing relies on doctors or technicians manually rotating the focusing knob while observing the eyepiece or display screen to achieve focus. This method is not only inefficient but also highly dependent on the operator's experience, easily causing visual fatigue during prolonged operation, and making it difficult to effectively track and respond to the patient's spontaneous or physiological subtle eye movements.
[0003] While some high-end devices are equipped with basic autofocus systems, their principles are mostly based on simple contrast detection or distance sensors. These methods often fail when dealing with the complex structure and environment of the eye. For example, they are easily interfered with by the reflection of the tear film on the corneal surface, have difficulty finding effective contrast edges under conditions of lens opacity (cataracts), are not sensitive to low-contrast tissues such as retinal vascular texture, and lose focus when surgical instruments (such as forceps and vitrectomy tips) enter the field of vision and cause obstruction.
[0004] Furthermore, some existing AI-based autofocus systems typically make decisions based solely on image information from a single frame or a very short time span. This approach has inherent drawbacks: First, it cannot utilize the spatiotemporal correlation information contained between consecutive frames, making it difficult to understand the dynamic evolution of a scene; second, it is extremely sensitive to interference such as noise, momentary reflections, or brief occlusions in a single frame, easily leading to incorrect focus area judgments; finally, because its judgments are made independently frame by frame, lacking temporal consistency, it can easily cause unreasonable jumps in the focus area between adjacent frames, resulting in unstable video footage and frequent reciprocating movements of the focusing motor, severely impacting the observation and operational experience. Summary of the Invention
[0005] To improve the intelligent focusing stability of imaging systems during ophthalmic diagnosis and surgery, this application provides an automatic focusing method, system, and storage medium for ophthalmic equipment.
[0006] Firstly, the automatic focusing method for ophthalmic equipment provided in this application adopts the following technical solution: An automatic focusing method for ophthalmic devices includes the following steps: Acquire a sequence of eye video frames captured by ophthalmic equipment; A temporal AI model is established, and the video frame sequence is used to perform scene recognition and focus area detection, and the scene category probability and focus area regression box are output accordingly. The focus area regression box is subjected to anti-interference and smoothing processing, and the smoothed focus target coordinates are output. The current treatment scenario is determined based on the probability of the scenario category, and combined with the coordinates of the focus target, a preset scenario-control parameter knowledge base is queried to generate and issue collaborative control commands for focus, illumination and zoom modules.
[0007] By adopting the above technical solutions, a complete technical closed loop from temporal perception to intelligent collaboration has been constructed. A temporal AI model synchronously analyzes the diagnostic and treatment scenario and the focus target, driving the collaborative operation of multiple modules such as focusing, illumination, and zoom. This not only significantly improves the accuracy and efficiency of image acquisition and reduces operational delays and subjective differences caused by manual adjustments, but also provides doctors with a consistently clear, stable, and optimal surgical field that highly matches the current surgical intent through integrated intelligent control. This comprehensively improves the standardization, operational smoothness, and surgical safety of ophthalmic diagnosis and treatment.
[0008] Preferably, the video frame sequence [F(t-N+1),…,F(t)] is formed by dynamically caching the most recent N consecutive video frames using a circular buffer, where F(t) is the current frame.
[0009] By adopting the above technical solution, the model is provided with input data that has temporal continuity, which enables the use of inter-frame motion information to effectively distinguish between instantaneous interference and real target motion, laying a key data foundation for stable and accurate focusing decisions.
[0010] Preferably, the temporal AI model includes a backbone network for spatiotemporal joint feature extraction, wherein the backbone network is one of a 3D convolutional network, a spatiotemporal separation network, an optical flow dual-stream network, or a CNN-Transformer hybrid network.
[0011] By adopting the above technical solution, the model can simultaneously perform spatial semantic understanding and temporal dynamic analysis on video sequences, thereby gaining the ability to understand surgical intent and anatomical context.
[0012] Preferably, the scenario category probability is a K-dimensional vector (p1, p2, ..., p), where each element is the normalized probability of the corresponding scenario, and the category with the highest probability is determined as the current diagnosis and treatment scenario.
[0013] By adopting the above technical solutions, a quantitative confidence basis is provided for scene judgment, enabling the system to adopt a more robust strategy when the recognition result is ambiguous, avoiding erroneous switching based on low confidence results, and improving the robustness of system decision-making.
[0014] Preferably, the focus area regression box is represented by normalized coordinates (x0, y0, x1, y1), which correspond to the coordinates of the upper left and lower right corners of the rectangle, respectively, and the coordinate values are normalized to the interval [0, 1].
[0015] By adopting the above technical solution, the output representation of the focus area is decoupled from the specific resolution of the input image, which enhances the versatility and adaptability of the algorithm to different hardware devices and facilitates system portability and deployment.
[0016] Preferably, the anti-interference and smoothing process uses Kalman filtering or moving average filtering algorithms to filter the center point coordinates of the focus area regression box.
[0017] By adopting the above technical solution, the inherent random noise and abnormal jumps in single-frame detection are effectively suppressed, and a smooth and continuous target trajectory is output, thereby eliminating focus jumps and image jitter, and ensuring the stability and visual comfort of the video stream.
[0018] Preferably, during the smoothing process, if the detected displacement exceeds a preset threshold or the scene recognition confidence is too low, the weight of the current frame observation is reduced, and prediction or interpolation is performed based on historical trajectories.
[0019] By adopting the above technical solutions, the system is provided with a fault-tolerant and recovery mechanism to cope with strong interference or temporary failures. It can maintain tracking based on reliable historical information under abnormal conditions, which significantly enhances the robustness and availability of the system in complex clinical environments.
[0020] Preferably, the scenario-control parameter knowledge base pre-stores optimized parameter combinations for focusing reference, illumination mode, brightness, and optical magnification under different diagnostic and treatment scenarios; the collaborative control command drives the focusing module, illumination module, and zoom module to execute synchronously or sequentially according to the parameter combinations.
[0021] By adopting the above technical solution, integrated intelligent matching of diagnosis and treatment scenarios and parameters of multiple devices has been achieved.
[0022] Secondly, the automatic focusing system for ophthalmic equipment provided in this application adopts the following technical solution: An autofocus system for ophthalmic equipment, comprising: The video acquisition module is used to acquire and cache the sequence of video frames of the eye. The temporal AI processing module is used to perform scene recognition and focus area detection on the video frame sequence, and output scene category probability and focus area regression box; The smoothing filter module is used to perform anti-interference and smoothing processing on the regression box of the focus area and output smoothed focus target coordinates. The collaborative control module is used to query the scene-control parameter knowledge base based on the scene recognition results and the coordinates of the smooth focus target, and generate and issue collaborative control commands for the focus, illumination and zoom modules.
[0023] Thirdly, the storage medium provided in this application adopts the following technical solution: A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method.
[0024] In summary, this application includes at least one of the following beneficial technical effects: 1. By using a temporal AI model to extract spatiotemporal joint features from video sequences, the parallel scene recognition classification head and focus area detection head can understand the diagnosis and treatment intentions and anatomical structures, and intelligently output the scene category probability and focus area regression box, realizing the transformation from manual focusing that relies on experience to automatic focusing based on scene understanding. 2. By performing anti-interference and smoothing processing on the regression box of the focus area using Kalman filtering or moving average filtering as the core, single-frame detection noise and instantaneous interference are effectively suppressed, and smooth and stable focus target coordinates are output, overcoming the defects of traditional focusing methods that are prone to failure in complex eye environments and image jumps. 3. Based on the identified scene and smooth coordinates, by querying the preset diagnosis and treatment scene-control parameter knowledge base, an integrated collaborative command is generated and issued to drive the focusing module, illumination module and zoom module to automatically and synchronously switch to the optimal working state, which simplifies the doctor's operation and improves the standardization and efficiency of the diagnosis and treatment process. Attached Figure Description
[0025] Figure 1 This is a schematic diagram of the overall process of an embodiment of this application; Figure 2 This is an example illustration of a video frame sequence. Detailed Implementation
[0026] The following combination Figure 1 and Figure 2 This application will be described in further detail. Example
[0027] Embodiment 1 of this application discloses an automatic focusing method for ophthalmic equipment.
[0028] Reference Figure 1 An automatic focusing method for ophthalmic equipment includes the following steps: S1: Acquire the sequence of eye video frames captured by ophthalmic equipment; S2: Establish a temporal AI model to identify and detect video frame sequences, perform scene recognition and focus area detection on the video frame sequences, and output the corresponding scene category probability and focus area regression box. S3: Perform anti-interference and smoothing processing on the focus area regression box, and output the coordinates of the focus target; S4: Determine the scene recognition result based on the probability of scene category and output the corresponding diagnosis and treatment scene; then, based on the coordinates of the focus target, query the preset diagnosis and treatment scene-control parameter knowledge base, generate and output the collaborative control instructions for focus, illumination and zoom module.
[0029] Specifically, step S1 acquires the eye video frame sequence captured by the ophthalmic device, including the following: It acquires video streams in real time from the image sensors of ophthalmic devices, continuously captures and buffers a sequence of video frames within a short time window, such as... Figure 2 As shown, the ophthalmic equipment can be a slit lamp or surgical microscope, etc. The system captures each frame through the image acquisition interface at the highest frame rate supported by the device (e.g., 30 or 60 frames / second), and marks each frame with a precise timestamp to ensure temporal accuracy. These consecutive frames are fed into a fixed-length circular buffer for management. The circular buffer always holds the most recent N frames (e.g., 16 frames). Whenever a new frame arrives, the oldest frame is overwritten, thus dynamically maintaining a video frame sequence representing the scene approximately 0.5 seconds ago, denoted as [F(t-N+1),...,F(t)], where F(t) is the latest frame at the current moment. Before being fed into the model, the video frame sequence can undergo preprocessing such as size normalization or light temporal denoising. By acquiring the video frame sequence, it is ensured that the input received by the model is a set of frames rich in temporal dynamic information, laying a crucial data foundation for subsequent steps to identify the motion patterns of eye structures and distinguish between transient interference and real anatomical targets.
[0030] Step S2 establishes a temporal AI model, which identifies and detects video frame sequences, performs scene recognition and focus area detection on the video frame sequences, and outputs the corresponding scene category probability and focus area regression box, including the following steps: S21: Spatiotemporal joint feature extraction.
[0031] The input video frame sequence is fed into the backbone network of a temporal AI model for joint spatiotemporal feature extraction, enabling the simultaneous capture of spatial details and temporal dynamics from the video frame sequence. Spatial details may include anatomical structures and instrument morphology; temporal dynamics may include eye movements and instrument manipulation. The backbone network can be implemented using one of the following advanced paradigms, including but not limited to 3D convolutional paradigms, spatiotemporal separation paradigms, optical flow-guided paradigms, and Transformer paradigms.
[0032] The 3D convolutional paradigm is illustrated using the I3D model as an example. The I3D model is a direct extension of the 2D convolutional neural network in the temporal dimension. The core operation involves using 3D convolutional kernels (e.g., 3×3×3, corresponding to the time, height, and width dimensions respectively) to perform sliding convolution and pooling on a sequence of video frames. In this way, the network can directly capture both the spatial features of local regions (such as texture and edges) and the temporal variation patterns (such as motion and deformation) between adjacent frames from the raw video cube data. In ophthalmic applications, this end-to-end spatiotemporal modeling capability enables it to effectively understand complex dynamic processes such as tear film dynamics on the corneal surface and tissue fragmentation and splashing during lens emulsification, providing robust feature representations for accurate tracking.
[0033] The spatiotemporal separation paradigm can employ the SlowFast network, which contains two parallel pathways: a Slow pathway and a Fast pathway. The Slow pathway samples the input at a lower frame rate but uses 3D convolutions with a large number of channels and a large spatiotemporal receptive field, focusing on learning and extracting slowly changing but fine spatial semantic features, such as identifying the static categories and shapes of the cornea, iris, and surgical instruments. The Fast pathway, on the other hand, takes the original high frame rate input but uses 3D convolutions with fewer channels and a temporally dense structure, specifically responsible for capturing rapidly changing temporal motion features, such as minute nystagmus of the eyeball, rapid instrument insertion, or blood flow. The two pathways are fused through lateral connections, making it particularly suitable for ophthalmic surgical scenarios that require both high spatial resolution observation and rapid motion tracking.
[0034] The optical flow-guided paradigm can be set up as an dilatational dual-stream network, which contains two input streams: an RGB stream and an optical flow stream. The RGB stream processes the original color frame sequence, learning appearance features through a 3D convolutional network. The optical flow stream takes a pre-computed optical flow field sequence as input, which quantifies the motion vector of each pixel between adjacent frames, thus explicitly describing the motion patterns in the scene. The optical flow sequence is also used for feature extraction through a 3D convolutional network. Finally, the features extracted by the two branches are fused in the deep layers of the network. In ophthalmic device focusing, the ability to clearly distinguish between displacement caused by the patient's voluntary eye movements or physiological nystagmus and tissue deformation caused by surgical manipulation is crucial for stably locking onto the target area in dynamic environments.
[0035] The Transformer paradigm employs a CNN-Transformer hybrid architecture. This architecture first uses a mature 2D CNN network to extract strong semantic spatial features from each frame, then uses a relatively lightweight Transformer to model the temporal relationships between these features. The specific process is as follows: First, strong semantic spatial features are extracted using a pre-trained image model (such as ResNet or EfficientNet) as the backbone network, processing each video frame independently. High-level feature maps (e.g., 1024 7x7 feature maps) or global feature vectors are extracted from each frame. Second, serialization and projection are performed, flattening or pooling the feature maps of each frame into a feature sequence, which is then projected onto a unified dimension through a linear layer. The feature sequences of all frames are concatenated in temporal order to form the final input sequence. Finally, a spatiotemporal Transformer encoder adds temporal embeddings (distinguishing which frame it is) and spatial embeddings (distinguishing the original position of features on the feature maps) to the sequence. Through a multi-head self-attention mechanism, the Transformer can model the long-range dependencies between features of any two frames in a video frame sequence, regardless of their distance. This enables temporal AI models not only to perceive minute changes in adjacent frames, but also to understand the evolutionary logic of surgical stages spanning several seconds, thereby achieving scene understanding and target reasoning based on advanced semantics and temporal context.
[0036] The four backbone networks mentioned above ultimately output a shared spatiotemporal feature rich in spatiotemporal information. For the CNN backbone network, the output feature map F∈R^(C×T×H×W), where C is the number of channels, T is the number of time frames, and H and W are the spatial height and width; for the Transformer architecture, the output is a global feature vector (such as the [CLS] token) or a reconstructed feature map of all image patch features.
[0037] S22: Parallel dual-task reasoning.
[0038] Based on the generated shared spatiotemporal features, the temporal AI model performs synchronous inference through two parallel, lightweight task-specific heads, which are set as a scene recognition and classification head and a focus area detection head, respectively.
[0039] The scene recognition and classification head intelligently determines the specific medical scenario of the current video frame sequence based on shared spatiotemporal features extracted from the backbone network. For CNN-based backbone networks (such as I3D and SlowFast), the output feature maps undergo global average pooling in the temporal, height, and width dimensions, summing all local activations into a fixed-dimensional global feature vector. For Transformer-based architectures, the [CLS] token feature vector, representing the global context of the sequence, is directly used as the global feature vector.
[0040] Subsequently, the global feature vector is fed into a lightweight yet fully functional classifier. The classifier typically consists of a series of fully connected layers, with non-linear activation functions (such as ReLU) and Dropout regularization layers embedded between them. The fully connected layers are responsible for learning the complex high-dimensional mapping between features and scene categories. The ReLU activation function introduces non-linear discriminative power, while the Dropout regularization layer randomly suppresses some neurons during training to prevent overfitting and ensure generalization performance. Finally, the classifier's output passes through a fully connected layer with a number of neurons strictly consistent with the preset number of scene categories K, and is normalized using the Softmax function, transforming the original category scores into a formal probability distribution. Therefore, the output of the scene recognition classifier is the scene category probability, which is represented as a K-dimensional probability distribution vector (p1, p2, ..., p), where each element's value is between 0 and 1, and the sum of all elements is 1. This intuitively quantifies the probability that the current video stream belongs to each preset scene, such as limbal vessel observation, lens emulsification, or retinal imaging.
[0041] The focus area detection head is used to locate key anatomical sites or surgical points requiring high-definition focusing in the current video frame in real time. The shared spatiotemporal features first undergo a global aggregation process (such as global average pooling), being compressed into a feature vector containing global semantics. This feature vector is then fed into a small neural network specifically designed for coordinate regression. This small neural network typically includes several sequential fully connected layers, with ReLU activation functions used between the fully connected layers to introduce non-linear modeling capabilities, supplemented by Dropout layers to prevent overfitting. The last layer of the regression network is a linear layer without activation functions. The number of neurons in this linear layer is fixed at four, directly corresponding to the four coordinate values (x0, y0, x1, y1) of the output focus area regression box. (x0, y0) represents the horizontal and vertical coordinates of the top-left corner of the rectangle, and (x1, y1) represents the coordinates of the bottom-right corner. All coordinate values are normalized to the [0, 1] interval relative to the width and height of the input image, decoupling the output from the specific resolution of the image and providing versatility. Therefore, the output of the focus area detection head is a clear area location instruction that can be directly used in subsequent steps, thereby enabling the mapping of complex visual spatiotemporal features to the most critical focus area, such as associating features with the corneal center, anterior lens capsule, retinal macular region, or surgical instrument tip.
[0042] Furthermore, since the backbone network on which the focus area detection head relies processes continuous frame sequences, the focus area detection head can effectively utilize temporal consistency information, making the prediction results more robust to transient interferences (such as strong reflections, brief occlusions, or noise) that occur in a single frame, thereby providing the system with a stable, continuous, and physically reliable focus target position.
[0043] Step S3 performs anti-interference and smoothing processing on the focus area regression box, and outputs the focus target coordinates, including the following: The focus area regression box is converted into a single center point coordinate, and then an advanced filtering algorithm is applied to the center point coordinate trajectory. The filtering algorithm can be set to Kalman filtering, moving average filtering, etc.
[0044] Kalman filtering constructs a motion model that includes position and velocity states by precisely tuning the covariance matrix of process noise and observation noise. It can optimally fuse physical predictions based on historical data with current AI observations, thereby outputting the most physically reasonable and smooth trajectory. It is particularly good at handling motions with certain regularities, such as micro-eye movements.
[0045] Moving average filtering quickly suppresses random jitter by calculating the mean of coordinates within a sliding time window. It is simple to implement, computationally inexpensive, and suitable for scenarios with extremely stringent system latency requirements. In practical applications, the system can employ an adaptive strategy, dynamically selecting or fusing two filtering methods based on motion speed, regularity, and the confidence level of the AI output to achieve the optimal balance.
[0046] Furthermore, this step integrates an anomaly handling mechanism. For example, when displacement is detected to exceed a reasonable physiological range or AI confidence is too low, the system will reduce the weight of the current observation and even perform predictive interpolation based on historical trajectories. This effectively addresses tracking loss caused by interference such as momentary occlusion and strong reflections. The focus center coordinates processed in this step not only eliminate jumps caused by single-frame misjudgments but also provide stable and continuous spatial guidance, laying a solid foundation for generating accurate and smooth focus control commands in the subsequent fourth step.
[0047] Step S4, scenario-based collaborative control, includes the following: Based on the scene category probabilities identified in step S3, the scene category with the highest probability is taken as the scene recognition result, and the corresponding treatment scene is output. Then, based on the stable and smooth focus target coordinates provided in step S3, the ophthalmic equipment is intelligently scheduled in an integrated manner. The system embeds a treatment scene-control parameter knowledge base built based on clinical expert experience. The treatment scene-control parameter knowledge base presets the optimal parameter combination for each treatment scene, including focus reference, illumination mode and brightness, optical magnification, and special filters. When the treatment scene switch is triggered, the system's control module sends a set of concurrent or ordered collaborative command sequences to the illumination module, zoom module, and focus module. For example, when switching to the retinal surgery scene, the system will simultaneously adjust the light source to low-brightness diffuse light, switch the magnification to low magnification for positioning, and quickly pre-position the focus unit to the approximate area of the retina; subsequently, fine-tuning of the focus is performed with the precise position tracked by AI as the center, and the red-free filter can be continuously activated to enhance the contrast of blood vessels. The entire process is integrated and controlled through a high-speed industrial bus, ensuring the synchronization and safety of the actions of each unit. This step transforms the perceptual intelligence of the previous steps into precise coordinated actions of the equipment, simplifying the doctor's operation and avoiding the need for them to manually switch multiple parameters in complex processes. This not only improves the standardization, efficiency, and smoothness of diagnosis and treatment, but also significantly enhances the safety of surgery by automatically maintaining the optimal field of vision, completing a value loop from intelligent perception to automated execution.
[0048] The implementation principle of an automatic focusing method for ophthalmic devices in Embodiment 1 of this application is as follows: A continuous sequence of eye video frames is acquired in real time and input into a temporal AI model for spatiotemporal joint analysis. The temporal AI model performs parallel identification of the treatment scene and detection of the optimal focus area, fully utilizing inter-frame motion and structural evolution information to overcome the shortcomings of single-frame processing. Subsequently, the coordinates of the detected focus area are filtered and smoothed to ensure the stability and continuity of the output trajectory. Finally, based on the identified specific scene and the smoothed focus position, the system triggers a preset scene-based collaborative control strategy, intelligently adjusting the focusing module, illumination module, and zoom module in an integrated manner. This automatically provides doctors with a consistently clear, stable, and optimal imaging field of view that matches the current treatment intent without manual intervention. Example
[0049] Embodiment 2 of this application discloses an automatic focusing system for ophthalmic equipment.
[0050] An automatic focusing system for ophthalmic equipment, based on the above-mentioned focusing method, includes a video acquisition unit, a temporal AI processing unit, a smoothing filtering unit, a decision unit, and a collaborative control unit.
[0051] The video acquisition unit is the system's data input port, directly connected to the optical imaging system of the ophthalmic equipment. Composed of a high-resolution image sensor and high-speed image acquisition circuitry, the video acquisition unit is responsible for capturing dynamic video streams of the eye region in real time and continuously. In addition to basic analog-to-digital conversion, the video acquisition unit typically includes a frame buffer management module to temporarily store a short sequence of video frames in chronological order, providing a stable and consistent data source for subsequent analysis and processing requiring temporal context.
[0052] The temporal AI processing unit receives video frame sequences acquired by the video acquisition unit. Essentially, it's a deep learning inference engine deployed on dedicated computing hardware, incorporating a trained multi-task temporal model capable of end-to-end analysis of continuous input video frames. During a single forward propagation, the temporal AI processing unit performs two key tasks in parallel: first, through its scene classification branch, it identifies and outputs the current diagnostic scene and its probability; second, through its target regression branch, it directly predicts the bounding box coordinates of the target region most requiring clear imaging in the current frame, achieving intelligent understanding from pixels to semantics.
[0053] The smoothing filter unit processes the raw coordinate data output by the temporal AI processing unit to improve the system's stability and robustness. The smoothing filter unit receives the bounding box of the focus area detected in each frame and first calculates its geometric center as the target point. Then, it applies advanced filtering algorithms (such as Kalman filtering or moving average filtering) to temporally smooth the coordinates of this series of center points. Its core function is to suppress unavoidable noise and random jitter in single-frame detection and to predict reasonable motion trends using temporal continuity, thereby outputting a physically reliable and spatially continuous trajectory of the focus target.
[0054] The decision-making unit receives scene recognition results and confidence levels from the temporal AI processing unit, as well as stable trajectory coordinates from the smoothing filtering unit. First, it determines the reliability of the current recognition result based on a scene confidence threshold to decide whether to trigger a scene switch. Second, it comprehensively evaluates the smoothness of the trajectory, movement speed, and whether any abnormal jumps occur. Finally, the decision-making unit generates a deterministic control command containing valid scene instructions and a verified focus position, ensuring that the instructions transmitted to the actuator are highly reliable and accurate.
[0055] The collaborative control unit is responsible for translating the intelligent commands from the decision-making unit into coordinated actions of the various physical subsystems of the equipment. The collaborative control unit is a "scene-parameter" mapping database integrating clinical experience and knowledge. Upon receiving a decision command, the controller immediately queries this database to obtain the optimal parameter presets for multiple subsystems such as focusing, illumination, and optical zoom in the corresponding scene. Subsequently, the collaborative control unit sends synchronous or sequential adjustment commands to execution modules such as the focusing drive motor, programmable light source controller, and electric zoom unit via an industrial control bus (such as CAN or EtherCAT), achieving one-click switching and optimization of the overall equipment status, enabling physicians to quickly obtain the best imaging environment tailored to the current operation. Example
[0056] Embodiment 3 of this application discloses a storage medium.
[0057] A computer program is stored that can be loaded by a processor and execute the command reconstruction method described above. Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a device (which may be a mobile phone, computer, server, controlled terminal, or network device, etc.) to execute the methods of each embodiment of this application.
[0058] The above are all preferred embodiments of this application, and are not intended to limit the scope of protection of this application. Therefore, all equivalent changes made in accordance with the structure, shape and principle of this application should be covered within the scope of protection of this application.
Claims
1. An ophthalmic device autofocus method, characterized by: Includes the following steps: Acquire a sequence of eye video frames captured by ophthalmic equipment; A temporal AI model is established, and the video frame sequence is used to perform scene recognition and focus area detection, and the scene category probability and focus area regression box are output accordingly. The focus area regression box is subjected to anti-interference and smoothing processing, and the smoothed focus target coordinates are output. The current treatment scenario is determined based on the probability of the scenario category, and combined with the coordinates of the focus target, a preset scenario-control parameter knowledge base is queried to generate and issue collaborative control commands for focus, illumination and zoom modules.
2. A method of autofocusing an ophthalmic device according to claim 1, wherein: The video frame sequence [F(t-N+1),…,F(t)] is formed by dynamically caching the most recent N consecutive video frames using a circular buffer, where F(t) is the current frame.
3. The method of claim 1, wherein: The temporal AI model includes a backbone network for spatiotemporal joint feature extraction, which is one of a 3D convolutional network, a spatiotemporal separation network, an optical flow dual-stream network, or a CNN-Transformer hybrid network.
4. The method of claim 1, wherein: The scenario category probability is a K-dimensional vector (p1, p2, ..., p), where each element is the normalized probability of the corresponding scenario, and the category with the highest probability is determined as the current diagnosis and treatment scenario.
5. The method of claim 1, wherein: The focus area regression box is represented by normalized coordinates (x0, y0, x1, y1), which correspond to the coordinates of the upper left and lower right corners of the rectangle, respectively, and the coordinate values are normalized to the interval [0, 1].
6. The method of claim 1, wherein: The anti-interference and smoothing process employs Kalman filtering or moving average filtering algorithms to filter the center point coordinates of the regression box in the focus area.
7. A method of autofocusing an ophthalmic device according to claim 6, wherein: During the smoothing process, if the detected displacement exceeds the preset threshold or the scene recognition confidence is too low, the weight of the current frame observation is reduced, and prediction or interpolation is performed based on the historical trajectory.
8. The method of claim 1, wherein: The scenario-control parameter knowledge base pre-stores optimized parameter combinations for focusing reference, illumination mode, brightness, and optical magnification under different diagnostic and treatment scenarios; the collaborative control command drives the focusing module, illumination module, and zoom module to execute synchronously or sequentially according to the parameter combinations.
9. An autofocus system for ophthalmic equipment, based on the autofocus method according to any one of claims 1-8, characterized in that: include: The video acquisition module is used to acquire and cache the sequence of video frames of the eye. The temporal AI processing module is used to perform scene recognition and focus area detection on the video frame sequence, and output scene category probability and focus area regression box; The smoothing filter module is used to perform anti-interference and smoothing processing on the regression box of the focus area and output smoothed focus target coordinates. The collaborative control module is used to query the scene-control parameter knowledge base based on the scene recognition results and the coordinates of the smooth focus target, and generate and issue collaborative control commands for the focus, illumination and zoom modules.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by the processor, it implements the method as described in any one of claims 1 to 8.