Target detection method and device, computer equipment and storage medium

By introducing a pre-layer, a playback layer and a fully connected layer into the object detection model, and using the playback image set and activation value for training, the problem of reduced accuracy and catastrophic forgetting of object detection models on edge devices in complex environments is solved, achieving efficient and accurate object detection effects.

CN119579877APending Publication Date: 2025-03-07PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411748073.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

Due to the limitation of computing resources, object detection models on edge devices are difficult to maintain high accuracy in a variety of complex environments and are prone to catastrophic forgetting problems.

Method used

A target detection method is adopted, by introducing a pre-layer, a playback layer and a fully connected layer, the model training is performed using the playback image set and the activation value in the playback storage, to enhance the model's memory ability of past data, and only the weight parameters of the fully connected layer are updated when backpropagated.

Benefits of technology

It effectively avoids catastrophic forgetting, improves the detection accuracy and generalization capabilities of the model, and realizes efficient object detection on resource-constrained edge devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119579877A_ABST
    Figure CN119579877A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of artificial intelligence, and relates to a target detection method and device, computer equipment and a storage medium, and the method comprises the steps: obtaining a playback image set and a pre-trained target detection model which comprises a front layer, a playback layer and a full connection layer; during forward propagation, inputting a training playback image to a front layer, extracting image features, obtaining an activation value corresponding to the training playback image from playback storage, connecting the image features and the activation value in a playback layer, inputting a connection data structure to a full connection layer, and determining a category result of a target object; and during back propagation, calculating a gradient according to a category result, updating a weight parameter of the full connection layer, and obtaining a trained target detection model. In addition, the invention also relates to a block chain technology, and data such as a target detection model can be stored in a block chain. According to the method and the device, disastrous forgetting of the model can be overcome, and accurate and efficient object detection can be realized on the edge equipment with limited resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a target detection method, device, computer equipment and storage medium. Background Art

[0002] With the in-depth penetration of Internet of Things (IoT) technology, edge devices are becoming increasingly important as outposts for data processing. In the field of vehicle and traffic management, edge devices can instantly analyze video data from road surveillance cameras and accurately identify vehicle types, license plate numbers, and even driver behaviors, which is crucial for intelligent traffic signal control, violation monitoring, and accident warning systems. However, edge devices have significant limitations in computing resources, which directly leads to the deployment of only lightweight object detection models on edge devices.

[0003] Although these lightweight models meet the needs of real-time detection to a certain extent, due to the resource-constrained nature of edge devices, lightweight models trained offline often find it difficult to fully adapt to a variety of complex environments, and their accuracy often fails to reach an ideal state. To address this challenge, the mini-batch replay continuous learning method has emerged, which aims to enable the model to maintain its performance while adapting to domain changes. However, in the process of implementing mini-batch replay continuous learning, the model faces the severe challenge of catastrophic forgetting, that is, the model may forget the old data that has been learned in the past while adapting to new data, resulting in a decrease in model performance.

[0004] Therefore, there is an urgent need for an object detection solution that can overcome catastrophic forgetting and run efficiently on resource-constrained edge devices. Summary of the invention

[0005] The purpose of the embodiments of the present application is to propose a target detection method, apparatus, computer equipment and storage medium, which can not only overcome the catastrophic forgetting of the model, but also realize accurate and efficient object detection on resource-constrained edge devices.

[0006] In order to solve the above technical problems, the present application embodiment provides a target detection method, which adopts the following technical solution:

[0007] Acquire a pre-collected replay image set, wherein the training replay image in the replay image set contains at least one target object;

[0008] Obtain a pre-trained target detection model, wherein the pre-trained target detection model includes a pre-layer, a replay layer, and a fully connected layer;

[0009] During forward propagation, the training replay images in the replay image set are sequentially input into the front layer, image features are extracted, activation values ​​corresponding to the training replay images are obtained from the replay storage, the image features and the activation values ​​are connected in the replay layer to obtain a connection data structure, the connection data structure is input into the fully connected layer, and the category result of the target object is determined;

[0010] During back propagation, a gradient is calculated according to the category result, and a weight parameter of the fully connected layer is updated according to the gradient to obtain a trained target detection model;

[0011] Acquire an image to be detected, wherein the image to be detected contains at least one target object to be detected;

[0012] The trained target detection model is used to perform target detection on the image to be detected, and a category result of the target object to be detected is output.

[0013] In order to solve the above technical problems, the embodiment of the present application further provides a target detection device, which adopts the following technical solution:

[0014] An image acquisition module, used to acquire a pre-collected replay image set, wherein the training replay image in the replay image set contains at least one target object;

[0015] A model acquisition module, used to acquire a pre-trained target detection model, wherein the pre-trained target detection model includes a pre-layer, a replay layer, and a fully connected layer;

[0016] A forward propagation module, used for inputting the training replay images in the replay image set into the front layer in sequence during forward propagation, extracting image features, obtaining activation values ​​corresponding to the training replay images from the replay storage, connecting the image features with the activation values ​​in the replay layer to obtain a connection data structure, inputting the connection data structure into the fully connected layer, and determining the category result of the target object;

[0017] A back propagation module, used for calculating the gradient according to the classification result during back propagation, and updating the weight parameters of the fully connected layer according to the gradient to obtain a trained target detection model;

[0018] A target acquisition module, used to acquire an image to be detected, wherein the image to be detected contains at least one target object to be detected;

[0019] The target detection module is used to use the trained target detection model to perform target detection on the image to be detected, and output the category result of the target object to be detected.

