Abstract
To enhance the automation level of foreign object removal in bird’s nest processing and reduce the costs and misjudgment rates associated with manual inspection, this paper proposes and develops a parallel system for automatic foreign object removal in bird’s nest based on machine vision. A two-stage foreign object detection algorithm is proposed: the first stage introduces an attention mechanism to improve the U-Net++ model, enhancing segmentation accuracy under texture interference; the second stage combines binary mask processing to achieve precise classification of foreign object and non-foreign object regions. Experimental results show that the algorithm achieves an
Introduction
Bird’s nest is formed by the saliva secreted by swiftlets intertwined with feathers to create a nest. Natural bird’s nests typically contain foreign objects such as feathers, eggshells, and sand particles, with down-like impurities being the most common. 1 Currently, impurity removal in bird’s nest processing primarily relies on manual visual inspection and manual removal, which not only results in low efficiency and high labor intensity but also carries significant risks of misjudgment and missed detection, severely hindering the automation development of the bird’s nest reprocessing industry. Therefore, achieving efficient and precise identification and automatic removal of impurities in bird’s nest has become a critical technological challenge that urgently needs to be addressed in the fields of food intelligent detection and automated processing.
In terms of bird’s nest impurity detection, traditional image processing methods struggle to handle its complex textured background and semi-transparent structure. Subramaniam et al. 2 used edge detection methods for identification, achieving a detection rate of only 68.18%; Meng et al. 3 employed the C-K mean fusion algorithm, improving the detection rate to 84%, but the misclassification rate remained as high as 57%. Yee et al. 4 combined image fusion technology to improve recall rates to some extent, but were still limited by image shadow interference, resulting in a misclassification rate exceeding 30%. The saliva chain structures in bird’s nest are entangled, with semi-transparent components and uneven intensity, 5 making it difficult for traditional image segmentation methods to extract effective features. As a result, researchers have gradually introduced deep learning methods to enhance segmentation accuracy. Hui et al. 6 utilized the U-Net architecture for segmentation of objects with uneven intensity in medical images, achieving good results; Yeo et al. 7 proposed a segmentation model based on autoencoders, achieving a recall rate of 92.82%, but the misclassification issue remains unresolved.
On the other hand, with the continuous increase in market demand, various types of automatic weed removal equipment have been developed and applied. Generally speaking, the configurations of such robots can be divided into serial robots,8,9 parallel robots,10,11 and hybrid robots.12,13 METİN derived the general inverse Jacobian matrix equations for 195 six-degree-of-freedom GSP mechanisms under specific constraints and proposed a generalizable construction method, providing a theoretical foundation and engineering tools for the systematic design and analysis of parallel robot systems. Additionally, a software tool was developed for the design, analysis, and simulation of 195 six-degree-of-freedom GSP parallel mechanisms.10,14 Serdar proposed a novel planar hybrid robot composed of a 2-degree-of-freedom planar parallel robot manipulator and two planar serial robot manipulators, enabling easier material grasping. 15 Based on the aforementioned three robot configurations, multiple studies have attempted to combine image recognition with robotic sorting systems to remove impurities from bird’s nest. Subramaniam et al. 2 developed a bird’s nest impurity removal device based on a machine vision system and a serial robot platform, targeting specific bird’s nest specimens with a thickness of 2 mm. They employed traditional image processing methods based on edge detection and image enhancement, achieving an impurity detection rate of only 68.18%. Seenivasan et al. 16 optimized brushing, bubble, and microbubble technologies to reduce cleaning time and improve purity for small impurities in bird’s nest. The structure was designed as a brush attached to the end of an arm to clean original bird’s nest impurities; Negatively charged microbubbles attract microscopic impurities, and the microbubbles contract and collapse under water pressure, leaving debris on the water surface. Fai et al. 2 designed a debris removal device based on machine vision and a robotic platform, using image processing to drive the end-effector to remove foreign objects; Kin et al. 3 designed a biomimetic end-effector based on the principle of artificial tweezers, improving the flexibility of the removal operation. However, most of these studies still face bottlenecks in terms of recognition accuracy or removal reliability, making it difficult to meet the complex and variable requirements of actual debris removal.
Based on the aforementioned issues, this paper proposes a systematic solution for the automatic removal of impurities from bird’s nest using a parallel robot configuration. By incorporating an attention mechanism based on the U-Net++ architecture, we have developed an impurity segmentation algorithm suitable for low-contrast and complex backgrounds. We have designed an automated impurity removal robot with integrated identification, localization, and removal functions, completing structural modeling, control system development, and end-effector optimization. A multi-indicator quality evaluation system is established to quantify removal effectiveness and validate the system’s overall performance. A collaborative “machine vision recognition + intelligent actuator” automated impurity removal platform is developed to address the core issues of low efficiency and poor accuracy in current bird’s nest impurity removal processes. This provides theoretical support and engineering implementation pathways for the intelligent upgrading of the bird’s nest industry, demonstrating significant research significance and application value.
Results and discussions
Design of the robot
According to the design requirements of the foreign object removal, the actuator for the multi-needle picking needle is designed including driving structure of the single-needle picking needle, the motor container of the multi-needle picking needle, the pressure plate structure and the self-cleaning device, which can achieve the fast and accurate removal of the foreign matter of the swallow in the bird’s nest.
As presented in Figure 1(a), with reference to the removal method of the picking needle in the manual needle-rolling method, a novel picking needle with three heads structure is designed to solve the problems of insufficient adhesion and low coaxiality between picking needle and the driving motor, which lead to the high-speed rotation of the picking needle to fly away the foreign matters in bird’s nests. Since high precision positioning is required for the removal of foreign matter from bird’s nests, the design of the picking needle drive structure, the surface treatment of the materials used and the assembly precision of the parts are all required to meet the design requirements.

