An optical fiber end face defect detection method, system and electronic device
Patent Information
- Application Number
- CN202611274863.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-21
- Publication Date
- 2026-11-03
AI Technical Summary
Existing fiber optic end-face inspection technologies suffer from low efficiency, subjective judgment, and serious missed detections, failing to meet the demands of high detection rates, low false detection rates, and high-speed mass production in industrial scenarios. Furthermore, traditional machine vision solutions have not been specifically optimized for the highly reflective curved surface characteristics of fiber optic ceramic end faces, making imaging susceptible to reflections, uneven lighting, workpiece clamping misalignment, and equipment vibration interference.
It adopts customized dynamic focusing imaging, partitioned adaptive preprocessing, dynamic mask segmentation, a three-level progressive detection architecture and a dual-algorithm bidirectional verification mechanism, including multi-level progressive defect detection, partitioned filtering, dynamic mask segmentation and bidirectional cross-verification. Through adaptive focusing imaging, differentiated filtering kernel size, dynamic mask segmentation and multi-level detection, it improves detection accuracy and robustness.
It achieves high-quality image input, significantly improves detection accuracy and robustness, increases detection speed by 30%, increases detection rate from 97.1% to 99.6%, reduces false detection rate by 80%, and adapts to the high-precision mass production requirements of fiber optic connectors.
Smart Images