[0020] In order to solve the above technical problems, an embodiment of the present application also provides a computer device, which adopts the technical solution described below: the computer device includes a memory and a processor, the memory stores computer-readable instructions, and the processor implements the steps of the target detection method described in any one of the above items when executing the computer-readable instructions.

[0021] In order to solve the above technical problems, an embodiment of the present application also provides a computer-readable storage medium, which adopts the following technical solution: the computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps of the target detection method described in any one of the above items are implemented.

[0022] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0023] The embodiment of the present application introduces a pre-layer, a replay layer and a fully connected layer into the target detection model, inputs the training replay image into the pre-layer to extract image features, obtains the activation value corresponding to the training replay image from the replay storage, and connects the image features with the activation value in the replay layer to obtain a connection data structure. By combining the activation value in the replay storage, the model's memory ability for past data is enhanced, which helps to alleviate the problem of catastrophic forgetting; the category result of the target object is determined by inputting the connection data structure into the fully connected layer, thereby achieving accurate classification of the target object; during back propagation, the gradient is calculated according to the category result, and the weight parameters of the fully connected layer are updated according to the gradient to obtain a trained target detection model, thereby improving the detection accuracy and generalization ability of the model. Based on the scheme of this application, by using the replay image set and the activation values ​​in the replay storage for model training, the model can review past data during the continuous learning process, effectively avoiding catastrophic forgetting; by directly connecting the image features and the activation values ​​in the replay storage in the replay layer of the model without processing through the previous layer, the computing resources and execution time required for forward propagation are significantly reduced; by only updating the weight parameters of the last fully connected layer during the back propagation process, the computing resources and execution time required for back propagation are reduced. This lightweight weight update method makes the model more efficient on edge devices and better meets the requirements of resource constraints. By optimizing the forward propagation and back propagation processes, the training efficiency and accuracy of the target detection model are improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0025] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;

[0026] Figure 2 is a flow chart of an embodiment of the target detection method of the present application;

[0027] Figure 3 is a schematic structural diagram of an embodiment of a target detection device of the present application;

[0028] Figure 4 It is a structural diagram of an embodiment of a computer device of the present application. DETAILED DESCRIPTION

[0029] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0030] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0031] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0032] like Figure 1 As shown, the system architecture 100 may include a terminal device 101, a network 102 and a server 103. The terminal device 101 may be a laptop 1011, a tablet computer 1012 or a mobile phone 1013. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables.

[0033] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0034] The terminal device 101 can be any electronic device with a display screen and supporting web browsing. In addition to a laptop computer 1011, a tablet computer 1012 or a mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV), a laptop computer, a desktop computer, etc.

[0035] The server 103 may be a server that provides various services, such as a background server that provides support for a web page displayed on the terminal device 101 .

[0036] It should be noted that the target detection method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the target detection device is generally set in the server / terminal device.

[0037] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0038] Continue to refer Figure 2 , shows a flow chart of an embodiment of a question-answering method according to the present application. The target detection method comprises the following steps:

[0039] Step S201, obtaining a pre-collected replay image set, wherein a training replay image in the replay image set contains at least one target object;

