Toward Automated Detection of Permanent Magnet Motors in WEEE Recycling Using Discriminative Transfer Learning
Abstract
1. Introduction
1.1. Literature Background
- Freezing the weights of deep convolutional layers. The weights of the initial convolutional layers are frozen. These layers act as generic feature extractors, capturing fundamental patterns such as edges, gradients, and textures that remain relevant across diverse image domains.
- Replacement of the final fully connected layers. The final fully connected layers are removed and replaced. The new classification layer is initialized and dimensionally adapted to match the specific number of classes in the target problem.
- Fine-tuning of the new layers. Initially, only the newly added layers are trained on the new dataset (Shallow Tuning). However, if the target domain differs significantly from the original source domain, it may be necessary to unfreeze and refine the convolutional layers adjacent to the fully connected block (Deep Tuning). This step allows the network to adapt its high-level feature representations to the specific characteristics of the new dataset [18].
1.2. Objectives and Work Structure
- PM Probability Assessment. Identifying motors with a high probability of containing PMs.
- Motor-Type Classification. Classifying the motors into the four most commercially widespread categories.
2. Materials and Methods
2.1. Dataset Acquisition and Motor Characterization
2.2. Two-Stage Detection Pipeline and Data Preprocessing
- PM Detection. Primary, to identify motors with a high probability of containing PMs.
- Typology Classification. Subsequently, to classify motors according to their construction typology, as specific categories inherently possess a higher probability of housing PMs. Consequently, each image was assigned to a target label corresponding to one of the four categories listed in Table 1.
- Region Identification. Fine-tuning of a simplified Faster R-CNN to detect the specific Region of Interest (RoI) containing the motor.
- Classification. Fine-tuning of a ResNeXt network to classify the motors within the proposed RoI. The dimensions of the detected regions were expanded by 30% to prevent the loss of boundary details.
2.3. Network Optimization and Discriminative Transfer Learning
- PM Probability Head. This fully connected block terminates in a single-neuron layer to estimate the likelihood of PM presence. The raw network output is processed through a Sigmoid activation function, which maps the result to a probability value in the range [0; 1].
- Multi-class Typology Head. It terminates in a four-neuron layer configured to classify the motor’s construction typology, in accordance with the categories outlined in Table 1. A Softmax activation function is applied to generate a probability distribution across the classes, where the highest probability identifies the predicted output class.
- Shallow Tuning. In the initial phase, only the newly added classification heads were trained while the entire ResNeXt backbone remained frozen. This stage aimed to adapt the randomly initialized weights of the Multilayer Perceptron heads to the generic features extracted by the pre-trained backbone.
- Deep Tuning. During the subsequent phase, the final convolutional bottleneck block was unfrozen to allow for finer feature specialization. By employing a reduced learning rate, the network preserved the fundamental knowledge acquired from ImageNet while adapting its filters to the specific structural patterns and textures of the electric motor dataset. This practice of applying differentiated learning rates across network layers is defined as Discriminative Transfer Learning (DTL).
3. Results
3.1. Model Performance Metrics
- True Positive Rate () and False Positive Rate (), defined as:An image is considered positive when it is correctly assigned to its true class and negative otherwise. These metrics aim to evaluate the network’s ability to detect samples with PM () and the probability of generating false alarms (), respectively. The reciprocal of the FPR corresponds to the True Negative Rate (TNR), which expresses the model’s ability to correctly identify samples without PM. In the case of binary classification, and values vary depending on the confidence threshold used to determine whether an image is classified as positive. A higher confidence threshold results in a cleaner sample of selected motors but increases the risk of excluding positive cases.
- Youden Index (). This parameter provides a criterion to identify the optimal trade-off between detecting positive () and negative (1 − ) samples. It is defined as:While this index can be used to determine the confidence threshold, it treats false positives and false negatives as equally weighted. In industrial applications, however, the costs of these errors are rarely symmetrical, especially when dealing with the recovery of high-value strategic materials.
- Precision (). This metric measures the model’s ability to correctly identify positive samples while minimizing false alarms:This metric is particularly relevant in practical applications, as it indicates the purity of the identified positive samples, thereby reducing time and costs for downstream processing.
- Score. This metric provides a balanced measure between precision and detection capability, evaluating the trade-off between highly precise but limited classification and a more complete but noisier classification. It is defined as:In industrial applications, the score represents an optimal parameter for selecting the confidence detection threshold because it is directly aimed at balancing the need to minimize false positives while ensuring a high volume of elements is recovered. This metric aligns the model’s performance with the economic and strategic requirements of REE recycling. Furthermore, the detection threshold can be strategically adjusted to favor either Precision or the quantity recovered, depending on specific industrial needs. Figure 4 shows the histogram of classification probabilities for the test sample. In this example, the confidence threshold was set to the optimal value of 0.38, corresponding to the maximum for both the F1 score and the Youden criterion.
3.2. Receiver Operating Characteristic and Precision–Recall Curves
- Universal motors are easily identified due to the characteristic cylindrical shape of the stator and the presence of brushes and commutators.
- Synchronous motors exhibit good identification performance, owing to the presence of magnets with repeated geometries in the rotor and coils in the stator, which constitute distinctive visual features.
- Brushed DC motors are recognized with high precision but lower recall, likely due to partial occlusion of structural features (such as the commutator, brushes, and arc-shaped magnets) caused by casings that are difficult to remove during upstream shredding processes.
- Asynchronous motors show lower classification accuracy, plausibly due to their limited representation in the collected dataset. However, this limitation does not significantly affect the overall outcome, as this motor type is often misclassified by the network as a universal motor. Since both classes lack PMs and are therefore not subject to rare earth recovery processes, this confusion does not compromise the practical applicability of the proposed approach. This aspect is further discussed in the following section.
3.3. Confusion Matrices
3.4. Model Explainability Analysis
3.5. Baseline Performance Comparison
4. Discussion and Conclusions
- The expansion and sharing of an EoL electric motor dataset, representative of a broader and more diverse range of motor types and operating conditions.
- The integration of radiographic images acquired at different penetration depths, aimed at improving the recognition of internal geometric patterns in cases where external casings limit the visibility of structural components, in analogy with approaches already explored in related domains such as electrochemical cell classification.
Supplementary Materials
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
Abbreviations
| CRMA | Critical Raw Materials Act |
| REE | Rare Earth Element |
| PM | Permanent Magnet |
| LCA | Life Cycle Assessment |
| EoL | End-of-Life |
| CNN | Convolutional Neural Network |
| WEEE | Waste Electrical and Electronic Equipment |
| RoI | Region of Interest |
| BLDC | Brushless Direct Current Motor |
| PMSM | Permanent Magnet Synchronous Motor |
| DTL | Discriminative Transfer Learning |
| ST | Shallow Tuning |
| ROC | Receiver Operating Characteristic |
| PR | Precision–Recall |
| TPR | True Positive Rate |
| FPR | False Positive Rate |
| TNR | True Negative Rate |
| FNR | False Negative Rate |
References
- Communication from The Commission to The European Parliament, The European Council, The Council, The European Economic and Social Committee and The Committee of the Regions The European Green Deal 2019. Available online: https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=COM%3A2019%3A640%3AFIN (accessed on 20 November 2025).
- Hool, A.; Helbig, C.; Wierink, G. Challenges and Opportunities of the European Critical Raw Materials Act. Miner. Econ. 2024, 37, 661–668. [Google Scholar] [CrossRef]
- Permanent Magnets Market. Market.us. Available online: https://market.us/report/permanent-magnets-market/ (accessed on 19 November 2025).
- Mugion, R.G.; Elmo, G.C.; Ungaro, V.; Pietro, L.D.; Martucci, O.; Mugion, R.G.; Elmo, G.C.; Ungaro, V.; Pietro, L.D.; Martucci, O. A Systematic Literature Review of Selected Aspects of Life Cycle Assessment of Rare Earth Elements: Integration of Digital Technologies for Sustainable Production and Recycling. Sustainability 2025, 17, 5825. [Google Scholar] [CrossRef]
- Werker, J.; Wulf, C.; Zapp, P.; Schreiber, A.; Marx, J. Social LCA for Rare Earth NdFeB Permanent Magnets. Sustain. Prod. Consum. 2019, 19, 257–269. [Google Scholar] [CrossRef]
- Jin, H.; Afiuny, P.; McIntyre, T.; Yih, Y.; Sutherland, J.W. Comparative Life Cycle Assessment of NdFeB Magnets: Virgin Production versus Magnet-to-Magnet Recycling. Procedia CIRP 2016, 48, 45–50. [Google Scholar] [CrossRef]
- Jin, H.; Afiuny, P.; Dove, S.; Furlan, G.; Zakotnik, M.; Yih, Y.; Sutherland, J.W. Life Cycle Assessment of Neodymium-Iron-Boron Magnet-to-Magnet Recycling for Electric Vehicle Motors. Environ. Sci. Technol. 2018, 52, 3796–3802. [Google Scholar] [CrossRef]
- Cortina, G.; Guadagno, M.; Berzi, L.; Delogu, M. Environmental Impact and Recycling Routes of Rare Earth Elements in Permanent Magnets of Electric Machines for Industrial and Automotive Applications: A Systematic Review. Eng. Proc. 2026; Under Review. [Google Scholar]
- Guadagno, M.; Innocenti, E.; Berzi, L.; Corsi, S.; Delogu, M. Development of Procedures for Disassembly of Industrial Products in Python Environment. Eng. Proc. 2025, 85, 6. [Google Scholar] [CrossRef]
- Fotovvatikhah, F.; Ahmedy, I.; Noor, R.M.; Munir, M.U. A Systematic Review of AI-Based Techniques for Automated Waste Classification. Sensors 2025, 25, 3181. [Google Scholar] [CrossRef] [PubMed]
- Zhang, Q.; Yang, Q.; Zhang, X.; Bao, Q.; Su, J.; Liu, X. Waste Image Classification Based on Transfer Learning and Convolutional Neural Network. Waste Manag. 2021, 135, 150–157. [Google Scholar] [CrossRef] [PubMed]
- Sterkens, W.; Diaz-Romero, D.; Goedemé, T.; Dewulf, W.; Peeters, J.R. Detection and Recognition of Batteries on X-Ray Images of Waste Electrical and Electronic Equipment Using Deep Learning. Resour. Conserv. Recycl. 2021, 168, 105246. [Google Scholar] [CrossRef]
- Ueda, T.; Koyanaka, S.; Oki, T. In-Line Sorting System with Battery Detection Capabilities in e-Waste Using Combination of X-Ray Transmission Scanning and Deep Learning. Resour. Conserv. Recycl. 2024, 201, 107345. [Google Scholar] [CrossRef]
- Krizhevsky, A.; Sutskever, I.; Hinton, G.E. ImageNet Classification with Deep Convolutional Neural Networks. In Proceedings of the 26th International Conference on Neural Information Processing Systems, Lake Tahoe, NV, USA, 3-8 December 2012; Curran Associates Inc.: Red Hook, NY, USA, 2012; Volume 1, pp. 1097–1105. [Google Scholar]
- He, K.; Zhang, X.; Ren, S.; Sun, J. Deep Residual Learning for Image Recognition. arXiv 2015, arXiv:1512.03385. [Google Scholar] [CrossRef]
- Xie, S.; Girshick, R.; Dollár, P.; Tu, Z.; He, K. Aggregated Residual Transformations for Deep Neural Networks. arXiv 2017, arXiv:1611.05431. [Google Scholar] [CrossRef]
- Baker, N.A.; Zengeler, N.; Handmann, U.; Baker, N.A.; Zengeler, N.; Handmann, U. A Transfer Learning Evaluation of Deep Neural Networks for Image Classification. Mach. Learn. Knowl. Extr. 2022, 4, 22–41. [Google Scholar] [CrossRef]
- Tajbakhsh, N.; Shin, J.Y.; Gurudu, S.R.; Hurst, R.T.; Kendall, C.B.; Gotway, M.B.; Liang, J. Convolutional Neural Networks for Medical Image Analysis: Full Training or Fine Tuning? IEEE Trans. Med. Imaging 2016, 35, 1299–1312. [Google Scholar] [CrossRef]
- Ren, S.; He, K.; Girshick, R.; Sun, J. Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks. arXiv 2016, arXiv:1506.01497. [Google Scholar] [CrossRef]
- Lin, T.-Y.; Goyal, P.; Girshick, R.; He, K.; Dollár, P. Focal Loss for Dense Object Detection. arXiv 2018, arXiv:1708.02002. [Google Scholar] [CrossRef]
- Pandilova, E.; Petrov, M.; Spasev, V.; Dimitrovski, I.; Kitanovski, I. Transfer Learning with Yolo for Object Detection in Remote Sensing. In ICT Innovations 2024. TechConvergence: AI, Business, and Startup Synergy; Risteska Stojkoska, B., Janeska Sarkanjac, S., Eds.; Communications in Computer and Information Science; Springer Nature: Cham, Switzerland, 2025; Volume 2436, pp. 121–135. ISBN 978-3-031-86161-1. [Google Scholar] [CrossRef]
- Madaan, V.; Roy, A.; Gupta, C.; Agrawal, P.; Sharma, A.; Bologa, C.; Prodan, R. XCOVNet: Chest X-Ray Image Classification for COVID-19 Early Detection Using Convolutional Neural Networks. New Gener. Comput. 2021, 39, 583–597. [Google Scholar] [CrossRef] [PubMed]
- Xiao, Z.; Wang, J.; Han, L.; Guo, S.; Cui, Q. Application of Machine Vision System in Food Detection. Front. Nutr. 2022, 9, 888245. [Google Scholar] [CrossRef]
- Kopalidis, T.; Solachidis, V.; Vretos, N.; Daras, P. Advances in Facial Expression Recognition: A Survey of Methods, Benchmarks, Models, and Datasets. Information 2024, 15, 135. [Google Scholar] [CrossRef]
- TrashNet. Available online: https://www.kaggle.com/datasets/feyzazkefe/trashnet (accessed on 19 November 2025).
- Li, Y.; Zhang, X. Intelligent X-Ray Waste Detection and Classification via X-Ray Characteristic Enhancement and Deep Learning. J. Clean. Prod. 2024, 435, 140573. [Google Scholar] [CrossRef]
- Burkhardt, C.; van Nielen, S.; Awais, M.; Bartolozzi, F.; Blomgren, J.; Ortiz, P.; Xicotencatl, M.B.; Degri, M.; Nayebossadri, S.; Walton, A. An Overview of Hydrogen Assisted (Direct) Recycling of Rare Earth Permanent Magnets. J. Magn. Magn. Mater. 2023, 588, 171475. [Google Scholar] [CrossRef]
- Podmiljšak, B.; Saje, B.; Jenuš, P.; Tomše, T.; Kobe, S.; Žužek, K.; Šturm, S. The Future of Permanent-Magnet-Based Electric Motors: How Will Rare Earths Affect Electrification? Materials 2024, 17, 848. [Google Scholar] [CrossRef] [PubMed]
- COCO—Common Objects in Context. Available online: https://cocodataset.org/#format-data (accessed on 15 December 2025).
- Tian, Y.; Zhang, Y.; Zhang, H. Recent Advances in Stochastic Gradient Descent in Deep Learning. Mathematics 2023, 11, 682. [Google Scholar] [CrossRef]
- Resnext50_32x4d—Torchvision 0.24 Documentation. Available online: https://docs.pytorch.org/vision/stable/models/generated/torchvision.models.resnext50_32x4d.html#torchvision.models.ResNeXt50_32X4D_Weights (accessed on 19 November 2025).
- ImageNet. Available online: https://www.image-net.org/index.php (accessed on 19 November 2025).
- Kingma, D.P.; Ba, J. Adam: A Method for Stochastic Optimization. arXiv 2014, arXiv:1412.6980. [Google Scholar] [CrossRef]
- Selvaraju, R.R.; Cogswell, M.; Das, A.; Vedantam, R.; Parikh, D.; Batra, D. Grad-CAM: Visual Explanations from Deep Net-works via Gradient-Based Localization. Int. J. Comput. Vis. 2020, 128, 336–359. [Google Scholar] [CrossRef]
- Petsiuk, V.; Das, A.; Saenko, K. RISE: Randomized Input Sampling for Explanation of Black-Box Models. arXiv 2018, arXiv:1806.07421. [Google Scholar] [CrossRef]










