A target detection method, system and terminal based on neural network training acceleration

CN118537525BActive Publication Date: 2026-08-07SHANGHAI JIAOTONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI JIAOTONG UNIV
Filing Date
2023-11-08
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

[0003](1)泛化能力问题:深度神经网络在训练数据上通常能够取得出色的性能,但泛化到未见过的数据上的性能往往不如人们期望的那么好

Benefits of technology

[0051]本发明提供的目标检测方法,可以实现可以神经网络训练的加速,在不引入额外计算开销的情况下改善目标检测器中模型的泛化能力。在同等训练时间的情况下,提高目标检测器召回率与准确率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118537525B_ABST
    Figure CN118537525B_ABST
Patent Text Reader

Abstract

The application provides a target detection method and system based on neural network training acceleration and a terminal, and the method comprises the following steps: acquiring an image of a target to be detected; a deep neural network is used to train the deep neural network, and the trained deep neural network is used as a target detection model, wherein a subspace composed of sampling points on a trajectory is constructed, and weight coefficients are trained in the subspace; in the subspace training process, the steepness of a loss function curve is used to adjust the weight coefficients; in the steepness optimization, perturbation point expansion is used to expand the subspace and enhance the expression ability of the low-dimensional subspace; the image of the target to be detected is input into the target detection model to obtain a target detection result; the application enhances the generalization ability of the model of the target detector under fast training, reduces the time and computing power costs, and makes the loss function curve more flat. The application is simple to operate, can be applied to target detection of various structures, and has high accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and more specifically, to a target detection method, system, and terminal based on neural network training acceleration. Background Technology

[0002] Object detection is a crucial task in computer vision, involving the accurate localization and identification of multiple object instances in images or videos. Its applications are widespread, encompassing numerous fields such as intelligent surveillance, autonomous driving, robot navigation, and human-computer interaction. It provides the foundation for tasks like object recognition, tracking, and scene understanding in real-time scenarios. The application of deep neural networks in object detection is primarily reflected in several key methods, including region-based methods, single-stage methods, and multi-scale methods. With the rapid development of deep learning, deep neural networks have achieved significant breakthroughs and progress in object detection. These deep neural network models not only surpass traditional methods in accuracy but also possess higher automation and generalization capabilities. However, object detection tasks based on deep neural network models still face some challenges and bottlenecks, with two main issues being:

[0003] (1) Generalization problem: Deep neural networks usually achieve excellent performance on training data, but their performance on unseen data is often not as good as expected. This is because the model is prone to overfitting, that is, it performs well on training data, but performs poorly on test data.

[0004] (2) Training speed issue: Deep neural networks typically require a significant amount of training time and computational resources, especially for complex models and large-scale datasets. Accelerating the training process is crucial for practical applications because it can reduce costs and improve efficiency.

[0005] The aforementioned problems with deep neural network models also affect the performance of existing object detection methods. Summary of the Invention

[0006] To address the shortcomings of existing technologies, this invention provides a target detection method, system, and terminal based on neural network training acceleration, which can improve the generalization ability of target detection without introducing additional computational requirements.

[0007] A first aspect of the present invention provides a target detection method based on neural network training acceleration, comprising:

[0008] Acquire an image of the target to be detected;

[0009] A deep neural network is used to train the deep neural network, and the trained deep neural network is used as a target detection model.

[0010] The image of the target to be detected is input into the target detection model to obtain the target detection result;

[0011] Wherein: the deep neural network is trained, and the trained deep neural network serves as an object detection model, including:

[0012] Obtain a training set, wherein the images in the training set correspond to the targets in the images of the target to be detected;

[0013] The training set is input into the deep neural network and the prediction result is output; the current training loss value between the prediction result and the true value is calculated according to the preset loss function; the model parameters of the deep neural network are updated based on the current training loss value.

[0014] The deep neural network is retrained by: constructing a subspace from the sampling points on the training trajectory; obtaining adversarial points in the subspace using the steepness of the loss function surface, and expanding the subspace using the adversarial points; training the weight coefficients in the expanded subspace using a steep loss function to adjust the model parameters of the deep neural network, and obtaining the target detection model after iteration.

[0015] Optionally, before inputting the training set into the deep neural network, the training set is further preprocessed, the preprocessing including normalization, label smoothing, and cropping, wherein:

[0016] The normalization process linearly scales the data to a specific range or distribution while preserving the distribution information of the original data.