Design of the foreign object removal device: (a) structure of the picking needle, (b) structure of the array structures of picking needles, (c) structure of the platen, and (d) structure of the whole picking device.
The foreign matter in the bird’s nest can be effectively rejected by single needle in a one-to-one manner, while the number of downy foreign matter in the bird’s nest pictures can be identified more than 1 with the assistance of machine vision. Therefore, it is necessary to arrange the single picking needle structure in arrays in order to improve the overall rejection efficiency without increasing the complexity of the mechanical structure. It is verified in experiments that the tiny picking needles do not damage the structural integrity of the bird’s nest filaments, and thus the array arrangement of the multi-needle picking needle structure can effectively increase the rejection efficiency of the bird’s nest foreign matter. The linear arrangement scheme is adopted, the mounting cover plate is used for effective fixation with the
Besides, as shown in Figure 1(c), the platen is fastened to the motor container structure by four fixed rods. The compression spring, built-in sliding sleeve which can realize the travel translation and the end fastening cover are designed on each fixed rod. The designed end actuator is obtained as shown in Figure 1(d). The initial state is the natural recovery state of the spring, at this time the tip of the picking needle is parallel to the bottom surface of the platen. When the foreign matter rejection in the bird’s nest is carried out, the end actuator reaches the rejection position, and as the end actuator continues to move downward in the
The structure of the whole robot is shown in Figure 2(a), which can be divided into robot motion module, foreign object removal module, vision module, and control module. The motion module contains the main architecture, drive structure of the upper end actuator and the motion of the lower bird’s nest container. Foreign object reject module can achieve the efficient removal of contaminants with the assistance with vison and control module. As shown in Figure 2(b), in the bridge structure of robot, the end actuator can realize the composite motion of

Design of the whole robot: (a) design of the robot including motion module, foreign object removal module, vision module, and control module and (b) design of the bridge structure of robot.
The load-bearing components of the