| Type | Quantity | PM |
|---|---|---|
| AC synchronous (PMSM/BLDC) | 94 | Probably |
| Universal brushed | 72 | No |
| DC brushed | 43 | Unlikely |
| AC asynchronous | 20 | No |
| Feature | Train Set | Test Set |
|---|---|---|
| Number of Copies | 2 | 1 |
| Total Number of Images | 1408 | 169 |
| Random Rotation | [0; 15]° | No |
| Resize | (600, 600) px | (600, 600) px |
| Color Jitter (B, S, C, H) | Yes, [0; 0.2] | No |
| Random Flip | Yes | No |
| Normalization | Yes | Yes |
| Feature | Shallow Tuning | Deep Tuning |
|---|---|---|
| Trainable Layers | PM head | PM head |
| Multi-class Head | Multi-class Head | |
| / | Last Bottleneck Block | |
| Trainable Parameters | ~780 thousand | ~5.2 million |
| Learning Rates | Heads: 1 × 10−3 | Heads: 1 × 10−3 |
| / | Last Bottleneck: 1 × 10−4 | |
| Epochs | 35 | 40 |
| Model | PM Acc. (%) | Classification Acc. (%) | Training Time (min) |
|---|---|---|---|
| ResNeXt DTL | 80.2 | 73.2 | 92 |
| DenseNet DTL | 79.1 | 71.9 | 84 |
| AlexNet ST | 76.3 | 62.8 | 39 |
| ResNet18 ST | 80.3 | 55.1 | 52 |
| DenseNet ST | 77.8 | 58.6 | 68 |
| ResNeXt ST | 80.2 | 62.8 | 80 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Pezzati, N.; Guadagno, M.; Berzi, L.; Delogu, M. Toward Automated Detection of Permanent Magnet Motors in WEEE Recycling Using Discriminative Transfer Learning. Machines 2026, 14, 331. https://doi.org/10.3390/machines14030331
Pezzati N, Guadagno M, Berzi L, Delogu M. Toward Automated Detection of Permanent Magnet Motors in WEEE Recycling Using Discriminative Transfer Learning. Machines. 2026; 14(3):331. https://doi.org/10.3390/machines14030331
Chicago/Turabian StylePezzati, Niccolò, Maurizio Guadagno, Lorenzo Berzi, and Massimo Delogu. 2026. "Toward Automated Detection of Permanent Magnet Motors in WEEE Recycling Using Discriminative Transfer Learning" Machines 14, no. 3: 331. https://doi.org/10.3390/machines14030331
APA StylePezzati, N., Guadagno, M., Berzi, L., & Delogu, M. (2026). Toward Automated Detection of Permanent Magnet Motors in WEEE Recycling Using Discriminative Transfer Learning. Machines, 14(3), 331. https://doi.org/10.3390/machines14030331