[0017] The label smoothing introduces a non-zero probability that is infinitely close to zero, transforming the target label from strict one-hot encoding to a gentler distribution;

[0018] The cropping process simulates potential occlusion or noise in the image by setting randomly selected rectangular regions in the image to zero or random pixel values.

[0019] Optionally, the retraining of the updated deep neural network includes:

[0020] During retraining, for input data x, the model f(x; w): X→Y, whose parameter w is represented by a k-dimensional vector w∈R n express;

[0021] Obtain sampling points w1, w2, ..., w n Then subspace A is represented as:

[0022] A={α1w1+α2w2+…+α n w n |α i∈R}

[0023] Where, α i These are trainable weight coefficients;

[0024] Gradient updates utilizing kurtosis can be implemented using the following optimization problem:

[0025]

[0026] Where L s (w) is given by the following formula:

[0027]

[0028] Where ρ∈R is the pre-defined attack radius;

[0029] In the extended subspace, for the gradient g at the adversarial point adv ∈R n With the projected gradient g in the subspace proj ∈R n The subspace is expanded using the following formula:

[0030] g=βg adv +(1-β)g proj

[0031] Where β∈R is a pre-defined combination constant, and g∈R n This is the gradient that is ultimately used to update the parameters during retraining.

[0032] Optionally, the step of training weight coefficients in the extended subspace using a steep loss function includes: optimizing the model using historical training trajectories to minimize the steepness loss function and adjusting the weight coefficients.

[0033] Optionally, the model is optimized using historical training trajectories, wherein the weights of the historical training trajectories are represented as an objective function, which is used to train the weight coefficients in the subspace to update the model parameters.

[0034] Optionally, the subspace is constructed based on the features of the sampling points on the training trajectory to adapt to different machine learning tasks.

[0035] A second aspect of the present invention provides a target detection system based on neural network training acceleration, comprising:

[0036] The image acquisition module is used to acquire images of the target to be detected.

[0037] A network training module provides a deep neural network for training, and the trained deep neural network serves as an object detection model.

[0038] The target detection module inputs the image of the target to be detected into the target detection model to obtain the target detection result;

[0039] Wherein: the network training module includes:

[0040] A training set acquisition module acquires a training set in which the images in the training set correspond to the targets in the images of the targets to be detected.

[0041] Training update module: inputs the training set into the deep neural network and outputs the prediction result; calculates the current training loss value between the prediction result and the true value according to a preset loss function; and updates the model parameters of the deep neural network based on the current training loss value.

[0042] Retraining module: Retraining the updated deep neural network: Constructing a subspace from sampling points on the training trajectory; Obtaining adversarial points in the subspace using the steepness of the loss function surface, and expanding the subspace through the adversarial points; Training weight coefficients in the expanded subspace using a steep loss function to adjust the model parameters of the deep neural network, and obtaining the target detection model after iteration.

[0043] Optionally, the system further includes a preprocessing module, which performs normalization, label smoothing, and cropping on the training set before inputting it into the deep neural network, wherein:

[0044] The normalization process linearly scales the data to a specific range or distribution while preserving the distribution information of the original data.

[0045] The label smoothing introduces a non-zero probability that is infinitely close to zero, transforming the target label from strict one-hot encoding to a gentler distribution;

[0046] The cropping process simulates potential occlusion or noise in the image by setting randomly selected rectangular regions in the image to zero or random pixel values.

[0047] A third aspect of the present invention provides a target detection device, characterized in that it comprises:

[0048] At least one memory for storing program instructions;

[0049] At least one processor is configured to call program instructions stored in the memory and execute the steps of the target detection method based on neural network training acceleration according to the obtained program instructions.

[0050] Compared with the prior art, the present invention has at least one of the following beneficial effects:

[0051] The object detection method provided by this invention can accelerate neural network training and improve the generalization ability of the model in the object detector without introducing additional computational overhead. It also improves the recall and accuracy of the object detector within the same training time.

[0052] The target detection method provided by this invention introduces kurtosis optimization to guide the target detection model to a flatter loss function surface, effectively improving the robustness of the target detector and increasing the recall and accuracy of targets in unfamiliar scenes. This invention is simple to operate, can be applied to target detection of various structures, and achieves high accuracy. Attached Figure Description

[0053] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:

[0054] Figure 1 This is a flowchart of the method in a preferred embodiment of the present invention;

