Spaceflight electrical connector excess material detection method
Patent Information
- Application Number
- CN202410966489.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2044-07-18
AI Technical Summary
另外也有助焊剂进入插孔合件内部,形成非导电的多余物,影响了插针和接触圈、接触圈和护管之间的有效接触,进而造成接触不良的情况
[0027]本发明的有益效果,本发明先采用掩模方式屏蔽检测图像中电连接器的外部区域和插针,从同型号的无多余物产品检测图片中提取出印刷线,来绘制印刷线模板图,再覆盖到检测图像上,并使用类间方差对检测图像进行二值化处理,然后使用形态学的膨胀操作恢复被覆盖的部分面积,得到疑似多余物区域图像,由于拍摄电连接器时的角度、距离等的影响,有一部分印刷线可能仍旧会被检测截取出来作为疑似多余物区域,所以采用训练后的二分类检测模型确定是否是多余物,本发明采用视觉检测结合机器学习的方法进行电连接器多余物检测,降低计算复杂度的同时提高准确度,实验验证,本发明能够有效检测出常见的金属多余物。
Smart Images

Figure CN118823000B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for detecting foreign objects in aerospace electrical connectors, belonging to the field of automated testing technology. Background Technology
[0002] Undetected foreign objects in aerospace electrical connectors can lead to electrical system failures, subsequently causing aerospace equipment malfunctions and posing a significant threat to aerospace missions. With the rapid development of microelectronics technology, connector failures caused by foreign objects are becoming increasingly prominent. Analysis of cases where foreign objects cause connector failures reveals that the main cause is metal, primarily generated during repeated insertion and removal, friction between rollers and threaded grooves, assembly, and external introduction during production. Additionally, flux can enter the socket assembly, forming non-conductive foreign objects that affect the effective contact between the pins and contact rings, and between the contact rings and the protective sheath, leading to poor contact. Currently, the detection method for foreign objects in electrical connectors is manual sampling, which cannot cover all products deployed on ships, posing a significant potential hazard.
[0003] If visual detection is used for unwanted object detection, the most complex background masking for unwanted object detection is the masking of printed lines. Since most unwanted objects are metal debris, their grayscale features are highly similar in the image, and a simple global processing method cannot be used to uniformly process the entire image. Summary of the Invention
[0004] To address the problem of how to effectively detect foreign metal objects, this invention provides a method for detecting foreign objects in aerospace electrical connectors that combines visual inspection with machine learning.
[0005] The present invention provides a method for detecting foreign objects in aerospace electrical connectors, comprising:
[0006] An image of the aerospace electrical connector under test is acquired, and the outer area and pins of the connector image are shielded using a mask to obtain the test image;
[0007] The printing lines are extracted from the inspection images of products of the same model without extraneous materials, a printing line template is drawn, and the printing line template is overlaid on the inspection image in the form of black lines through transmission transformation.
[0008] The detection image of the overprinted printing line template is binarized using inter-class variance. Morphological dilation is then applied to the binarized detection image, and the suspected extraneous object region is extracted from the dilated detection image.
[0009] The image of the suspected redundant object region is used as the input image and fed into the binary classification detection model. The binary classification detection model outputs the classification result to determine whether it is a redundant object. The binary classification detection model is implemented by training a deep learning network.
[0010] As a preferred method, the electrical connector pins are shielded using a mask:
[0011] The centroid position of the pin is obtained based on the pin identification and positioning algorithm. Using this centroid position as the center, the radius pixel value of the circle is calculated based on the calibrated pixel equivalent and the inner circle diameter of the electrical connector. The circle for masking is then drawn, and all elements outside the circle are black. The inner circle diameter of the electrical connector is obtained by actual measurement.
[0012] As a preferred method, the printing lines are extracted from inspection images of products of the same model without any extraneous materials, and a printing line template diagram is drawn:
[0013] Use edge detection methods to extract printing lines from images of products of the same model without any extraneous objects;
[0014] The extracted printed lines are expanded to obtain the printed line outline;
[0015] Create an image with a transparent background of the same size as the detection image, and draw the obtained printing line outline on the image with black lines to form the first obtained printing line template image.
[0016] The transparent channel on the first obtained printed line template image is fused with the product image without any extraneous objects. The contour of the fused image is extracted and drawn as black lines onto the first obtained printed line template image to obtain the second obtained printed line template image. According to the correspondence of the coordinates of the same-order insertion points in the detection image, a transmission transformation is performed to align the second obtained printed line template image with the aerospace electrical connector under test, thus obtaining the final printed line covering template.
[0017] As a preferred option, when the second obtained printed line template is aligned with the aerospace electrical connector under test, the pin position is determined by combining the RANSAC algorithm.
[0018] As a preferred method, the following approach is used to train the binary classification detection model:
[0019] Obtain metal foreign objects of different sizes, lengths, and shapes. Randomly place the obtained metal foreign objects in different positions in different electrical connectors. Capture images of suspected foreign object areas. Expand the captured images to obtain two types of training images: metal foreign object area images and uncovered printed line images. Use the two types of images to train the binary classification detection model.
[0020] During training, grayscale images of the training images are acquired, and all grayscale images are scaled to the same size H×H, where H represents the height of the grayscale image. The scaled grayscale images are then converted to have a dimension of 1×H×H, with the tensor normalized in the range of [0,1]. The grayscale images with the converted dimensions are then normalized to a standard Gaussian distribution with a mean close to 0 and a standard deviation close to 1.
[0021] As a preferred embodiment, the binary classification detection model includes a 3×3 convolutional layer, an attention module, ShuffleNet-V2 unit 1, ShuffleNet-V2 unit 2, ShuffleNet-V2 unit 3, a 1×1 convolutional layer, an average pooling layer, and a fully connected layer. The input image is fed into the 3×3 convolutional layer, and the output of the 3×3 convolutional layer is then fed into the attention module, which weights the convolutional features. The output of the attention module is then fed into ShuffleNet-V2 unit 1, the output of ShuffleNet-V2 unit 1 is then fed into ShuffleNet-V2 unit 2, the output of ShuffleNet-V2 unit 2 is then fed into ShuffleNet-V2 unit 3, the output of ShuffleNet-V2 unit 3 is then fed into the 1×1 convolutional layer, and the output of the 1×1 convolutional layer is then fed into an average pooling layer and a fully connected layer. The fully connected layer outputs the classification result.
[0022] The first ShuffleNet-V2 unit consists of one downsampling unit and three basic units stacked together.
[0023] The second ShuffleNet-V2 unit consists of one downsampling unit and seven basic units stacked together.
[0024] The third ShuffleNet-V2 unit consists of one downsampling unit and three basic units stacked together.
[0025] The basic unit consists of two branches, upper and lower. The input feature map is divided into two halves, which are then fed into the upper and lower branches respectively. The half feature map of the upper branch is processed by a first 1×1 convolution, a 3×3 depthwise convolution, and a second 1×1 convolution. The result of the second 1×1 convolution in the upper branch is then concatenated with the half feature map of the lower branch. The result of the concatenation is the output of the basic unit.
[0026] The downsampling unit consists of two branches. The input feature map of the downsampling unit is sequentially processed by the first 1×1 convolution, the 3×3 depthwise convolution, and the second 1×1 convolution in the upper branch. The input feature map of the downsampling unit is sequentially processed by the 3×3 depthwise convolution and the 1×1 convolution in the lower branch. The result of the second 1×1 convolution in the upper branch and the result of the 1×1 convolution in the lower branch are concat-fused. The result after concat-fusion is the output of the downsampling unit.
[0027] The beneficial effects of this invention are as follows: First, a mask is used to shield the external area and pins of the electrical connector in the detection image. Printed lines are extracted from the detection image of a product of the same model without extraneous objects to draw a printed line template image, which is then overlaid on the detection image. The detection image is binarized using inter-class variance, and then morphological dilation is used to restore the area of the covered part, obtaining an image of the suspected extraneous object area. Due to the influence of angle, distance, etc. when photographing the electrical connector, some printed lines may still be detected and extracted as suspected extraneous object areas. Therefore, a trained binary classification detection model is used to determine whether it is an extraneous object. This invention uses a visual detection combined with machine learning method to detect extraneous objects in electrical connectors, reducing computational complexity while improving accuracy. Experiments have verified that this invention can effectively detect common metal extraneous objects. Attached Figure Description
[0028] Figure 1 Background information for foreign object detection;
[0029] Figure 2 For shielding the external area of the pins and electrical connectors;
[0030] Figure 3 The process of making a printing line template includes (a) a product with shielded pins and no extraneous material in the outer area, (b) the initial extracted printing line outline, (c) the secondary filled printing line, and (d) drawing the printing line covering template.
[0031] Figure 4 The process of masking the background of printed lines and cropping the suspected extraneous areas includes (a) the effect of the printed line template covering the product, (b) the effect of binarizing the image of the covered printed lines, (c) the effect of dilated binarized image, and (d) the cropping mark of the suspected extraneous areas.
[0032] Figure 5 The metal extras and printed lines are of different materials and shapes, including (a) curled, (b) rough copper, (c) recessed, (d) aluminum, (e) resistor, (f) smooth iron, and (g) printed lines.
[0033] Figure 6The process of expanding and building the dataset includes: (a) the original image; (b) random adjustment of saturation; (c) random adjustment of contrast; (d) random adjustment of brightness; (e) horizontal flipping; (f) vertical flipping; (g) random cropping; and (h) uniform resizing.
[0034] Figure 7 The grayscale distribution of a training image for a certain redundant object;
[0035] Figure 8 This is a structural block for the SHUFFLENET-V2 network model;
[0036] Figure 9 The figures show the accuracy and loss curves of a binary classification model based on ShuffleNetV2, where (a) represents the accuracy and loss changes on the training set, and (b) represents the accuracy and loss changes on the test set.
[0037] Figure 10 An improved ShuffleNet-V2 network structure incorporating an attention module;
[0038] Figure 11 The figures show the accuracy and loss curves during the training of ShuffleNet-V2 models with different attention modules, where (a) is the curve of loss value change in the training set, (b) is the curve of average accuracy change in the training set, (c) is the curve of loss value change in the test set, and (d) is the curve of average accuracy change in the test set.
[0039] Figure 12 The images show examples of foreign object detection using a binary classification model, where (a) is an example of actual metal foreign object detection and (b) is an example of printed line detection. Detailed Implementation
[0040] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0041] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other.
[0042] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, but this is not intended to limit the scope of the invention.
[0043] The external environment of an electrical connector is highly complex, while the grayscale and shape characteristics of the internal printed lines and pins of the connector resemble extraneous objects in the image, such as... Figure 1 As shown. Therefore, it is necessary to first mask the background to reduce its impact on subsequent training results and avoid misclassifying printed lines and pins as redundant objects. Appropriate masking algorithms should be selected based on the different characteristics of the masked objects to mask them one by one.
[0044] The foreign object detection method for aerospace electrical connectors in this embodiment includes:
[0045] Step 1: Acquire an image of the aerospace electrical connector under test. Use a mask to shield the outer area and pins of the connector image to obtain the test image.
[0046] For the external area and pin portion of the electrical connector, a masking method is used to shield them from subsequent foreign object detection. Specifically, the pin portion's centroid position is determined based on the pin identification and positioning algorithm, and a solid black circle with a radius of 15 is drawn around this centroid for shielding. Using the center points of all pins as centers, the radius pixel value is calculated based on the calibrated pixel equivalent and the actual internal diameter of the electrical connector, and a masking circle is drawn. All elements outside this circle are assigned a value of 0, i.e., displayed as black. Figure 2 To test the shielding effect on the external area of the pins and electrical connectors.
[0047] Background masking for unwanted object detection is more complex than that for printed lines. Since most unwanted objects are metal debris, their grayscale features are highly similar in the image, and a simple global processing method cannot be used to process the entire image uniformly.
[0048] Step 2: Extract the printing lines from the inspection images of products of the same model without extraneous materials, draw the printing line template, and overlay the printing line template onto the inspection image in the form of black lines through transmission transformation;
[0049] The printing lines are extracted from inspection images of identical products without extraneous objects, and then overlaid onto the currently inspected image as black lines using transmission transformation. Based on pixel equivalents and the approximate width of the printing lines, the pixel size occupied by the printing lines in the image can be determined. Taking an example where the printing line width occupies 4 pixels, the extraneous object background masking algorithm will be explained. The specific process is as follows:
[0050] First, Canny edge detection is used to obtain the printed lines of the product without any extraneous objects. To increase the continuity of the printed line edges and ensure complete coverage of the product under test in subsequent steps, the initially extracted printed lines are expanded to obtain... Figure 3 The printed line outline is shown in (b). Now create an image with a transparent background the same size as the original image, and draw the printed line outline on this image as a 2-pixel thick, opaque black line. Figure 3(c) Green lines). Because the printed outline is truncated, the area within the outline cannot be directly filled. Therefore, the transparency channel of the printed line drawing with a transparent background is blended with the product image without any extraneous elements. This step is equivalent to refining the printed lines. The outline of the blended image is extracted again, and a black opaque line with a thickness of 2 pixels is drawn onto the printed line template image obtained in the first step. Figure 3 (c) Red lines), this step fills the inner area and expands the outer area by 2 pixels. The contours obtained from the two contour extractions are drawn as black lines on the same image, resulting in... Figure 3 The printing line covering template shown in (d) is shown in the middle.
[0051] Furthermore, in the pin detection process, in-sequence pin registration was performed, mechanically defining the pin plane and the imaging plane. The axial angular offset between the two pin images is negligible. Therefore, by using the correspondence of the detected in-sequence pin point coordinates, transmission transformation can be performed to align the printed line template with the product under test. Simultaneously, the RANSAC algorithm is used to avoid the influence of individual pins with large positional offsets. Images of products without extraneous objects are fused to cover the printed lines of the product under test. Figure 4 Image (a) shows the effect after coverage.
[0052] The RANSAC (Random Sample Consensus) algorithm works by randomly selecting a minimum subset (usually 4 points) from all corresponding points. Two linear equations are generated for every two points, as shown in equation (1). Solving this subset's system of linear equations estimates the perspective transformation matrix H, as shown in equation (2). For the estimated perspective transformation matrix, the reprojection error of all corresponding points is calculated, which maps the source point to the target image using the perspective transformation matrix and calculates its distance from the target point. A threshold of 5 is set; a point is classified as an inlier only if its reprojection error is less than the threshold; otherwise, it is classified as an outlier. This process is repeated until the perspective transformation matrix with the most inliers is selected as the final H estimation result.
[0053]
[0054] Step 3: Binarize the detection image of the overlaid printed line template using inter-class variance. Apply morphological dilation to the binarized detection image and extract the suspected extraneous object region from the dilated detection image. Specifically:
[0055] Because the excess material may overlap with the printed lines, after covering the printed lines of the detected image, a portion of the excess material will also be covered, such as... Figure 4As shown in (a). Therefore, after the step of covering the printed lines is completed, the image is first binarized using inter-class variance. Figure 4 As shown in (b). Then, a morphological dilation operation is used to recover the covered area. The kernel function is a 4×4 rectangle. The recovered image is shown below. Figure 4 As shown in (c). Since the size of the foreign object is approximately 789μm × 246μm, and based on the measured pixel equivalent of approximately 0.015mm / pixel, corresponding to 0.789 ÷ 0.015 × 0.246 ÷ 0.015 = 863 pixels, to avoid missed detections, regions with a connected component greater than 400 pixels are identified as suspected foreign object regions, and these regions are selected and cropped, as shown in [image / description]. Figure 4 As shown in (d).
[0056] Step 4: Input the image of the suspected redundant object region into the binary classification detection model. The binary classification detection model outputs the classification result to determine whether it is a redundant object. The binary classification detection model is implemented by training a deep learning network.
[0057] Based on the aforementioned method for masking unwanted objects, the suspected unwanted object area can be finally extracted. Due to the influence of angle, distance, etc. when photographing the electrical connector, some printed lines may still be detected and extracted as suspected unwanted object areas, so further discrimination is required on the extracted areas. This implementation uses a deep learning network as a binary classification detection model, which requires training the deep learning network. The first step is to create training data:
[0058] Based on the factory exterior inspection and microscopic analysis of the foreign objects, the fault diagnosis revealed that the foreign objects causing the electrical system failure were mainly curled metal with a silvery-white metallic luster, measuring approximately 789μm × 246μm. Figure 5 As shown in (a). However, during the inspection, metal foreign objects as long as 4mm were also found. To increase the coverage of foreign object detection, a custom-made device was developed. Figure 5 The images (b) to (f) show metal resistors of different sizes, lengths, and shapes, as well as copper, iron, and aluminum metals, and various small metal particles with different shapes, including curled, concave, smooth, and rough surfaces. Figure 5 In the middle (g), there are uncovered printed lines.
[0059] Different types of unwanted metal objects were randomly placed in different locations within different electrical connectors. Suspected unwanted areas were cropped and stored. The cropped images were manually divided into two categories—unwanted metal objects and printed lines—for training a binary classification model. Because real-world unwanted metal objects are difficult to obtain, the dataset was small. To expand the dataset, the images underwent random adjustments to saturation, contrast, and brightness, as well as data augmentation operations such as horizontal flipping, vertical flipping, and random cropping. Figure 6As shown in (b) to (g).
[0060] Different types of metal foreign objects were randomly placed in different models of electrical connectors. Single-channel grayscale images were acquired using a black and white camera. Suspected foreign object areas were cropped through a previous process, and data augmentation and size adjustment were performed.
[0061] A binary classification detection model was trained on a small dataset of grayscale images. First, the grayscale image data was preprocessed. To facilitate standardized computation, the `transform.Resize()` function was used to scale all images to the same (H×H) size, according to the training requirements of different models. Then, `transforms.ToTensor()` was used to convert the image data into tensors of dimension (1×H×H) with values in the range [0,1]. The distribution of the image data used for training was analyzed, and the grayscale mean and standard deviation of the images were calculated. Figure 7 For a given training image, after normalizing the gray-level histogram to the range [0,1], most gray-level mean values are between 0.3 and 0.6, and the standard deviation is around 0.3. To improve the training effect and stability of the model, the transforms.Normalize((0.5,),(0.3,)) function is used to normalize the data to a standard Gaussian distribution with a mean close to 0 and a standard deviation close to 1.
[0062] Regarding the selection of deep learning networks:
[0063] Convolutional neural networks (CNNs) generally perform well when trained on large-scale datasets. The ShuffleNet-V2 network model is a representative lightweight neural network from recent years. Its goal is to improve accuracy while reducing computational complexity; therefore, for small sample datasets, it can train an efficient image classification model with a limited number of parameters. Basic units and spatial downsampling units, such as... Figure 8 As shown.
[0064] The SGD optimizer was used with an initial learning rate of 0.0001. Each training iteration used 16 samples and consisted of 100 epochs. A linear warm-up learning rate was used for the first 2000 steps, followed by cosine annealing (Cosine Annealing Lr) to update the learning rate. The ShuffleNetV2 network structure was designed and optimized for a 224×224 input size; therefore, all dimensions were uniformly adjusted to 224×224 in this paper. The changes in the loss function and accuracy of the training set during training are shown in [link to documentation]. Figure 9 In section (a), the changes in the loss function value and accuracy on the test set are shown in [reference 1]. Figure 9(b) It can be seen that the model basically converges after about 80 training epochs. The accuracy on the test set is slightly lower than that on the training set, and the loss function value is also slightly higher. Using the test set as the evaluation standard, the best model has a test accuracy of approximately 97.4% and a loss function value of approximately 0.10. The redundant object binary classification model trained by the ShuffleNet-V2 network has achieved a classification accuracy of 97.4%, but for redundant object detection, it is desirable to achieve 100% detection. Therefore, an attention mechanism will be added to the ShuffleNet-V2 network to further improve the model's classification accuracy.
[0065] Furthermore, this implementation optimizes the redundant object binary classification model based on a small dataset using ShuffleNet-V2 by incorporating an attention mechanism to enhance the model's focus on input data and weight allocation. The optimized ShuffleNet-V2 network structure is as follows: Figure 10 As shown. Because the attention module has a max pooling operation, the max pooling layer in the initial ShuffleNet-V2 network structure is removed and replaced by the attention module.
[0066] The binary classification detection model consists of a 3×3 convolutional layer, an attention module, ShuffleNet-V2 units 1, 2, and 3, a 1×1 convolutional layer, an average pooling layer, and a fully connected layer. The input image is fed into the 3×3 convolutional layer, and its output is fed into the attention module, which weights the convolutional features. The output of the attention module is then fed into ShuffleNet-V2 unit 1, which in turn feeds into ShuffleNet-V2 unit 2. The output of ShuffleNet-V2 unit 2 is fed into ShuffleNet-V2 unit 3, which is then fed into the 1×1 convolutional layer. The output of the 1×1 convolutional layer then passes through an average pooling layer and a fully connected layer, with the fully connected layer outputting the classification result.
[0067] The first ShuffleNet-V2 unit consists of one downsampling unit and three basic units stacked together.
[0068] The second ShuffleNet-V2 unit consists of one downsampling unit and seven basic units stacked together.
[0069] The third ShuffleNet-V2 unit consists of one downsampling unit and three basic units stacked together.
[0070] The basic unit consists of two branches, upper and lower. The input feature map is divided into two halves, which are then fed into the upper and lower branches respectively. The half feature map of the upper branch is processed by a first 1×1 convolution, a 3×3 depthwise convolution, and a second 1×1 convolution. The result of the second 1×1 convolution in the upper branch is then concatenated with the half feature map of the lower branch. The result of the concatenation is the output of the basic unit.
[0071] The downsampling unit consists of two branches. The input feature map of the downsampling unit is sequentially processed by the first 1×1 convolution, the 3×3 depthwise convolution, and the second 1×1 convolution in the upper branch. The input feature map of the downsampling unit is sequentially processed by the 3×3 depthwise convolution and the 1×1 convolution in the lower branch. The result of the second 1×1 convolution in the upper branch and the result of the 1×1 convolution in the lower branch are concat-fused. The result after concat-fusion is the output of the downsampling unit.
[0072] To test the performance of the ShuffleNet-V2 network after adding an attention module, the following hyperparameters were uniformly set after multiple adjustments. The training epochs were 100, at which point the model had fully converged. The batch size was 16. The optimizer configuration was as follows: type SGD; initial learning rate of 0.0001 for more stable parameter updates; momentum of 0.9 to retain some preceding steps to accelerate convergence and avoid getting trapped in local optima; L2 regularization weight decay strength of 0.00004 to effectively balance the risks of overfitting and underfitting. The first 20 epochs served as a warm-up phase for the learning rate, using linear annealing, followed by cosine annealing to adjust the learning rate.
[0073] The deep learning training environment is as follows: operating system is Win 11 x64, CPU processor is i9-13900HX, GPU is NVIDIA RTX 4060 graphics card, running memory is 16GB RAM, language is Python 3.7.12, Anaconda3-2024.02-1-Windows-x86_64 is configured, and integrated development environment software is PyCharm CommunityEdition2023.3.1.
[0074] result:
[0075] from Figure 11It can be seen that the accuracy of the redundant object binary classification model trained by the ShuffleNet-V2 network after adding the attention module is higher than that trained by the ShuffleNet-V2 network, and the loss value is also relatively reduced. The training with the ECA attention module yields the best results, with an accuracy of 99.17%, an average precision of 98.98%, an average recall of 99.32%, an average F1 score of 99.2%, and a loss value of approximately 0.04, all reaching high levels. Furthermore, the accuracy is improved by 1.8% compared to the unoptimized ShuffleNet-V2 neural network. The training optimization effect with the CBAM attention module is the worst, with a model test accuracy of 98.6%, while the test accuracy of the other optimized networks all reach over 99%. This may be because spatial location in the image is not important for the classification task, so CBAM does not significantly improve the model compared to other channel attention modules. The ECA module is designed to be lightweight, and the dataset in this paper is not complex. Adding the ECA module will not significantly increase the complexity of the model, which is more in line with the characteristics of the dataset in this paper, and all optimizations are the best.
[0076] The specific data for the evaluation metrics of the classification model trained on the test set using the improved ShuffleNet-V2 network with added ECA module are shown in Table 1.
[0077] Figure 12 This is an example diagram showing the use of the model trained according to this embodiment for binary classification detection of unwanted objects. Figure 12 In (a), the object of detection is the curled metal foreign matter detected under actual working conditions, the predicted category is metal (jinshu), and the probability score is 1.00. Figure 12 In (b), the classification prediction for unshielded printed lines is given as the category "printed line" (yinshua), with a probability score of 0.96. All lines were correctly classified and detected.
[0078] In summary, the foreign object detection algorithm for aerospace electrical connectors developed in this research can effectively detect common metal foreign objects with an accuracy rate of over 99%, which is far higher than the success rate of detecting foreign objects by manual sampling.
[0079] While the invention has been described herein with reference to specific embodiments, it should be understood that these embodiments are merely examples of the principles and applications of the invention. Therefore, it should be understood that many modifications can be made to the exemplary embodiments, and other arrangements can be designed without departing from the spirit and scope of the invention as defined by the appended claims. It should be understood that different dependent claims and features described herein can be combined in ways different from those described in the original claims. It is also understood that features described in conjunction with individual embodiments can be used in other described embodiments.
Claims
1. A method for detecting foreign objects in aerospace electrical connectors, characterized in that, The method includes: An image of the aerospace electrical connector under test is acquired, and the outer area and pins of the connector image are shielded using a mask to obtain the test image; The printing lines are extracted from the inspection images of products of the same model without extraneous materials, a printing line template is drawn, and the printing line template is overlaid on the inspection image in the form of black lines through transmission transformation. The detection image of the overprinted printing line template is binarized using inter-class variance. Morphological dilation is then applied to the binarized detection image, and the suspected extraneous object region is extracted from the dilated detection image. The image of the suspected redundant object area is used as the input image and fed into the binary classification detection model. The binary classification detection model outputs the classification result to determine whether it is a redundant object. The binary classification detection model is implemented by training a deep learning network. Method for extracting printing lines from inspection images of products of the same model without excess material, and drawing a printing line template: Use edge detection methods to extract printing lines from images of products of the same model without any extraneous objects; The extracted printed lines are expanded to obtain the printed line outline; Create an image with a transparent background of the same size as the detection image, and draw the obtained printing line outline on the image with black lines to form the first obtained printing line template image. The transparent channel on the first obtained printed line template image is fused with the product image without any extraneous objects. The contour of the fused image is extracted and drawn as black lines onto the first obtained printed line template image to obtain the second obtained printed line template image. According to the correspondence of the coordinates of the same-order insertion points in the detection image, a transmission transformation is performed to align the second obtained printed line template image with the aerospace electrical connector under test, thus obtaining the final printed line covering template.
2. The method for detecting foreign objects in aerospace electrical connectors according to claim 1, characterized in that, Method of shielding electrical connector pins using a mask: The centroid position of the pin is obtained based on the pin identification and positioning algorithm. Using this centroid position as the center, the radius pixel value of the circle is calculated based on the calibrated pixel equivalent and the inner circle diameter of the electrical connector. The circle for masking is then drawn, and all elements outside the circle are black. The inner circle diameter of the electrical connector is obtained by actual measurement.
3. The method for detecting foreign objects in aerospace electrical connectors according to claim 1, characterized in that, When the second printed line template is aligned with the aerospace electrical connector under test, the pin position is determined by combining the RANSAC algorithm.
4. The method for detecting foreign objects in aerospace electrical connectors according to claim 1, characterized in that, Methods for training binary classification detection models: Obtain metal foreign objects of different sizes, lengths, and shapes. Randomly place the obtained metal foreign objects in different positions in different electrical connectors. Capture images of suspected foreign object areas. Expand the captured images to obtain two types of training images: metal foreign object area images and uncovered printed line images. Use the two types of images to train the binary classification detection model. During training, grayscale images of the training images are acquired, and all grayscale images are scaled to the same size. , This represents the height of a grayscale image. The dimensions of the scaled grayscale image are then converted to dimensionality. Tensor specification in Within the range, the grayscale image with the transformed dimension is then standardized to a standard Gaussian distribution with a mean close to 0 and a standard deviation close to 1.
5. The method for detecting foreign objects in aerospace electrical connectors according to claim 4, characterized in that, The binary classification detection model is implemented using the ShuffleNet-V2 network.
6. The method for detecting foreign objects in aerospace electrical connectors according to claim 1, characterized in that, Binary classification detection models include Convolutional layer, attention module, ShuffleNet-V2 unit 1, ShuffleNet-V2 unit 2, ShuffleNet-V2 unit 3, Convolutional layers, average pooling layers, and fully connected layers; input image input to... Convolutional layer The output of the convolutional layer is then fed into the attention module, which weights the convolutional features. The output of the attention module is then fed into ShuffleNet-V2 unit 1, which in turn feeds into ShuffleNet-V2 unit 2. The output of ShuffleNet-V2 unit 2 is then fed into ShuffleNet-V2 unit 3, and finally... Convolutional layer The output of the convolutional layer then passes through an average pooling layer and a fully connected layer in sequence, with the fully connected layer outputting the classification result. The first ShuffleNet-V2 unit consists of one downsampling unit and three basic units stacked together. The second ShuffleNet-V2 unit consists of one downsampling unit and seven basic units stacked together. The third ShuffleNet-V2 unit consists of one downsampling unit and three basic units stacked together. The basic unit consists of two branches, an upper branch and an lower branch, and the input feature map is divided into various parts. Feature maps, respectively entering the upper and lower branches, the upper branch The feature maps pass through the first time in sequence convolution, Depth convolution, second Convolution, the second time in the upper branch The result after convolution and the next branch The feature maps are concatted together, and the result of the concat fusion is the output of the basic unit. The downsampling unit consists of two branches, an upper branch and an lower branch. The input feature map of the downsampling unit is processed sequentially through the first branch. convolution, Depth convolution, second The input feature maps of the convolution and downsampling units are sequentially processed by the lower branches. Depth convolution and Convolution, upper branch, second time The result of convolution and the next branch The results of convolution are concatted, and the result after concatting is the output of the downsampling unit.
7. A computer-readable storage device storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the aerospace electrical connector foreign object detection method as described in any one of claims 1 to 6.
8. A foreign object detection device for aerospace electrical connectors, comprising a storage device, a processor, and a computer program stored in the storage device and executable on the processor, characterized in that, The processor executes the computer program to implement the steps of the aerospace electrical connector foreign object detection method as described in any one of claims 1 to 6.
9. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of the aerospace electrical connector foreign object detection method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Aviation electric connector pin position deviation detection method
CN106500593A
Method for detecting redundancies on circuit board
CN114820492A