Figure CN123032689A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of machine vision industrial inspection technology, and in particular to a method, system and electronic equipment for detecting defects at the end face of optical fibers. Background Technology
[0002] Fiber optic connectors are fundamental core components in 5G communications, data centers, and high-speed computing networks. The quality of their end faces directly determines optical signal coupling loss and link transmission stability. After undergoing multiple processes such as cutting, grinding, polishing, and cleaning, fiber optic connectors are highly susceptible to defects such as micro-dust stains, dotted impurities, fine scratches, edge chipping, and end face gaps. Micrometer-level defects can cause bit errors in high-speed optical modules, link fluctuations, or even disconnections.
[0003] Existing fiber optic end-face visual inspection technologies generally suffer from technical shortcomings: traditional manual inspection is inefficient, subjective in judgment, and prone to missed defects; conventional machine vision solutions mostly adopt a general fixed focus, globally unified preprocessing, and single-algorithm inspection mode, without specific optimization for the highly reflective curved surface characteristics of fiber optic ceramic end faces, making imaging susceptible to reflections, uneven lighting, workpiece clamping misalignment, and equipment vibration interference. Furthermore, traditional inspection solutions often involve single-stage inspection or simple parallel operation of two algorithms, resulting in slow global inference speed, numerous missed defects for minute defects, a large amount of noise and false defects, and insufficient inspection accuracy in high-risk areas.
[0004] Existing technologies lack a systematic architectural design to address the pain points of fiber optic end-face inspection, and cannot simultaneously meet the four demands of high detection rate, low false detection rate, high-speed mass production, and strong robustness in industrial scenarios. Therefore, there is an urgent need for an integrated intelligent inspection method with dedicated imaging control, multi-level progressive screening, and multi-layer cross-verification. Summary of the Invention
[0005] To address the aforementioned shortcomings of existing technologies, this invention provides a method, system, and electronic device for detecting defects at the fiber optic end face. By employing customized dynamic focusing imaging, adaptive preprocessing of partitions, dynamic mask segmentation, a three-level progressive detection architecture, and a dual-algorithm bidirectional verification mechanism, it solves the problems of insufficient accuracy and poor robustness of traditional solutions.
[0006] In a first aspect, embodiments of this application provide a method for detecting fiber optic end-face defects based on multi-level progressive verification, comprising the following steps: Acquire an initial end-face image of the optical fiber end face, and select end-face images whose clarity meets preset conditions from the initial image to obtain the selected end-face images; The region containing the fiber end face and the surrounding background region in the filtered end face image are subjected to partitioned filtering to obtain a filtered end face image. Edge detection and contour extraction are performed on the filtered end face image. The extracted contours are fitted and repaired, and a dynamic mask that adaptively adjusts with contour offset is generated based on the fitted contours. The filtered end-face image is segmented based on the mask to obtain an effective detection region; Multi-level progressive defect detection is performed within the effective detection area to obtain initial defect detection results, which include defect classification results, defect size data, and initial high-risk area verification results. Based on the fiber optic defect detection standard, the initial defect detection results are comprehensively judged, and the end face defect detection results are output. The multi-level progressive defect detection includes: Spot detection is performed on the effective detection area to mark suspected defect areas; The marked suspected defect areas are classified, detected, and sized to obtain defect classification results and defect size data; Edge gradient verification is performed on the preset high-risk areas in the effective detection area to obtain the verification results of the high-risk areas; at the same time, false defects caused by noise are eliminated through bidirectional cross-verification of spot detection and classification detection results.
[0007] Preferably, the process of acquiring an initial end-face image of the optical fiber end face, and then selecting end-face images from the initial end-face images that meet preset clarity conditions to obtain the selected end-face images, includes: Acquire images of the fiber optic end face to obtain an initial end face image; The initial end face image is subjected to a linkage adjustment process between the focus position and the light source brightness to filter out end face images whose clarity meets the preset conditions, thereby obtaining the filtered end face images. The process of adjusting the focus position and light source brightness of the initial end-face image includes: The first focusing step size is used to traverse the focusing range of the initial end face image. At each focusing position, an intermediate end face image is acquired. The sharpness of each acquired intermediate fiber end face image is evaluated. The sharpness range is determined based on the image sharpness evaluation function. When the sharpness is close to the peak threshold, the second focusing step size is switched to focus. The second focusing step size is smaller than the first focusing step size. During the focus position adjustment process, the average grayscale value of the middle end face image acquired at each focus position is evaluated, and the brightness of the light source is dynamically adjusted according to the grayscale value evaluation result. When the average grayscale value is lower than the lower limit of the preset target grayscale range, a brightening adjustment is performed. When the average grayscale value is higher than the upper limit of the target grayscale range, a dimming adjustment is performed. When the average grayscale value is within the target grayscale range, the current light source brightness is maintained.
[0008] Preferably, the step of performing partitioned filtering on the region where the fiber end face is located and the surrounding background region in the filtered end face image to obtain the filtered end face image includes: The image of the screened end face is converted to grayscale to obtain a grayscale image; The region where the fiber end face is located in the grayscale image is filtered using a filter kernel of a first size, and the surrounding background region in the grayscale image is filtered using a filter kernel of a second size, wherein the first size is smaller than the second size. The filtered image is subjected to partition contrast enhancement processing to obtain the filtered end face image.
[0009] Preferably, the step of performing edge detection and contour extraction on the filtered end-face image, fitting and repairing the extracted contours, and generating a dynamic mask based on the fitted contours includes: An edge detection algorithm is used to process the filtered end face image to extract the outer contour of the fiber end face; The broken and offset portions in the outer contour are repaired by least squares fitting to obtain a fitted and repaired contour. The fitted and repaired contour is filled to generate the dynamic mask.
[0010] Preferably, the filtered end-face image is segmented based on the mask to obtain an effective detection region, including: The image of the filtered end face is processed by the dynamic mask, the image area covered by the dynamic mask is retained, and the background area not covered by the dynamic mask is removed to obtain the effective detection area of the fiber end face.
[0011] Preferably, the step of performing spot detection on the effective detection area and marking suspected defect areas includes: Adaptive threshold segmentation is performed on the image of the effective detection region to obtain a binarized image; The binarized image is subjected to connected component filtering. Connected components that meet the preset gray-level anomaly conditions are marked as suspected defect regions, and the coordinate information of the suspected defect regions is output. The preset grayscale anomaly condition is that the difference between the average grayscale of the connected region and the grayscale of the surrounding background is greater than a preset threshold, and the area of the connected region is within a preset size range.
[0012] Preferably, the step of classifying and measuring the size of the marked suspected defect areas to obtain defect classification results and defect size data includes: The suspected defective region is used as the inference region and input into a pre-trained lightweight detection network; The lightweight detection network is used to extract features from the inference region to complete defect category classification and defect contour reconstruction, thereby obtaining defect classification information and defect contour information. The defect size is quantitatively calculated based on the defect classification information and the defect contour information to obtain the defect classification result and defect size data; The defect classification information is matched and verified with all marked areas of the spot detection, and the marked areas of the spots that do not match the corresponding defect classification information are removed.
[0013] Preferably, the step of performing edge gradient verification on the preset high-risk areas within the effective detection area to obtain the high-risk area verification result includes: The fiber core area at the fiber end face is designated as the preset high-risk area; An edge gradient detection algorithm is used to traverse and verify the preset high-risk area, extract the scratch edges and chipped edge contours, and obtain defect edge information; Based on the defect edge information, the edge ambiguity omissions and contour misjudgments in the classification detection results are corrected to obtain the high-risk area verification results.
[0014] In a second aspect, embodiments of this application provide an optical fiber end-face defect detection system implemented using the method described in any one of the first aspects, comprising: The image acquisition module is used to acquire an initial end-face image of the optical fiber end face, and to select end-face images whose clarity meets preset conditions from the initial image to obtain the selected end-face images. The partition filtering module is used to perform partition filtering on the region where the optical fiber end face is located and the surrounding background region in the filtered end face image to obtain the filtered end face image. The mask generation module is used to perform edge detection and contour extraction on the filtered end face image, fit and repair the extracted contours, and generate a dynamic mask that adaptively adjusts with contour offset based on the fitted contours. The region segmentation module is used to segment the filtered end face image based on the mask to obtain an effective detection region; A multi-level detection module is used to perform multi-level progressive defect detection within the effective detection area to obtain initial defect detection results, which include defect classification results, defect size data, and initial high-risk area verification results. The comprehensive judgment module is used to comprehensively judge the initial defect detection results based on the optical fiber defect detection standard and output the end face defect detection results.
[0015] Thirdly, embodiments of this application provide an electronic device, including: at least one memory for storing a computer program; and at least one processor for executing the computer program stored in the memory to implement the method described in any one of the first aspects.
[0016] Compared with the solutions of the prior art, the present invention has at least the following beneficial technical effects: (1) An imaging strategy of coarse and fine dual-stage adaptive focusing and gray-scale step dimming is adopted; by quickly locking the sharpness range with a large step size and accurately locking the peak with a small step size, and with three levels of gray-scale dynamic adjustment of the light source brightness, the gray-scale of the image is stabilized in the optimal range, suppressing specular reflection and uneven brightness from the source of imaging; the gray-scale contrast of defects is significantly improved, and the features of micron-level scratches and point impurities are completely preserved, providing high-quality image input for subsequent high-precision detection; (2) Differentiated filter kernel sizes are used for the core area of the end face and the surrounding background, combined with partition contrast enhancement; small-sized filter kernels retain the edges of the fine defects in the fiber core, while large-sized filter kernels filter out meaningless noise from the periphery, achieving the optimal balance between noise reduction and detail preservation, and avoiding invalid noise from entering the subsequent detection link. (3) By using Canny edge extraction and least squares circle fitting to repair the fracture contour, a dynamic mask that adapts to the workpiece offset is generated; it is compatible with clamping eccentricity and vibration offset within ±0.2mm, and there is no need to manually recalibrate the mask position. It is suitable for the complex working conditions of continuous production line and its robustness is significantly better than the fixed mask solution.
[0017] (4) Construct a three-level convergence architecture of full-domain coarse screening, local fine inspection, and high-risk verification; the first-level spot detection removes most of the defect-free blank areas at low cost, greatly reducing the number of pixels for deep learning inference; the second-level network accurately classifies and measures the size of local ROIs; the third-level edge algorithm specifically strengthens the edge detection capability of high-risk areas of the fiber core; the three-level convergence ultimately achieves a dual improvement in detection speed and accuracy of high-risk areas. (5) Construct a bidirectional cross-validation mechanism between speckles and deep learning; the high sensitivity of speckles provides weak defect priors for deep learning, supplementing the detection capability of low-contrast small defects; the structured classification capability of deep learning filters out isolated gray-scale noise and eliminates pseudo-defects without physical structure; after bidirectional complementarity, the false detection rate is greatly reduced, while ensuring a high detection rate. (6) The overall algorithm architecture is lightweight and modular. The parameters of each link can be adaptively adjusted according to multiple connectors such as LC / SC / FC / MPO. It can adapt to two scenarios, namely desktop sampling inspection and online inspection of production line, without replacing hardware. The mass production deployment and maintenance costs are low and the industrial versatility is strong.
[0018] In summary, this invention, through its technical architecture of dedicated imaging control, partitioned preprocessing, dynamic mask segmentation, three-level progressive detection, and bidirectional cross-verification, systematically solves the problems of imaging interference, single detection level, numerous false defects, and lack of verification in high-risk areas in fiber optic end-face defect detection throughout the entire process from image acquisition to result determination. Experimental data shows that this invention achieves a comprehensive defect detection rate of 99.6% and a false detection rate as low as 0.3%. Compared with traditional single-level algorithm schemes, it improves detection accuracy by 2.5%, reduces the false detection rate by 80%, and increases single-frame detection speed by 30%. It can stably adapt to the high-precision mass production inspection requirements of fiber optic connectors, demonstrating significant technological advancements and broad application prospects. Attached Figure Description
[0019] Exemplary embodiments of the present invention can be more fully understood by referring to the accompanying drawings. The drawings are provided to further illustrate the embodiments of this application and form part of the specification. They are used together with the embodiments of this application to explain the present invention and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same components or steps.
[0020] Figure 1 A flowchart of a fiber optic end-face defect detection method provided as an exemplary embodiment of this application; Figure 2 An overall flowchart of a fiber optic end-face defect detection method provided for an exemplary embodiment of this application; Figure 3 A schematic diagram illustrating the functional region division of an optical fiber endface provided for an exemplary embodiment of this application; Figure 4 A schematic diagram of defect detection results provided for an exemplary embodiment of this application; Figure 5 A schematic diagram of the structure of an optical fiber end-face defect detection system provided as an exemplary embodiment of this application; Figure 6 A schematic diagram of an electronic device provided for an exemplary embodiment of this application; Figure 7 This is a schematic diagram of a computer-readable medium provided for an exemplary embodiment of this application. Detailed Implementation
[0021] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0022] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for 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, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0023] Furthermore, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0024] Please refer to Figure 1 , Figure 1 This is a fiber optic end-face defect detection method according to some embodiments of this application. The method implemented in this disclosure is executed by a processor in an electronic device, and the method includes the following steps: S110: Acquire an initial end-face image of the optical fiber end face, and select end-face images whose clarity meets preset conditions from the initial images to obtain the selected end-face images. S120, Perform partitioned filtering on the region where the optical fiber end face is located and the surrounding background region in the filtered end face image to obtain a filtered end face image; S130 performs edge detection and contour extraction on the filtered end face image, fits and repairs the extracted contours, and generates a dynamic mask that adaptively adjusts with contour offset based on the fitted contours. S140, The filtered end face image is segmented based on the mask to obtain an effective detection region; S150 performs multi-level progressive defect detection within the effective detection area to obtain initial defect detection results, which include defect classification results, defect size data, and initial high-risk area review results. S160 comprehensively judges the initial defect detection results based on the fiber optic defect detection standard and outputs the end-face defect detection results.
[0025] It should be noted that the method in this embodiment constitutes an integrated detection scheme with multi-level progression, region convergence, and cross-verification. In the entire processing flow, image acquisition provides high-quality image input for subsequent detection, partition preprocessing and dynamic mask segmentation lock the effective detection area, three-level progressive detection gradually converges the detection range and improves detection accuracy, and a two-way verification mechanism filters out false defects. Each step is interconnected and works together to ensure the accuracy of the detection results.
[0026] Please refer to Figure 2 , Figure 2This is an overall flowchart of a fiber optic end-face defect detection method in some embodiments of this application. This embodiment will further explain the method in the foregoing embodiments in conjunction with a detailed process.
[0027] Specifically, in step S110, an image acquisition hardware platform is built, consisting of an industrial CCD camera, a telecentric lens, a continuously adjustable ring-shaped shadowless light source, and a high-precision motorized Z-axis focusing module. To address the issues of high reflectivity at the fiber optic ceramic end face and imaging interference from curved surfaces, an imaging strategy is designed that integrates adaptive focusing step size switching with dynamic linkage of light source brightness.
[0028] After acquiring images of the fiber optic end face, the focus position and light source brightness are adjusted in conjunction: a first focus step size is used to traverse the focus range for coarse focusing. At each focus position, intermediate end face images are acquired, and the sharpness of each acquired intermediate end face image is evaluated. The sharpness range is determined based on the Laplacian variance function; the sharper the image, the larger the Laplacian variance function value. When the sharpness approaches the peak threshold, the focus is switched to a second focus step size for precise focus locking. The peak threshold is an empirical value determined through multiple calibrations. When the sharpness value rises to more than 90% of the peak threshold, it is considered close to the peak range, triggering a step size switch. The focus step size is determined by dividing the total travel of the corresponding stage by the number of samples. Coarse focusing has a large total travel and a large step size for quickly locating the sharpness range; fine focusing has a small total travel and a small step size for accurately locking the optimal imaging plane.
[0029] As an alternative implementation, the image sharpness evaluation function can also use the gradient energy summation function, and the present invention does not specifically limit this.
[0030] In a preferred embodiment, the total travel distance during the coarse focusing stage is 0.1 mm, and the total travel distance during the fine focusing stage is 0.02 mm. The step size is the total motor travel distance divided by the number of focusing attempts. During the focus position adjustment process, the average grayscale value of the intermediate end face image acquired at each focus position is evaluated simultaneously. The brightness of the ring light source is dynamically adjusted based on the grayscale value evaluation result, as follows: The preset optimal grayscale range is 90~160. When the average grayscale value is within this range, the current light source brightness remains unchanged. When the average grayscale value is below 90, the brightness adjustment is applied; when the average grayscale value is above 160, the brightness adjustment is applied.
[0031] The light source brightness adopts a stepped dimming rule, with the ring light source divided into 0-100 brightness levels: For slight deviations (70 ≤ mean < 90 or 160 < mean ≤ 180), the single adjustment step is 2 levels; for moderate deviations (40 ≤ mean < 70 or 180 < mean ≤ 210), the single adjustment step is 5 levels; for severe deviations (mean < 40 or mean > 210), the single adjustment step is 10 levels. The minimum brightness level is no lower than 5 levels, and the maximum is no higher than 95 levels. This stepped dimming rule avoids brightness fluctuations caused by excessive single-step adjustments: small steps for slight deviations ensure stable light source brightness; large steps for severe deviations lead to rapid convergence, shortening dimming time. Simultaneously, setting brightness boundaries of 5-95 levels prevents lifespan degradation and brightness instability caused by operating the light source at its limits.
[0032] This application effectively suppresses the interference of reflection from the curved surface of the ceramic end face by adjusting the focus and the light source in a coordinated manner, and obtains the original end face image with complete details and uniform brightness.
[0033] Specifically, the Laplace variance clarity evaluation function is as follows: (1); in, This is the Laplacian variance sharpness evaluation function; the larger the value, the sharper the image. For image In pixel coordinates The Laplacian operator response value at a given point is the second-order gradient value at that pixel; x and y are the x and y coordinates of the pixel, respectively; Σ represents the summation over all pixels in the image. The mean of the Laplace response values for the entire graph is expressed by the following formula: (2); Specifically, grayscale mean This can be expressed by the following formula: (3); in, The average gray level of the image. pixel coordinates The grayscale value.
[0034] It should be noted that the above-mentioned focus position adjustment and light source brightness adjustment share the same batch of intermediate end face images: the intermediate end face images collected at each focus position are used for both the sharpness evaluation of formula (1) to determine the timing of focus step size switching and the gray mean evaluation of formula (3) to determine the adjustment direction and adjustment step size of light source brightness. The two adjustment actions are executed alternately in the same focus traversal process until the image sharpness meets the preset conditions and the gray mean converges to the target gray range, thereby achieving the optimal imaging quality.
[0035] Specifically, in step S120, the acquired image is converted to grayscale, and two processing areas are divided by the outer contour boundary of the end face. The area inside the boundary is the effective detection area of the end face, and the area outside the boundary is the background area surrounding the insert. The contrast enhancement of the partition adopts a differentiated strategy: the grayscale contrast of the dark areas of the end face is increased to highlight the slight defects, and the grayscale extreme values of the bright reflective areas are suppressed to weaken the reflective noise.
[0036] Specifically, a small-sized Gaussian filter kernel (preferably 3×3) is used to filter the effective detection area of the fiber end face, preserving the edges of micron-level scratches and point defects; a large-sized Gaussian filter kernel (preferably 5×5) is used to filter the background area surrounding the ferrule, completely removing noise. Combined with zone contrast enhancement, the defect characteristics in dark areas are enhanced, and noise in bright reflective areas is suppressed, preserving the true defect characteristics to the greatest extent possible. In a preferred embodiment, in addition to Gaussian filtering, bilateral zone filtering can be used for even better detail preservation in strongly reflective scenes.
[0037] This application solves the problems of uneven brightness and local overexposure on the end face by using zoned differential preprocessing to filter out noise while retaining micron-level defect edge details.
[0038] Specifically, in step S130, the Canny edge detection algorithm is used to extract the outer contour of the ceramic ferrule. Addressing the issues of contour breakage and offset caused by vibration and slight eccentricity in industrial settings, a least-squares method is used for fault-tolerant fitting and repair. This is because equipment vibration and workpiece clamping eccentricity in industrial settings can cause breakage and positional shifts in the extracted outer contour. Least-squares fitting can utilize all valid contour sampling points to fit a complete standard circular contour, automatically completing broken sections and correcting the position of offset contours. The fitted center and radius accurately represent the actual position of the end face. A dynamic adaptive mask is generated based on the fitted accurate contour, and the mask boundary adaptively fine-tunes as the workpiece position shifts. The dynamic mask uses the fitted end face center as its center and the fitted radius as its boundary. When the workpiece clamping position shifts, the fitted center moves synchronously, and the mask boundary adaptively fine-tunes accordingly, eliminating the need for manual recalibration of the mask position. In a preferred embodiment, this segmentation method can adaptively adapt to workpiece clamping offsets within ±0.2mm, eliminating invalid background areas and accurately locking the end face detection area.
[0039] As an alternative implementation, dynamic mask generation can also be achieved by detecting or fitting the fiber core contour using spot detection or circular fitting methods, and generating a mask based on the contour. During automatic detection, the mask adaptively adjusts as the fiber core position moves. This approach is suitable for scenarios where the outer contour of the ceramic ferrule is highly reflective and edge extraction fails. It can achieve mask positioning through the inner contour of the fiber core, improving the robustness of the solution under extreme conditions.
[0040] Please refer to Figure 3 , Figure 3 This diagram illustrates the functional area division of the optical fiber endface according to an embodiment of this application. From the inside out, the diagram is divided into four regions: Region A is the fiber core region, the core path for optical signal transmission, and a high-risk, sensitive area for defects; Region B is the cladding region; Region C is the adhesive ring region; and Region D is the buffer layer region. This scheme pre-designates the innermost fiber core region as a high-risk verification region, performing targeted edge gradient secondary verification. The remaining peripheral regions only undergo the first two levels of detection, balancing detection accuracy and operational efficiency.
[0041] (4); in, For the extracted contour on the first The coordinates of each sampling point , These are the x-coordinate and y-coordinate of the center of the fitted circle, respectively; Let be the radius of the fitted circle; The objective function is to minimize the sum of the squares of the radial distance residuals from each contour sampling point to the fitted circle. By solving this objective function, a complete end face contour circle can be fitted using all valid contour sampling points, thus completing broken parts of the contour and correcting contour offsets.
[0042] Specifically, in step S140, after generating a dynamic mask based on the fitted contour, the dynamic mask is used to segment the filtered end-face image. The mask boundary is adaptively fine-tuned as the workpiece position shifts, eliminating invalid background areas and obtaining the effective detection area of the fiber end face. After mask segmentation, dust and reflective noise in the surrounding background are completely eliminated. Subsequent defect detection only needs to be performed within the effective area of the end face, which reduces the amount of unnecessary computation and avoids misidentifying background noise as defects, thus simultaneously improving detection efficiency and accuracy.
[0043] In practice, the dynamic mask and the filtered end face image are processed pixel by pixel through masking operations: pixels within the area covered by the dynamic mask are retained, while pixels outside the area covered by the dynamic mask are removed or marked as background, thereby separating the effective detection area of the fiber end face from the surrounding background area.
[0044] In a preferred embodiment, this segmentation method can adaptively adapt to workpiece clamping offsets within ±0.2mm, accurately lock the end face detection area, and avoid defect omissions or background misjudgments caused by incorrect segmentation of the fixed mask when the workpiece position is offset.
[0045] Specifically, in step S150, this embodiment performs a three-level progressive defect detection, and the specific process is as follows: Level 1: Spot Detection and Coarse Screening Across the Entire Area. Adaptive threshold segmentation and connected component feature filtering are performed on the entire end-face image to quickly capture all gray-level anomalies and tiny point-like suspected defects, outputting the coordinates of the suspected defect areas. Adaptive threshold segmentation can adapt to uneven lighting conditions on the end face. Connected component filtering uses dual constraints of gray-level difference and area range to mark connected components with a gray-level difference greater than a set threshold and an area within a preset size range as suspected defects. This ensures that weak gray-level anomalies are not missed while initially eliminating excessively large background interference areas.
[0046] This step achieves coarse localization of the defect area across the entire end face, eliminates invalid detection areas, and solves the problems of long global inference time and missed detection of weak defects in deep learning.
[0047] Level 2: Lightweight YOLO Local Precision Inspection. This level avoids full-image inference, focusing only on high-precision feature extraction of suspected defect ROIs marked in Level 1. It accurately classifies defects (stains, scratches, chipped edges, gaps) and simultaneously reconstructs defect contours and quantitatively calculates micrometer-level dimensions. Inference only on ROIs significantly reduces the number of pixels required for deep learning computation, improving detection speed. Furthermore, it focuses the network's attention on suspicious areas, enhancing sensitivity to micrometer-level defects. Defect size calculation uses pre-calibrated pixel equivalents (micrometers / pixel) to convert the pixel length of the defect contour into actual physical size, enabling quantitative detection.
[0048] Specifically, based on the pixel equivalent (micrometers / pixel) obtained from camera calibration, the pixel length of the defect contour is multiplied by the pixel equivalent to obtain the actual physical size of the defect. The lightweight YOLO model adopts the lightweight YOLOv5s structure and is trained on a massive number of industrial end-face defect samples, adapting to micrometer-level minute defect features. In a preferred embodiment, in addition to YOLOv5s, the MobileNet-SSD lightweight network can be used to adapt to low-computing-power embedded terminals.
[0049] Level 3: Secondary Verification of High-Risk Areas Using Edge Algorithms. For the optically sensitive core high-risk area of the fiber endface (i.e., the fiber core region), an edge gradient detection algorithm is used for independent secondary verification. This extracts the edges of minute scratches and chipped edges, correcting edge ambiguity and misjudgment issues that are prone to occur in deep learning models. The fiber core is the core path for optical signal transmission, and defects in this area have the greatest impact on transmission performance; therefore, it is designated as a high-risk area. The independent secondary verification using the edge gradient detection operator can accurately extract the edge contours of scratches and chipped edges, correcting the missed detections and size measurement errors caused by blurred edge features in deep learning models, further improving the reliability of high-risk area detection.
[0050] Simultaneously, a dual-algorithm bidirectional verification mechanism is implemented: blob detection provides the YOLO model with prior suspected regions, improving the sensitivity of weak defect detection; the structured defect detection results of the YOLO model inversely verify the blob detection output, filtering isolated noise points and pseudo-defects with abrupt grayscale changes, significantly reducing the overall false detection rate. The bidirectional verification creates complementary gains: blob detection has high sensitivity and can capture weak defects with extremely low contrast, providing prior regions of interest for deep learning and preventing minor defects from being ignored by the network; deep learning has semantic classification capabilities, distinguishing between real defects and isolated noise points, and inversely eliminating pseudo-anomalies in the blob detection output. The two are matched and correlated through intersection-union ratio (IOU); IOU greater than 0.5 is considered a valid defect, while isolated blobs without corresponding deep learning results are considered noise and eliminated.
[0051] This application achieves the overall effect of progressively narrowing the detection range, progressively improving the detection accuracy, and bidirectional filtering of false defects through three-level progressive convergence detection and bidirectional cross-validation.
[0052] Specifically, in step S160, a comprehensive judgment is made based on the fiber optic end-face inspection standard, combined with the defect type, defect size, and risk level of the defect. This comprehensive judgment follows a regional risk priority principle: defects located in high-risk areas such as the fiber core have stricter judgment standards, and defects of the same size have a higher judgment level in high-risk areas. Finally, combining the three dimensions of defect type, physical size, and regional risk level, a pass / fail judgment result is output according to the fiber optic end-face inspection standard, and the original image and defect marking image are saved simultaneously, achieving full traceability of production quality. The fiber optic end-face inspection standard can be customized according to customer needs. Through standardized result judgment output, structured management of inspection results and full-process traceability of production quality are achieved.
[0053] Please refer to Figure 4 , Figure 4 A schematic diagram of the defect detection results of this embodiment is shown. To verify the effectiveness of the method of this application, industrial mass-produced LC single-core fiber optic connectors were used as the test objects. The method was applied to a desktop high-precision fiber optic end-face inspection equipment, adapted to the real industrial working conditions of normal workshop lighting and slight clamping offset. 200 mass-produced fiber optic connectors were randomly selected and compared with the traditional single-level YOLO full-image inspection scheme for comparative testing.
[0054] Traditional single-level detection schemes use YOLOv5s to directly infer the entire image, which has three inherent limitations: First, the number of pixels for inference of the entire image is large, and the processing time per frame is high; second, the proportion of small defects is small and the features are weak, which the network can easily ignore, leading to missed detections; third, there is no independent verification step, and background noise is easily misjudged as defects.
[0055] This solution achieves systematic optimization through a three-level progressive approach and bidirectional verification. The derivation logic for each performance improvement is as follows: Derivation of the improved detection speed: The speckle coarse screening can remove about 92% of the defect-free background areas, and the YOLO network only needs to perform inference on the remaining 8% of suspected areas, which greatly reduces the number of pixels to be processed. Therefore, the detection speed per frame is improved by 30% compared with traditional full-image inference. Derivation of the improved detection rate: Spot detection first captures all gray-scale abnormal points, providing YOLO with a priori ROI region, avoiding low-contrast micro-defects being ignored by the network. Therefore, the overall defect detection rate is improved from 97.1% in the traditional solution to 99.6%, with an accuracy improvement of 2.5%. Reasoning for the reduction in false positive rate: The YOLO classification results are filtered in reverse to remove isolated noise points in the output of the spots and eliminate false anomalies without real defect structures. Therefore, the false positive rate is reduced from 1.5% in the traditional scheme to 0.3%, a reduction of 80%.
[0056] The final test results show that the overall defect detection rate of this invention is 99.6%, and the false detection rate is as low as 0.3%. Compared with the traditional single-level algorithm solution, the detection accuracy is improved by 2.5% and the false detection rate is reduced by 80%. At the same time, the model inference range is greatly narrowed and the single-frame detection speed is improved by 30%, which can stably adapt to the full inspection requirements of high-speed mass production on the production line.
[0057] It should be noted that the specific parameter values described in this embodiment (such as focusing stroke 0.1mm / 0.02mm, target grayscale range 90~160, dimming step size 2 / 5 / 10 levels, brightness level boundary 5~95, filter kernel size 3×3 / 5×5, clamping offset tolerance ±0.2mm, etc.) are all illustrative examples. Those skilled in the art can adjust them according to actual application scenarios, and they do not constitute a limitation on the present invention.
[0058] Please refer to Figure 5 This application provides an optical fiber end-face defect detection system 20, which corresponds one-to-one with the method steps in the aforementioned method embodiments, and further illustrates the method. The system 20 includes the following functional modules: Image acquisition module 210 is used to acquire an initial end face image of the optical fiber end face, and to select end face images whose clarity meets preset conditions from the initial end face image to obtain the selected end face image. The partition filtering module 220 is used to perform partition filtering on the region where the optical fiber end face is located and the surrounding background region in the filtered end face image to obtain the filtered end face image. The mask generation module 230 is used to perform edge detection and contour extraction on the filtered end face image, fit and repair the extracted contours, and generate a mask based on the fitted contours. The region segmentation module 240 is used to segment the filtered end face image based on the mask to obtain an effective detection region; The multi-level detection module 250 is used to perform multi-level progressive defect detection within the effective detection area to obtain initial defect detection results, which include defect classification results, defect size data, and initial high-risk area verification results. The multi-level progressive defect detection includes spot detection in the effective detection area to mark suspected defect areas, classification detection and size measurement of the marked suspected defect areas, and edge gradient verification of preset high-risk areas in the effective detection area. The comprehensive judgment module 260 is used to comprehensively judge the initial defect detection results based on the optical fiber defect detection standard and output the end face defect detection results.
[0059] It should be noted that the division of labor and naming of the modules and their sub-modules described in this embodiment are merely illustrative examples. Those skilled in the art can merge multiple modules into one module or split one module into multiple sub-modules with finer functions according to the actual system architecture. These adjustments do not affect the substance of the technical solution of this invention and should be considered as falling within the protection scope of this invention.
[0060] This application discloses specific implementation scenarios of the methods described in the above embodiments in some embodiments, so as to more specifically illustrate the specific workflow and beneficial effects of the methods and systems constituted by the methods in the present invention when facing multi-scenario deployment, especially the typical application of batch inspection of fiber optic connector end faces.
[0061] This embodiment takes industrially produced LC single-core fiber optic connectors as the testing object and provides a specific application scenario for desktop high-precision fiber optic end-face testing equipment.
[0062] Hardware platform configuration: industrial CCD camera, telecentric optical lens, continuously adjustable brightness ring shadowless light source, high-precision electric Z-axis focusing module.
[0063] During the inspection process, the equipment activates an adaptive focusing strategy. A coarse focusing step size of 0.1mm is used to quickly traverse and acquire sharpness ranges, while a fine focusing step size of 0.01mm is automatically switched to lock the optimal imaging plane near peak values. The light source brightness is dynamically adjusted based on the image grayscale to suppress specular reflections on the ceramic end face, resulting in high-definition, distortion-free end face images. A 3×3 Gaussian kernel filter is applied to the central area of the end face, while a 5×5 Gaussian kernel filter is applied to the surrounding background. The Canny algorithm is used to extract contours and fit and repair broken contours, generating a dynamic mask that adaptively adapts to workpiece clamping offsets within ±0.2mm. After the full end face coarse screening is completed by spot detection, the lightweight YOLOv5s model only infers for suspected areas. Finally, a second edge gradient check is performed on the high-risk core areas of the end face, and noise and false defects are eliminated through bidirectional verification. Products are strictly judged according to fiber optic end face inspection standards, and an inspection report is generated and image data is archived.
[0064] The method of this invention is applicable to desktop testing and automated production line online testing scenarios for LC, SC, FC, and MPO fiber optic connectors.
[0065] It should be noted that the specific hardware configuration and detection parameters described in this embodiment are merely illustrative examples, and those skilled in the art can make adjustments based on the actual detection object and production line conditions.
[0066] Please refer to Figure 6 This illustrates a schematic diagram of an electronic device provided by some embodiments of this application. For example... Figure 6 As shown, the electronic device 30 includes: a processor 300, a memory 301, a bus 302, and a communication interface 303. The processor 300, the communication interface 303, and the memory 301 are connected via the bus 302. The memory 301 stores a computer program that can run on the processor 300. When the processor 300 runs the computer program, it executes the method described above in this application.
[0067] The memory 301 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 303 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network.
[0068] Bus 302 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. The memory 301 is used to store programs. After receiving an execution instruction, the processor 300 executes the program. The methods disclosed in any of the foregoing embodiments of this application can be applied to the processor 300, or implemented by the processor 300.
[0069] The processor 300 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 300 or by instructions in software form. The processor 300 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 301. The processor 300 reads the information in memory 301 and, in conjunction with its hardware, completes the steps of the above method.
[0070] It should be noted that the electronic device provided in this embodiment is based on the same inventive concept as the above method embodiment. It can be deployed at the fiber optic connector inspection station and cooperate with peripheral equipment such as industrial cameras, ring light sources, and electric focusing modules to realize the fully automated inspection of fiber optic end face defects.
[0071] This application also provides a computer-readable medium corresponding to the method provided in the foregoing embodiments. Please refer to... Figure 7 The computer-readable storage medium shown is an optical disc 40, on which a computer program (i.e., a program product) is stored, which, when run by a processor, performs the aforementioned method.
[0072] The computer-readable storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks. In a specific application scenario, the computer-readable storage medium can be built into an industrial inspection control computer as part of the firmware; or it can be installed on the target device as a standalone software product through downloading or physical distribution, enabling existing hardware devices with only basic image acquisition capabilities to acquire the fiber optic end-face defect detection function described in this invention after loading and executing the computer program on the storage medium.
[0073] The computer-readable storage medium provided in the above embodiments of this application and the method provided in the embodiments of this application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the applications stored therein.
[0074] This embodiment provides a computer program product, which includes a computer program. When executed by a processor, the computer program implements the optical fiber end-face defect detection method as described in any of the above embodiments.
[0075] This computer program product can be deployed on industrial servers to provide fiber optic defect detection capabilities to multiple inspection terminals as a service; it can also be packaged as a software development kit (SDK) for integration and use by third-party vision inspection systems, enabling applications integrating the SDK to obtain the multi-level progressive fiber optic end-face defect detection capabilities of this invention without increasing additional hardware costs or modifying existing image acquisition links.
[0076] It should be noted that the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0077] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0078] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and there may be other division methods in actual implementation. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interface; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0079] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0080] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0081] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application, and they should all be covered within the scope of the claims and specification of this application.
Claims
1. A method for detecting defects at the end face of an optical fiber, characterized in that, Includes the following steps: An initial end-face image of the optical fiber end face is acquired, and end-face images with clarity meeting preset conditions are selected from the initial image to obtain the selected end-face images. The region containing the fiber end face and the surrounding background region in the filtered end face image are subjected to partitioned filtering to obtain a filtered end face image. Edge detection and contour extraction are performed on the filtered end face image. The extracted contours are fitted and repaired, and a dynamic mask that adaptively adjusts with contour offset is generated based on the fitted contours. The filtered end-face image is segmented based on the mask to obtain an effective detection region; Multi-level progressive defect detection is performed within the effective detection area to obtain initial defect detection results, which include defect classification results, defect size data, and high-risk area verification results. Based on the fiber optic defect detection standard, the initial defect detection results are comprehensively judged, and the end face defect detection results are output. The multi-level progressive defect detection includes: Spot detection is performed on the effective detection area to mark suspected defect areas; The marked suspected defect areas are classified, detected, and sized to obtain defect classification results and defect size data; Edge gradient verification is performed on the preset high-risk areas in the effective detection area to obtain the verification results of the high-risk areas; at the same time, false defects caused by noise are eliminated through bidirectional cross-verification of spot detection and classification detection results.
2. The method according to claim 1, characterized in that, The process of acquiring an initial end-face image of the optical fiber end face, and then selecting end-face images from the initial end-face images that meet preset clarity criteria to obtain the selected end-face images includes: Acquire images of the fiber optic end face to obtain an initial end face image; The initial end face image is subjected to a linkage adjustment process between the focus position and the light source brightness to filter out end face images whose clarity meets the preset conditions, thereby obtaining the filtered end face images. The process of adjusting the focus position and light source brightness of the initial end-face image includes: The first focusing step size is used to traverse the focusing range of the initial end face image. At each focusing position, an intermediate end face image is acquired. The sharpness of each acquired intermediate fiber end face image is evaluated. The sharpness range is determined based on the image sharpness evaluation function. When the sharpness is close to the peak threshold, the second focusing step size is switched to focus. The second focusing step size is smaller than the first focusing step size. During the focus position adjustment process, the average grayscale value of the middle end face image acquired at each focus position is evaluated, and the brightness of the light source is dynamically adjusted according to the grayscale value evaluation result. When the average grayscale value is lower than the lower limit of the preset target grayscale range, a brightening adjustment is performed. When the average grayscale value is higher than the upper limit of the target grayscale range, a dimming adjustment is performed. When the average grayscale value is within the target grayscale range, the current light source brightness is maintained.
3. The method according to claim 1, characterized in that, The step of performing partitioned filtering on the region where the fiber end face is located and the surrounding background region in the filtered end face image to obtain a filtered end face image includes: The image of the screened end face is converted to grayscale to obtain a grayscale image; The region where the fiber end face is located in the grayscale image is filtered using a filter kernel of a first size, and the surrounding background region in the grayscale image is filtered using a filter kernel of a second size, wherein the first size is smaller than the second size. The filtered image is subjected to partition contrast enhancement processing to obtain the filtered end face image.
4. The method according to claim 1, characterized in that, The step of performing edge detection and contour extraction on the filtered end-face image, fitting and repairing the extracted contours, and generating a dynamic mask based on the fitted contours includes: An edge detection algorithm is used to process the filtered end face image to extract the outer contour of the fiber end face; The broken and offset portions in the outer contour are repaired by least squares fitting to obtain a fitted and repaired contour. The fitted and repaired contour is filled to generate the dynamic mask.
5. The method according to claim 1, characterized in that, The filtered end-face image is segmented based on the mask to obtain an effective detection region, including: The image of the filtered end face is processed by the dynamic mask, the image area covered by the dynamic mask is retained, and the background area not covered by the dynamic mask is removed to obtain the effective detection area of the fiber end face.
6. The method according to claim 1, characterized in that, The step of performing spot detection on the effective detection area and marking suspected defect areas includes: Adaptive threshold segmentation is performed on the image of the effective detection region to obtain a binarized image; The binarized image is subjected to connected component filtering. Connected components that meet the preset gray-level anomaly conditions are marked as suspected defect regions, and the coordinate information of the suspected defect regions is output. The preset grayscale anomaly condition is that the difference between the average grayscale of the connected region and the grayscale of the surrounding background is greater than a preset threshold, and the area of the connected region is within a preset size range.
7. The method according to claim 6, characterized in that, The process of classifying, detecting, and measuring the dimensions of the marked suspected defect areas to obtain defect classification results and defect size data includes: The suspected defective region is used as the inference region and input into a pre-trained lightweight detection network; The lightweight detection network is used to extract features from the inference region to complete defect category classification and defect contour reconstruction, thereby obtaining defect classification information and defect contour information. The defect size is quantitatively calculated based on the defect classification information and the defect contour information to obtain the defect classification result and defect size data; The defect classification information is matched and verified with all marked areas of the spot detection, and the marked areas of the spots that do not match the corresponding defect classification information are removed.
8. The method according to claim 7, characterized in that, The step of performing edge gradient verification on the preset high-risk areas within the effective detection area to obtain the high-risk area verification result includes: The fiber core area at the fiber end face is designated as the preset high-risk area; An edge gradient detection algorithm is used to traverse and verify the preset high-risk area, extract the scratch edges and chipped edge contours, and obtain defect edge information; Based on the defect edge information, the edge ambiguity omissions and contour misjudgments in the classification detection results are corrected to obtain the high-risk area verification results.
9. A fiber optic end-face defect detection system implemented using the method of any one of claims 1 to 8, characterized in that, include: The image acquisition module is used to acquire an initial end-face image of the optical fiber end face, and to select end-face images whose clarity meets preset conditions from the initial image to obtain the selected end-face images. The partition filtering module is used to perform partition filtering on the region where the optical fiber end face is located and the surrounding background region in the filtered end face image to obtain the filtered end face image. The mask generation module is used to perform edge detection and contour extraction on the filtered end face image, fit and repair the extracted contours, and generate a dynamic mask that adaptively adjusts with contour offset based on the fitted contours. The region segmentation module is used to segment the filtered end face image based on the mask to obtain an effective detection region; A multi-level detection module is used to perform multi-level progressive defect detection within the effective detection area to obtain initial defect detection results, which include defect classification results, defect size data, and initial high-risk area verification results. The comprehensive judgment module is used to comprehensively judge the initial defect detection results based on the optical fiber defect detection standard and output the end face defect detection results.
10. An electronic device, characterized in that, include: At least one memory for storing computer programs; At least one processor is configured to execute a computer program stored in the memory to implement the method of any one of claims 1 to 8.