Simplified diagram of forces acting on the upper
To calculate the load results under uniformly distributed loads on the simply supported beam shown in the figure above, it is simplified to act on the midpoint of the beam. In the actual calculation, the length of the slider on the
In the equation,
In the equation,
In the formula,
Based on the calculation results, it can be seen that the simplified simply supported beam on the
Based on the design of the proposed mechanism, we can complete the kinematic modeling. The parallel robot for bird’s nest cleaning and debris removal constructed in this paper has independent serial motion chains, which are simultaneously connected to the ground and the motion platform. However, due to the complexity of closed-loop chain mechanisms, the kinematic analysis of parallel robots is relatively challenging. The D-H15,17 method is a common kinematic modeling convention that uses a 4 × 4 homogeneous transformation matrix. The main advantage of this method is that it facilitates a physical interpretation of the robot mechanism.
Given that research on Cartesian coordinate robots is already well-established, based on robotics theory,
18
we assume that any point
The pose transformation between the end-effector pose of the Cartesian coordinate robot and the polar coordinate system is shown in equation (6). According to the design requirements, the initial positions of the sliding joints of the Cartesian coordinate robot are
Parameter analysis and optimization
As shown in Figure 4, the triple-needle structure consists of fixed, transitional, and rejection segments. Due to that the picking needle is driven by a motor for high speed rotation, the fixed segment of the picking needle is used to connect with the end of the motor shaft to ensure that the center maintains a consistent coaxiality with the motor shaft. The transitional segment is used to adjust the scaling tolerance of the platen section in the end actuator and rejection segment can achieve the removement of foreign objects. It should be noted that the length (

Parameters of triple-needle structure consisting of fixed, transitional, and rejection segments.
Based on the basic mechanical theory, there will be a variety of forces between the high-speed rotation of the picking needle with the foreign body, such as the centripetal force generated by the high-speed rotation (
Herein,
Since that the contact area between the swallow down and the needle tip is very small and the fiber structure of swallow down is complex, the actual friction will be affected by many factors such as bending, compression, and stretching of the fibers. Therefore, an approximation will be taken to calculate the friction force:
where μ is the friction coefficient between swallow down and needle tip, pressure
Herein,
Moreover, in order to further study the effect of the above variables on the action force of the picking needle, the uniform design method19–21 as well as simulation method are designed to calculate the force and provide theoretical support for the related research. The specific optimization design and experimental steps are described in detail in Section “Parameter analysis and optimization.”
Parameter analysis and optimization
The design focus of the bird’s nest foreign object removal robot lies in its end-effector, and the core of the end-effector is the design of the feather-picking needles. For the three-needle-tip feather-picking needle, parameter analysis and calculations indicate that the needle tip spacing
Optimization framework and experimental design
For the design of optimization frameworks, intelligent algorithms such as PSO, are currently popular. This study adopts an optimization strategy combining the Uniform Design Method (UDM) with multivariate regression analysis. UDM can efficiently explore the multi-factor design space with the minimum number of experiments and sets the needle tip distance (
Based on the above optimization framework, the experiment was designed with the following specific steps:
(1) Determine the indexes for experimental analysis. The main research index of the experiment is the maximum adhesion force at the contact between the picking needle and the bird’s nest
(2) Determine the experimental factors. The factors are picked as picking needle tip distance
(3) Determine the level of each experimental factor. According to the homogeneous design method using three factors and six levels of the homogeneous design method, the level table of the influence variables is shown in Table 1.
(4) Design of uniform design table. In order to reduce the number of experiments, the uniform design table is designed. Based on Admas simulation software, the tip of the picking needle in the adhesion of the different influencing factors can be acquired through setting of different depth of contact and drive speed. The statistical results are shown in Table 2.
Factors and level distribution.
Results of uniform design method.
Through the above experiments, a 3-factor, 6-level experimental matrix was constructed based on UDM, as shown in Table 1. Only six groups of simulation experiments were required to cover the design space. By simulating the needle tip-impurity interaction under different parameter combinations, the maximum adhesion force
Regression modeling and parameter optimization
Moreover, multivariate regression analysis is designed to calculate the correlation through SPSS software, the result is shown in Table 3.
Analysis of multiple regression results.
It can be obtained from the experimental results that the correlation coefficient
As presented in Figure 5(a), the average value of the effect of each factor on the results and the response contribution rate of each factor are obtained as well. The response contribution rate of each factor indicates the normalized value in the regression model. According to the sample fitting, the red color indicates the positive effect, and the larger the value of the parameter, the closer it is to the target value. Therefore, it can be obtained that the most influential factor on adhesion is rotational speed, followed by tip distance and contact depth.

Analysis of multiple regression results and simulations: (a) average value of the effect of each factor on the results and the response contribution rate of each factor, (b) the simulation of total deformation displacement and equivalent force and (c) total deformation displacement and equivalent atress calculation results.
Static analysis of the pick needle
Through the optimization design in the previous section, the optimal parameter design for the hair-picking needle structure was adopted. This was used for mechanical simulation verification, where the drive motor secures the hair-picking needle to the motor shaft via a connector, thereby transmitting power to the hair-picking needle, driving it to rotate at high speed and start/stop. During simulation, the 3D model .x_t file is first imported into the static structure of Workbench, and the material properties of the plucking needle and end-effector are configured to match the material characteristics of the simulation, as shown in Table 4.
Modal analysis material properties table.
Finally, the optimal parameters are obtained: the speed of the picking needle is 16,000 r/min, the tip distance is 0.45 mm, and the contact depth is 1.5 mm, respectively, and the resulting adhesion force is about 0.539 N. Therefore, the optimal design of the structure of the triple-tip picking needles is optimized using this optimal combination of factors. The simulation of total deformation displacement and equivalent force is achieved through Ansys software shown in Figure 5(b). It can be obtained from Figure 5(c) that while under 20,000 r/min rotational speed, the deformation of picking needles can be almost negligible. And the equivalent force results in 0.5 MPa, which is far less than the yield strength value of stainless steel materials. Therefore, it can be concluded that it is fully capable of adapting to the needs of practical work.
Visual discussions and applications
After optimizing the structural design, we conducted research on visual applications. First, we collected raw bird’s nests, which are referred to as “raw nests.” Raw nests can be classified into extremely light raw nests, light raw nests, medium raw nests, and heavy raw nests based on their impurity content. Medium raw nests account for the largest proportion of imported raw materials in the bird’s nest processing industry. According to application requirements, the selected medium raw bird’s nests were soaked in water at 20°C for 2 h, after which images of the target bird’s nests were captured (Figure 6).

RGB image of bird’s nest collected.
Image preprocessing
In order to enhance the collected images and reduce the deformation of foreign objects in the images caused by enhancement, radiographic transformation and elastic deformation are used to achieve data enhancement. 22 The image data is prepared as 512 × 512 pixels, which satisfies the requirements for extracting impurity features while ensuring the integrity of the image. The images captured and stored by industrial cameras are in RGB-32 output format, which takes up a lot of storage space, has low transmission efficiency, and results in long computer processing times, which does not meet practical usage requirements. Therefore, it is necessary to convert color images into grayscale images for model training through grayscale conversion (Figure 7). 23

Gray-scale image of bird’s nest.
Improved U-Net++ method for detecting foreign objects in bird’s nest
U-Net++ is an improvement and extension of the U-Net model, as shown in Figure 8, aimed at improving the segmentation performance of image boundaries to reduce boundary blurring. 24 Due to the tangled saliva chain structure of bird’s nest, its strength exhibits significant non-uniformity. Additionally, bird’s nest impurities vary in type, shape, and depth, and are influenced by factors such as lighting, making this model unsuitable for bird’s nest images.

Improved U-Net++ architecture.
The improved network model retains certain structural components from U-Net++, such as skip connections and dense convolutional blocks, as shown in Figure 8. The encoder section employs 3 × 3 same convolutions and 2 × 2 max pooling layers to progressively reduce the spatial resolution of the input image, ensuring that the feature extraction section and upsampled image have consistent sizes, which facilitates feature fusion.
25
The decoder section restores the resolution through upsampling and skip connections, and performs multi-scale feature fusion by combining small-scale features with large-scale features. This enables the model to obtain more information from both upper and lower layers in feature maps at different levels, thereby enhancing its ability to segment objects at different scales. In the figure,
In the equation,
To highlight the foreground target, a nested jump link structure of the AG module is introduced, as shown in Figure 9. When
When outputting

AG flowchart.
Two-stage foreign object detection algorithm
To meet the demand for efficient and accurate detection of impurities in bird’s nest, the U-Net++ network model was specifically improved to propose a two-stage impurity detection algorithm for bird’s nest, as shown in Figure 10.

Two-stage impurity detection algorithm.
In the first stage, the image segmentation model outputs a tensor of size 512 × 512 × 2. The first channel contains the probability values of all pixels classified as impurities, and the second channel contains the probability values of all pixels classified as non-impurities. In the second stage, pixels are classified into impurity and non-impurity regions based on the probability values, as shown in equation (13), ultimately yielding a binary mask image for classification. Pixels with a mask intensity value of 255 represent impurity regions, while those with a value of 0 represent non-impurity regions.
In this context,
Analysis of test results
A confusion matrix is a matrix used to evaluate the performance of a classification model,
26
showing the correspondence between the model’s predicted images and the actual labels on the test data. Bird’s nest images are labeled into two parts: foreign object parts and non-foreign object parts. For a binary classification problem, foreign object parts are classified as the positive class, and non-foreign object parts are classified as the negative class. The segmentation results of bird’s nest images are compared to assess the performance of the foreign object detection algorithm. For all pixels in the image, the predicted image results are compared with the expert manual segmentation values. If the instance is a positive class and the predicted result is positive, it is a true positive (
Among them,
The improved detection algorithm was compared with U-Net, U-Net++ neural network models, and traditional image processing methods. Under the same experimental conditions, ablation experiments were used to verify that the improved U-Net++ model with the
By calculating the sum and average of the

Performance indicators for detecting foreign objects in bird’s nest using different models.
Removal test of the robot
Based on the reliable design of the robot, the test of foreign object removal is carried out to verify the function. As presented in Figure 12(a), the whole process can be divided into four steps: Recognition of the foreign object inside the bird’s nest; Route planning of the needle structures; Removal of foreign objects; Self-cleaning of the device. Every time the end-actuator cleans the bird’s nest on the picking needle, it needs to collect real-time images through the vision, and complete the rapid rejection of all the foreign objects in the bird’s nest after several cycles.

Foreign object removal test of the robot: (a) the whole process including recognition, route planning, removal and self cleaning, (b) comparison of robot coordinates with the actual removal coordinates, and (c) comparison of bird’s nest before and after the cleaning by foreign object removal robot.
The control system acquires images of bird’s nests and recognizes the shaped centers of a plurality of bird’s down foreign objects, which can obtain the pixel coordinates of the shaped centers of the foreign objects. Based on the proportionality relationship of the results of the hand-eye calibration,10,14 the pixel coordinates of the foreign objects are converted to the actual spatial coordinates, and then the picking needles are used to reject the foreign objects. The data for the seven foreign body shaped centers are shown in Table 6 and the comparison of robot coordinates with the actual removal coordinates are shown in Figure 12(b). Through the fixed-point removal of multiple groups of specific foreign objects, the pixel coordinates of the optimal group of detected foreign object centers highly coincide with the trajectory of the rejection coordinates of the centermost picking needle, errors of witch are lower than 0.5 mm, demonstrating the accurate automated detection, identification, localization, and removal of foreign objects from bird’s nest.
Foreign body shaped centers.
And as presented in Figure 12(c), it can be obtained that after the removal process through the robot, most of the foreign objects are cleaned away from the nest. The cleanliness rate can be as high as 92.78% with the loss rate as 1.96%. Working time of the robot is about 20 min, which is 7.07% faster than that of manual operation, demonstrating the reliable performance of our robot in foreign object removal applications.
Conclusions
In this study, we propose an automatic needle removal scheme for clearing foreign objects swallowed by birds. According to the design requirements of the scheme, we designed the overall structure of the needle removal robot, the key components of the end effector, and the structure of the vision module. Specifically targeting the need to remove foreign objects from bird nests, we conducted computational analysis on the key mechanisms of the end effector and performed specialized design on the parameters of the needle. Finally, we analyzed and quantified the key mechanisms of the end effector. This study successfully developed an automatic impurity removal system for bird’s nest based on parallel robots, overcoming the limitations of traditional manual removal methods, which are inefficient and lack precision. An innovative attention mechanism-enhanced U-Net++ algorithm was proposed, achieving an
Footnotes
Handling Editor: Guanglei Wu
Funding
The authors disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This research was supported by the National Key R&D Program of China (2024YFD2100202) and the National Key R&D Program of China (2022YFD2100304).
Declaration of conflicting interests
The authors declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