[0055] Figure 2 This is a flowchart of the preliminary training process of the model in a preferred embodiment of the present invention;

[0056] Figure 3 This is a flowchart of the model retraining process in a preferred embodiment of the present invention;

[0057] Figure 4 This is a flowchart of the face recognition system in a preferred embodiment of the present invention;

[0058] Figure 5 This is a system flowchart of a preferred embodiment of the present invention. Detailed Implementation

[0059] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. The described embodiments are merely some embodiments of the present invention, not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the protection scope of the present invention.

[0060] In order to improve the generalization ability of object detection without introducing additional computational requirements, this invention provides an object detection method based on neural network training acceleration.

[0061] Example 1

[0062] This embodiment provides a target detection method based on neural network training acceleration, including:

[0063] S100, acquire the image of the target to be detected;

[0064] S200 uses a deep neural network, trains the deep neural network, and uses the trained deep neural network as the object detection model.

[0065] S300: Input the image of the target to be detected into the target detection model to obtain the target detection result;

[0066] S200: Training the deep neural network, the trained deep neural network serves as the object detection model, including:

[0067] S201, Obtain the training set, where the images in the training set correspond to the targets in the images of the target to be detected;

[0068] S202: Input the training set into the deep neural network and output the prediction result; calculate the current training loss value between the prediction result and the true value according to the preset loss function; update the model parameters of the deep neural network based on the current training loss value.

[0069] S203, retrain the updated deep neural network: construct a subspace from the sampling points on the training trajectory; obtain adversarial points in the subspace using the steepness of the loss function surface, and expand the subspace using the adversarial points; train the weight coefficients in the expanded subspace using the steep loss function to adjust the model parameters of the deep neural network, and obtain the object detection model after iteration.

[0070] In this embodiment, by effectively training the model in an extended subspace of the training trajectory and simultaneously optimizing the loss value and the steepness of the loss, the convergence speed is accelerated and the generalization performance of the model is improved. This method does not require additional hardware resources, thus enabling faster model training without increasing costs, thereby improving the recall and accuracy of object detection.

[0071] Example 2

[0072] To improve the generalization ability of the target detector, this preferred embodiment provides a target detection method based on neural network training acceleration, referring to... Figure 1 As shown, it specifically includes:

[0073] S1, Obtain the training set, wherein the training set is a set of labeled images;

[0074] The target images to be detected are images from various sources and fields, such as natural scene images, medical images, satellite images, etc.

[0075] In one implementation, the training set is COCO2017. COCO2017 is a widely used object detection and image segmentation dataset that includes several common object categories, such as humans, animals, vehicles, and indoor objects. This dataset has become one of the benchmark datasets for evaluating and comparing the performance of different algorithms and models.

[0076] S2, Preprocess the image

[0077] The images in the training set are normalized, labeled, smoothed, and cropped; these three preprocessing steps can be performed in any order. Of course, in other embodiments, further preprocessing such as data augmentation may be included, depending on the specific dataset.

[0078] The training set can be from a public dataset or a private, labeled dataset. The images in this dataset should correspond to the targets in the images of the targets to be detected.

[0079] Preprocessing can accelerate model convergence and improve model robustness and generalization ability.

[0080] Specifically, the normalization step linearly scales the data to a specific range or distribution, preserving the distribution information of the original data, which helps the model converge and optimize.

[0081] Specifically, label smoothing introduces a smaller non-zero probability, transforming the target label from a strict one-hot encoding to a softer distribution, thereby reducing overfitting and improving the model's generalization ability.

[0082] Specifically, cropping simulates potential occlusion or noise in an image by setting randomly selected rectangular regions to zero or random pixel values. This technique increases the model's robustness to occlusion and noise, helps improve its generalization ability, and reduces the risk of overfitting.

[0083] S3, Build the initial training model and initialize the model parameters.

[0084] In one implementation, the YOLOv3 algorithm is used, with Darknet as its backbone network. Darknet is a lightweight convolutional neural network with multiple convolutional and pooling layers. As the foundational framework for the YOLO family of algorithms, Darknet provides a flexible and efficient tool for object detection and image recognition tasks. It has been widely used in both academia and industry and has become one of the preferred frameworks in many research and practical applications.

[0085] S4, Train the network and save the historical model. In this stage, the deep neural network undergoes a short initial training period, and the model along the training history is saved. (Refer to...) Figure 2 The diagram shown is a flowchart of the initial model training process. Specifically, it includes the following steps:

[0086] S401, The training set is input into a deep neural network, and the deep neural network performs calculations to obtain the final prediction result of the training set image;

[0087] S402, Construct a preset loss function, and calculate the current training loss value between the final prediction result and the true value corresponding to the training set image through the preset loss function;

[0088] In one implementation, the loss function comprises three parts: object detection loss, classification loss, and bounding box coordinate loss. The object detection loss and classification loss use the cross-entropy loss function as the preset loss function, while the bounding box coordinate loss uses the smoothed L1 loss function of the bounding box coordinates to measure the difference between the predicted bounding box and the ground truth bounding box.

[0089] S403, Update the parameters of the deep neural network model based on the current training loss value;

[0090] In one implementation, the ADAM gradient descent algorithm is used for gradient updates. The ADAM algorithm combines the characteristics of momentum methods and adaptive learning rates, aiming to accelerate convergence and handle gradient changes of different features.

[0091] S404, Preserve historical models;

[0092] In one implementation, five network models are saved in each epoch of training, for a total of 325 models saved during this training phase.

[0093] S405, using the historical model to create a subspace;

[0094] The model vectors on the training history trajectory have small angles in high-dimensional space. To reduce errors caused by floating-point operations during projection, Schmidt orthogonalization can be used to construct the basis of the subspace. Schmidt orthogonalization provides a robust and accurate method for vector projection, helping to obtain a more accurate subspace.

[0095] In one implementation, for the 325 stored YOLOv3 models w1, w2, ..., w 325 After normalizing it, perform Schmidt orthogonalization and calculate the projection matrix.

[0096] S5, retraining is performed in the subspace, and the retrained deep neural network model serves as the final object detection model. (Refer to...) Figure 3 The diagram shown is a flowchart of the model retraining process. Specifically, the retraining process includes the following steps:

[0097] S501, The training set is input into a deep neural network, and the deep neural network performs calculations to obtain the final prediction result of the training set image;

[0098] S502, Construct a kurtosis loss function, and calculate the current training loss value between the final prediction result and the true value corresponding to the training set image through the kurtosis loss function;

[0099] S503, Obtain the gradient based on the current training loss value, and project the gradient onto the subspace;

[0100] S504 linearly combines the projected gradient with the original gradient and uses the resulting gradient to update the parameters of the deep neural network model.

[0101] Repeat steps S501-S504 until the set number of retraining rounds is reached.

[0102] In one implementation, the retraining rounds are set to 5, that is, the final object detection model is saved after 5 rounds of retraining in the subspace.

[0103] The above target detection model was applied to target detection in the test set to obtain the corresponding target detection results.

[0104] This embodiment adjusts the weights of the object detection model by considering the steepness of the loss function, thereby increasing the generalization ability during the model's training. Furthermore, by introducing adversarial points to expand the subspace, the expressive power of the object detection model is further enhanced, thus improving generalization performance. This embodiment effectively improves the robustness of the object detector and increases the recall and accuracy of objects in unfamiliar scenes.

[0105] This embodiment can be flexibly applied to various object detection methods, significantly improving the training efficiency and generalization performance of object detection models without requiring additional hardware resources.

[0106] Example 3

[0107] This invention provides a face recognition system based on rapid training of an object detection network. The face recognition system comprises two parts: model training and online recognition. (Refer to...) Figure 4 The diagram shown is a flowchart of the face recognition system.

[0108] Specifically, the model training part includes:

[0109] S1, Obtain the training set, wherein the training set is a set of labeled images;

[0110] In one implementation, the training set is the IJBB and IJBC datasets. The IJBB and IJBC datasets contain face images from different sources and environmental conditions, covering different ages, genders, and facial expressions. The images in the datasets are diverse, including close-up images, long-distance images, blurred images, low-light images, etc., to simulate various face recognition scenarios in the real world.

[0111] S2, perform preprocessing on the images, including data augmentation, normalization, and standardization on the images in the training set;

[0112] S3, Build the initial training model and initialize the model parameters;

[0113] In one implementation, the base network of the model is ResNet-101. ResNet-101 is a variant of the ResNet family and mainly includes the following key components:

[0114] Input layer: Accepts pixel data from the input image.

[0115] Convolutional layer: Extracts image features through convolution operations.

