Collision detection method, electronic device and storage medium for optical fiber unit of multi-target optical fiber spectral astronomical telescope
Through deep learning methods, the collision situation of optical fiber units is identified in real time, which solves the problem of lack of real-time detection methods in the prior art, and improves the observation efficiency of the telescope and the accuracy of optical fiber positioning.
Patent Information
- Application Number
- CN202411401952.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-10-09
AI Technical Summary
The prior art lacks a method for detecting collisions of optical fiber units in real time, which leads to mechanical collisions in the optical fiber units during operation, reducing the observation efficiency of the telescope.
By acquiring the optical fiber unit image on the focal surface of the astronomical telescope, the collision situation of the optical fiber unit is recognized in real time based on image segmentation and template matching.
Real-time collision detection of optical fiber units is realized, and the position of optical fiber units can be discovered and adjusted in time, reducing the impact of collision on telescope observation efficiency, and ensuring the accuracy of optical fiber positioning.
Smart Images

Figure CN118898729B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of multi-target optical fiber spectral astronomical telescopes, and in particular relates to a collision detection method, an electronic device and a storage medium of an optical fiber positioning unit of a multi-target optical fiber spectral astronomical telescope. Background Art
[0002] The multi-target fiber optic spectroscopic telescope deploys a large number of optical fibers on the focal plane. By adjusting the position of the optical fiber on the focal plane so that the position of the optical fiber corresponds to the position of the celestial target, it can receive optical signals from multiple celestial bodies at the same time. Its single observation can obtain spectral data of thousands or even tens of thousands of celestial bodies. It is one of the most efficient spectral survey technologies in the current astronomical field. The fiber optic positioning unit is a precision mechanical positioning device widely used in the fiber optic positioning system of the multi-target fiber optic spectroscopic telescope. The parallel control of the fiber optic positioning unit can achieve fast and accurate positioning of large-scale optical fibers. In order to ensure that there is no positioning blind spot on the focal plane, there will be overlapping coverage areas between adjacent fiber optic units, which will cause mechanical collisions between the fiber optic units during operation. The collision of the fiber optic units will cause the optical fiber to fail to reach the expected position, thereby reducing the observation efficiency of the telescope.
[0003] The anti-collision method based on path planning is the most commonly used anti-collision method in the fiber optic positioning system. This method actively plans a collision-free running trajectory for the fiber optic unit to prevent the fiber optic unit from colliding during operation. However, since a large number of fiber optic units are densely arranged on the focal plane of the telescope, when an occasional mechanical failure causes the fiber optic unit to deviate from the predetermined running trajectory, it will cause a high probability of a collision between the fiber optic units. If such a collision cannot be detected in time, it will then cause more collisions between fiber optic units. Therefore, even if there is an anti-collision method based on path planning, it is impossible to completely avoid the occurrence of fiber optic unit collisions. In order to solve the shortcomings of the existing anti-collision method based on path planning, it is very necessary to realize real-time collision detection of fiber optic units.
[0004] With regard to the collision problem of optical fiber units in a multi-target optical fiber spectral telescope, the prior art lacks a method for real-time detection of optical fiber unit collisions, so as to timely discover collisions and reduce the impact of optical fiber unit collisions on telescope observation efficiency. Summary of the invention
[0005] The purpose of the present invention is to propose a collision detection method, electronic device and storage medium for optical fiber units of a multi-target optical fiber spectral survey telescope, using image data containing the real-time operating posture of the optical fiber units to identify the optical fiber units that have collided based on a deep learning method.
[0006] A collision detection method for an optical fiber unit of an astronomical telescope, comprising:
[0007] Acquire images of all optical fiber units of the astronomical telescope on the focal plane to be tested;
[0008] Segmenting all the optical fiber unit images to obtain a segmentation map containing each optical fiber unit;
[0009] Constructing a template image based on the posture of the fiber unit;
[0010] Matching the postures of the segmented images with the template images to obtain the contours of the optical fiber units;
[0011] Fiber unit collision detection is performed based on the distance between adjacent fiber unit contours.
[0012] Furthermore, the segmentation map is obtained based on a fiber unit segmentation model, wherein the fiber unit segmentation model is established by the following steps:
[0013] Acquire a data set obtained by manually segmenting and annotating the optical fiber unit image;
[0014] The data set is input into a convolutional neural network for training, and the model weights are obtained and saved.
[0015] Furthermore, the segmentation graph is cut based on a Hough transform circle detection method before matching.
[0016] Furthermore, any of the segmentation maps and the template image includes:
[0017] A fiber optic unit ceramic head; a fiber optic unit central arm and an eccentric arm of the fiber optic unit.
[0018] Furthermore, the rules for constructing the template image are as follows:
[0019] The central arm and the eccentric arm of the optical fiber unit rotate according to the set step length respectively, and all images formed by the rotation are stored.
[0020] Furthermore, the method for matching each of the segmentation images with each of the template images includes:
[0021] Aligning the ceramic heads of each segmentation image with the ceramic heads of each template image;
[0022] Calculating the overlapping ratio between the central arm and the eccentric arm of each segmentation image and the central arm and the eccentric arm of each template image;
[0023] The template image with the highest overlap ratio is selected as the outline of the optical fiber unit corresponding to the segmentation image.
[0024] Furthermore, the distance is the minimum length between the adjacent contours.
[0025] Further, the collision detection is performed according to the following steps:
[0026] Determining parameters of collision of the optical fiber unit based on the optical fiber unit profile;
[0027] In response to the distance between the contours of adjacent optical fiber units being smaller than the parameter, it is determined that the optical fiber units corresponding to the contours of adjacent optical fiber units collide.
[0028] An electronic device comprises a memory and a processor, wherein the memory stores a computer program, the computer program is configured to be executed by the processor, and the computer program comprises instructions for executing the above method of the present invention.
[0029] A storage medium stores a computer program, wherein when the computer program is executed by a computer, the method of the present invention is implemented.
[0030] The beneficial effects of the present invention are as follows:
[0031] The optical fiber positioning unit collision detection method for a spectral astronomical telescope proposed in the present invention obtains the edge profile of each optical fiber unit through an image segmentation algorithm, and then determines the distance between the optical fiber units, and finally realizes the collision detection of the optical fiber units. The optical fiber units that collide during operation can be found in time by using the method proposed in the present invention, and the optical fiber positioning control system with a feedback system can be combined to adjust the movement in real time, which can reduce the impact of the collision, ensure the positioning accuracy of the optical fiber, and further improve the observation efficiency of the telescope. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 This is a physical picture of the LAMOST focal plane.
[0033] Figure 2 is a flow chart of an embodiment of the present invention.
[0034] Figure 3 Schematic diagram of the front illumination method for fiber optic positioning detection.
[0035] Figure 4 Image of a fiber unit taken with a single camera.
[0036] Figure 5a This is a front-illuminated image of a single fiber positioning unit in the dataset.
[0037] Figure 5b is the label image corresponding to the front-light image in the dataset.
[0038] Figure 6 Schematic diagram of the template image of the optical fiber unit in multiple postures.
[0039] Figure 7a Schematic diagram of the matched optical fiber unit profile.
[0040] Figure 7b Schematic diagram of the shortest distance between fiber unit outlines.
[0041] Figure 8 This is an example diagram of manually determining the collision probability of optical fiber units.
[0042] Fig. 9 is the fitting curve of collision probability and critical distance. DETAILED DESCRIPTION
[0043] The present invention will be further described below by way of embodiments in conjunction with the accompanying drawings.
[0044] This embodiment takes LAMOST (Large Sky Area Multi-Object Fiber Spectroscopic Telescope) as an example to describe the fiber positioning unit collision detection method of the present invention. LAMOST is a major scientific and technological infrastructure in my country. It is the first in the world to creatively propose a parallel controllable dual-rotation fiber positioning technology, which can complete the precise positioning of 4,000 optical fibers on the focal plane within 10 minutes. It became the telescope with the highest spectrum acquisition rate in the world at that time, leading the development trend of large-scale spectral surveys. Figure 1 This is a real shot of the LAMOST focal plane. The diameter of the LAMOST focal plane is 1.75m. 4000 fiber optic positioning units achieve full coverage of the fiber optic positioning area on the entire focal plane. The length of the two arms of the fiber optic positioning units is 8.25mm, and the distance between the center axes of two adjacent positioning units is 25.6mm.
[0045] Figure 2 This is a flow chart of an embodiment of the present invention, and the specific steps are as follows:
[0046] Step S1, obtaining images of all optical fiber units.
[0047] In LAMOST's fiber positioning detection system, six fiber detection cameras are installed off-axis around the spherical primary mirror about 20 meters away from the focal plane. Each camera is responsible for capturing one-sixth of the focal plane. The fiber positioning unit uses front lighting for detection, such as Figure 3 As shown in Figure 1, in the front lighting mode, the headlight located in front of the focal plane can illuminate the entire focal plane, including the mechanical structure of the positioning unit and the ceramic head that fixes the optical fiber. The image of the optical fiber unit taken by a single LAMOST camera is shown in Figure 1. Figure 4 As shown, the operating status of each optical fiber positioning unit is clearly presented in the image, and the image is a grayscale image with a size of 6004×7920 pixels.
[0048] Step S2, segment all optical fiber unit images to obtain a segmentation map.
[0049] In this embodiment, the UNet model is used as the segmentation model of the optical fiber unit. The establishment of the model requires a large amount of data for training and testing. A large amount of historical image data obtained by the LAMOST optical fiber positioning detection system is used to construct a data set for training the optical fiber unit segmentation model.
[0050] To make the dataset easier to label, each image contains only one fiber positioning unit, e.g. Figure 5a As shown in the figure, the label is the corresponding fiber positioning unit segmentation diagram. In the segmentation diagram, the fiber positioning unit is marked as three non-intersecting parts, each part is represented by a different color: the central arm is represented by red, the eccentric arm is represented by green, and the ceramic head is represented by yellow, as shown in the figure. Figure 5b As shown in the figure. About 300 pairs of data were obtained through manual labeling, and the labeled data set was divided into a training set and a validation set in a ratio of 7:3. When training the model, the training set is used to train the model weights, the validation set is used to verify the model performance, and the set of weights that performs best on the validation set is saved.
[0051] UNet is built on a fully convolutional neural network, and uses the feature extraction capability of the convolutional neural network to extract features at different levels, and finally classifies each pixel in the image. In this embodiment, there are three categories: the central arm, the eccentric arm, and the ceramic head of the optical fiber positioning unit.
[0052] Input all the data into UNet and start training the model. UNet consists of two parts: encoder and decoder. In this embodiment, the module of each layer of the encoder part contains two convolutional layers, each of which uses a convolution kernel of size 3×3, followed by a ReLU activation function, and then uses a maximum pooling layer to downsample the image. The decoder part gradually recovers the object details and spatial dimensions from the rough feature map output by the encoder part. Unlike the encoder part, the convolution layer in the decoder is followed by an upsampling operation, which doubles the spatial size of the feature map through interpolation. The feature map of the decoder part is connected to the feature map of the same size of the encoder part, so that the model can eventually obtain high-level features with fine positioning capabilities.
[0053] In the last layer of the model, this embodiment uses a 1×1 convolution kernel to map the feature map into a four-channel feature map, where each channel corresponds to a category of the fiber unit. The last layer uses the Softmax activation function, which is expressed as:
[0054]
[0055] in is the feature value of the i-th channel in the feature map, represent The normalized probability of belonging to the i-th category.
[0056] The Softmax activation function can convert the feature map of the four channels into the probability size of four categories. For each pixel, the category with the highest probability is selected as its classification result.
[0057] In this embodiment, a cross entropy loss function is used to measure the difference between the model prediction value and the true value. When training the model, the model weight is optimized by minimizing the loss function value. The formula of the cross entropy loss function is:
[0058]
[0059] Among them, i is the index of the category, is the probability that the true value is the i-th category, The probability that the model predicts the value to be the i-th category.
[0060] When the loss value of the model on the validation set does not improve significantly in several consecutive training cycles, the training is stopped, and the model weight corresponding to the minimum loss value on the validation set is saved to complete the model training.
[0061] The validation set was input into the trained model to check the training status of the model. It was found that the average intersection-over-union ratio between the model's predicted value and the true value reached 81.21%.
[0062] The fiber unit image in step S1 is input into the model to obtain a segmentation map of all fiber units, which can be further cut for accurate matching. The ceramic head of the fiber unit in the segmentation map is detected using the Hough transform circle detection method, and the above image is cut with the ceramic head as the center to obtain a segmentation map of a single fiber unit to ensure that the size of the segmentation map is in a matching state with the template image to be constructed.
[0063] Step S3, obtaining a template image based on the optical fiber unit.
[0064] The posture matching of the fiber unit is as follows Figure 6 First, according to the shape and size of the mechanical structure of the optical fiber unit, a template image of the optical fiber unit in various postures is constructed, where the ceramic head of the optical fiber unit is located at the center of the template image, and different gray values are used to distinguish the two arms.
[0065] The rotation angle ranges of the central arm and the eccentric arm of the optical fiber unit are 0-360 degrees and 0-180 degrees respectively. The angles of the two arms are set to 1 degree per step. Starting from 0 degrees, the two arms are rotated and all the images that appear are saved as template images. The postures of the two arms in each template image are different. In the template image, the contours of the two arms are composed of equally spaced coordinate points, and these coordinate points have position information. In this embodiment, 70 coordinate points are used to form the contours of the two arms in the template image.
[0066] Step S4, matching the segmentation map with the template image to obtain the fiber unit outline.
[0067] The segmentation map of a single fiber unit is aligned with all template images through the ceramic head, and their overlap ratios are calculated respectively. The template image with the highest overlap ratio is selected as the matching result. The size of the overlap ratio is obtained by calculating the intersection over union (IoU). Let A and B be the areas of a single fiber unit in the segmentation map and template image respectively. The calculation formula of IoU is: .
[0068] This embodiment further optimizes the matching process and adopts a two-stage matching mechanism to improve matching efficiency.
[0069] In the first stage, the content of the matching pool is all template images obtained by rotating the template image in steps of 10 degrees. Through these template images, the approximate angle positions of the two arms can be quickly determined, and a preliminary angle estimation can be achieved to obtain a preliminary template image.
[0070] In the second stage, the content of the matching pool is all the template images in step S3. After obtaining the preliminary approximate angle, we further select the angle within the range of plus or minus 10 degrees as the new template image matching interval based on the preliminary template image. Specifically, if the angle of the central arm obtained by the preliminary estimation is , Angle of eccentric arm , then the central arm is Degree, eccentric arm The posture matching is performed within the range of degrees, so as to perform more accurate matching processing, and finally achieve high-precision posture matching with an accuracy of 1 degree. The template image obtained by matching is used as the outline of the optical fiber unit, such as Figure 7a shown.
[0071] Step S5: performing collision detection based on the optical fiber unit profile.
[0072] After the running posture of the optical fiber unit is matched, the outline of the optical fiber unit is obtained by combining the shape and size of the mechanical structure of the optical fiber unit. The distance between the optical fiber units is obtained by calculating the shortest distance between the edge outlines of the optical fiber units, such as Figure 7b As shown, whether a collision occurs is determined based on the distance.
[0073] Each fiber unit profile is represented by 70 equally spaced coordinate points. By traversing all 70 coordinate points on the edge profile of a fiber unit, the distance from each point to the 70 coordinate points on the adjacent fiber unit profile is calculated, and the minimum value is found from all distances. This minimum value represents the shortest distance between the adjacent fiber unit profiles mentioned above, and is used to represent the distance between two fiber units.
[0074] In this embodiment, a critical distance is used as a parameter for collision occurrence.
[0075] In this embodiment, when the distance between the contours of adjacent optical fiber units is less than 5 pixels, it is difficult to clearly determine whether the adjacent optical fiber units collide. There are 25 pairs of optical fiber units with a distance less than 5 pixels, which are selected to determine the critical distance. The collision of these 25 pairs of optical fiber units is manually checked. Figure 8 As shown, the collision probability of completely contacting optical fiber units is set to 1, the collision probability of completely separated optical fiber units is set to 0, and the collision probability of optical fiber units that cannot be judged whether a collision occurs is set to 0.5. Substitute the distances and collision probabilities of these 25 pairs of optical fiber units into the following formula:
[0076]
[0077] in, is the shortest distance between adjacent fiber units, The shortest distance between adjacent fiber units is The probability of a collision occurring when is the critical distance at which optical fiber units collide, is the shape parameter.
[0078] Then the critical distance was obtained by least squares fitting. is 1.04 pixels, such as Fig. 9 shown.
[0079] After calculating the distance between the optical fiber units according to the above steps, when the distance between the two optical fiber units is less than 1.04 pixels, it is determined that the optical fiber units have collided, and when the distance between the two optical fiber units is greater than or equal to 1.04 pixels, it is determined that the optical fiber units have not collided.
[0080] Combined with the spectral data, it is found that the accuracy of the above method in this embodiment exceeds 92%. The collision of the optical fiber unit will affect the alignment between the optical fiber and the celestial target, thereby reducing the spectral flow value collected by the CCD. The test results of the optical fiber unit collision detection are shown in Table 1. In the three tests, a total of 26 pairs of optical fiber units were detected to have collided, of which 24 pairs of optical fibers had abnormal flow values collected by the CCD.
[0081] Table 1
[0082] Test No. The number of fiber units where collisions were detected The number of fiber units with abnormal flow values 1 9 9 2 5 4 3 12 11
[0083] The above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit the same. A person skilled in the art may modify or make equivalent substitutions for the technical solutions of the present invention without departing from the spirit and scope of the present invention. The protection scope of the present invention shall be subject to the claims.
Claims
1. A collision detection method for optical fiber units of a multi-target optical fiber astronomical telescope, comprising: Acquire images of all optical fiber units of the astronomical telescope on the focal plane to be tested; Segmenting all the optical fiber unit images to obtain a segmentation map containing each optical fiber unit; Constructing a template image based on the posture of the fiber unit; Matching the postures of each segmentation graph with each template image to obtain the contour of each optical fiber unit, wherein the contour of the optical fiber unit is the template image with the highest overlap ratio with the segmentation graph of the optical fiber unit; Fiber unit collision detection is performed based on the distance between adjacent fiber unit contours: 1) Each fiber unit profile is represented by equally spaced coordinate points; by traversing all coordinate points on the edge profile of a fiber unit, the distance from each point to the coordinate point on the adjacent fiber unit profile is calculated, and the minimum value among all distances is found as the distance between the adjacent fiber unit profiles; 2) The critical distance for the collision of the optical fiber unit is obtained by fitting the least square method according to the following formula: in, is the shortest distance between adjacent fiber units, The shortest distance between adjacent fiber units is The probability of a collision occurring when is the critical distance at which the optical fiber units collide, is the shape parameter; 3) When the distance between two optical fiber units is less than the critical distance, it is determined that the optical fiber units collide.
2. The method according to claim 1, characterized in that The segmentation graph is obtained based on a fiber unit segmentation model, wherein the fiber unit segmentation model is established by the following steps: Acquire a data set obtained by manually segmenting and annotating the optical fiber unit image; The data set is input into a convolutional neural network for training, and the model weights are obtained and saved.
3. The method according to claim 2, characterized in that The segmentation map is cut based on the Hough transform circle detection method before matching.
4. The method according to claim 1, characterized in that: Any of the segmentation maps and the template image includes: A fiber optic unit ceramic head; a fiber optic unit central arm and an eccentric arm of the fiber optic unit.
5. The method according to claim 4, characterized in that The rules for constructing the template image are as follows: The central arm and the eccentric arm of the optical fiber unit rotate according to the set step length respectively, and all images formed by the rotation are stored.
6. The method according to claim 5, characterized in that The method for matching each of the segmentation images with each of the template images comprises: Aligning the ceramic heads of each segmentation image with the ceramic heads of each template image; Calculating the overlapping ratio between the central arm and the eccentric arm of each segmentation image and the central arm and the eccentric arm of each template image; The template image with the highest overlap ratio is selected as the outline of the optical fiber unit corresponding to the segmentation image.
7. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, the computer program is configured to be executed by the processor, and the computer program comprises instructions for executing the method according to any one of claims 1 to 6.
8. A storage medium storing a computer program, wherein when the computer program is executed by a computer, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Multi-target optical fiber position accurate detection system and use method thereof
CN110487183A
Anti-collision operation planning method for optical fiber operation of multi-target optical fiber spectrum astronomical telescope
CN117182900A
Single target positioning method based on lightweight improved Unet semantic segmentation network
CN117237620A
Optical fiber positioning unit dynamic path planning method based on genetic algorithm
CN117669704A
Collision avoidance using an object contour
WO2022146623A1