[0040] In this embodiment, the target detection method is executed on the electronic device (eg Figure 1 The server / terminal device shown in the figure can obtain the pre-captured replay image set through a wired connection or a wireless connection. It should be noted that the above wireless connection method may include but is not limited to 2G / 3G / 4G / 5G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or to be developed in the future.

[0041] Specifically, a pre-collected replay image set is obtained, which is an image data set collected in advance and used to train the model. The replay image set contains a number of training replay images, each of which contains at least one target object, which is an object that the model needs to recognize and detect. Each training replay image in the replay image set covers various forms of the target object under different scenes, angles, lighting and occlusion conditions, which is used to ensure that the trained model has good generalization ability. In addition, each training replay image in the replay image set also contains information related to the target object, such as the category label, position label, etc. of the target object. This information related to the target object is used to calculate the loss function and update the weight parameters of the model during the model training process.

[0042] Step S202, obtaining a pre-trained target detection model, wherein the pre-trained target detection model includes a pre-layer, a playback layer, and a fully connected layer;

[0043] In this embodiment, a pre-trained target detection model is obtained through a wired connection or a wireless connection. The target detection model is an algorithm or model in the field of computer vision, which is used to automatically identify and locate target objects in images or videos. The target detection model can learn how to identify specific objects in images through model training based on deep learning techniques, such as convolutional neural networks (CNNs). The pre-trained target detection model includes a pre-layer, a replay layer, and a fully connected layer, wherein the pre-layer is the first part of the target detection model, which is used to extract features from the input image; the replay layer is the middle part of the target detection model, which is used to connect image features and activation values ​​to enhance the memory capacity of the model; the fully connected layer is the last part of the target detection model, which is used to classify and regress according to the input image features and activation values, and identify the category results of the target object.

[0044] Step S203, during forward propagation, the training replay images in the replay image set are sequentially input into the front layer, image features are extracted, activation values ​​corresponding to the training replay images are obtained from the replay storage, the image features and the activation values ​​are connected in the replay layer to obtain a connection data structure, the connection data structure is input into the fully connected layer, and the category result of the target object is determined;

[0045] In this embodiment, during the forward propagation process, each training replay image in the replay image set is sequentially input into the front layer, and in the front layer, image features are extracted through operations such as convolution and pooling. A pre-constructed replay storage is obtained, and the replay storage is used to store the activation values ​​output by each training replay image in the replay image set after passing through the front layer. The activation value corresponding to the currently input training replay image is obtained from the replay storage. The activation value is the value calculated by passing the training replay image and the image features extracted from it through the front layer during the historical model training process. The activation value reflects the feature strength or importance of the image features in the training replay image. The image features extracted in the front layer and the obtained activation values ​​are input into the replay layer, and in the replay layer, the image features and the activation values ​​are connected to obtain a connection data structure. The connection data structure is input into the fully connected layer, and in the fully connected layer, the category result of the target object contained in the training replay image is determined through operations such as weighted summation and activation function.

[0046] In some optional implementations, the step of obtaining the activation value corresponding to the training replay image from the replay storage may include the following steps:

[0047] Obtaining identification information of the training replay image;

[0048] According to the identification information and a preset index of the replay storage, an activation value matching the identification information is searched from the replay storage as the activation value corresponding to the training replay image, wherein the index at least includes a correspondence between the identification information and the activation value.

[0049] Specifically, unique identification information is pre-assigned to each training replay image in the replay image set, and the identification information may be an image ID, a file name, a hash value, etc., which is used to uniquely identify the training replay image in the replay storage. An index is pre-created in the replay storage, and the index may be a hash table, a database, or other data structure, which is used to store the correspondence between all activation values ​​and the identification information.

[0050] Specifically, in the forward propagation process, for the currently input training replay image, the identification information of the training replay image is obtained. A pre-built index is obtained from the replay storage, and according to the identification information of the training replay image and the index of the replay storage, an activation value matching the identification information is searched from the replay storage, and the found activation value is determined as the activation value corresponding to the training replay image.

[0051] The embodiment of the present application can achieve efficient data retrieval by assigning unique identification information to each training replay image and constructing an index containing the corresponding relationship between the identification information and the activation value. When it is necessary to obtain the activation value corresponding to the training replay image, it is only necessary to search in the index according to the identification information to quickly locate the corresponding activation value, avoiding inefficient operations such as full table scanning or one-by-one comparison, and improving the efficiency of data retrieval.

[0052] In some optional implementations, the above-mentioned connecting the image features and the activation values ​​at the playback layer to obtain a connection data structure may include the following steps:

[0053] According to the data format of the fully connected layer, the image features and the activation values ​​are standardized in the playback layer to obtain standardized image features and standardized activation values;

[0054] The standardized image features and the standardized activation values ​​are data aligned and concatenated to obtain the connection data structure.

[0055] Specifically, the data format of the fully connected layer in the model is determined, and the data format may include the dimension, data type, and data range of the data. According to the data format of the fully connected layer, the extracted image features and the acquired activation values ​​are standardized in the replay layer, such as scaling the image features and activation values ​​to a suitable data range (such as between 0 and 1), or converting the image features and activation values ​​to a normal distribution with a specific mean and standard deviation, etc., to obtain standardized image features and standardized activation values. The standardized image features and standardized activation values ​​are data aligned, and after the data alignment, the standardized image features and the standardized activation values ​​are spliced ​​to obtain a connection data structure.

[0056] The embodiments of the present application help eliminate the dimensional differences between different features and improve the training efficiency of the model by standardizing the image features; by standardizing the activation values, it can ensure that the activation values ​​are numerically comparable with the image features, thereby facilitating subsequent connection and splicing operations. By aligning and splicing the standardized image features and activation values, it can ensure that they correspond and combine correctly in different channel dimensions, which helps to build a complete and accurate connection data structure.

[0057] In some optional implementations, the step of inputting the connection data structure into the fully connected layer to determine the category result of the target object may include the following steps:

[0058] Inputting the connection data structure into the fully connected layer, and using the fully connected layer to convert the connection data structure into a feature vector;

[0059] Generate probability values ​​of each target category according to the feature vector;

[0060] The category result of the target object is determined according to the probability value.

[0061] Specifically, the connection data structure is input into the fully connected layer of the model, and the connection data structure is converted into a feature vector through the fully connected layer using a linear transformation (such as matrix multiplication of a weight matrix and a connection data structure) or a nonlinear activation function (such as a ReLU function, a Sigmoid function, etc.); the feature vector is mapped to the probability space of the target category, and each component of the feature vector is converted into a probability value of the corresponding target category using a preset function, wherein the sum of all probability values ​​is 1, and the preset function may be a softmax function; according to the probability values ​​of each target category, the target category with the highest probability value is selected to determine the category result of the target object.

[0062] Step S204, during back propagation, calculate the gradient according to the category result, and update the weight parameters of the fully connected layer according to the gradient to obtain a trained target detection model.

[0063] In this embodiment, during the back propagation process, information related to the target object contained in the training replay image, such as the category label and position label of the target object, is obtained according to the category result output by the fully connected layer. A loss function value is calculated according to the category result and the information related to the target object. The gradient of the weight parameters of the fully connected layer is calculated according to the loss function value. According to the calculated gradient, an optimization algorithm (such as SGD, Adam, etc.) is used to update the weight parameters of the fully connected layer to obtain a trained target detection model.

[0064] In some optional implementations, calculating the gradient according to the category result, updating the weight parameters of the fully connected layer according to the gradient, and obtaining the trained target detection model may include the following steps:

[0065] Obtaining a preset loss function, and calculating the loss function value of the category result and the label of the target object based on the loss function;

[0066] Specifically, a preset loss function is obtained, which is used to measure the difference between the model prediction result (i.e., the category result) and the true annotation label. The loss function may include cross entropy loss, mean square error loss, etc. The annotation label of the target object is extracted from the information related to the target object contained in the training replay image, and the category result of the target object output by the fully connected layer and the annotation label are input into the loss function to calculate the loss function value. The loss function value reflects the accuracy of the current prediction of the model. The smaller the value, the more accurate the prediction result.

[0067] The gradient is calculated according to the loss function value, the weight parameters of the fully connected layer are updated according to the gradient, the forward propagation of the gradient is stopped before the back propagation reaches the replay layer, and the weight parameters of the front layer are fixed to obtain the trained target detection model.

[0068] Specifically, based on the calculated loss function value, the gradient of the weight parameters of the fully connected layer to the loss function value is calculated through the back propagation algorithm. The gradient represents the speed and direction of the change of the loss function value with the weight parameters. According to the calculated gradient, the weight parameters of the fully connected layer are updated using an optimization algorithm (such as stochastic gradient descent, Adam, etc.). Among them, the optimization algorithm will adjust the weight parameters appropriately according to the direction and size of the gradient to reduce the loss function value, thereby improving the prediction accuracy of the model. In the back propagation process, before the gradient propagates to the replay layer, the forward propagation of the gradient is stopped. At the same time, the weight parameters of the front layer (such as the convolution layer, the pooling layer, etc.) are fixed so that the replay layer and the front layer no longer participate in the training process. After multiple iterations of training, the weight parameters of the fully connected layer are continuously updated until the preset training target is reached (such as the loss function value converges to below the preset threshold), the model training is completed, and the trained target detection model is obtained.

[0069] The embodiment of the present application only updates the weight parameters of the last fully connected layer of the model during the training process, and fixes the weight parameters of the front layer, so that during the back propagation process, the gradient does not need to be propagated to the front layer, thereby reducing the amount of back propagation calculations, and further reducing the demand for computing resources and execution time during the training process. Compared with traditional continuous learning methods, it is more lightweight and more in line with the operating requirements of resource-constrained edge devices, which helps to achieve efficient target detection on edge devices.

[0070] In some optional implementations, during back propagation, the gradient is calculated according to the category result, and the weight parameters of the fully connected layer are updated according to the gradient to obtain the trained target detection model, and the following steps may be included:

[0071] Acquire a preset number of target replay images from the replay image set;

[0072] Specifically, a preset number of target replay images are obtained from a pre-collected replay image set. Optionally, a preset number of target replay images are randomly selected from a plurality of training replay images input to the front layer. The preset number is set according to the size of the replay storage to ensure that the replay storage can maintain an appropriate size and diversity.

[0073] Inputting the target replay image into the front layer, using a preset activation function to calculate the activation value corresponding to the target replay image, the activation value corresponding to the target replay image is used to represent the feature intensity at each position in the target replay image;

[0074] Specifically, the acquired target replay image is input into the front layer of the model, which may include a convolution layer, a pooling layer, etc., for extracting features of the image, and a preset activation function (such as a ReLU function, a sigmoid function, etc.) is used to calculate the activation value of the target replay image at each position in the front layer. The activation value corresponding to the target replay image is used to represent the feature strength at each position in the target replay image.

[0075] The activation values ​​corresponding to the target replay image replace the activation values ​​of the same number in the replay storage to update the replay storage.

[0076] Specifically, a subset having the same number as the target replay image is randomly selected in the replay storage, and the calculated activation value corresponding to the target replay image is replaced with the position corresponding to the subset in the replay storage to update the replay storage.

[0077] The embodiment of the present application can retain the key feature information of the images encountered in the previous learning process by selecting the target replay image from the replay image set and calculating its activation value after each learning. In the scenario of continuous learning or incremental learning, the addition of new data may cause the model to gradually forget the information of old data. By regularly updating the activation value in the replay storage, it can be ensured that the model does not lose the key feature information learned previously.

[0078] Step S205, obtaining an image to be detected, wherein the image to be detected contains at least one target object to be detected;

[0079] Step S206: Use the trained target detection model to perform target detection on the image to be detected, and output the category result of the target object to be detected.

[0080] Specifically, after obtaining the trained target detection model, an image to be detected is obtained, and the image to be detected contains at least one target object to be detected. The trained target detection model is used to perform target detection processing on the image to be detected. The model analyzes the features in the image and outputs the category result of the target object to be detected, that is, the model predicts the category information to which each target object in the image to be detected belongs.

[0081] The embodiment of the present application adopts the above scheme, specifically by introducing a pre-layer, a replay layer and a fully connected layer into the target detection model, inputting the training replay image into the pre-layer to extract the image features, obtaining the activation value corresponding to the training replay image from the replay storage, and connecting the image features with the activation value in the replay layer to obtain a connection data structure. By combining the activation value in the replay storage, the model's memory ability for past data is enhanced, which helps to alleviate the problem of catastrophic forgetting; by inputting the connection data structure into the fully connected layer to determine the category result of the target object, accurate classification of the target object is achieved; during back propagation, by calculating the gradient according to the category result, the weight parameters of the fully connected layer are updated according to the gradient, and the trained target detection model is obtained, thereby improving the detection accuracy and generalization ability of the model. Based on the scheme of this application, by using the replay image set and the activation values ​​in the replay storage for model training, the model can review past data during the continuous learning process, effectively avoiding catastrophic forgetting; by directly connecting the image features and the activation values ​​in the replay storage in the replay layer of the model without processing through the previous layer, the computing resources and execution time required for forward propagation are significantly reduced; by only updating the weight parameters of the last fully connected layer during the back propagation process, the computing resources and execution time required for back propagation are reduced. This lightweight weight update method makes the model more efficient on edge devices and better meets the requirements of resource constraints. By optimizing the forward propagation and back propagation processes, the training efficiency and accuracy of the target detection model are improved.

[0082] In addition, the embodiment of the present application solves the problem of the offset of relevant data over time during the object detection process by adopting a target detection model that combines the pre-layer, replay layer, and fully connected layer for target detection, and meets the computing and memory requirements of resource-constrained edge devices.

[0083] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned replay image set, target detection model, replay storage and other information as well as other related data, the above-mentioned replay image set, target detection model, replay storage and other information as well as other related data can also be stored in a blockchain node.

[0084] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0085] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0086] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0087] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of a target detection device, and the device embodiment is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0088] like Figure 3 As shown, the target detection device 400 described in this embodiment includes: an image acquisition module 401, a model acquisition module 402, a forward propagation module 403, a reverse propagation module 404, a target acquisition module 405 and a target detection module 406. Among them:

[0089] An image acquisition module 401 is used to acquire a pre-collected replay image set, wherein the training replay image in the replay image set contains at least one target object;

[0090] A model acquisition module 402 is used to acquire a pre-trained target detection model, wherein the pre-trained target detection model includes a pre-layer, a replay layer, and a fully connected layer;

[0091] A forward propagation module 403 is used to input the training replay images in the replay image set into the front layer in sequence during forward propagation, extract image features, obtain activation values ​​corresponding to the training replay images from the replay storage, connect the image features with the activation values ​​in the replay layer to obtain a connection data structure, input the connection data structure into the fully connected layer, and determine the category result of the target object;

[0092] A back propagation module 404 is used to calculate the gradient according to the classification result during back propagation, and update the weight parameters of the fully connected layer according to the gradient to obtain a trained target detection model;

[0093] The target acquisition module 405 is used to acquire an image to be detected, wherein the image to be detected contains at least one target object to be detected;

[0094] The target detection module 406 is used to perform target detection on the image to be detected using the trained target detection model, and output the category result of the target object to be detected.

[0095] In this embodiment, the image acquisition module 401 is used to acquire a pre-collected replay image set, which is an image data set collected in advance and used for training the model. The replay image set contains a number of training replay images, each of which contains at least one target object, which is an object that the model needs to identify and detect. The various training replay images in the replay image set cover various forms of the target object under different scenes, angles, lighting and occlusion conditions, which are used to ensure that the trained model has good generalization ability. In addition, the various training replay images in the replay image set also contain information related to the target object, such as the category label, position label, etc. of the target object. This information related to the target object is used to calculate the loss function and update the weight parameters of the model during the model training process.