[0116] Residual blocks are the core component of ResNet. Each residual block consists of two convolutional layers, including skip connections. Skip connections pass input information directly to the output, allowing gradients to be directly propagated across multiple residual blocks, thus avoiding the vanishing gradient problem.

[0117] Residual group: consists of multiple residual blocks, and the residual blocks within each residual group share the same feature map size.

[0118] Global average pooling layer: Performs average pooling on the output feature map of the last residual group, converting it into a fixed-length feature vector.

[0119] Fully connected layer: The fully connected layer maps the feature vector to the class probability distribution to perform image classification.

[0120] S4, Train the network and save the historical model. In this stage, the deep neural network undergoes a short initial training period, and the model along the training history is saved. Specifically, it includes the following steps:

[0121] S401, The training set is input into a deep neural network, and the deep neural network performs calculations to obtain the final prediction result of the training set image;

[0122] S402, Construct a preset loss function, and calculate the current training loss value between the final prediction result and the true value corresponding to the training set image through the preset loss function;

[0123] In one implementation, the ArcFace loss function is used. The ArcFace loss function combines the cosine similarity of angles and the classification cross-entropy to form discriminative facial features in the feature space. For two feature vectors x and w, which are L2 normalized (i.e., transformed into unit vectors), the cosine similarity of angles is given by the following formula:

[0124] cosine similarity=x·w=‖x‖‖w‖cosθ

[0125] Where θ is the angle between x and w.

[0126] S403, Update the parameters of the deep neural network model based on the current training loss value;

[0127] In one implementation, a stochastic gradient descent algorithm is used for gradient updates. In each iteration, a mini-batch of samples is randomly selected from the training set to compute the gradient of the loss function, and the model parameters are updated in the opposite direction of the gradient.

[0128] S404, Preserve historical models;

[0129] In one implementation, five network models are saved in each epoch of training, for a total of 325 models saved during this training phase.

[0130] S405, using the historical model to create a subspace;

[0131] The model vectors on the training history trajectory have small angles in high-dimensional space. To reduce errors caused by floating-point operations during projection, Schmidt orthogonalization can be used to construct the basis of the subspace. Schmidt orthogonalization provides a robust and accurate method for vector projection, helping to obtain a more accurate subspace.

[0132] In one implementation, for the 325 stored ResNet-101 models w1, w2, ..., w 325 After normalizing it, perform Schmidt orthogonalization and calculate the projection matrix.

[0133] S5, retraining is performed in the subspace, and the retrained deep neural network model serves as the final object detection model. Specifically, the retraining process includes the following steps:

[0134] S501, The training set is input into a deep neural network, and the deep neural network performs calculations to obtain the final prediction result of the training set image;

[0135] S502, Construct a kurtosis loss function, and calculate the current training loss value between the final prediction result and the true value corresponding to the training set image through the kurtosis loss function;

[0136] S503, Obtain the gradient based on the current training loss value, and project the gradient onto the subspace;

[0137] S504 linearly combines the projected gradient with the original gradient and uses the resulting gradient to update the parameters of the deep neural network model.

[0138] Repeat steps S501-S504 until the set number of retraining rounds is reached.

[0139] The online recognition component mainly includes:

[0140] S1, The camera captures images and transmits them to the server in real time;

[0141] S2, preprocess the image;

[0142] S3, input the preprocessed image into the trained model and extract the feature vector;

[0143] S4. Using the ArcFace method, the extracted facial features are compared and matched with data in the existing facial feature database.

[0144] S5 generates corresponding output based on the comparison results. If the input face matches a face in the database, it outputs the matched identity information or confirms successful identity verification. Depending on the requirements of the security system, it triggers corresponding operations, such as opening access control or generating an alarm signal. If the match fails, it outputs a result indicating recognition failure or unknown identity.

[0145] This embodiment increases the generalization ability of the object detection model during training by adjusting the model's weights after considering the steepness of the loss function. Furthermore, by introducing adversarial points to expand the subspace, the expressive power of the object detection model is further improved, thereby further enhancing its generalization performance. This embodiment can improve the generalization ability of the model in the object detector without introducing additional computational overhead. It improves the recall and accuracy of the object detector within the same training time.

[0146] Example 4

[0147] Reference Figure 5As shown, this embodiment provides a target detection system based on neural network training acceleration, including: an image acquisition module for acquiring an image of a target to be detected; a network training module that provides a deep neural network, trains the deep neural network, and uses the trained deep neural network as a target detection model; and a target detection module that inputs the image of the target to be detected into the target detection model to obtain the target detection result; wherein: the network training module includes:

[0148] A training set acquisition module acquires a training set in which the images in the training set correspond to the targets in the images of the targets to be detected.

[0149] Training update module: inputs the training set into the deep neural network and outputs the prediction result; calculates the current training loss value between the prediction result and the true value according to a preset loss function; and updates the model parameters of the deep neural network based on the current training loss value.

[0150] Retraining module: Retraining the updated deep neural network: Constructing a subspace from sampling points on the training trajectory; Obtaining adversarial points in the subspace using the steepness of the loss function surface, and expanding the subspace through the adversarial points; Training weight coefficients in the expanded subspace using a steep loss function to adjust the model parameters of the deep neural network, and obtaining the target detection model after iteration.

[0151] In a possible implementation, the system of this embodiment further includes a preprocessing module. Before inputting the training set into the deep neural network, the preprocessing module performs normalization, label smoothing, and cropping on the training set. The preprocessing module includes three steps: normalization, label smoothing, and cropping. The normalization step linearly scales the data to a specific range or distribution, preserving the distribution information of the original data, which helps with model convergence and optimization. Label smoothing introduces a smaller non-zero probability, transforming the target label from strict one-hot encoding to a softer distribution, thereby reducing overfitting and improving the model's generalization ability. Cropping simulates potential occlusion or noise in the image by setting randomly selected rectangular regions to zero or random pixel values. This technique increases the model's robustness to occlusion and noise, helps improve the model's generalization ability, and reduces the risk of overfitting.

[0152] This embodiment allows for conventional and rapid training, including inputting samples, predicting outputs, calculating gradients, and updating parameters. This process is repeated until a preset number of rounds is reached, and the model is saved along the historical training trajectory. Higher saving frequencies result in higher subspace dimensions in subsequent training. Because of the use of the subspace method, fewer rounds can be used in the early stages of training, ultimately achieving the desired training effect.

[0153] Reference Figure 5 As shown, in this embodiment, the historical model can be used to span a subspace in the retraining module. Preferably, the basis of the subspace is calculated using Schmidt orthogonalization, thereby reducing the impact of floating-point errors.

[0154] In this embodiment, in the retraining module, the subspace module can obtain the attack point based on the gradient information of the model input, which is used to simulate the point with the highest loss function value within the attack radius. Further, the attacker module projects the gradient of the attack point onto the subspace. Preferably, the gradient projection module uses the gradient before projection to expand the subspace and performs gradient updates within the subspace. Specifically, for the model f(x; w): X→Y, its parameter w can be represented by a k-dimensional vector w∈R. n The obtained sampling points w1, w2, ..., w n Then the subspace can be represented as:

[0155] A={α1w1+α2w2+…+α n w n |α i ∈R}

[0156] Gradient updates utilizing kurtosis can be implemented using the following optimization problem:

[0157]

[0158] Where L s (w) is given by the following formula:

[0159]

[0160] Where ρ∈R is the pre-defined attack radius.

[0161] For the adversarial point gradient g adv ∈R n With the projected gradient g in the subspace proj ∈R n The subspace is expanded using the following formula:

[0162] g=βg adv +(1-β)g proj

[0163] Where β∈R is a pre-defined combination constant, and g∈R n This is the gradient that will ultimately be used to update the parameters during retraining. In this embodiment, β is 0.2.

[0164] The specific implementation of each module in the target detection system of the above embodiments can refer to the techniques used in the steps of the above target detection method embodiments, and will not be repeated here.

[0165] This embodiment considers the flatness of the loss function surface and adjusts the weight coefficients during training. Specifically, it includes: constructing a subspace consisting of sampling points on the trajectory and training the weight coefficients in this subspace; adjusting the weight coefficients using the steepness of the loss function surface during subspace training; expanding the subspace using perturbation points in steepness optimization and enhancing the expressive power of the low-dimensional subspace. This embodiment enhances the generalization ability of the target detector model under rapid training, reduces time and computational costs, and makes the loss function surface flatter. This invention is simple to operate, can be applied to models with various structures, and has high accuracy.

[0166] Example 5

[0167] This embodiment provides a specific application example where the object detection model is built upon a deep convolutional neural network, with a ResNet50 architecture, and is implemented using Python and the PyTorch framework. The training and test sets utilize ImageNet, a dataset containing over 14 million images. These images cover over 20,000 different categories of objects and scenes. Each category has multiple image samples, acquired from different perspectives, scales, and environments. This application example follows these steps:

[0168] Step 1: Preprocess the image by adjusting its size to a fixed value. For ResNet50, the input image size is adjusted to 224x224 pixels. Afterwards, normalization and format conversion are performed on the image.

[0169] Step 2: For the model f(x; w): X→Y, its parameter w can be represented by a k-dimensional vector w∈R k This indicates that the preprocessed image is input into the model for initial training, and the historical models w1, w2, ..., w on the training trajectory are saved. n (w i ∈R k ).

[0170] Step 3: Based on the historical model, extract the basis of the subspace using the Schmidt orthogonalization technique.

[0171] (1)e d =w d (d=1)

[0172]

[0173]

[0174] The subspace can be represented as:

[0175] A={α1w1+α2w2+…+αn w n |α i ∈R}

[0176] Step 4: Retrain in this subspace; the retrained deep neural network model is used as the final classification model.

[0177] The retraining process in the subspace includes:

[0178] The preprocessed training set is input into the model, and the deep neural network is used to calculate the final prediction result of the training set image.

[0179] Construct a kurtosis loss function, and use the kurtosis loss function to calculate the current training loss value between the final prediction result and the true value corresponding to the training set image;

[0180] The gradient is obtained based on the current training loss value, and the gradient is projected onto the subspace;

[0181] Gradient updates utilizing kurtosis can be implemented using the following optimization problem:

[0182]

[0183] Where L s (w) is given by the following formula:

[0184]

[0185] Where ρ∈R is the pre-defined attack radius. In this specific application example, ρ is 0.1.

[0186] The projected gradient is linearly combined with the original gradient to supplement the subspace, and the combined gradient is used to update the parameters of the deep neural network model.

[0187] For the adversarial point gradient g adv ∈R n With the projected gradient g in the subspace proj ∈R n Expand the subspace using the following formula:

[0188] g=βg adv +(1-β)g proj

[0189] Where β∈R is a pre-defined combination constant, and g∈R n This is the gradient that is ultimately used to update the parameters during retraining. In this specific application example, β is 0.2.

[0190] In this embodiment, the generalization ability of the object detection model is improved during training. By introducing adversarial points to expand the subspace, the expressive power of the object detection model is further improved without the need for additional hardware resources.

[0191] Based on the same concept described above, in another embodiment of the present invention, a target detection terminal is also provided, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor. When the processor executes the program, it is used to execute the target detection method in any of the above embodiments.

[0192] Optionally, the memory is used to store programs; the memory may include volatile memory, such as random-access memory (RAM), such as static random-access memory (SRAM), double data rate synchronous dynamic random-access memory (DDR SDRAM), etc.; the memory may also include non-volatile memory, such as flash memory. The memory is used to store computer programs (such as application programs, functional modules, etc. that implement the above methods), computer instructions, etc., and the aforementioned computer programs, computer instructions, etc., can be partitioned and stored in one or more memories. Furthermore, the aforementioned computer programs, computer instructions, data, etc., can be accessed by the processor.

[0193] The aforementioned computer programs, computer instructions, etc., can be stored in partitions within one or more memory locations. Furthermore, the aforementioned computer programs, computer instructions, data, etc., can be accessed by a processor.

[0194] A processor is used to execute a computer program stored in memory to implement the various steps of the methods involved in the above embodiments. For details, please refer to the relevant descriptions in the preceding method embodiments.

[0195] The processor and memory can be separate structures or integrated structures. When the processor and memory are separate structures, they can be coupled together via a bus.

[0196] In this embodiment of the invention, a computer-readable storage medium is also provided, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the target detection method in any of the above embodiments.

[0197] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0198] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0199] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0200] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0201] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the invention.

[0202] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

[0203] The specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various modifications or variations within the scope of the claims, which do not affect the essence of the present invention.

Claims

