Target detection model training method, detection method and system in industrial intensive detection scene
By deploying a target detection model training method with multiple training units in industrial intensive detection scenarios, the consistency loss function and Fisher information matrix are used to achieve semi-supervised training, which solves the problem of insufficient data labels and privacy protection, and improves the accuracy of target detection. and model collaborative training effect.
Patent Information
- Application Number
- CN202410656235.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-24
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-05-24
AI Technical Summary
In industrial intensive detection scenarios, due to distributed data generation and insufficient label volume, it is difficult to train target detection models, and traditional centralized training methods have problems such as data privacy leakage and intellectual property rights.
Using a target detection model training method that deploys training units in multiple detection scenarios, by acquiring image data for localized storage and enhancement expansion, the intersection loss, center alignment loss, probability alignment loss, and The consistency loss function predicts the box size consistency loss, combines the Fisher information matrix to calculate the information content of the student network, designs an elastic update loss function, realizes semi-supervised training, and ensures data privacy through federated learning.
Based on a small amount of labeled data and combined with a large amount of unlabeled data, the semi-supervised training of the model is completed to ensure data privacy, coordinate the differences in data distribution in different scenarios, optimize model update performance, and improve target detection accuracy.
Smart Images

Figure CN118657976A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a target detection model training method, a detection method and a system in an industrial intensive detection scene. Background Art
[0002] Deep learning and image processing technology, as the driving force of the rapid development of the Industrial Internet of Things, have made industrial production and logistics processes more efficient and customizable. In recent years, object detection based on deep learning has begun to play an indispensable role in various industrial applications, including but not limited to industrial production supervision, defect detection and fault detection. These works have played a significant role in improving the accuracy of industrial image detection, model reasoning speed and establishing practical applications that can be used in production.
[0003] However, the mainstream method of building high-precision intelligent models for industrial applications usually requires the collection of massive amounts of data for model training. However, in many scenarios, due to data privacy protection and the lack of target data, the traditional centralized training method is no longer feasible. For example, in the case of target detection in intelligent manufacturing, the traditional centralized training method requires the collection of data from sensors of equipment in different institutions and uploading it to a public cloud server for training. This data may include intellectual property, production information, user profiles, and sensitive information from different institutions. Such practices have raised concerns about potential privacy and data leaks.
[0004] Therefore, a new model training and detection solution is urgently needed for target detection tasks in industrial intensive detection scenarios. Summary of the invention
[0005] In view of this, the embodiments of the present invention provide a target detection model training method, a detection method and a system in an industrial intensive detection scenario to eliminate or improve one or more defects existing in the prior art and solve the problem that the target detection model training is difficult due to the distributed generation of data and insufficient number of labels in industrial detection scenarios.
[0006] One aspect of the present invention provides a method for training a target detection model in an industrial intensive detection scenario. The method is executed on training units respectively deployed in multiple detection scenarios. The method comprises the following steps:
[0007] Image data in a first target detection scene is obtained, and the image data is locally stored and enhanced and expanded; the enhanced image obtained after the enhancement and expansion and the original image data are used as samples, and some marked target objects therein are used as labels to construct a first training sample set.
[0008] Obtain a teacher network and a student network initialized for target detection; input a first training sample set into the teacher network and the student network, and output a center position, a box position, and a prediction probability corresponding to a target object prediction box, wherein the labeled samples are only input into the student network.
[0009] A consistency loss function based on intersection-over-union loss, center alignment loss, probability alignment loss and prediction box size consistency loss is constructed between the teacher network and the student network. The standard supervision loss of the student network for labeled samples is constructed, and a joint loss function is constructed based on the consistency loss and the standard supervision loss. The information content of the student network is calculated based on the Fisher information matrix, and the information content and the parameter difference between the student network and the shared student network are introduced into the joint loss to construct an elastic update loss function.
[0010] In local training, the student network parameters are updated by minimizing the elastic update loss function, and the teacher network is updated according to the parameters of the student network in each round by moving sliding window averaging until convergence; the converged teacher network is used to average and aggregate with the teacher networks of the training units in other detection scenarios to update the shared teacher network, and the converged student network is weighted averaged and aggregated with the student networks of the training units in other detection scenarios to update the shared student network. The updated shared teacher network and shared student network are synchronized to the training units in each detection scenario for the next round of local training until convergence, at which time the shared learning network is used as the target detection model.
[0011] In some embodiments, the enhancement and expansion includes: denoising, spatial transformation, cropping and rotation of the image data, each enhancement stage randomly adopts two of the enhancement methods, and all enhancement methods adopt the same hyperparameters.
[0012] In some embodiments, the teacher network and the student network have the same structure, and a standard residual neural network ResNet-101 and a feature pyramid network are used as image encoders for feature extraction. The feature pyramid is divided into multiple layers to generate features of different dimensions for each input sample and integrate the feature extraction results; and Faster RCNN is used to process the feature extraction results and output the predicted box and predicted probability of the target object.
[0013] In some embodiments, the calculation formula of the intersection-over-intersection loss is:
[0014]
[0015] The calculation formula of the center alignment loss is:
[0016]
[0017] Among them, θ represents the parameters of the student network, o s represents the output bounding box of the student network, o t represents the output bounding box of the teacher network, and N represents the output amount of the teacher network and the student network;
[0018] The calculation formula of the probability alignment loss is:
[0019]
[0020] Where θ represents the parameters of the student network, KL represents the Kullback-Leibler divergence, and p s represents the detection probability value output by the student network, p t represents the detection probability value output by the teacher network, D n represents the amount of local data of the nth training unit;
[0021] The prediction box size consistency loss calculation formula is:
[0022]
[0023] Among them, θ represents the parameters of the student network, d s represents the pixel range covered by the predicted border of the student network, d t Denotes the predicted border pixel value of the teacher network, D n represents the amount of local data of the nth training unit;
[0024] The calculation formula of the consistency loss function is:
[0025]
[0026] In some embodiments, a joint loss function is constructed based on the consistency loss and the standard supervision loss, and the expression is:
[0027]
[0028] Among them, X L represents a labeled sample, X U represents samples without labels, L sup (θ) represents the standard supervised loss function generated by the student network on labeled samples, and θ represents the parameters of the student network.
[0029] In some embodiments, the Fisher information matrix calculates the information content of the student network, and the calculation formula is:
[0030]
[0031] Among them, D n represents the amount of local data of the nth training unit, θ represents the parameters of the student network, and p represents the probability estimate;
[0032] The information content and the parameter difference between the student network and the shared student network are introduced into the joint loss to construct an elastic update loss function, which is calculated as follows:
[0033]
[0034] in, represents the joint loss function, θ g represents the parameters of the shared student network, θ ci represents the parameters of the student network in round i, represents the information content of the student network in round i, k is the weight parameter, and n represents the total number of training rounds;
[0035] The teacher network is updated according to the parameters of each round of the student network by moving sliding window average, and the expression is:
[0036] f i =αf i-1 +(1-α)0 i ;
[0037] Among them, f i represents the parameters of the local teacher network in the i-th iteration, θ i represents the parameters of the local student network in the i-th iteration, and α represents the smoothing factor.
[0038] On the other hand, the present invention also provides a method for detecting an object in an industrial intensive detection scenario, wherein the method is executed on training units respectively deployed in a plurality of detection scenarios, and the method comprises the following steps:
[0039] Acquire image data to be detected;
[0040] The image data to be detected is input into the target detection model in the target detection model training method in the above-mentioned industrial intensive detection scenario, and the prediction box and prediction probability for the target object are output.
[0041] On the other hand, the present invention also provides a target detection system in an industrial intensive detection scenario, the system comprising:
[0042] Industrial image acquisition unit, used to obtain image data in target detection scenes;
[0043] A plurality of consistent semi-supervised training units for executing the target detection model training method in the above industrial intensive detection scenario;
[0044] A plurality of model alignment units, corresponding one to one with the consistency semi-supervised training units, are used to calculate the information content of the corresponding local student network based on the Fisher information matrix, and introduce the information content and the parameter difference between the student network and the shared student network into the joint loss to construct an elastic update loss function;
[0045] A federated parameter aggregation unit, configured to aggregate the student network and the teacher network obtained by training the consistency semi-supervised training units in a weighted aggregation manner to update the corresponding shared student network and shared teacher network;
[0046] The target detection application unit is used to use the updated shared student network to perform the target detection task.
[0047] On the other hand, the present invention further provides a computer-readable storage medium having a computer program / instruction stored thereon, which implements the steps of the above method when the computer program / instruction is executed by a processor.
[0048] On the other hand, the present invention also provides a computer program product, comprising a computer program / instruction, which implements the steps of the above method when executed by a processor.
[0049] The beneficial effects of the present invention are at least:
[0050] The target detection model training method, detection method and system in the industrial intensive detection scenario described in the present invention, in a distributed industrial detection scenario, constructs a consistency loss function between the teacher network and the student network based on the intersection loss, center alignment loss, probability alignment loss and prediction box size consistency loss in each detection scenario, constructs the standard supervision loss of the student network for labeled samples, and can complete the semi-supervised training of the model based on a small amount of labeled data combined with a large amount of unlabeled data. At the same time, the form of federated learning is introduced for multiple detection scenarios, which can ensure the privacy of data at each end and guide the model to learn multiple targets in a complex background. Furthermore, the Fisher information matrix is introduced to calculate the information content of the student network in each scene, and based on this, an elastic weight update mechanism is designed to coordinate the data distribution differences in different scenes to optimize the overall performance of the model update.
[0051] Additional advantages, purposes, and features of the present invention will be described in part in the following description, and will become apparent to those skilled in the art after studying the following, or may be learned from the practice of the present invention. The purposes and other advantages of the present invention may be achieved and obtained by the structures specifically indicated in the specification and the accompanying drawings.
[0052] Those skilled in the art will appreciate that the objectives and advantages that can be achieved with the present invention are not limited to the above specific description, and the above and other objectives that can be achieved by the present invention will be more clearly understood from the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of the present application, and do not constitute a limitation of the present invention. In the drawings:
[0054] Figure 1 The figure is a flow chart of a method for training a target detection model in an industrial intensive detection scenario according to an embodiment of the present invention.
[0055] Figure 2 This is a structural diagram of the industrial Internet dense target detection system structure described in one embodiment of the present invention. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0057] It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, only structures and / or processing steps closely related to the solutions according to the present invention are shown in the accompanying drawings, while other details that are not closely related to the present invention are omitted.
[0058] It should be emphasized that the term “include / comprises” when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.
[0059] It should also be noted that, unless otherwise specified, the term “connection” herein may refer not only to a direct connection but also to an indirect connection involving an intermediate.
[0060] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In the accompanying drawings, the same reference numerals represent the same or similar components, or the same or similar steps.
[0061] In industrial Internet applications, the collected images usually contain a large number of targets to be detected. With the popularization of intelligent acquisition equipment, the detection system that simply deploys local detection models has exposed more and more deficiencies. Directly applying the existing federated learning solution to industrial target detection scenarios also has the following problems:
[0062] First, label missing is particularly evident in industrial environments. Manually obtaining data labels is a daunting task. It turns out that manual annotation for industrial object detection applications is time-consuming and expensive.
[0063] Second, in addition to insufficient labels, real-world industrial applications are usually in a non-independent and identically distributed form. Different devices have different object sizes, production environments, and device types. At the same time, industrial organizations also have differences in private dataset categories and image features. Simply using the weighted average aggregation method of federated learning parameters will lead to poor performance of model collaborative optimization in industrial scenarios.
[0064] Therefore, in densely packed scenarios, for industrial target detection tasks with limited data labels, in order to improve the working efficiency of the federated target detection solution in the industrial Internet, this application proposes a training solution for the target detection model.
[0065] Specifically, the present application provides a method for training a target detection model in an industrial intensive detection scenario, wherein the method is executed on training units respectively deployed in multiple detection scenarios, such as Figure 1 As shown, the method includes the following steps S101 to S104:
[0066] Step S101: Acquire image data in a first target detection scene, locally store and enhance the image data; use the enhanced image obtained after the enhancement and expansion and the original image data as samples, and use some marked target objects therein as labels to construct a first training sample set.
[0067] Step S102: Obtain and initialize a teacher network and a student network for target detection; input the first training sample set into the teacher network and the student network, and output the center position, box position and prediction probability corresponding to the target object prediction box, wherein the labeled samples are only input into the student network.
[0068] Step S103: construct a consistency loss function between the teacher network and the student network based on intersection-over-union loss, center alignment loss, probability alignment loss and prediction box size consistency loss, construct a standard supervision loss for the student network for labeled samples, and construct a joint loss function based on the consistency loss and the standard supervision loss; calculate the information content of the student network based on the Fisher information matrix, introduce the information content and the parameter difference between the student network and the shared student network into the joint loss to construct an elastic update loss function.
[0069] Step S104: In local training, the parameters of the student network are updated by minimizing the elastic update loss function, and the teacher network is updated according to the parameters of each round of the student network by moving sliding window averaging until convergence; the converged teacher network is used to average and aggregate with the teacher networks of the training units in other detection scenarios to update the shared teacher network, and the converged student network is weighted averaged and aggregated with the student networks of the training units in other detection scenarios to update the shared student network. The updated shared teacher network and shared student network are synchronized to the training units in each detection scenario for the next round of local training until convergence, and the shared learning network is used as the target detection model.
[0070] This application combines multiple detection scenarios for training. A training unit is deployed for each detection scenario. The training unit uses locally collected data for training, and the data does not interact between the training units.
[0071] In step S101, the image acquisition device acquires image data for the target object in a single detection scene. In actual application, the subject in each scene has only a small ability to add labels to part of the image data, so a first training sample set with a small number of samples having labels can be formed.
[0072] Among them, in view of the limited number of samples directly collected, the present application also enhances and expands the image data. In some embodiments, the enhancement and expansion includes: denoising, spatial transformation, cropping and rotation of the image data. Each enhancement stage randomly adopts two of the enhancement methods, and all enhancement methods use the same hyperparameters.
[0073] The purpose of noise reduction is to remove noise from an image to generate new samples and make the image clearer. Common methods include: Mean Filtering, which replaces the central pixel with the average value of the pixels in the convolution kernel. Gaussian Filtering, which uses a Gaussian function to calculate the weighted average value of the pixels in the convolution kernel. Median Filtering, which replaces the central pixel with the median value of the pixels in the convolution kernel, is particularly suitable for removing salt and pepper noise.
[0074] Spatial transformation can change the shape and position of an image to generate new samples. Common operations include translation, scaling, affine transformation, etc.: Translation moves an image by a certain number of pixels horizontally and / or vertically. Scaling adjusts the size of an image, either maintaining or not maintaining the proportion. Affine transformation transforms an image through a matrix, including rotation, scaling, translation, shearing, etc.
[0075] Cropping is to cut out a certain area from the original image to generate a new sample. It is often used to generate images of local areas: fixed area cropping is to crop a fixed size area in the image. Random cropping is to randomly select an area in the image for cropping, which can increase data diversity.
[0076] Rotating an image means rotating the image at a certain angle to generate a new sample. Fixed angle rotation: rotate the image at a predetermined angle. Random angle rotation: randomly select an angle within a certain range for rotation.
[0077] In steps S102 and S103, a teacher-student neural network structure is established in a single training unit, and a consistency loss function is designed to align the detection box center position, detection probability and target box position predicted by the teacher network and the student network. The loss function encourages the output alignment of the network by encoding the geometric and semantic information of the detection target. After the teacher network and the student network process the sample data, the prediction results are compared for consistency, which does not require the help of labels. The small amount of labeled data in the first training sample set is only used to train the student network to guide the model to achieve the leaf segmentation function.
[0078] In some embodiments, the teacher network and the student network have the same structure, and a standard residual neural network ResNet-101 and a feature pyramid network are used as image encoders for feature extraction. The feature pyramid is divided into multiple layers to generate features of different dimensions for each input sample and integrate the feature extraction results; and, Faster RCNN is used to process the feature extraction results to output the predicted box and predicted probability of the target object.
[0079] In the training unit of a single detection scenario, the training updates of the teacher network and the student network mainly utilize the consistency loss function and the standard supervision loss. At the same time, in order to coordinate the training effect and degree of the model in different detection scenarios, the Fisher information matrix is introduced to calculate the information content of the student network and establish a flexible update mechanism.
[0080] In some embodiments, the calculation formula for the intersection-over-intersection loss is:
[0081]
[0082] The calculation formula of center alignment loss is:
[0083]
[0084] Among them, θ represents the parameters of the student network, o s represents the output bounding box of the student network, o t represents the output bounding box of the teacher network, and N represents the output volume of the teacher network and the student network.
[0085] The calculation formula of the probability alignment loss is:
[0086]
[0087] Among them, θ represents the parameters of the student network, KL represents the Kullback-Leibler divergence, and p s Represents the detection probability value output by the student network, p t represents the detection probability value output by the teacher network, D n Indicates the amount of local data for the nth training unit.
[0088] The calculation formula for the prediction box size consistency loss is:
[0089]
[0090] Among them, θ represents the parameters of the student network, d s represents the pixel range covered by the predicted border of the student network, d t Denotes the predicted border pixel value of the teacher network, D n Represents the amount of local data of the nth training unit.
[0091] The calculation formula of the consistency loss function is:
[0092]
[0093] In some embodiments, a joint loss function is constructed based on the consistency loss and the standard supervision loss, and the expression is:
[0094]
[0095] Among them, X L represents a labeled sample, X U Indicates samples without labels, Lsu p (θ) represents the standard supervised loss function generated by the student network on labeled samples, and θ represents the parameters of the student network.
[0096] In some embodiments, the Fisher information matrix calculates the information content of the student network as follows:
[0097]
[0098] Among them, D n represents the amount of local data in the nth training unit, θ represents the parameters of the student network, and p represents the probability estimate;
[0099] The information content and the parameter difference between the student network and the shared student network are introduced into the joint loss to construct the elastic update loss function, which is calculated as follows:
[0100]
[0101] in, represents the joint loss function, θ g represents the parameters of the shared student network, θ ci represents the parameters of the student network in round i, represents the information content of the student network in round i, k is the weight parameter, and n represents the total number of training rounds;
[0102] At the same time, the teacher network is updated according to the parameters of each round of the student network by moving the sliding window average, and the expression is:
[0103] f i =αf i-1 +(1-α)θ i ;
[0104] Among them, f i represents the parameters of the local teacher network in the i-th iteration, θ i represents the parameters of the local student network for the i-th iteration, and α represents the smoothing factor.
[0105] In step S104, after completing the local training, the teacher network and the student network obtained by the training unit in each detection scene are averaged and aggregated based on the form of federated training, preferably weighted average aggregation can be used. The aggregated shared teacher network and shared student network are fed back to each detection scene to update the local model for further training.
[0106] On the other hand, the present invention further provides a method for detecting an object in an industrial intensive detection scenario, the method being executed on training units respectively deployed in a plurality of detection scenarios, the method comprising the following steps S201-S202:
[0107] Step S201: Acquire image data to be detected.
[0108] Step S202: input the image data to be detected into the target detection model in the target detection model training method in the industrial intensive detection scene described in the above steps S101 to S104, and output the prediction box and prediction probability for the target object.
[0109] On the other hand, the present invention also provides a target detection system in an industrial intensive detection scenario, the system comprising:
[0110] Industrial image acquisition unit, used to obtain image data in target detection scenes;
[0111] A plurality of consistent semi-supervised training units, used to execute the target detection model training method in the industrial intensive detection scenario described in the above steps S101 to S104;
[0112] Multiple model alignment units correspond one-to-one to the consistent semi-supervised training units, which are used to calculate the information content of the corresponding local student network based on the Fisher information matrix, and introduce the information content and the parameter difference between the student network and the shared student network into the joint loss to construct an elastic update loss function.
[0113] The federated parameter aggregation unit is used to aggregate and update the corresponding shared student network and shared teacher network by weighted aggregation based on the student network and teacher network trained by each consistent semi-supervised training unit.
[0114] The target detection application unit is used to perform target detection tasks using the updated shared student network.
[0115] On the other hand, the present invention further provides a computer-readable storage medium having a computer program / instruction stored thereon, which implements the steps of the above method when the computer program / instruction is executed by a processor.
[0116] On the other hand, the present invention also provides a computer program product, comprising a computer program / instruction, which implements the steps of the above method when executed by a processor.
[0117] The present invention is described below in conjunction with a specific embodiment:
[0118] This embodiment intends to improve and optimize the collaborative training method of the target recognition model in the densely stacked scene of the industrial Internet. Given the detection of the collected images in the industrial environment, the main goal is to accurately locate all targets by defining the bounding box of the object. Such image data may contain sensitive information of the industrial organization. For example, the acquisition device may be an intelligent device, such as an intelligent camera array, which collects image or video data for various applications. These applications range from product quality monitoring to worker detection and tracking. This method enables the detection model to be collaboratively learned among decentralized devices. These data sets include both labeled and unlabeled data. In order to reduce the annotation cost of dense target images, this embodiment proposes a federated semi-supervised learning framework for dense target detection scenarios, which realizes target detection tasks in complex scenarios with few samples while ensuring data privacy and security, so as to improve the availability and practicality of the target detection method of the industrial Internet.
[0119] This embodiment builds a teacher-student network on the data provider (hereinafter referred to as the client) to achieve local semi-supervised learning, thereby improving the model's ability to learn on unlabeled data, and constructs a consistency loss function based on target detection results between the two networks to ensure network output alignment and improve the efficiency of semi-supervised learning. Taking into account the differentiated characteristics of data volume and distribution between different clients, the information content of the local model is quantified by calculating the Fisher information matrix of each client model, and a flexible update mechanism is designed based on the amount of information contained in the client to reduce the divergence between the local model and the shared model, and improve the efficiency of collaborative model optimization among multiple clients.
[0120] like Figure 2 As shown, this embodiment enhances and collaboratively trains images in the dense target detection scenario of the Industrial Internet, and combines the federated learning framework to improve the accuracy of the target detection model while ensuring the privacy of the original data.
[0121] The industrial Internet intensive target detection system structure adopted in this embodiment includes six parts: an industrial image acquisition unit, a data storage and preprocessing unit, a consistency semi-supervised training unit, a model alignment unit, a federated parameter aggregation unit, and a target detection application unit.
[0122] Step 1: Industrial data acquisition devices (such as cameras, etc.) obtain image data in the target detection scene, where each device has only a small amount of annotation capabilities and can only annotate a small amount of data. In other cases, only some devices in the system have the ability to annotate (such as devices that need to be inspected and calibrated), and the remaining large number of devices only contain unlabeled data.
[0123] Step 2: The client local server locally stores the collected data and enhances and expands the image. The present invention adopts a hybrid expansion method, including denoising, spatial transformation, cropping, rotation, etc. of the image. Two of the enhancement methods are randomly used in each enhancement stage, and all enhancement methods use the same hyperparameters. The enhanced data set is stored together with the original image as a training data set.
[0124] Step 3: In the consistency semi-supervised training unit, this embodiment constructs a teacher-student network, which is composed of two neural networks with the same architecture but different parameters. The local enhanced image and the original image are respectively used as network inputs to the teacher network and the student network. In the neural network optimization stage, the center position, prediction probability and target frame position of the two neural network output prediction boxes are aligned, and a consistency loss function is constructed to perform an error back propagation algorithm on the student network. The above steps are repeated until the student network converges, and the teacher network is updated according to the parameters of the student network by moving the sliding window.
[0125] Step 4: In the model alignment unit, this embodiment uses the Fisher information matrix to quantify the amount of information contained in the parameters of each client, and uses this as a weight to align with the current global model parameters to ensure that the deviation between the local model parameter update and the global update is not too large, thereby alleviating the problem of global model performance degradation caused by non-independent and identically distributed client data.
[0126] Step 5: In the parameter aggregation unit, the embodiment of the present invention performs weighted balancing on all client teacher network and student network parameters based on the amount of local data as weight, repeats the above steps until the global model converges, and then performs industrial applications of complex target detection based on the input image based on the teacher network.
[0127] The specific operation process is as follows:
[0128] 1. Industrial data acquisition equipment collects images of the target environment, and stores the original data and enhanced data in the device after preprocessing operations using a hybrid data enhancement method (noise reduction, spatial transformation, cropping, rotation, etc.).
[0129] 2. In order to jointly train the target detection model with other devices, for each device C = {C 1 ,C 2 ,…,C n}, both have local dataset D n ={X L ,X U}, where X L Indicates labeled data, X U Represents unlabeled data. Each client first inputs the enhanced data set as the network into the teacher network and the student network. Here, the standard residual neural network ResNet-101 and the feature pyramid network are used as image encoders for feature extraction. The feature pyramid network is divided into multiple layers to generate different features for each image. The bottom layer predicts all layers of the feature pyramid and integrates all results to obtain feature extraction results. Finally, Faster RCNN is used to output the target prediction box for the aforementioned features.
[0130] 3. After obtaining the outputs of the student network and the teacher network, a consistency loss function is used to align the outputs. Here, the intersection over union (IoU) is used to evaluate the accuracy of the network output bounding box. Intuitively, when all network parameters of the teacher and student networks are aligned, the bounding boxes predicted by the two network outputs should be completely consistent. At this time, the performance of the teacher network and the student network is optimal. Therefore, the present invention enhances the performance of the detector by maximizing the IoU of the predicted bounding boxes between the teacher network and the student network. The IoU loss function can be expressed as
[0131]
[0132] Among them, θ represents the parameters of the student network, o s represents the output bounding box of the student network, o t represents the output bounding box of the teacher network, and N represents the output volume of the teacher network and the student network.
[0133] Next, the center positions of the two bounding boxes are aligned, and the center alignment loss function can be expressed as
[0134]
[0135] Among them, θ represents the parameters of the student network, o s represents the output bounding box of the student network, o t represents the output bounding box of the teacher network, and N represents the output volume of the teacher network and the student network.
[0136] In addition to the alignment of the detection centers, this embodiment also takes into account the alignment of the predicted probability values output by the network and constructs the corresponding probability alignment loss function:
[0137]
[0138] Among them, θ represents the parameters of the student network, KL represents the Kullback-Leibler divergence, and p s Represents the detection probability value output by the student network, p t represents the detection probability value output by the teacher network, D n Indicates the amount of local data for the nth training unit.
[0139] Finally, the predicted box sizes output by the two networks are aligned, and the prediction box size consistency loss function can be expressed as:
[0140]
[0141] Among them, θ represents the parameters of the student network, d s represents the pixel range covered by the predicted border of the student network, d t Denotes the predicted border pixel value of the teacher network, D n Represents the amount of local data of the nth training unit.
[0142] Therefore, the student network consistency loss function can be expressed as:
[0143]
[0144] For client D that has label data n ={X L ,X UThe detection model is trained and optimized through semi-supervised learning. The client student network loss function can be expressed as:
[0145]
[0146] Among them, X L represents a labeled sample, X U represents samples without labels, L sup (θ) represents the standard supervised loss function generated by the student network on labeled samples, and θ represents the parameters of the student network.
[0147] In other embodiments, since some clients have the ability to add tags while others do not, for clients without the tagging ability, n ={X U}, the student network loss function only uses the consistency loss function
[0148] 4. After the consistency training of the locally trained teacher network and the student network, the network parameters of the local student network are then aligned with the global network parameters. In order to apply the elastic update mechanism, the present invention uses the Fisher Information Matrix (FIM) to calculate the information content of the local model. Since clients with fewer labels tend to learn less knowledge, their FIM values are lower than other clients. This elastic weighting method can ensure that the global model is not affected by the update of undertrained clients during the collaborative training process, thereby improving the convergence and robustness of the system. The FIM value of each client model can be calculated as
[0149]
[0150] Among them, D n represents the amount of local data in the nth training unit, θ represents the parameters of the student network, and p represents the probability estimate;
[0151] The local student model parameters are updated by weighted averaging the local model parameters, with the weights determined by the number of samples contributed by each client. Given this elastic update mechanism, the client student network parameter loss function can be updated as
[0152]
[0153] in, represents the joint loss function, θ g represents the parameters of the shared student network, θ ci represents the parameters of the student network in round i, represents the information content of the student network in round i, k is the weight parameter, and n represents the total number of training rounds;
[0154] After the local training of the student network is completed, the teacher network updates the teacher network parameters f according to the parameters of the student network by moving the sliding window. The moving sliding window update method can be expressed as
[0155] f i =αf i-1 +(1-α)θ i ;
[0156] Among them, f represents the teacher network model parameters, α represents the smoothing factor that controls the influence of the new student model parameters on the teacher model parameters, and i represents the number of training rounds.
[0157] 5. Finally, the federated average weighted algorithm is used to perform weighted average aggregation on the parameters of the teacher network and the student network, and the above steps are repeated until the model converges. After completing the federated collaborative training, the teacher network can be used for target detection applications in complex scenarios.
[0158] Corresponding to the above method, the present invention also provides an apparatus / system, which includes a computer device, the computer device includes a processor and a memory, the memory stores computer instructions, the processor is used to execute the computer instructions stored in the memory, and when the computer instructions are executed by the processor, the apparatus / system implements the steps of the method described above.
[0159] The embodiment of the present invention also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the aforementioned edge computing server deployment method are implemented. The computer-readable storage medium can be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the technical field.
[0160] The accuracy of target detection in the industrial Internet scenario is the basis of various applications. In order to achieve efficient training of multi-device detection models under the premise of ensuring data privacy, and taking into account the problems of insufficient data annotation and non-independent and identically distributed data, the main innovations of this embodiment are as follows: First, accurate and concise target detection models are the core of industrial applications. To address this problem, the present invention proposes a teacher-learning network to realize the detection model training under a small amount of data labels. Secondly, by constructing a consistency loss function to improve the model detection accuracy, the target detection model training in dense scenarios can be realized. Secondly, there is still a need for data privacy protection in industrial scenarios. To address this need, the present invention adopts a federated learning paradigm to ensure that data does not leave the local area by uploading parameters instead of raw data. At the same time, considering the non-independent and identically distributed nature of data between different clients, the amount of information contained in the client model is measured according to the Fisher matrix, and an elastic update mechanism is proposed to reduce the degree of divergence between the client and the global model, thereby improving the collaborative training effect of the model.
[0161] Compared with the prior art, the main advantages of this embodiment are:
[0162] 1. Existing target detection technologies usually need to collect a large amount of data from various sensors for centralized training, ignoring the requirements of data privacy protection and intellectual property rights. This embodiment adopts a federated learning paradigm, and various smart devices perform local training based on local data, and only upload the trained parameters for weighted aggregation, effectively protecting data privacy.
[0163] 2. Taking into account the complex detection target environment and the large number of objects to be detected in industrial scenarios, this embodiment uses hybrid data enhancement and teacher-student networks to perform semi-supervised learning on the data, reducing the demand for data labels. At the same time, a consistency loss function is constructed for the network output, and the detection accuracy is improved by semantically aligning the network predicted detection box.
[0164] 3. In response to the problem of non-independent and identically distributed data of various industrial acquisition devices, this embodiment quantifies the amount of information of each client through the Fisher information matrix, and aligns it with the global model based on the amount of information contained, thereby reducing the impact of insufficiently trained client knowledge on the global model, thereby achieving efficient collaborative training of detection models in different industrial scenarios.
[0165] In summary, the target detection model training method, detection method and system in the industrial intensive detection scenario described in the present invention, in a distributed industrial detection scenario, constructs a consistency loss function between the teacher network and the student network based on the intersection loss, center alignment loss, probability alignment loss and prediction box size consistency loss in each detection scenario, and constructs the standard supervision loss of the student network for labeled samples, which can complete the semi-supervised training of the model based on a small amount of labeled data combined with a large amount of unlabeled data. At the same time, the introduction of federated learning for multiple detection scenarios can ensure the privacy of data at each end and guide the model to learn multiple targets in a complex background. Furthermore, the Fisher information matrix is introduced to calculate the information content of the student network in each scene, and based on this, an elastic weight update mechanism is designed to coordinate the data distribution differences in different scenes to optimize the overall performance of the model update.
[0166] It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.
[0167] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.
[0168] In the present invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with features of other embodiments or replace features of other embodiments.
[0169] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for training a target detection model in an industrial intensive detection scenario, characterized in that: The method is performed on training units respectively deployed in multiple detection scenarios, and the method includes the following steps: Acquire image data in a first target detection scene, locally store and enhance and expand the image data; use the enhanced image obtained after the enhancement and expansion and the original image data as samples, and use some marked target objects therein as labels to construct a first training sample set; Obtaining a teacher network and a student network for initializing target detection; inputting the first training sample set into the teacher network and the student network, and outputting the center position, box position and prediction probability corresponding to the target object prediction box, wherein the labeled samples are only input into the student network; Constructing a consistency loss function between the teacher network and the student network based on intersection-over-union loss, center alignment loss, probability alignment loss, and prediction box size consistency loss, constructing a standard supervision loss for the student network for labeled samples, and constructing a joint loss function based on the consistency loss and the standard supervision loss; calculating the information content of the student network based on the Fisher information matrix, introducing the information content and the parameter difference between the student network and the shared student network into the joint loss to construct an elastic update loss function; In local training, the parameters of the student network are updated by minimizing the elastic update loss function, and the teacher network is updated according to the parameters of the student network in each round by moving sliding window averaging until convergence; the converged teacher network is used to average and aggregate with the teacher networks of training units in other detection scenarios to update the shared teacher network, and the converged student network is weighted averaged and aggregated with the student networks of training units in other detection scenarios to update the shared student network. The updated shared teacher network and the shared student network are synchronized to the training units in each detection scenario for the next round of local training until convergence, and the shared learning network is used as the target detection model.
2. The target detection model training method in industrial intensive detection scenarios according to claim 1 is characterized in that: The enhancement and expansion includes: denoising, spatial transformation, cropping and rotation of the image data, two of the enhancement methods are randomly adopted in each enhancement stage, and all enhancement methods adopt the same hyperparameters.
3. The target detection model training method in an industrial intensive detection scenario according to claim 1 is characterized in that: The teacher network and the student network have the same structure, and use a standard residual neural network ResNet-101 and a feature pyramid network as image encoders for feature extraction. The feature pyramid is divided into multiple layers to generate features of different dimensions for each input sample and integrate the feature extraction results; and Faster RCNN is used to process the feature extraction results and output the predicted box and predicted probability of the target object.
4. The target detection model training method in an industrial intensive detection scenario according to claim 1 is characterized in that: The calculation formula of the intersection-over-combination loss is: The calculation formula of the center alignment loss is: Among them, θ represents the parameters of the student network, o s represents the output bounding box of the student network, o t represents the output bounding box of the teacher network, and N represents the output amount of the teacher network and the student network; The calculation formula of the probability alignment loss is: Where θ represents the parameters of the student network, KL represents the Kullback-Leibler divergence, and p s represents the detection probability value output by the student network, p t represents the detection probability value output by the teacher network, D n represents the amount of local data of the nth training unit; The prediction box size consistency loss calculation formula is: Among them, θ represents the parameters of the student network, d s represents the pixel range covered by the predicted border of the student network, d t Denotes the predicted border pixel value of the teacher network, D n represents the amount of local data of the nth training unit; The calculation formula of the consistency loss function is:
5. The target detection model training method in industrial intensive detection scenarios according to claim 4 is characterized in that: A joint loss function is constructed based on the consistency loss and the standard supervision loss, and the expression is: Among them, X L represents a labeled sample, X U represents samples without labels, L sup (θ) represents the standard supervised loss function generated by the student network on labeled samples, and θ represents the parameters of the student network.
6. The target detection model training method in industrial intensive detection scenarios according to claim 5 is characterized in that: The Fisher information matrix calculates the information content of the student network, and the calculation formula is: Among them, D n represents the amount of local data of the nth training unit, θ represents the parameters of the student network, and p represents the probability estimate; The information content and the parameter difference between the student network and the shared student network are introduced into the joint loss to construct an elastic update loss function, which is calculated as follows: in, represents the joint loss function, θ g represents the parameters of the shared student network, θ ci represents the parameters of the student network in round i, represents the information content of the student network in round i, k is the weight parameter, and n represents the total number of training rounds; The teacher network is updated according to the parameters of each round of the student network by moving sliding window average, and the expression is: f i =αf i-1 +(1-α)θ i ; Among them, f i represents the parameters of the local teacher network in the i-th iteration, θ i represents the parameters of the local student network in the i-th iteration, and α represents the smoothing factor.
7. A method for detecting targets in industrial intensive detection scenarios, characterized in that: The method is performed on training units respectively deployed in multiple detection scenarios, and the method includes the following steps: Acquire image data to be detected; The image data to be detected is input into the target detection model in the target detection model training method in the industrial intensive detection scene as described in any one of claims 1 to 6, and the prediction box and prediction probability for the target object are output.
8. A target detection system in an industrial intensive detection scenario, characterized in that: The system comprises: Industrial image acquisition unit, used to obtain image data in target detection scenes; A plurality of consistent semi-supervised training units, used to execute the target detection model training method in an industrial intensive detection scenario as described in any one of claims 1 to 6; A plurality of model alignment units, corresponding one to one with the consistency semi-supervised training units, are used to calculate the information content of the corresponding local student network based on the Fisher information matrix, and introduce the information content and the parameter difference between the student network and the shared student network into the joint loss to construct an elastic update loss function; A federated parameter aggregation unit, configured to aggregate the student networks and teacher networks trained by the consistency semi-supervised training units in a weighted aggregation manner to update the corresponding shared student network and shared teacher network; The target detection application unit is used to use the updated shared student network to perform the target detection task.
9. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method as claimed in any one of claims 1 to 7 are implemented.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Directed target detection method based on semi-supervised learning
CN116452794A
SAR (Synthetic Aperture Radar) image nearshore ship target detection method based on semi-soft label
CN116563697A
Mutual learning-based semi-supervised medical image segmentation method and system
WO2023116635A1
Cited By
Big data analysis processing method and system based on artificial intelligence
CN119415892A
Target detection deep learning network quantification method
CN120562490A
Target detection deep learning network quantization method
CN120562490B