[0096] Specifically, the model acquisition module 402 is used to acquire a pre-trained target detection model through a wired connection or a wireless connection. The target detection model is an algorithm or model in the field of computer vision, which is used to automatically identify and locate target objects in images or videos. The target detection model can learn how to identify specific objects in images through model training based on deep learning techniques, such as convolutional neural networks (CNNs). The pre-trained target detection model includes a pre-layer, a replay layer, and a fully connected layer, wherein the pre-layer is the first part of the target detection model, which is used to extract features from the input image; the replay layer is the middle part of the target detection model, which is used to connect image features and activation values ​​to enhance the memory ability of the model; the fully connected layer is the last part of the target detection model, which is used to classify and regress according to the input image features and activation values, and identify the category results of the target object.

[0097] Specifically, the forward propagation module 403 is used to input each training replay image in the replay image set into the front layer in sequence during the forward propagation process, and in the front layer, the image features are extracted through operations such as convolution and pooling. A pre-constructed replay storage is obtained, and the replay storage is used to store the activation values ​​output by each training replay image in the replay image set after passing through the front layer. The activation value corresponding to the currently input training replay image is obtained from the replay storage. The activation value is the value calculated by passing the training replay image and the image features extracted from it through the front layer during the historical model training process. The activation value reflects the feature strength or importance of the image features in the training replay image. The image features extracted in the front layer and the obtained activation values ​​are input to the replay layer, and in the replay layer, the image features and the activation values ​​are connected to obtain a connection data structure. The connection data structure is input to the fully connected layer, and in the fully connected layer, the category result of the target object contained in the training replay image is determined through operations such as weighted summation and activation function.

[0098] Specifically, the back propagation module 404 is used to obtain information related to the target object contained in the training replay image, such as the category label and position label of the target object, according to the category result output by the fully connected layer during the back propagation process, calculate the loss function value according to the category result and the information related to the target object, calculate the gradient of the weight parameters of the fully connected layer according to the loss function value, and use an optimization algorithm (such as SGD, Adam, etc.) according to the calculated gradient to update the weight parameters of the fully connected layer to obtain a trained target detection model.

[0099] Specifically, the target acquisition module 405 is used to obtain the image to be detected after obtaining the trained target detection model, and the image to be detected contains at least one target object to be detected. The target detection module 406 is used to perform target detection processing on the image to be detected using the trained target detection model. The model analyzes the features in the image and outputs the category result of the target object to be detected, that is, the model predicts the category information to which each target object in the image to be detected belongs.

[0100] The target detection device 400 of the embodiment of the present application introduces a pre-layer, a replay layer and a fully connected layer into the target detection model, inputs the training replay image into the pre-layer to extract image features, obtains the activation value corresponding to the training replay image from the replay storage, and connects the image features with the activation value in the replay layer to obtain a connection data structure. By combining the activation value in the replay storage, the model's memory ability for past data is enhanced, which helps to alleviate the catastrophic forgetting problem; by inputting the connection data structure into the fully connected layer to determine the category result of the target object, accurate classification of the target object is achieved; during back propagation, by calculating the gradient according to the category result, the weight parameters of the fully connected layer are updated according to the gradient, and the trained target detection model is obtained, thereby improving the detection accuracy and generalization ability of the model. Based on the scheme of this application, by using the replay image set and the activation values ​​in the replay storage for model training, the model can review past data during the continuous learning process, effectively avoiding catastrophic forgetting; by directly connecting the image features and the activation values ​​in the replay storage in the replay layer of the model without processing through the previous layer, the computing resources and execution time required for forward propagation are significantly reduced; by only updating the weight parameters of the last fully connected layer during the back propagation process, the computing resources and execution time required for back propagation are reduced. This lightweight weight update method makes the model more efficient on edge devices and better meets the requirements of resource constraints. By optimizing the forward propagation and back propagation processes, the training efficiency and accuracy of the target detection model are improved.