1. A target detection method based on neural network training acceleration, characterized in that, include: Acquire an image of the target to be detected; A deep neural network is used to train the deep neural network, and the trained deep neural network is used as a target detection model. The image of the target to be detected is input into the target detection model to obtain the target detection result; Wherein: the deep neural network is trained, and the trained deep neural network serves as an object detection model, including: Obtain a training set, wherein the images in the training set correspond to the targets in the images of the target to be detected; The training set is input into the deep neural network and the prediction result is output; the current training loss value between the prediction result and the true value is calculated according to the preset loss function; the model parameters of the deep neural network are updated based on the current training loss value. The deep neural network is retrained by: constructing a subspace from the sampling points on the training trajectory; obtaining adversarial points in the subspace using the steepness of the loss function surface, and expanding the subspace using the adversarial points; training the weight coefficients in the expanded subspace using a steep loss function to adjust the model parameters of the deep neural network, and obtaining the target detection model after iteration; The retraining of the updated deep neural network includes: During retraining, for input data x, the model Its parameter w is a k-dimensional vector express; Obtain sampling points Then the subspace Represented as: ; in, These are trainable weight coefficients; Gradient updates utilizing kurtosis can be implemented using the following optimization problem: ; in Given by the following formula: ; in, The pre-set attack radius; In the extended subspace, for the adversarial point gradient Projected gradient in subspace The subspace is expanded using the following formula: ; in, For a pre-defined combination constant, This is the gradient that is ultimately used to update the parameters during retraining.

2. The target detection method based on neural network training acceleration according to claim 1, characterized in that, Before inputting the training set into the deep neural network, the method further includes preprocessing the training set, which includes normalization, label smoothing, and cropping, wherein: The normalization process linearly scales the data to a specific range or distribution while preserving the distribution information of the original data. The label smoothing introduces a non-zero probability that is infinitely close to zero, transforming the target label from strict one-hot encoding to a gentler distribution; The cropping process simulates potential occlusion or noise in the image by setting randomly selected rectangular regions in the image to zero or random pixel values.

3. The target detection method based on neural network training acceleration according to claim 2, characterized in that, It is 0.

2.

4. The target detection method based on neural network training acceleration according to claim 1, characterized in that, The weight coefficients are trained using a steep loss function in the extended subspace, wherein: The training process for the weight coefficients includes optimizing the model using historical training trajectories to minimize the kurtosis loss function and adjust the weight coefficients.

5. The target detection method based on neural network training acceleration according to claim 4, characterized in that, The model is optimized using historical training trajectories, where the weights of the historical training trajectories are represented as an objective function. This objective function is used to train the weight coefficients in a subspace to update the model parameters.

6. The target detection method based on neural network training acceleration according to claim 4, characterized in that, The subspace is constructed based on the features of the sampling points on the training trajectory to adapt to different machine learning tasks.

7. A target detection system based on neural network training acceleration, employing the target detection method based on neural network training acceleration as described in any one of claims 1-6, characterized in that, include: The image acquisition module is used to acquire images of the target to be detected. A network training module provides a deep neural network for training, and the trained deep neural network serves as an object detection model. The target detection module inputs the image of the target to be detected into the target detection model to obtain the target detection result; Wherein: the network training module includes: A training set acquisition module acquires a training set in which the images in the training set correspond to the targets in the images of the targets to be detected. Training update module: inputs the training set into the deep neural network and outputs the prediction result; calculates the current training loss value between the prediction result and the true value according to a preset loss function; and updates the model parameters of the deep neural network based on the current training loss value. Retraining module: Retraining the updated deep neural network: Constructing a subspace from sampling points on the training trajectory; Obtaining adversarial points in the subspace using the steepness of the loss function surface, and expanding the subspace through the adversarial points; Training weight coefficients in the expanded subspace using a steep loss function to adjust the model parameters of the deep neural network, and obtaining the target detection model after iteration.

8. The target detection system based on neural network training acceleration according to claim 7, characterized in that, It also includes a preprocessing module, which performs normalization, label smoothing, and cropping on the training set before inputting it into the deep neural network, wherein: The normalization process linearly scales the data to a specific range or distribution while preserving the distribution information of the original data. The label smoothing introduces a non-zero probability that is infinitely close to zero, transforming the target label from strict one-hot encoding to a gentler distribution; The cropping process simulates potential occlusion or noise in the image by setting randomly selected rectangular regions in the image to zero or random pixel values.

9. A target detection device, characterized in that, include: At least one memory for storing program instructions; At least one processor is configured to invoke program instructions stored in the memory and execute the steps of the method described in any one of claims 1-6 according to the obtained program instructions.

Citation Information

Patent Citations

  • Object recognition model training method and device

    CN112784953A

  • Text-driven face editing anti-attack method and device and medium

    CN116796829A