A method and apparatus for determining an image detection model
By dividing candidate subnetworks into multiple sets based on their training loss and configuring different training methods, the problem of insufficient training accuracy during image detection model creation is solved, thereby improving the model's accuracy and reducing costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA TELECOM CLOUD TECH CO LTD
- Filing Date
- 2022-09-30
- Publication Date
- 2026-06-02
AI Technical Summary
In the creation of existing image detection models, the uniform sampling strategy leads to insufficient training accuracy, which may result in overfitting, increases training costs, and fails to guarantee model accuracy.
By dividing the candidate subnetworks into multiple sets based on their training loss and configuring different training methods for each set, the training process is optimized, and finally the subnetworks of the image detection model are determined based on the accuracy after training.
It improved the accuracy of image detection models, optimized the creation process, and reduced training costs.
Smart Images

Figure CN115496969B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image detection technology, and in particular to a method and apparatus for determining an image detection model. Background Technology
[0002] With the widespread adoption of smart cameras and visual analytics, methods for detecting video frames and single images have become increasingly important. Related technologies have proposed creating and pre-training image detection models to achieve image detection. Currently, creating image detection models is generally achieved through Neural Architecture Search (NAS) techniques. This mainly consists of two stages: First, based on the image set used for training, the parameters of all sub-networks in the search space are trained and optimized using weight-sharing techniques to improve the performance of all sub-networks. Second, using typical search algorithms, such as evolutionary algorithms, the optimal image detection model architecture is determined under various resource constraints.
[0003] However, the current first-stage sampling and training process uses a uniform sampling strategy, meaning that all sub-networks in the search space are trained using the same image set used for pre-training. This cannot guarantee training accuracy, and if the image set is small, the trained sub-networks may also suffer from overfitting. Consequently, the image detection model architecture searched in the second stage still needs to be trained again, increasing training costs. Summary of the Invention
[0004] This application provides a method and apparatus for determining an image detection model, which improves the accuracy of the image detection model.
[0005] In a first aspect, this application provides a method for determining an image detection model, comprising:
[0006] Obtain the first image set for pre-training and multiple candidate subnetworks for building the image detection model;
[0007] Based on the training losses of the multiple candidate sub-networks, at least one set to which each of the multiple candidate sub-networks belongs is determined, and the training method corresponding to each set is determined; the training losses of the multiple candidate sub-networks are determined based on the first image set;
[0008] The candidate subnetworks included in each set are trained using the training method corresponding to each set, resulting in multiple trained candidate subnetworks;
[0009] The subnetworks included in the image detection model are determined based on the accuracy of the multiple candidate subnetworks after training.
[0010] In some embodiments, the method further includes:
[0011] Obtain a second image set for pre-training; the first image set and the second image set contain different training samples;
[0012] The step of determining the sub-networks included in the image detection model based on the accuracy of the multiple candidate sub-networks after training specifically includes:
[0013] The target subnetwork among the multiple candidate subnetworks trained using the second image set is trained to determine the parameters of the target subnetwork; the target subnetwork is any subnetwork among the multiple candidate subnetworks trained in which the number of optimal solutions is greater than a set threshold.
[0014] Replace the parameters of any candidate subnetwork other than the target subnetwork in the trained candidate subnetworks with the parameters mentioned above.
[0015] The accuracy of any candidate sub-network after determining the replacement parameters using the first image set and the second image set;
[0016] The image detection model is composed of candidate subnetworks with accuracy higher than a preset value.
[0017] In some embodiments, assembling the neural network model from candidate subnetworks with accuracy higher than a preset value includes:
[0018] Based on various combinations of candidate sub-networks with accuracy higher than a preset value, multiple candidate detection models are determined;
[0019] The accuracy of the multiple candidate detection models is determined using the first image set and the second image set;
[0020] The candidate detection model with the highest accuracy is selected as the image detection model.
[0021] In some embodiments, determining at least one set to which each of the plurality of candidate sub-networks belongs, and determining the training method corresponding to each set, based on the training loss of the plurality of candidate sub-networks, includes:
[0022] The first image set is used to train the multiple candidate sub-networks, and the training loss of each sub-network is determined.
[0023] Based on the training loss of each candidate subnetwork, determine the set to which each candidate subnetwork belongs;
[0024] Based on the training loss of the candidate subnetworks included in any set, a training method corresponding to any set is generated according to the first image set.
[0025] Secondly, this application provides an apparatus for determining an image detection model, the apparatus comprising:
[0026] The acquisition unit is used to acquire a first image set for pre-training and multiple candidate sub-networks for building an image detection model;
[0027] The processing unit is configured to execute:
[0028] Based on the training losses of the multiple candidate sub-networks, at least one set to which each of the multiple candidate sub-networks belongs is determined, and the training method corresponding to each set is determined; the training losses of the multiple candidate sub-networks are determined based on the first image set;
[0029] The candidate subnetworks included in each set are trained using the training method corresponding to each set, resulting in multiple trained candidate subnetworks;
[0030] The subnetworks included in the image detection model are determined based on the accuracy of the multiple candidate subnetworks after training.
[0031] In some embodiments, the acquisition unit is further configured to acquire a second image set for pre-training; the first image set and the second image set include different training samples;
[0032] The processing unit specifically performs the following:
[0033] The target subnetwork among the multiple candidate subnetworks trained using the second image set is trained to determine the parameters of the target subnetwork; the target subnetwork is any subnetwork among the multiple candidate subnetworks trained in which the number of optimal solutions is greater than a set threshold.
[0034] Replace the parameters of any candidate subnetwork other than the target subnetwork in the trained candidate subnetworks with the parameters mentioned above.
[0035] The accuracy of any candidate sub-network after determining the replacement parameters using the first image set and the second image set;
[0036] The image detection model is composed of candidate subnetworks with accuracy higher than a preset value.
[0037] In some embodiments, when the processing unit assembles candidate subnetworks with accuracy higher than a preset value into the neural network model, it is specifically used for:
[0038] Based on various combinations of candidate sub-networks with accuracy higher than a preset value, multiple candidate detection models are determined;
[0039] The accuracy of the multiple candidate detection models is determined using the first image set and the second image set;
[0040] The candidate detection model with the highest accuracy is selected as the image detection model.
[0041] In some embodiments, when determining at least one set to which the plurality of candidate sub-networks belong based on the training loss of the plurality of candidate sub-networks, and determining the training method corresponding to each set, the processing unit is specifically configured to:
[0042] The first image set is used to train the multiple candidate sub-networks, and the training loss of each sub-network is determined.
[0043] Based on the training loss of each candidate subnetwork, determine the set to which each candidate subnetwork belongs;
[0044] Based on the training loss of the candidate subnetworks included in any set, a training method corresponding to any set is generated according to the first image set.
[0045] Thirdly, an electronic device is provided, comprising a controller and a memory. The memory stores computer-executable instructions, and the controller executes the computer-executable instructions in the memory to perform operational steps of any possible implementation of the method of the first aspect using hardware resources in the controller.
[0046] Fourthly, a computer-readable storage medium is provided, which stores instructions that, when executed on a computer, cause the computer to perform the methods described above.
[0047] The proposed method for determining the image detection model in this application no longer employs a uniform sampling strategy to obtain candidate sub-networks from the search space and train them. Instead, it divides the candidate sub-networks into multiple sets based on their training losses, configures different training methods for each set, and finally determines the sub-networks included in the image detection model to be created based on the accuracy of the trained candidate sub-networks. This proposed solution optimizes the process of creating the image detection model and fundamentally improves its accuracy. Attached Figure Description
[0048] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0049] Figure 1A flowchart illustrating a method for determining an image detection model provided in an embodiment of this application;
[0050] Figure 2 A schematic diagram of a sample distribution under Pareto constraints provided in an embodiment of this application;
[0051] Figure 3 A flowchart illustrating another method for determining an image detection model provided in an embodiment of this application;
[0052] Figure 4 A schematic diagram of the structure of an image detection model determination device provided in an embodiment of this application;
[0053] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0054] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.
[0055] It should be noted that the terms "first," "second," etc., used in this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data used can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The implementations described in the following exemplary embodiments do not represent all implementations consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0056] Image detection technology includes analyzing targets within a single image and detecting targets within a video stream. Specifically, it uses a pre-trained image detection model to perform feature recognition, extract target locations and features, and determine target labels. It's clear that improving the accuracy of the image detection model is crucial to ensuring the overall accuracy of image detection technology. Improving model accuracy mainly involves two methods: first, accurately selecting appropriate sub-networks during model creation; and second, increasing the quantity and variety of pre-trained images during the pre-training process to enhance model accuracy. The first method fundamentally addresses the issue of model accuracy, and using appropriate sub-networks can also save on pre-training costs. Therefore, the model creation process is quite important.
[0057] Currently, the common method for creating image detection models is through Neural Network Attachment (NAS) technology. NAS data provides a powerful automated tool for efficient neural network design. Traditional NAS techniques are based on evolutionary algorithms and reinforcement learning. Given a set of candidate subnetworks called the search space, a certain strategy is used to search for the optimal network structure. The quality of the neural network structure, i.e., its performance, is measured by certain metrics such as accuracy and speed, which can also be called performance evaluation. In each iteration of the search process, candidate subnetworks obtained from the search space are combined to form a candidate neural network structure. The candidate neural network structure is trained on the training sample set, and then its performance is evaluated on the validation set. The network structure is gradually optimized until the optimal candidate neural network structure is found as the neural network model to be created. However, due to the million floating-point operations per second (MFLOPS), the cost of generating the model is relatively high.
[0058] Therefore, related technologies propose decoupling NAS technology into two stages: The first stage involves training and optimizing the parameters of all sub-networks in the search space using a weight-sharing technique, based on the image set used for training. The second stage utilizes typical search algorithms, such as evolutionary algorithms, to determine the optimal image detection model architecture under various resource constraints. The first stage employs a uniform sampling strategy, specifically including two steps: first, grouping sub-networks with the same probability in the search space into a set; and second, training all sub-networks to the same degree.
[0059] As can be seen, in the first stage, the first step focuses on distinguishing sub-networks with different accuracy and inference efficiency, grouping sub-networks with different probabilities into different sets. However, the second step, which uses a uniform sampling strategy, does not set different training methods for different sets, thus failing to adequately train each sub-network. Simply put, the uniform sampling strategy cannot guarantee the Pareto front of the generated image detection model; if the number of images used for subsequent training is insufficient, the accuracy of the image detection model cannot be guaranteed.
[0060] To address the aforementioned issues, this application proposes a method and apparatus for determining an image detection model. The method involves determining the training loss of all candidate sub-networks in the search space using an image set for pre-training, classifying the candidate sub-networks based on the training loss, employing different training methods for candidate sub-networks belonging to different categories, and finally determining the sub-networks included in the generated image detection model based on the accuracy of the trained candidate sub-networks.
[0061] The determination method for the image detection model proposed in this application will be described in detail below. In the embodiments of this application, "and / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the related objects before and after are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple. The singular expressions "a," "an," "the," "the," "this," and "this" are intended to also include expressions such as "one or more," unless the context explicitly indicates otherwise. Furthermore, unless otherwise stated, the ordinal numbers such as "first" and "second" mentioned in the embodiments of this application are used to distinguish multiple objects and are not used to limit the order, sequence, priority, or importance of multiple objects. For example, "first task execution device" and "second task execution device" are only used to distinguish different task execution devices, and do not indicate a difference in priority or importance between the two task execution devices.
[0062] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0063] The solution provided in this application will be described in detail below. (See also...) Figure 1 This is a flowchart illustrating a method for determining an image detection model according to an embodiment of this application. It should be noted that this application... Figure 1 The execution entity of the method for determining the image detection model shown is not limited. For example, it can be executed by terminal devices such as computers and mobile phones, or by electronic devices with computing functions such as servers, server clusters, processors or processing chips, or by cloud computing platforms. Figure 1 The method flow shown specifically includes:
[0064] 101. Obtain the first image set for pre-training and multiple candidate sub-networks for building the image detection model.
[0065] Optionally, the candidate subnetwork can be one of the subnetworks included in the search space involved in NAS technology. Optionally, the first image set can include multiple images and a label for each image.
[0066] As an example, the label of any image can be used to characterize whether the image contains a target or the location, quantity, and other features of the target contained in the image. The specific correspondence between images and labels, as well as the characterization meaning of the labels, can be set according to the requirements. Different requirements correspond to different roles of the image detection model to be created.
[0067] 102. Based on the training loss of multiple candidate sub-networks, determine at least one set to which each candidate sub-network belongs, and determine the training method corresponding to each set.
[0068] The training loss of multiple candidate sub-networks is determined based on the first image set. Optionally, the obtained candidate sub-networks can be trained using each image and its corresponding label included in the first image set, the training loss of each candidate sub-network can be determined, and the candidate sub-networks can be classified according to the training loss, so that the training losses of the candidate sub-networks in each set obtained after classification are the same or differ by less than a threshold.
[0069] In one possible implementation, after determining at least one set of multiple candidate subnetworks, the training method for each set can be further determined based on the training loss of the candidate subnetworks included in each set. Optionally, for a set of candidate subnetworks with lower training losses, a training method containing more training samples and more training iterations can be configured to further increase the accuracy of the candidate subnetworks with lower training losses. For a set of candidate subnetworks with higher training losses, the proportion of hard samples in the training samples can be increased by adjusting the training loss.
[0070] 103. Train the candidate subnetworks included in each set using the training method corresponding to each set, and obtain multiple candidate subnetworks after training.
[0071] 104. Based on the accuracy of multiple candidate subnetworks after training, determine the subnetworks included in the image detection model.
[0072] Optionally, the accuracy of multiple candidate sub-networks can be determined based on a first image set used for pre-training. Alternatively, the accuracy of multiple candidate sub-networks can be verified using other images and corresponding labels different from the first image set. Furthermore, candidate sub-networks with accuracy higher than a preset value can be combined to form an image detection model.
[0073] Based on the above scheme, the proposed method for determining the image detection model no longer employs a uniform sampling strategy to obtain candidate sub-networks from the search space and train them. Instead, it divides the candidate sub-networks into multiple sets based on their training losses, configures different training methods for each set, and finally determines the sub-networks included in the image detection model to be created based on the accuracy of the trained candidate sub-networks. The proposed scheme optimizes the process of creating the image detection model and fundamentally improves its accuracy.
[0074] Optionally, after determining the image detection model to be generated, a first image set of the image detection model can be obtained. The first image set includes multiple images and the label corresponding to each image.
[0075] In some embodiments, a first image set can be used to train multiple candidate sub-networks, determine the training loss of each candidate sub-network, and group candidate sub-networks with the same or similar training losses into a set, resulting in at least one set of multiple candidate sub-networks. Further, based on the training losses of the candidate sub-networks included in each set, a training method corresponding to any set can be generated according to the first image set. It is known that the current goal of NAS technology is to find a network architecture with higher accuracy under different computational constraints. As an example, see [link to example]. Figure 2 This demonstrates the sample distribution under Pareto optimal and Pareto worst constraints. Based on this, this application proposes that different sets can be set with different training methods.
[0076] As an alternative approach, more training samples and training iterations can be allocated to the set containing candidate sub-networks with low training loss. For example, the set with low training loss can be considered the optimal Pareto set, and training methods for such sets can allocate more training budget to improve the current Pareto frontier. Another alternative approach is to allocate more training methods to the set containing candidate sub-networks with high training loss, changing the ratio of positive to negative samples in the original training samples, and increasing the proportion of hard samples by adjusting the training loss of the candidate sub-networks in the set. For example, similar to hard example mining techniques, by modifying the worst Pareto model to bring more information gradients, the accuracy of candidate sub-networks with high training loss can be improved.
[0077] In one or more embodiments, when determining the best and worst Pareto sets, a performance evaluator can also be used to compute the training loss for each candidate subnetwork. As an example, a performance evaluator with mini-batch loss can be used, which divides a first image set into 90% training samples and 10% validation samples. Multiple candidate subnetworks can be pre-trained without constraints using the training samples, and then the performance of these candidate subnetworks can be evaluated using the validation samples.
[0078] Optionally, during unconstrained pre-training of multiple candidate sub-networks, the shared weights of the multiple candidate sub-networks can be determined, and the sub-networks for constructing the image detection model can be determined based on the determined shared weights. Specifically, the shared weights can be determined using the following formulas (1)-(2):
[0079]
[0080]
[0081] Where W is the shared weight, a is any candidate subnetwork, A is the set of candidate subnetworks, and W... a Let a be the weight of the candidate subnetwork a. For regularization, let a be the term. s The candidate subnetwork with the minimum training loss, a l To train the candidate subnetwork with the minimum loss, For candidate subnetwork a s The weight, For candidate subnetwork a l The weight is η, where η is the weight attenuation coefficient.
[0082] In one or more embodiments, after training each set according to the training method corresponding to each set, the sub-networks included in the created image detection model can be determined based on the accuracy of the multiple candidate sub-networks after training. For example, the sub-networks included in the image detection model can be determined using the following formula (3):
[0083]
[0084] in, Let A be the i-th subnetwork included in the image detection model, and let A be the set of candidate subnetworks. The weight sharing parameters of the i-th subnetwork are obtained through formulas (1) and (2).
[0085] One possible approach is to obtain a second image set for pre-training. The training samples in the first and second image sets are different. When creating the image detection model, a target subnetwork can be determined from multiple candidate subnetworks trained using the first image set. The target subnetwork can be considered an over-parameterized subnetwork, i.e., a subnetwork containing more than a set threshold of optimal solutions. Further, the target subnetwork can be trained using the second image set to determine its parameters, and the parameters of other candidate subnetworks (excluding the target subnetwork) can be replaced with those of the target subnetwork. Furthermore, the accuracy of each candidate subnetwork after parameter replacement can be determined using the first and second image sets, and the candidate subnetworks with accuracy higher than a preset value can be used to form the image detection model.
[0086] Optionally, after determining candidate subnetworks with accuracy higher than a preset value, multiple candidate detection models can be determined based on various combinations of these subnetworks. The accuracy of the multiple candidate detection models can be determined using a first image set and a second image set, and the candidate detection model with the highest accuracy can be used as the image detection model.
[0087] The following description, in order to further understand the solution of this application, is provided in conjunction with specific embodiments. See also... Figure 3 The flowchart below illustrates a method for determining an image detection model according to an embodiment of this application, specifically including:
[0088] 301. Determine the first and second image sets corresponding to the image detection model to be created.
[0089] 302. The training loss of the candidate subnetworks included in the search space is determined using the first image set.
[0090] 303. Based on the training loss of each candidate subnetwork, determine the set to which each candidate subnetwork belongs and the corresponding training method for each set.
[0091] The specific process of subdividing sets and determining the corresponding training methods for each set can be found in the above embodiments, and will not be repeated here.
[0092] 304. The candidate subnetworks included in each set are trained using the training method corresponding to each set, and the target subnetwork among the multiple candidate subnetworks after training is determined.
[0093] 305. The target subnetwork is trained using the second image set to determine the parameters included in the target subnetwork.
[0094] 306 replaces the parameters of the candidate subnetworks other than the target subnetwork with the parameters of the target subnetwork.
[0095] 307. The accuracy of the candidate sub-network after parameter replacement is determined using the first image set and the second image set. Multiple candidate detection models are determined based on different combinations of candidate sub-networks with accuracy higher than the preset value.
[0096] 308. The detection model with the highest accuracy among multiple candidate detection models is selected as the image detection model to be created.
[0097] Based on the same concept as the method described above, see [link to relevant documentation]. Figure 4 This application provides an image detection model determination device 400. The device 400 performs the various steps of the above method; to avoid repetition, these steps will not be described again here. The device 400 includes an acquisition unit 401 and a processing unit 402.
[0098] The acquisition unit 401 is used to acquire a first image set for pre-training and multiple candidate sub-networks for building an image detection model;
[0099] Processing unit 402 is configured to execute:
[0100] Based on the training losses of the multiple candidate sub-networks, at least one set to which each of the multiple candidate sub-networks belongs is determined, and the training method corresponding to each set is determined; the training losses of the multiple candidate sub-networks are determined based on the first image set;
[0101] The candidate subnetworks included in each set are trained using the training method corresponding to each set, resulting in multiple trained candidate subnetworks;
[0102] The subnetworks included in the image detection model are determined based on the accuracy of the multiple candidate subnetworks after training.
[0103] In some embodiments, the acquisition unit 401 is further configured to acquire a second image set for pre-training; the first image set and the second image set include different training samples;
[0104] The processing unit 402 specifically performs the following:
[0105] The target subnetwork among the multiple candidate subnetworks trained using the second image set is trained to determine the parameters of the target subnetwork; the target subnetwork is any subnetwork among the multiple candidate subnetworks trained in which the number of optimal solutions is greater than a set threshold.
[0106] Replace the parameters of any candidate subnetwork other than the target subnetwork in the trained candidate subnetworks with the parameters mentioned above.
[0107] The accuracy of any candidate sub-network after determining the replacement parameters using the first image set and the second image set;
[0108] The image detection model is composed of candidate subnetworks with accuracy higher than a preset value.
[0109] In some embodiments, the processing unit 402, when assembling the neural network model from candidate sub-networks with accuracy higher than a preset value, is specifically used for:
[0110] Based on various combinations of candidate sub-networks with accuracy higher than a preset value, multiple candidate detection models are determined;
[0111] The accuracy of the multiple candidate detection models is determined using the first image set and the second image set;
[0112] The candidate detection model with the highest accuracy is selected as the image detection model.
[0113] In some embodiments, when the processing unit 402 determines at least one set to which the plurality of candidate sub-networks belong based on the training loss of the plurality of candidate sub-networks, and determines the training method corresponding to each set, it is specifically used for:
[0114] The first image set is used to train the multiple candidate sub-networks, and the training loss of each sub-network is determined.
[0115] Based on the training loss of each candidate subnetwork, determine the set to which each candidate subnetwork belongs;
[0116] Based on the training loss of the candidate subnetworks included in any set, a training method corresponding to any set is generated according to the first image set.
[0117] Figure 5 A schematic diagram of the structure of an electronic device 500 provided in an embodiment of this application is shown. The electronic device 500 in this embodiment may further include a communication interface 503, such as a network port, through which the electronic device can transmit data.
[0118] In this embodiment, the memory 502 stores instructions that can be executed by at least one controller 501. By executing the instructions stored in the memory 502, the at least one controller 501 can perform various steps in the above-described method. For example, the controller 501 can implement the above-described... Figure 4 The functions of the acquisition unit 401 and the processing unit 402 in the process.
[0119] The controller 501 is the control center of the electronic device, capable of connecting various parts of the device via various interfaces and lines. It executes instructions stored in the memory 502 and retrieves data stored in the memory 502. Optionally, the controller 501 may include one or more processing units. The controller 501 may integrate an application controller and a modem controller. The application controller primarily handles the operating system and applications, while the modem controller primarily handles wireless communication. It is understood that the modem controller may not be integrated into the controller 501. In some embodiments, the controller 501 and the memory 502 may be implemented on the same chip; in other embodiments, they may be implemented on separate chips.
[0120] Controller 501 can be a general-purpose controller, such as a central processing unit (CPU), digital signal controller, application-specific integrated circuit, field-programmable gate array or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose controller can be a microcontroller or any conventional controller. The steps performed by the data statistics platform disclosed in the embodiments of this application can be directly executed by the hardware controller, or executed by a combination of hardware and software modules within the controller.
[0121] Memory 502, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory 502 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic memory, magnetic disk, optical disk, etc. Memory 502 can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. In the embodiments of this application, memory 502 can also be a circuit or any other device capable of implementing storage functions for storing program instructions and / or data.
[0122] By designing and programming the controller 501, for example, the code corresponding to the neural network model training method described in the foregoing embodiments can be embedded into the chip, so that the chip can execute the steps of the aforementioned neural network model training method when running. How to design and program the controller 501 is a technique known to those skilled in the art, and will not be described in detail here.
[0123] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application 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.
[0124] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should 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 controller of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions, which execute via the controller of the computer or other programmable data processing device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0125] 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.
[0126] 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.
[0127] Although preferred embodiments of this application 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 this application.
[0128] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for determining an image detection model, characterized in that, The method includes: Obtain the first image set for pre-training and multiple candidate subnetworks for building the image detection model; Based on the training loss of the multiple candidate sub-networks, at least one set to which each of the multiple candidate sub-networks belongs is determined, and the training method corresponding to each set is determined; the training loss of the multiple candidate sub-networks is determined based on the first image set, and the training losses of the candidate sub-networks in each set are the same or differ by less than a threshold. The candidate subnetworks included in each set are trained using the training method corresponding to each set, resulting in multiple trained candidate subnetworks; The subnetworks included in the image detection model are determined based on the accuracy of the multiple candidate subnetworks after training.
2. The method according to claim 1, characterized in that, The method further includes: Obtain a second image set for pre-training; the first image set and the second image set contain different training samples; The step of determining the sub-networks included in the image detection model based on the accuracy of the multiple candidate sub-networks after training specifically includes: The target subnetwork among the multiple candidate subnetworks trained using the second image set is trained to determine the parameters of the target subnetwork; the target subnetwork is any subnetwork among the multiple candidate subnetworks trained in which the number of optimal solutions is greater than a set threshold. Replace the parameters of any candidate subnetwork other than the target subnetwork in the trained candidate subnetworks with the parameters mentioned above. The accuracy of any candidate sub-network after determining the replacement parameters using the first image set and the second image set; The image detection model is composed of candidate subnetworks with accuracy higher than a preset value.
3. The method according to claim 2, characterized in that, The step of forming the image detection model by assembling candidate sub-networks with accuracy higher than a preset value includes: Based on various combinations of candidate sub-networks with accuracy higher than a preset value, multiple candidate detection models are determined; The accuracy of the multiple candidate detection models is determined using the first image set and the second image set; The candidate detection model with the highest accuracy is selected as the image detection model.
4. The method according to any one of claims 1-3, characterized in that, The step of determining at least one set to which each of the multiple candidate sub-networks belongs, and determining the training method corresponding to each set, based on the training loss of the multiple candidate sub-networks, includes: The first image set is used to train the multiple candidate sub-networks, and the training loss of each sub-network is determined. Based on the training loss of each candidate subnetwork, determine the set to which each candidate subnetwork belongs; Based on the training loss of the candidate subnetworks included in any set, a training method corresponding to any set is generated according to the first image set.
5. A device for determining an image detection model, characterized in that, The device includes: The acquisition unit is used to acquire a first image set for pre-training and multiple candidate sub-networks for building an image detection model; The processing unit is configured to execute: Based on the training loss of the multiple candidate sub-networks, at least one set to which each of the multiple candidate sub-networks belongs is determined, and the training method corresponding to each set is determined; the training loss of the multiple candidate sub-networks is determined based on the first image set, and the training losses of the candidate sub-networks in each set are the same or differ by less than a threshold. The candidate subnetworks included in each set are trained using the training method corresponding to each set, resulting in multiple trained candidate subnetworks; The subnetworks included in the image detection model are determined based on the accuracy of the multiple candidate subnetworks after training.
6. The apparatus according to claim 5, characterized in that, The acquisition unit is further configured to acquire a second image set for pre-training; the first image set and the second image set include different training samples; The processing unit specifically performs the following: The target subnetwork among the multiple candidate subnetworks trained using the second image set is trained to determine the parameters of the target subnetwork; the target subnetwork is any subnetwork among the multiple candidate subnetworks trained in which the number of optimal solutions is greater than a set threshold. Replace the parameters of any candidate subnetwork other than the target subnetwork in the trained candidate subnetworks with the parameters mentioned above. The accuracy of any candidate sub-network after determining the replacement parameters using the first image set and the second image set; The image detection model is composed of candidate subnetworks with accuracy higher than a preset value.
7. The apparatus according to claim 6, characterized in that, The processing unit, when assembling the image detection model from candidate sub-networks with accuracy higher than a preset value, is specifically used for: Based on various combinations of candidate sub-networks with accuracy higher than a preset value, multiple candidate detection models are determined; The accuracy of the multiple candidate detection models is determined using the first image set and the second image set; The candidate detection model with the highest accuracy is selected as the image detection model.
8. The apparatus according to any one of claims 5-7, characterized in that, The processing unit, when determining at least one set to which each of the multiple candidate sub-networks belongs based on the training loss of the multiple candidate sub-networks, and determining the training method corresponding to each set, is specifically used for: The first image set is used to train the multiple candidate sub-networks, and the training loss of each sub-network is determined. Based on the training loss of each candidate subnetwork, determine the set to which each candidate subnetwork belongs; Based on the training loss of the candidate subnetworks included in any set, a training method corresponding to any set is generated according to the first image set.
9. An electronic device, characterized in that, include: Memory, used to store computer instructions; A controller, connected to the memory, is configured to execute computer instructions in the memory, and, in executing the computer instructions, implement the method as described in any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that, include: The computer-readable storage medium stores computer instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1 to 4.