[0101] The target detection device 400 of the embodiment of the present application performs target detection by adopting a target detection model that combines a pre-layer, a replay layer, and a fully connected layer, thereby solving the problem of the offset of relevant data over time during the object detection process and meeting the computing and memory requirements of resource-constrained edge devices.

[0102] In some optional implementations of this embodiment, the forward propagation module 403 may include an information acquisition submodule and a value search submodule.

[0103] An information acquisition submodule, used to acquire identification information of the training replay image;

[0104] A numerical search submodule is used to search the activation value matching the identification information from the replay storage according to the identification information and a preset index of the replay storage as the activation value corresponding to the training replay image, wherein the index at least includes the corresponding relationship between the identification information and the activation value.

[0105] Specifically, unique identification information is pre-assigned to each training replay image in the replay image set, and the identification information may be an image ID, a file name, a hash value, etc., which is used to uniquely identify the training replay image in the replay storage. An index is pre-created in the replay storage, and the index may be a hash table, a database, or other data structure, which is used to store the correspondence between all activation values ​​and the identification information.

[0106] Specifically, in the forward propagation process, for the currently input training replay image, the identification information of the training replay image is obtained. A pre-built index is obtained from the replay storage, and according to the identification information of the training replay image and the index of the replay storage, an activation value matching the identification information is searched from the replay storage, and the found activation value is determined as the activation value corresponding to the training replay image.

[0107] The forward propagation module 403 of the embodiment of the present application can achieve efficient data retrieval by assigning unique identification information to each training replay image and constructing an index containing the corresponding relationship between the identification information and the activation value. When it is necessary to obtain the activation value corresponding to the training replay image, it is only necessary to search in the index according to the identification information to quickly locate the corresponding activation value, avoiding inefficient operations such as full table scanning or one-by-one comparison, and improving the efficiency of data retrieval.

[0108] In some optional implementations of this embodiment, the forward propagation module 403 may include a normalization submodule and a data splicing submodule.

[0109] A standardization submodule, configured to perform standardization processing on the image features and the activation values ​​in the playback layer according to the data format of the fully connected layer, so as to obtain standardized image features and standardized activation values;

[0110] The data splicing submodule is used to align and splice the standardized image features and the standardized activation values ​​to obtain the connection data structure.

[0111] Specifically, the standardization submodule is used to determine the data format of the fully connected layer in the model, and the data format may include the dimension, data type, and data range of the data. According to the data format of the fully connected layer, the extracted image features and the acquired activation values ​​are standardized in the replay layer, such as scaling the image features and activation values ​​to a suitable data range (such as between 0 and 1), or converting the image features and activation values ​​to a normal distribution with a specific mean and standard deviation, etc., to obtain standardized image features and standardized activation values. The data splicing submodule is used to align the data of each standardized image feature and the standardized activation value, and splice the standardized image features and the standardized activation values ​​after the data alignment to obtain a connection data structure.

[0112] The forward propagation module 403 of the embodiment of the present application, by standardizing the image features, helps to eliminate the dimensional differences between different features and improve the training efficiency of the model; by standardizing the activation values, it can ensure that the activation values ​​are numerically comparable with the image features, thereby facilitating subsequent connection and splicing operations. By aligning and splicing the standardized image features and activation values, it can be ensured that they are correctly corresponding and combined in different channel dimensions, which helps to build a complete and accurate connection data structure.

[0113] In some optional implementations of this embodiment, the forward propagation module 403 may include a vector conversion submodule, a numerical value generation submodule, and a category determination submodule.

[0114] A vector conversion submodule, used for inputting the connection data structure into the fully connected layer, and using the fully connected layer to convert the connection data structure into a feature vector;

[0115] A numerical value generation submodule, used to generate a probability value of each target category according to the feature vector;

[0116] The category determination submodule is used to determine the category result of the target object according to the probability value.

[0117] Specifically, the vector conversion submodule is used to input the connection data structure into the fully connected layer of the model, and convert the connection data structure into a feature vector through the fully connected layer using a linear transformation (such as matrix multiplication of a weight matrix and a connection data structure) or a nonlinear activation function (such as a ReLU function, a Sigmoid function, etc.); the numerical generation submodule is used to map the feature vector to the probability space of the target category, and use a preset function to convert each component of the feature vector into a probability value of the corresponding target category, where the sum of all probability values ​​is 1, and the preset function can be a softmax function; the category determination submodule is used to select the target category with the highest probability value as the category result of the target object according to the probability value of each target category.

[0118] In some optional implementations of this embodiment, the back propagation module 404 may include a numerical calculation submodule and a weight update submodule.

[0119] A numerical calculation submodule, used to obtain a preset loss function, and calculate the loss function value of the category result and the label of the target object based on the loss function;

[0120] The weight update submodule is used to calculate the gradient according to the loss function value, update the weight parameters of the fully connected layer according to the gradient, stop forward propagation of the gradient before back propagation reaches the replay layer, and fix the weight parameters of the front layer to obtain the trained target detection model.

