A method and system for detecting small surface defects of alkaline batteries
By improving the DETR detection model and edge computing architecture, the problems of low efficiency and unstable accuracy in alkaline battery surface defect detection have been solved, realizing high-precision, low-latency intelligent quality inspection, which meets the real-time and reliability requirements of industrial production lines.
Patent Information
- Application Number
- CN202610301676.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-12
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2046-03-12
AI Technical Summary
Existing technologies for detecting surface defects in alkaline batteries suffer from low efficiency, unstable accuracy, high cost, and high rates of missed and false detections. Furthermore, large-scale deep learning models are difficult to deploy and integrate in real time in industrial settings, failing to meet the requirements for real-time performance and reliability in industrial applications.
An improved DETR detection model is constructed, employing a bottom-up path aggregation module and Focal Loss and CIoU Loss. A student model is generated in a lightweight manner through knowledge distillation technology and deployed on edge computing nodes. Real-time detection and control are achieved by combining 5G multi-access edge computing.
It achieves high-precision, low-latency detection of surface defects in alkaline batteries, significantly improving detection and positioning accuracy, adapting to production line changes, and providing an efficient industrial quality inspection solution.
Smart Images

Figure CN122199470B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer vision and industrial automation technology, and particularly relates to a method and system for detecting small targets with surface defects in alkaline batteries. Background Technology
[0002] Alkaline batteries are widely used in consumer electronics, electric toys, and medical devices due to their high capacity, stable discharge performance, and long shelf life. The quality of the battery casing, especially the sealing area, directly affects the product's sealing performance, safety, and appearance. Common surface defects include dirt, dents, poor edge curling, whitening, and metallic streaks. These defects are tiny, mostly in the millimeter or even sub-millimeter range, occupying only a few pixels in high-resolution images captured by industrial cameras. Currently, quality inspection in the battery manufacturing industry mainly relies on manual visual inspection. This method has significant drawbacks, including low efficiency, inconsistent accuracy, high cost, and difficulty in data quantification. It cannot match the pace of high-speed production lines, is affected by worker experience, fatigue, and subjective judgment, resulting in high rates of missed and false detections. Furthermore, it cannot generate accurate defect statistics and analysis reports, hindering process improvement. With the development of machine vision technology, automatic detection schemes based on traditional image processing and early machine learning methods have been proposed. However, when faced with small target detection tasks such as battery surface defects, traditional methods have exposed serious limitations. Their feature extraction capabilities are weak, they are extremely sensitive to changes in illumination, background interference, and the diversity of defect morphology, have poor generalization ability, and are complex to debug and maintain. In recent years, deep learning target detection algorithms, represented by convolutional neural networks, have made breakthrough progress. However, these algorithms usually rely on pre-set anchor box mechanisms, which are ineffective when detecting targets at extreme scales. This is because small targets have weak responses on feature maps, and after multiple downsampling, the features almost disappear. The anchor box size and proportion are difficult to perfectly match all small defects, and complex backgrounds easily generate a large number of false candidate boxes, leading to false detections. DETR was the first to introduce the Transformer architecture into target detection, abandoning complex designs such as anchor boxes and non-maximum suppression. It achieves end-to-end detection through global attention mechanisms and ensemble prediction, providing a new approach for small target detection. However, its original model still has shortcomings in small target detection. The feature extraction network does not fully fuse multi-scale features, and the loss function is not sensitive enough to easy and difficult samples and the geometric properties of bounding boxes. On the other hand, industrial environments place stringent demands on the real-time performance, reliability, and deployment cost of inspection systems. Directly deploying large-scale deep learning models on the production line faces challenges such as insufficient computing power, high power consumption, and significant latency. Furthermore, industrial environments require seamless integration of the inspection system with the production control system to achieve real-time feedback control. Therefore, there is an urgent need for a comprehensive solution that can accurately identify small target defects on battery surfaces, meet industrial real-time requirements, is easy to deploy and integrate, and can continuously and adaptively optimize. Summary of the Invention
[0003] To address the aforementioned technical problems, this invention proposes a method and system for detecting small targets on the surface of alkaline batteries, thereby resolving the issues present in the prior art.
[0004] In a first aspect, to achieve the above objective, the present invention provides a method for detecting small targets of surface defects in alkaline batteries, comprising the following steps: An improved DETR detection model is constructed, wherein the improved DETR detection model uses a bottom-up path aggregation module as the feature extraction backbone network, and Focal Loss as the classification loss function and CIoU Loss as the bounding box regression loss function. The improved DETR detection model is lightweighted using knowledge distillation technology to generate a student model; The student model is deployed on an edge computing node; Real-time defect detection is performed on the collected battery surface images by deploying edge computing nodes equipped with the student model, and the detection results are obtained. Based on the detection results, control instructions are generated by the cloud-based programmable logic controller and the actuator is driven to perform corresponding operations.
[0005] Optionally, the process of constructing an improved DETR detection model includes: acquiring and labeling battery images including several types of surface defects to construct a training dataset; training the improved DETR detection model using the training dataset, wherein the improved DETR detection model uses a bottom-up path aggregation module as the feature extraction backbone network and Focal Loss as the classification loss function and CIoU Loss as the bounding box regression loss function.
[0006] Optionally, the improved DETR detection model is lightweighted using knowledge distillation technology to generate a student model. The process includes: using the fully trained improved DETR detection model as the teacher model, generating soft labels using temperature parameters; constructing a student model that simultaneously learns the soft labels and the real hard labels; jointly optimizing the distillation loss of the student model output with the soft labels and the student loss with the hard labels to complete knowledge transfer and obtain a lightweight student model.
[0007] Optionally, the process of deploying the student model on an edge computing node includes: deploying the student model on an edge computing node of the 5G edge control layer; the edge computing node is connected to the cloud intelligent analysis and decision layer through the 5G network transmission layer, receives model updates from the cloud at a preset period, and performs local performance evaluation and parameter optimization at another preset period.
[0008] Optionally, the process of obtaining detection results by performing real-time defect detection on the acquired battery surface images through edge computing nodes deployed with the student model includes: acquiring battery surface images through an industrial camera; the edge computing node calling the deployed student model to perform inference on the images and outputting the category, location, and confidence information of the defects; and sending the detection results to the cloud-based programmable logic controller and cloud-based intelligent analysis and decision-making layer through a 5G network.
[0009] Optionally, the process of generating control instructions and driving the actuator to perform corresponding operations through the cloud-based programmable logic controller based on the detection results includes: the cloud-based programmable logic controller receiving the detection results, determining the defect category and location according to predefined logic; calculating the delay of the corresponding battery reaching the actuator, generating control instructions; and driving the actuator to perform the removal of defective batteries or alarm operations.
[0010] Optionally, the method further includes a model optimization and update step: the edge computing node transmits the detection results and performance indicators back to the cloud; the cloud uses the transmitted data to incrementally train the improved DETR detection model and generates an updated student model through knowledge distillation; the cloud pushes the updated student model to the edge computing node to replace the original model.
[0011] Secondly, the present invention also provides a small target detection system for surface defects of alkaline batteries, used to implement a method for detecting small targets for surface defects of alkaline batteries, the system comprising: The model building module is used to build an improved DETR detection model. The improved DETR detection model uses a bottom-up path aggregation module as the feature extraction backbone network, and Focal Loss as the classification loss function and CIoU Loss as the bounding box regression loss function. The model lightweighting module is used to lightweight the improved DETR detection model using knowledge distillation technology to generate a student model; The model deployment module is used to deploy the student model to edge computing nodes; An edge detection module, deployed on the edge computing node, is used to perform real-time defect detection on the acquired battery surface images and obtain detection results. The control execution module is used to generate control commands through the cloud-based programmable logic controller based on the detection results and drive the actuator to perform corresponding operations.
[0012] Thirdly, the present invention also provides a computer terminal device, comprising: One or more processors; A memory, coupled to the processor, for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the steps of the alkaline battery surface defect small target detection method in the first aspect described above.
[0013] Fourthly, the present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, it implements the steps of the method for detecting small targets on the surface of alkaline batteries in the first aspect described above.
[0014] Compared with the prior art, the present invention has the following advantages and technical effects: This invention provides a method and system for detecting small surface defects in alkaline batteries. By introducing a bottom-up path aggregation module, it enhances the network's ability to represent the features of minute defects, effectively solving the problem of feature attenuation during downsampling. By fusing Focal Loss and CIoU Loss, this invention addresses the common class imbalance problem in industrial scenarios and guides the model to more accurately regress the true boundaries of defects, significantly improving the identification and localization accuracy of difficult-to-detect defects. Through knowledge distillation technology to lightweight the model, this invention maintains superior detection accuracy while significantly reducing the number of model parameters and computational complexity, enabling advanced algorithms to adapt to edge computing resources. By designing a cloud-edge-device collaborative detection architecture based on 5G multi-access edge computing, this invention deploys inference tasks at the edge to achieve millisecond-level response, performs centralized model training and iterative updates in the cloud, and deeply integrates the vision inspection system with the production control system through cloud-based PLC, realizing full-stack closed-loop control from data acquisition, edge inference, cloud analysis to control execution. This invention achieves high-precision, high-robustness, and low-latency intelligent quality inspection in alkaline battery surface defect detection tasks. It can adapt to production line changes and discover new defect patterns, providing an efficient and feasible solution for industrial product quality control. Attached Figure Description
[0015] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings: Figure 1 This is a flowchart illustrating a method for detecting small targets on the surface of an alkaline battery according to an embodiment of the present invention. Figure 2 This is a schematic diagram of a small target detection system for surface defects in alkaline batteries according to an embodiment of the present invention. Detailed Implementation
[0016] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0017] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0018] like Figure 1 As shown, this embodiment provides a method for detecting small targets on the surface of an alkaline battery, including: An improved DETR detection model is constructed, wherein the improved DETR detection model uses a bottom-up path aggregation module as the feature extraction backbone network, and Focal Loss as the classification loss function and CIoU Loss as the bounding box regression loss function. The improved DETR detection model is lightweighted using knowledge distillation technology to generate a student model; The student model is deployed on an edge computing node; Real-time defect detection is performed on the collected battery surface images by deploying edge computing nodes equipped with the student model, and the detection results are obtained. Based on the detection results, control instructions are generated by the cloud-based programmable logic controller and the actuator is driven to perform corresponding operations.
[0019] Furthermore, the process of constructing the improved DETR detection model includes: acquiring and labeling battery images containing several types of surface defects to construct a training dataset; and training the improved DETR detection model using the training dataset. The improved DETR detection model uses a bottom-up path aggregation module as the feature extraction backbone network and Focal Loss as the classification loss function and CIoU Loss as the bounding box regression loss function.
[0020] Specifically, the implementation process of this embodiment includes: Data Preparation: Approximately 1000 battery surface images containing various defects were collected, all with a resolution of 4096×3072. Bounding boxes for five types of defects (dirt, dents, poor edge curling, whitening, and metal wires) were labeled by professional quality inspectors. The dataset was divided into training, validation, and test sets in an 8:1:1 ratio.
[0021] Teacher model training: An improved DETR model was implemented using the PyTorch framework. The backbone network was a ResNet-50 variant with BUPAM. The loss function was a combination of Focal Loss (α=0.25, γ=2) and CIoU Loss. The AdamW optimizer was used with an initial learning rate of 1e-4 and a batch size of 4, trained for 300 epochs on two RTX 3090 GPUs.
[0022] The core detection model of this invention is based on the DETR framework and has been deeply improved, mainly including three aspects of innovation: (1) Backbone network optimization: Introducing the BUPAM module The ResNet-50 backbone network in the original DETR model was replaced with a feature pyramid network integrating the Bottom-Up Path Aggregation Module. Traditional feature pyramid networks use a top-down unidirectional path to transmit high-level semantic information, but low-level detail information is easily attenuated during this transmission. BUPAM adds a bottom-up enhancement path, directly transmitting detailed low-level features (crucial for locating small targets) to higher levels, where they are fully integrated with high-level semantic features. This bidirectional cross-scale connection mechanism greatly enhances the network's ability to represent features of minute defects, enabling the model to more effectively capture details such as scratches and dents.
[0023] (2) Loss function optimization: fusing Focal Loss and CIoU Loss Classification Loss: Focal Loss is used instead of standard cross-entropy loss. Focal Loss automatically reduces the weight of easily classified background samples in the total loss by introducing an adjustable focusing parameter γ, forcing the model to pay more attention to difficult-to-classify defect samples and the boundary region between positive and negative samples during training. Simultaneously, the class weight factor α further balances the imbalance between defect and background classes. This significantly improves the model's ability to identify small, blurry defects with high similarity to the background.
[0024] Bounding box regression loss: CIoU Loss is used instead of the original GIoU Loss. CIoU, based on the IoU metric, considers the center distance between the predicted and ground truth boxes, the overlap area, and aspect ratio consistency. For battery surface defects, whose shapes may be irregular (such as striped scratches and circular dents), CIoU, by introducing an aspect ratio penalty term, guides the model to more accurately regress the true contours of the defects, especially for targets with large aspect ratio differences, resulting in a significant improvement in localization accuracy.
[0025] (3) Model lightweighting: compression based on knowledge distillation To meet the deployment requirements of edge devices, knowledge distillation is used to compress the improved DETR model (as the teacher model). A higher temperature parameter T is used to soften the output probability distribution of the teacher model, allowing it to include more inter-class relationship information. Subsequently, a student model with a more compact structure, shallower layers, or fewer channels is used to simultaneously fit the soft labels of the teacher model and the true hard labels of the data. By balancing the distillation loss with the original task loss, the student model can inherit most of the performance of the teacher model while significantly reducing parameter size and computational cost (e.g., by more than 30%), achieving an excellent trade-off between accuracy and efficiency.
[0026] Furthermore, the improved DETR detection model is lightweighted using knowledge distillation technology to generate a student model. The process includes: using the fully trained improved DETR detection model as the teacher model, generating soft labels using temperature parameters; constructing a student model that simultaneously learns the soft labels and the real hard labels; jointly optimizing the distillation loss of the student model output with the soft labels and the student loss with the hard labels to complete knowledge transfer and obtain a lightweight student model.
[0027] Specifically, the implementation process of this embodiment includes: Knowledge distillation: A pre-trained teacher model is used. The student model employs the lighter MobileNetV3 as its backbone network, with the number of Transformer encoder layers reduced by half. The distillation temperature is set to T=2, and the soft target loss weights are set to λ=4. The student model is trained for 150 epochs using the same training data as the teacher model.
[0028] Model performance: The evaluation results on the independent test set are shown in Table 1.
[0029] Table 1
[0030] The results show that the improved teacher model achieves a 5.5 percentage point improvement in mAP compared to the original DETR, significantly outperforming Faster R-CNN. The lightweight student model, with a 34.7% reduction in parameters and a 32.3% reduction in computation, only experiences a 0.6 percentage point decrease in mAP compared to the teacher model, achieving an excellent balance between accuracy and efficiency.
[0031] Furthermore, the process of deploying the student model on an edge computing node includes: deploying the student model on an edge computing node of the 5G edge control layer; the edge computing node is connected to the cloud intelligent analysis and decision layer through the 5G network transmission layer, receives model updates from the cloud at a preset period, and performs local performance evaluation and parameter optimization at another preset period.
[0032] Specifically, the implementation process of this embodiment includes: Data Interaction and Execution Layer: As the terminal for the system's "sensing and execution," it consists of high-resolution industrial cameras, light sources, 5G industrial gateways, sensors, and cloud-based PLC-driven actuators (such as robotic arms and sorting devices). It is responsible for high-quality image acquisition, command reception, and action execution.
[0033] 5G Edge Control Layer: A lightweight student model is deployed on edge servers or industrial control computers near the production line. It is responsible for millisecond-level inference on uploaded images, enabling real-time defect identification, classification, and preliminary localization. This layer possesses local autonomy, allowing for local performance fine-tuning according to strategies (e.g., every 10 minutes) and periodic (e.g., every 30 seconds) synchronization of the latest model parameters from the cloud.
[0034] 5G Network Transport Layer: Based on 5G TSN technology, a deterministic low-latency data transmission channel is constructed. It integrates the OPC UA protocol to achieve semantic interoperability between devices. This layer dynamically schedules data of different priorities, such as detection image streams, control commands, and model update packets, ensuring that the end-to-end transmission latency of critical data remains stable within 10 milliseconds.
[0035] Intelligent Analysis and Decision Layer: Deployed in the enterprise cloud or central data center, equipped with a high-performance GPU cluster. Core functions include: a) training and optimizing teacher models using full data; b) performing knowledge distillation to generate lightweight student models; c) aggregating inspection data from multiple production lines for in-depth analysis such as yield analysis, defect pattern mining, and equipment health prediction; d) managing the model lifecycle to achieve MLOps-style continuous integration and deployment.
[0036] Industrial Application Layer: Centered on a cloud-based PLC, it deeply integrates visual inspection logic with production line control logic. It receives inspection results from the edge layer and generates control sequences based on predefined rules (such as immediate rejection of specific defects) to schedule the entire production line's cycle time. Simultaneously, through a web or client-side visual interface, it provides engineers with a global dashboard, displaying real-time inspection result statistics, defect image backtracking, equipment status monitoring, alarm logs, and remote parameter configuration functions.
[0037] Furthermore, the process of obtaining detection results by real-time defect detection of the acquired battery surface images through edge computing nodes deployed with the student model includes: acquiring battery surface images through an industrial camera; the edge computing node calling the deployed student model to perform inference on the images and outputting the category, location, and confidence information of the defects; and sending the detection results to the cloud-based programmable logic controller and cloud-based intelligent analysis and decision-making layer through a 5G network.
[0038] Specifically, the implementation process of this embodiment includes: Initialization and Deployment: The DETR teacher model is trained and optimized using a historical defect image dataset in the cloud, and then a lightweight student model is obtained through distillation and deployed to each edge node.
[0039] Online inspection: On the production line, batteries pass through a camera station, images are captured, and transmitted to edge nodes via a 5G network. A lightweight model performs rapid inference, outputting the defect category, location, and confidence level.
[0040] Real-time control: Inspection results are sent to the cloud-based PLC in real time. After PLC logic judgment, if the product is qualified, it is released; if it is defective, the rejection mechanism is triggered at the subsequent workstation. At the same time, alarm information is pushed to the HMI.
[0041] Edge Deployment: Convert the lightweight student model to TensorRT format and deploy it to the Jetson module of the edge computing gateway. Develop an edge service program that: a) captures camera images via the GigE Vision protocol; b) calls the TensorRT engine for inference; and c) encapsulates the detection results in JSON format and simultaneously sends them to the cloud-based PLC and cloud data platform via the 5G network.
[0042] Furthermore, based on the detection results, the process of generating control instructions through the cloud-based programmable logic controller and driving the actuator to perform corresponding operations includes: the cloud-based programmable logic controller receiving the detection results, determining the defect type and location according to predefined logic; calculating the delay of the corresponding battery reaching the actuator, generating control instructions; and driving the actuator to perform the removal of defective batteries or alarm operations.
[0043] Specifically, the implementation process of this embodiment includes: Cloud and PLC integration: Cloud platform: Develop a model management platform based on Docker and Kubernetes, automatically receive edge-transmitted data, trigger an incremental training and distillation process for the model once a month, and push the new model to the edge gateway through a secure channel.
[0044] Cloud-based PLC program: The control logic is written to calculate the precise delay for the corresponding battery to reach the rejection cylinder based on the defect type and location when a JSON message tagged with "defect" is received, and then triggers the action. Simultaneously, all detection records are stored in a database for real-time display and historical querying by the HMI.
[0045] Furthermore, the method also includes a model optimization and update step: the edge computing node transmits the detection results and performance indicators back to the cloud; the cloud uses the transmitted data to incrementally train the improved DETR detection model and generates an updated student model through knowledge distillation; the cloud pushes the updated student model to the edge computing node to replace the original model.
[0046] Specifically, the implementation process of this embodiment includes: Data feedback and model iteration: Edge nodes encrypt and transmit detection results (including images and labels) along with their own performance metrics back to the cloud. The cloud uses this new production data to incrementally train or periodically retrain the teacher model and initiates a new round of knowledge distillation, pushing the new student model with better performance to the edge. This forms a continuous learning loop of "data acquisition - model optimization - deployment and update," enabling the system to adapt to changes in defect patterns brought about by new materials and processes.
[0047] Operational Results: After the system went live, it achieved 24 / 7 uninterrupted monitoring. The single monitoring cycle (from image capture to result output) is less than 50 milliseconds, perfectly matching the production line's cycle of 600 batteries per minute. The false negative rate decreased from approximately 2% with manual monitoring to below 0.3%, and the false positive rate remained stable below 0.5%. The daily quality reports automatically generated by the system provide precise data support for process engineers to optimize sealing parameters.
[0048] like Figure 2 As shown, based on the same general inventive concept, the present invention also provides a small target detection system for surface defects of alkaline batteries. The small target detection system for surface defects of alkaline batteries provided by the present invention will be described below. The alkaline battery surface defect small target detection system described below can be referred to in correspondence with the alkaline battery surface defect small target detection method described above. The system includes: The model building module is used to build an improved DETR detection model. The improved DETR detection model uses a bottom-up path aggregation module as the feature extraction backbone network, and Focal Loss as the classification loss function and CIoU Loss as the bounding box regression loss function. The model lightweighting module is used to lightweight the improved DETR detection model using knowledge distillation technology to generate a student model; The model deployment module is used to deploy the student model to edge computing nodes; An edge detection module, deployed on the edge computing node, is used to perform real-time defect detection on the acquired battery surface images and obtain detection results. The control execution module is used to generate control commands through a cloud-based programmable logic controller based on the detection results and drive the actuator to perform corresponding operations.
[0049] In this embodiment, a computer terminal device is provided, including: One or more processors; A memory, coupled to the processor, for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the steps of the above-described method for detecting small targets on the surface of alkaline batteries.
[0050] In this embodiment, a computer-readable storage medium is also provided, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of the above-described method for detecting small targets on the surface of alkaline batteries.
[0051] This invention provides a method and system for detecting small surface defects in alkaline batteries. By introducing a bottom-up path aggregation module, it enhances the network's ability to represent the features of minute defects, effectively solving the problem of feature attenuation during downsampling. By fusing Focal Loss and CIoU Loss, this invention addresses the common class imbalance problem in industrial scenarios and guides the model to more accurately regress the true boundaries of defects, significantly improving the identification and localization accuracy of difficult-to-detect defects. Through knowledge distillation technology to lightweight the model, this invention maintains superior detection accuracy while significantly reducing the number of model parameters and computational complexity, enabling advanced algorithms to adapt to edge computing resources. By designing a cloud-edge-device collaborative detection architecture based on 5G multi-access edge computing, this invention deploys inference tasks at the edge to achieve millisecond-level response, performs centralized model training and iterative updates in the cloud, and deeply integrates the vision inspection system with the production control system through cloud-based PLC, realizing full-stack closed-loop control from data acquisition, edge inference, cloud analysis to control execution. This invention achieves high-precision, high-robustness, and low-latency intelligent quality inspection in alkaline battery surface defect detection tasks. It can adapt to production line changes and discover new defect patterns, providing an efficient and feasible solution for industrial product quality control.
[0052] The above are merely preferred embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for detecting small targets with surface defects in alkaline batteries, characterized in that, Includes the following steps: An improved DETR detection model is constructed, which uses a bottom-up path aggregation module as the feature extraction backbone network, and Focal Loss as the classification loss function and CIoU Loss as the bounding box regression loss function. The bottom-up path aggregation module is set in the feature pyramid network, which directly transmits detailed low-level features to high-level features by adding a bottom-up enhancement path, and performs bidirectional cross-scale fusion with high-level semantic features. The feature extraction backbone network is a ResNet-50 variant that integrates the bottom-up path aggregation module. Focal Loss is used instead of standard cross-entropy loss for classification loss. The weight of easily classified background samples in the total loss is reduced by focusing parameters, and the imbalance between defect category and background category is balanced by category weight factor. CIoU Loss is used for bounding box regression loss, which considers the center point distance, overlap area, and aspect ratio consistency between the predicted box and the ground truth box. The improved DETR detection model is lightweighted using knowledge distillation technology to generate a student model. Specifically, this includes: using the fully trained improved DETR detection model as the teacher model, generating soft labels using temperature parameters; constructing a student model that simultaneously learns the soft labels and the real hard labels; and jointly optimizing the distillation loss of the student model output with the soft labels and the student loss with the hard labels to complete knowledge transfer and obtain a lightweight student model. Deploying the student model on an edge computing node specifically includes: deploying the student model on an edge computing node of the 5G edge control layer; the edge computing node is connected to the cloud intelligent analysis and decision layer through the 5G network transmission layer, receives model updates from the cloud at a preset period, and performs local performance evaluation and parameter optimization at another preset period; Real-time defect detection is performed on the collected battery surface images by the edge computing node with the student model deployed, and the detection results are obtained. The student model is converted into TensorRT format and deployed to the Jetson module of the edge computing gateway. The industrial camera image is captured through the GigE Vision protocol, the TensorRT engine is called for inference, the detection results are encapsulated in JSON format and sent to the cloud-based programmable logic controller and cloud data platform through the 5G network. Based on the detection results, a cloud-based programmable logic controller (PLC) generates control commands and drives the actuator to perform corresponding operations. Specifically, the PLC receives the detection results and determines the defect category and location based on predefined logic; calculates the delay of the corresponding battery reaching the actuator and generates control commands; drives the actuator to perform defective battery removal or alarm operations; the edge computing node transmits the detection results and performance indicators back to the cloud; the cloud uses the transmitted data to incrementally train the improved DETR detection model and generates an updated student model through knowledge distillation; the cloud pushes the updated student model to the edge computing node to replace the original model.
2. The method according to claim 1, characterized in that, The process of constructing an improved DETR detection model includes: acquiring and labeling battery images containing several types of surface defects to construct a training dataset; and training the improved DETR detection model using the training dataset. The improved DETR detection model uses a bottom-up path aggregation module as the feature extraction backbone network and Focal Loss as the classification loss function and CIoU Loss as the bounding box regression loss function.
3. A small target detection system for surface defects in alkaline batteries, characterized in that, The system for implementing the method according to any one of claims 1-2 comprises: The model building module is used to build an improved DETR detection model. The improved DETR detection model uses a bottom-up path aggregation module as the feature extraction backbone network, and Focal Loss as the classification loss function and CIoU Loss as the bounding box regression loss function. The model lightweighting module is used to lightweight the improved DETR detection model using knowledge distillation technology to generate a student model; The model deployment module is used to deploy the student model to edge computing nodes; An edge detection module, deployed on the edge computing node, is used to perform real-time defect detection on the acquired battery surface images and obtain detection results. The control execution module is used to generate control commands through the cloud-based programmable logic controller based on the detection results and drive the actuator to perform corresponding operations.
4. A computer terminal device, characterized in that, include: One or more processors; A memory, coupled to the processor, for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors perform the steps of the method as described in any one of claims 1-2.
5. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1-2.
Citation Information
Patent Citations
Knowledge distillation-based light-weight detection method for free-range chickens in complex commercial breeding environment
CN120510626A