[0121] Specifically, the numerical calculation submodule is used to obtain a preset loss function, which is used to measure the difference between the model prediction result (i.e., the category result) and the true annotation label. The loss function may include cross entropy loss, mean square error loss, etc. The annotation label of the target object is extracted from the information related to the target object contained in the training replay image, and the category result of the target object output by the fully connected layer and the annotation label are input into the loss function to calculate the loss function value. The loss function value reflects the accuracy of the current prediction of the model. The smaller the value, the more accurate the prediction result.

[0122] Specifically, the weight update submodule is used to calculate the gradient of the weight parameters of the fully connected layer to the loss function value through the back propagation algorithm based on the calculated loss function value. The gradient represents the speed and direction of the change of the loss function value with the weight parameter. According to the calculated gradient, the weight parameters of the fully connected layer are updated using an optimization algorithm (such as stochastic gradient descent, Adam, etc.). Among them, the optimization algorithm will adjust the weight parameters appropriately according to the direction and size of the gradient to reduce the loss function value, thereby improving the prediction accuracy of the model. In the back propagation process, before the gradient propagates to the replay layer, the forward propagation of the gradient is stopped. At the same time, the weight parameters of the front layer (such as the convolution layer, the pooling layer, etc.) are fixed so that the replay layer and the front layer no longer participate in the training process. After multiple iterative training, the weight parameters of the fully connected layer are continuously updated until the preset training target is reached (such as the loss function value converges to below the preset threshold), the model training is completed, and the trained target detection model is obtained.

[0123] The back propagation module 404 of the embodiment of the present application only updates the weight parameters of the last fully connected layer of the model during the training process, and fixes the weight parameters of the front layer, so that during the back propagation process, the gradient does not need to be propagated to the front layer, thereby reducing the amount of back propagation calculations, and further reducing the demand for computing resources and execution time during the training process. Compared with traditional continuous learning methods, it is more lightweight and more in line with the operating requirements of resource-constrained edge devices, which helps to achieve efficient target detection on edge devices.

[0124] In some optional implementations of this embodiment, the target detection device 400 may further include a replay update module. The replay update module is configured to obtain a preset number of target replay images from the replay image set;

[0125] Inputting the target replay image into the front layer, using a preset activation function to calculate the activation value corresponding to the target replay image, the activation value corresponding to the target replay image is used to represent the feature intensity at each position in the target replay image;

[0126] The activation values ​​corresponding to the target replay image replace the activation values ​​of the same number in the replay storage to update the replay storage.

[0127] Specifically, a preset number of target replay images are obtained from a pre-collected replay image set. Optionally, a preset number of target replay images are randomly selected from a plurality of training replay images input to the front layer. The preset number is set according to the size of the replay storage to ensure that the replay storage can maintain an appropriate size and diversity.

[0128] Specifically, the acquired target replay image is input into the front layer of the model, which may include a convolution layer, a pooling layer, etc., for extracting features of the image, and a preset activation function (such as a ReLU function, a sigmoid function, etc.) is used to calculate the activation value of the target replay image at each position in the front layer. The activation value corresponding to the target replay image is used to represent the feature strength at each position in the target replay image.

[0129] Specifically, a subset having the same number as the target replay image is randomly selected in the replay storage, and the calculated activation value corresponding to the target replay image is replaced with the position corresponding to the subset in the replay storage to update the replay storage.

[0130] The target detection device 400 of the embodiment of the present application can retain the key feature information of the image encountered in the previous learning process by selecting the target replay image from the replay image set and calculating its activation value after each learning. In the scenario of continuous learning or incremental learning, the addition of new data may cause the model to gradually forget the information of old data. By regularly updating the activation value in the replay storage, it can be ensured that the model does not lose the key feature information learned previously.

[0131] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.

[0132] The computer device 6 includes a memory 61, a processor 62, and a network interface 63 that are interconnected and communicated through a system bus. It should be noted that the figure only shows a computer device 6 with a memory 61, a processor 62, and a network interface 63, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.

[0133] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.

[0134] The memory 61 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 61 can be an internal storage unit of the computer device 6, such as a hard disk or memory of the computer device 6. In other embodiments, the memory 61 can also be an external storage device of the computer device 6, such as a plug-in hard disk equipped on the computer device 6, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. Of course, the memory 61 can also include both the internal storage unit of the computer device 6 and its external storage device. In this embodiment, the memory 61 is generally used to store the operating system and various application software installed on the computer device 6, such as computer-readable instructions of the target detection method, etc. In addition, the memory 61 can also be used to temporarily store various types of data that have been output or are to be output.

[0135] The processor 62 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor or other data processing chip in some embodiments. The processor 62 is generally used to control the overall operation of the computer device 6. In this embodiment, the processor 62 is used to run computer-readable instructions or process data stored in the memory 61, such as computer-readable instructions for running the target detection method.

[0136] The network interface 63 may include a wireless network interface or a wired network interface. The network interface 63 is generally used to establish a communication connection between the computer device 6 and other electronic devices.

[0137] The present application also provides another embodiment, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the target detection method as described above.

[0138] The computer device, computer-readable storage medium and computer-readable instructions thereof provided in the embodiments of the present application introduce a pre-layer, a replay layer and a fully connected layer into the target detection model through the processor execution, input the training replay image into the pre-layer to extract the image features, obtain the activation value corresponding to the training replay image from the replay storage, and connect the image features with the activation value in the replay layer to obtain a connection data structure. By combining the activation value in the replay storage, the model's memory ability for past data is enhanced, which helps to alleviate the problem of catastrophic forgetting; by inputting the connection data structure into the fully connected layer to determine the category result of the target object, accurate classification of the target object is achieved; during back propagation, by calculating the gradient according to the category result, the weight parameters of the fully connected layer are updated according to the gradient, and the trained target detection model is obtained, thereby improving the detection accuracy and generalization ability of the model. Based on the scheme of this application, by using the replay image set and the activation values ​​in the replay storage for model training, the model can review past data during the continuous learning process, effectively avoiding catastrophic forgetting; by directly connecting the image features and the activation values ​​in the replay storage in the replay layer of the model without processing through the previous layer, the computing resources and execution time required for forward propagation are significantly reduced; by only updating the weight parameters of the last fully connected layer during the back propagation process, the computing resources and execution time required for back propagation are reduced. This lightweight weight update method makes the model more efficient on edge devices and better meets the requirements of resource constraints. By optimizing the forward propagation and back propagation processes, the training efficiency and accuracy of the target detection model are improved.

[0139] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0140] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to replace some of the technical features therein with equivalents. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.

[0141] The non-Company software tools or components appearing in the embodiments of this application are merely examples and do not represent actual use.

Claims

1. A target detection method, characterized in that: The steps include: Acquire a pre-collected replay image set, wherein the training replay image in the replay image set contains at least one target object; Obtain a pre-trained target detection model, wherein the pre-trained target detection model includes a pre-layer, a replay layer, and a fully connected layer; During forward propagation, the training replay images in the replay image set are sequentially input into the front layer, image features are extracted, activation values ​​corresponding to the training replay images are obtained from the replay storage, the image features and the activation values ​​are connected in the replay layer to obtain a connection data structure, the connection data structure is input into the fully connected layer, and the category result of the target object is determined; During back propagation, a gradient is calculated according to the category result, and a weight parameter of the fully connected layer is updated according to the gradient to obtain a trained target detection model; Acquire an image to be detected, wherein the image to be detected contains at least one target object to be detected; The trained target detection model is used to perform target detection on the image to be detected, and a category result of the target object to be detected is output.

2. The target detection method according to claim 1, characterized in that: The step of obtaining the activation value corresponding to the training replay image from the replay storage comprises: Obtaining identification information of the training replay image; According to the identification information and a preset index of the replay storage, an activation value matching the identification information is searched from the replay storage as the activation value corresponding to the training replay image, wherein the index at least includes a correspondence between the identification information and the activation value.

3. The target detection method according to claim 1, characterized in that: The step of connecting the image feature and the activation value at the playback layer to obtain a connection data structure comprises: According to the data format of the fully connected layer, the image features and the activation values ​​are standardized in the playback layer to obtain standardized image features and standardized activation values; The standardized image features and the standardized activation values ​​are data aligned and concatenated to obtain the connection data structure.

4. The target detection method according to claim 1, characterized in that: The step of inputting the connection data structure into the fully connected layer to determine the category result of the target object includes: Inputting the connection data structure into the fully connected layer, and using the fully connected layer to convert the connection data structure into a feature vector; Generate probability values ​​for each target category according to the feature vector; The category result of the target object is determined according to the probability value.

5. The target detection method according to claim 1, characterized in that: The step of calculating the gradient according to the classification result, updating the weight parameters of the fully connected layer according to the gradient, and obtaining the trained target detection model includes: Obtaining a preset loss function, and calculating the loss function value of the category result and the label of the target object based on the loss function; The gradient is calculated according to the loss function value, the weight parameters of the fully connected layer are updated according to the gradient, the forward propagation of the gradient is stopped before the back propagation reaches the replay layer, and the weight parameters of the front layer are fixed to obtain the trained target detection model.

6. The target detection method according to claim 1, characterized in that: Before the step of calculating the gradient according to the category result during back propagation and updating the weight parameters of the fully connected layer according to the gradient to obtain the trained target detection model, the step further includes: Acquire a preset number of target replay images from the replay image set; Inputting the target replay image into the front layer, using a preset activation function to calculate the activation value corresponding to the target replay image, the activation value corresponding to the target replay image is used to represent the feature intensity at each position in the target replay image; The activation values ​​corresponding to the target replay image replace the activation values ​​of the same number in the replay storage to update the replay storage.

7. A target detection device, characterized in that: The device comprises: An image acquisition module, used to acquire a pre-collected replay image set, wherein the training replay image in the replay image set contains at least one target object; A model acquisition module, used to acquire a pre-trained target detection model, wherein the pre-trained target detection model includes a pre-layer, a replay layer, and a fully connected layer; A forward propagation module, used for inputting the training replay images in the replay image set into the front layer in sequence during forward propagation, extracting image features, obtaining activation values ​​corresponding to the training replay images from the replay storage, connecting the image features with the activation values ​​in the replay layer to obtain a connection data structure, inputting the connection data structure into the fully connected layer, and determining the category result of the target object; A back propagation module, used for calculating the gradient according to the classification result during back propagation, and updating the weight parameters of the fully connected layer according to the gradient to obtain a trained target detection model; A target acquisition module, used to acquire an image to be detected, wherein the image to be detected contains at least one target object to be detected; The target detection module is used to use the trained target detection model to perform target detection on the image to be detected, and output the category result of the target object to be detected.

8. The target detection device according to claim 7, characterized in that: The forward propagation module comprises: An information acquisition submodule, used to acquire identification information of the training replay image; A numerical search submodule is used to search the activation value matching the identification information from the replay storage according to the identification information and a preset index of the replay storage as the activation value corresponding to the training replay image, wherein the index at least includes the corresponding relationship between the identification information and the activation value.

9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the target detection method according to any one of claims 1 to 6 when executing the computer-readable instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the target detection method according to any one of claims 1 to 6 are implemented.