Network model pre-training and training methods, terminals, and storage media
By performing feature extraction and iterative training on the sample images transformed by the same original image, the problem of poor training effect of network model is solved, especially in the object detection task, the model's attention to the prospective target and detection effect are improved.
Patent Information
- Application Number
- CN202211739401.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-31
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2042-12-31
AI Technical Summary
The training effect of network models in the prior art is poor, especially in image classification and object detection tasks, local and multi-scale information cannot be fully considered, resulting in incomplete learning features.
By obtaining the first and second sample images after the transformed original image, inputting the network model for feature extraction, obtaining global and local feature maps, and based on the correspondence relationship and predicting position features of these feature maps, determining and updating feature maps, using MoCo loss function for iterative training, and adding position features to improve training effect.
The effectiveness of network models in object detection tasks is improved, so that prospective targets are paid more attention to and backgrounds are paid less, and the accuracy and efficiency of detection are improved.
Smart Images

Figure CN116310625B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a network model pre-training and training method, a terminal, and a storage medium. Background Art
[0002] Self-supervised learning, a method of contrastive learning, is widely used in tasks such as image classification and object detection. Generally, this method designs a self-supervised network model based on the backbone network structure of the network to be fine-tuned, and completes training to obtain the corresponding pre-trained model. The training samples of the pre-trained model consider the overall characteristics of the input image, but do not take into account the local and multi-scale information involved in image classification and detection tasks. Furthermore, the designed training framework requires clustering methods to obtain labels, rather than complete self-learning, resulting in incomplete learned features and affecting the effectiveness of the final pre-trained model. Summary of the Invention
[0003] The main technical problem solved by the present invention is to provide a pre-training and training method, terminal, and storage medium for a network model, so as to solve the problem of poor training effect of the network model in the prior art.
[0004] To solve the above technical problems, the first technical solution adopted by the present invention is to provide a pre-training method for a network model, the pre-training method comprising:
[0005] Acquire a first sample image and a second sample image, where the first sample image and the second sample image are transformed images of the same original image;
[0006] Input the first sample image and the second sample image into the network model respectively for feature extraction, and obtain a first global feature map and m first local feature maps corresponding to the first sample image, and a second global feature map and m second local feature maps corresponding to the second sample image; m is a positive integer, and m ≥ 2;
[0007] Based on the correspondence between each first local feature map and the first global feature map, and the correspondence between each second local feature map and the second global feature map, obtaining predicted position features corresponding to the first global feature map, the second global feature map, each first local feature map, and each second local feature map, respectively;
[0008] Determine, based on the first global feature map, the second global feature map, the first local feature maps, the second local feature maps, and their corresponding predicted position features, updated feature maps corresponding to the first global feature map, the second global feature map, the first local feature maps, and the second local feature maps, respectively;
[0009] The network model is iteratively trained based on at least two error values among the error values between the updated feature map of the first global feature map and the updated feature map of the second global feature map, the error values between the updated feature maps corresponding to the first global feature map and the updated feature maps corresponding to each second local feature map, and the error values between the updated feature maps of each first local feature map and the updated feature maps corresponding to each second local feature map.
[0010] The step of obtaining a first sample image and a second sample image, where the first sample image and the second sample image are transformed images of the same original image, includes:
[0011] Get the original image;
[0012] The original image is subjected to data transformation to obtain a first sample image and a second sample image; the data transformation method includes at least one of image cropping, color dithering, graying, Gaussian blurring, preset angle flipping, and normalization.
[0013] The method of obtaining a first sample image and a second sample image, wherein the first sample image and the second sample image are images transformed from the same original image, further includes:
[0014] The sizes of the first sample image and the second sample image are adjusted to preset sizes.
[0015] The first sample image and the second sample image are respectively input into the network model for feature extraction, and a first global feature map and m first local feature maps corresponding to the first sample image, and a second global feature map and m second local feature maps corresponding to the second sample image are obtained, including:
[0016] Input the sample image into the network model for feature extraction to obtain the global feature map corresponding to the sample image;
[0017] Performing local transformation processing on the global feature map to obtain multiple local feature maps corresponding to the global feature map; wherein the local transformation processing includes convolution processing and / or slicing processing.
[0018] Wherein, based on the first global feature map, the second global feature map, each first local feature map, each second local feature map and their corresponding predicted position features, determining the updated feature maps corresponding to the first global feature map, the second global feature map, each first local feature map, and each second local feature map, respectively, includes:
[0019] Perform feature fusion on the feature map and the predicted position features corresponding to the feature map to obtain a fused feature map corresponding to the feature map;
[0020] Feature extraction is performed on the fused feature map corresponding to the feature map to obtain an updated feature map corresponding to the feature map.
[0021] The network model is iteratively trained based on at least two error values among the error value between the updated feature map of the first global feature map and the updated feature map of the second global feature map, the error value between the updated feature map corresponding to the first global feature map and the updated feature map corresponding to each second local feature map, and the error value between the updated feature map of each first local feature map and the updated feature map corresponding to each second local feature map, including:
[0022] Connecting the updated feature maps corresponding to the first local feature maps to obtain a first connected feature map; connecting the updated feature maps corresponding to the second local feature maps to obtain a second connected feature map;
[0023] The pre-trained model is iteratively trained based on at least two error values among the error value between the updated feature map of the first global feature map and the updated feature map of the second global feature map, the error value between the first connection feature map and the second connection feature map, and the error value between the updated feature map of the first global feature map and the second connection feature map.
[0024] The pre-training model is iteratively trained based on at least two error values among an error value between an updated feature map of the first global feature map and an updated feature map of the second global feature map, an error value between the first connection feature map and the second connection feature map, and an error value between the updated feature map of the first global feature map and the second connection feature map, including:
[0025] Based on the MoCo loss function, calculate the error value between the updated feature map of the first global feature map and the updated feature map of the second global feature map, the error value between the first connection feature map and the second connection feature map, and the error value between the updated feature map of the first global feature map and the second connection feature map;
[0026] The pre-trained model is iteratively trained based on the weighted sum of each error value.
[0027] To solve the above technical problems, the second technical solution adopted by the present invention is to provide a network model training method, comprising:
[0028] Obtain a pre-trained model; wherein the pre-trained model is obtained according to the pre-training method of the above-mentioned network model;
[0029] Obtain new training samples corresponding to the target processing task;
[0030] The pre-trained model is trained using new training samples to obtain an image processing model corresponding to the target processing task.
[0031] In order to solve the above technical problems, the third technical solution adopted by the present invention is: to provide a terminal, the terminal includes a memory, a processor, and a computer program stored in the memory and running on the processor, the processor is used to execute program data to implement the pre-training method of the network model as mentioned above or the steps in the training method of the network model as mentioned above.
[0032] In order to solve the above technical problems, the fourth technical solution adopted by the present invention is: to provide a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by the processor, it implements the above-mentioned network model pre-training method or the steps in the above-mentioned network model training method.
[0033] The beneficial effects of the present invention are as follows: different from the prior art, a network model pre-training and training method, terminal, and storage medium are provided, and the pre-training method includes: obtaining a first sample image and a second sample image, the first sample image and the second sample image being images transformed from the same original image; inputting the first sample image and the second sample image into the network model for feature extraction respectively, and obtaining a first global feature map and m first local feature maps corresponding to the first sample image, and a second global feature map and m second local feature maps corresponding to the second sample image; m is a positive integer, and m≥2; based on the correspondence between each first local feature map and the first global feature map, and the correspondence between each second local feature map and the second global feature map, obtaining the first global feature map, the second global feature map, and each second local feature map; The predicted position features corresponding to the first local feature map and each second local feature map respectively; based on the first global feature map, the second global feature map, each first local feature map, each second local feature map and their corresponding predicted position features, determine the updated feature maps corresponding to the first global feature map, the second global feature map, each first local feature map, and each second local feature map respectively; iteratively train the network model based on at least two error values among the error values between the updated feature map of the first global feature map and the updated feature map of the second global feature map, the error values between the updated feature map corresponding to the first global feature map and the updated feature map corresponding to each second local feature map respectively, and the error values between the updated feature map of each first local feature map and the updated feature map corresponding to each second local feature map respectively. This application makes full use of the characteristics of the target detection task. By adding position features at the levels of the first global feature map, the second global feature map, each first local feature map, and each second local feature map respectively, the foreground target can be paid more attention and the background can be paid less attention based on the position features, which can more effectively improve the effect of the network model on the target detection task. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0035] Figure 1 It is a flowchart of the pre-training method of the network model provided by the present invention;
[0036] Figure 2 It is a flowchart of a specific embodiment of the pre-training method of the network model provided by the present invention;
[0037] Figure 3 Schematic diagram of a segmentation method in one embodiment of a local feature map provided by the present invention;
[0038] Figure 4 It is a flowchart of the training method of the network model provided by the present invention;
[0039] Figure 5 This is a schematic diagram of a framework of a terminal embodiment provided by the present invention;
[0040] Figure 6 A schematic diagram of a framework of an embodiment of a computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION
[0041] The following describes the embodiments of the present application in detail with reference to the accompanying drawings.
[0042] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.
[0043] The term "and / or" in this document simply describes a relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " in this document generally indicates that the related objects are in an "or" relationship. Furthermore, "many" in this document means two or more than two.
[0044] In order to enable those skilled in the art to better understand the technical solution of the present invention, the pre-training and training method of a network model provided by the present invention are further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0045] See also Figure 1 and Figure 2 , Figure 1 It is a flowchart of the pre-training method of the network model provided by the present invention; Figure 2 It is a flowchart of a specific embodiment of the pre-training method of the network model provided by the present invention.
[0046] This embodiment provides a network model pre-training method, which includes the following steps.
[0047] S1: Acquire a first sample image and a second sample image, where the first sample image and the second sample image are transformed images of the same original image.
[0048] S2: Input the first sample image and the second sample image into the network model respectively for feature extraction, and obtain a first global feature map and m first local feature maps corresponding to the first sample image, and a second global feature map and m second local feature maps corresponding to the second sample image; m is a positive integer, and m≥2.
[0049] S3: Based on the correspondence between each first local feature map and the first global feature map, and the correspondence between each second local feature map and the second global feature map, obtain the predicted position features corresponding to the first global feature map, the second global feature map, each first local feature map, and each second local feature map, respectively.
[0050] S4: Based on the first global feature map, the second global feature map, the first local feature maps, the second local feature maps and their corresponding predicted position features, determine the updated feature maps corresponding to the first global feature map, the second global feature map, the first local feature maps, and the second local feature maps, respectively.
[0051] S5: Iteratively train the network model based on at least two error values among the error value between the updated feature map of the first global feature map and the updated feature map of the second global feature map, the error value between the updated feature map corresponding to the first global feature map and the updated feature map corresponding to each second local feature map, and the error value between the updated feature map of each first local feature map and the updated feature map corresponding to each second local feature map.
[0052] In this embodiment, the network model may be yolov4. Specifically, the backbone network of the network model is CSPDarknet53. The network model may be a pre-trained model.
[0053] The MoCo series is a commonly used self-supervised learning framework with a simple design, low resource usage, and low training cost. The self-supervised learning framework for pre-trained models is MoCo. In this embodiment, the self-supervised learning framework for the network model is MoCo v2.
[0054] In one embodiment, the specific implementation of obtaining the first sample image and the second sample image in step S1 includes the following steps.
[0055] Obtain the original image; perform data transformation on the original image to obtain the first sample image I q and the second sample image I k The data transformation method includes at least one of image cropping, color dithering, graying, Gaussian blurring, flipping at a preset angle, and normalization. The cropped image accounts for no less than 60% of the original image.
[0056] The sizes of the first sample image and the second sample image are adjusted to a preset size, wherein the preset size may be 512*512.
[0057] In one embodiment, a specific implementation of obtaining the first global feature map and m first local feature maps corresponding to the first sample image and the second global feature map and m second local feature maps corresponding to the second sample image in step S2 includes the following steps.
[0058] The sample image is input into the network model for feature extraction, resulting in a global feature map corresponding to the sample image. Feature extraction is performed on the first sample image to obtain a first global feature map; feature extraction is performed on the second sample image to obtain a second global feature map. The first and second global feature maps are global features.
[0059] Performing local transformation processing on the global feature map to obtain multiple local feature maps corresponding to each global feature map; wherein the local transformation processing includes convolution processing and / or slicing processing.
[0060] See also Figure 3 , Figure 3 Schematic diagram of a segmentation method in an embodiment of a local feature map provided by the present invention.
[0061] To reduce computational complexity, the first global feature map is sliced to obtain four local feature blocks, i.e., four first local feature maps. The second global feature map is sliced to obtain four local feature blocks, i.e., four second local feature maps.
[0062] The local features in this embodiment are obtained by segmenting the global feature map in the network, rather than segmenting the input image. This reduces reliance on manual intervention, offers better end-to-end performance, and extracts more complete features, resulting in better results. Furthermore, the input resolution is significantly reduced, which reduces algorithm complexity and reduces the resource consumption of training.
[0063] For object detection tasks, the foreground object to be detected occupies a certain proportion of the input image, rather than the entire image. Therefore, the foreground has clear location information. Darker shading indicates more foreground objects, while lighter shading indicates more background. Therefore, during feature calculation, each local feature map has a different impact on the loss. Foreground objects should receive more attention, while background should receive less.
[0064] According to the position of each first local feature map in the first global feature map, the position information feature coding of each first local feature map is determined. The predicted position features corresponding to the first global feature map, the second global feature map, each first local feature map, and each second local feature map are respectively obtained by prediction through a pre-training model. When the dimension of the position information feature coding is a 1-dimensional position coding, the position information feature coding of each first local feature map is 0, 1, 2, 3, 4, ... in sequence. When the dimension of the position information feature coding is a 2-dimensional position coding, the position information feature coding of each first local feature map is (0, 0), (1, 0), (2, 0), (3, 0), (0, 1), ... in sequence.
[0065] In one embodiment, a specific implementation method of obtaining the updated feature maps corresponding to the first global feature map, the second global feature map, each first local feature map, and each second local feature map in step S4 includes the following steps.
[0066] The feature map and the predicted position features corresponding to the feature map are added to obtain a fused feature map corresponding to the feature map; and features are extracted from the fused feature map corresponding to the feature map to obtain an updated feature map corresponding to the feature map.
[0067] Specifically, the fused feature map is input into a multi-layer perceptron (MLP) to obtain an updated feature map corresponding to the fused feature map.
[0068] In one embodiment, the specific implementation of obtaining the iterative training network model in step S5 includes the following steps.
[0069] In a specific embodiment, the updated feature maps corresponding to the first local feature maps are connected to obtain a first connected feature map; and the updated feature maps corresponding to the second local feature maps are connected to obtain a second connected feature map.
[0070] The pre-trained model is iteratively trained based on a weighted sum of an error value between an updated feature map of the first global feature map and an updated feature map of the second global feature map, an error value between the first connection feature map and the second connection feature map, and an error value between the updated feature map of the first global feature map and the second connection feature map.
[0071] Specifically, based on the MoCo loss function, the error value between the updated feature map of the first global feature map and the updated feature map of the second global feature map, the error value between the first connection feature map and the second connection feature map, and the error value between the updated feature map of the first global feature map and the second connection feature map are calculated; and the pre-trained model is iteratively trained based on the weighted sum of each error value.
[0072] Specifically, the weighted sum of the error values is calculated based on the following loss function.
[0073]
[0074]
[0075] Where: τ, They are all hyperparameters, determined through experiments here and set to fixed values of 0.1, 0.4, 0.2, and 0.4 respectively.
[0076] The present embodiment provides a pre-training method for a network model, the pre-training method comprising: obtaining a first sample image and a second sample image, wherein the first sample image and the second sample image are images transformed from the same original image; inputting the first sample image and the second sample image into the network model for feature extraction, respectively, to obtain a first global feature map and m first local feature maps corresponding to the first sample image, and a second global feature map and m second local feature maps corresponding to the second sample image; m is a positive integer, and m≥2; based on the correspondence between each first local feature map and the first global feature map, and the correspondence between each second local feature map and the second global feature map, the first global feature map, the second global feature map, the first local feature maps, and the second local feature maps are obtained. The predicted position features corresponding to the first global feature map, the second global feature map, the first local feature maps, the second local feature maps and their corresponding predicted position features are respectively determined; based on the first global feature map, the second global feature map, the first local feature maps and the second local feature maps and their corresponding predicted position features, the updated feature maps corresponding to the first global feature map, the second global feature map, the first local feature maps and the second local feature maps are respectively determined; the network model is iteratively trained based on at least two error values among the error values between the updated feature map of the first global feature map and the updated feature map of the second global feature map, the error values between the updated feature map corresponding to the first global feature map and the updated feature map corresponding to the second local feature maps, and the error values between the updated feature map of each first local feature map and the updated feature map corresponding to the second local feature maps. The present application makes full use of the characteristics of the target detection task. By adding position features at the levels of the first global feature map, the second global feature map, the first local feature maps and the second local feature maps, the foreground target can be paid more attention and the background can be paid less attention based on the position features, which can more effectively improve the effect of the network model on the target detection task.
[0077] See also Figure 4 , Figure 4 1 is a flow chart of the network model training method provided by the present invention. In this embodiment, a network model training method is provided, and the network model training method includes the following steps.
[0078] S21: Get the pre-trained model.
[0079] The pre-training model is obtained according to the pre-training method of the above-mentioned network model.
[0080] S22: Obtain new training samples corresponding to the target processing task.
[0081] Specifically, if the network model needs to detect an object, new training samples are determined based on the object detection task. If the network model needs to classify an object, new training samples are determined based on the object classification task.
[0082] S23: Train the pre-trained model using new training samples to obtain an image processing model corresponding to the target processing task.
[0083] Specifically, the parameters of the pre-trained model are modified based on the network parameters of the network model, and then the pre-trained model is trained with new training samples to obtain an image processing model corresponding to the target processing task, thereby obtaining better target detection indicators or target classification indicators.
[0084] The network model training method provided in this embodiment modifies the parameters in the image processing model based on the network model in the above embodiment, thereby improving the effect of the image processing model on the target detection task.
[0085] See also Figure 5 , Figure 5 is a schematic diagram of a framework of an embodiment of a terminal provided by the present invention. Terminal 80 includes a memory 81 and a processor 82 coupled to each other. Processor 82 is configured to execute program instructions stored in memory 81 to implement the steps of any of the above-mentioned network model pre-training methods or network model training method embodiments. In a specific implementation scenario, terminal 80 may include, but is not limited to, a microcomputer and a server. In addition, terminal 80 may also include mobile devices such as laptops and tablet computers, which are not limited here.
[0086] Specifically, the processor 82 is used to control itself and the memory 81 to implement the steps of the above-mentioned pre-training method of any network model or the training method embodiment of the network model. The processor 82 can also be called a CPU (Central Processing Unit). The processor 82 may be an integrated circuit chip with signal processing capabilities. The processor 82 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 82 can be implemented by an integrated circuit chip.
[0087] See also Figure 6 , Figure 6 A schematic diagram of a computer-readable storage medium according to an embodiment of the present invention is provided. The computer-readable storage medium 90 stores program instructions 901 executable by a processor, and the program instructions 901 are used to implement the steps of any of the above-mentioned network model pre-training methods or network model training method embodiments.
[0088] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments. For the sake of brevity, it will not be repeated here.
[0089] The above description of the various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced with each other and will not be repeated herein for the sake of brevity.
[0090] In the several embodiments provided in this application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation methods described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. For example, units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0091] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0092] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0093] The above are merely embodiments of the present invention and are not intended to limit the scope of patent protection of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention's description and drawings, or directly or indirectly applied in other related technical fields, are also included in the scope of patent protection of the present invention.
Claims
1. A pre-training method for a network model, characterized in that: The pre-training method comprises: Acquire a first sample image and a second sample image, where the first sample image and the second sample image are transformed images of the same original image; Inputting the first sample image and the second sample image into the network model for feature extraction, respectively, to obtain a first global feature map and m first local feature maps corresponding to the first sample image, and a second global feature map and m second local feature maps corresponding to the second sample image; m is a positive integer, and m ≥ 2; Based on the correspondence between each of the first local feature maps and the first global feature map, and the correspondence between each of the second local feature maps and the second global feature map, obtaining predicted position features corresponding to the first global feature map, the second global feature map, each of the first local feature maps, and each of the second local feature maps, respectively; Determine, based on the first global feature map, the second global feature map, each of the first local feature maps, each of the second local feature maps, and their corresponding predicted position features, an updated feature map corresponding to the first global feature map, the second global feature map, each of the first local feature maps, and each of the second local feature maps; The network model is iteratively trained based on at least two of the error values: the error value between the updated feature map of the first global feature map and the updated feature map of the second global feature map, the error value between the updated feature map corresponding to the first global feature map and the updated feature map corresponding to each of the second local feature maps, and the error value between the updated feature map of each of the first local feature maps and the updated feature map corresponding to each of the second local feature maps.
2. The pre-training method according to claim 1, wherein The acquiring of a first sample image and a second sample image, where the first sample image and the second sample image are transformed images of the same original image, includes: Acquire the original image; Performing data transformation on the original image to obtain the first sample image and the second sample image; the data transformation method includes at least one of image cropping, color dithering, graying, Gaussian blurring, preset angle flipping, and normalization.
3. The pre-training method according to claim 2, wherein: The acquiring of a first sample image and a second sample image, wherein the first sample image and the second sample image are images transformed from the same original image, further includes: The sizes of the first sample image and the second sample image are adjusted to preset sizes.
4. The pre-training method according to claim 1, wherein The step of inputting the first sample image and the second sample image into a network model for feature extraction to obtain a first global feature map and m first local feature maps corresponding to the first sample image, and a second global feature map and m second local feature maps corresponding to the second sample image, includes: Inputting the sample image into the network model for feature extraction to obtain a global feature map corresponding to the sample image; Performing local transformation processing on the global feature map to obtain multiple local feature maps corresponding to the global feature map; wherein the local transformation processing includes convolution processing and / or slicing processing.
5. The pre-training method according to claim 1, wherein The determining, based on the first global feature map, the second global feature map, the first local feature maps, the second local feature maps, and the respective predicted position features, of the updated feature maps corresponding to the first global feature map, the second global feature map, the first local feature maps, and the second local feature maps, respectively, includes: Performing feature fusion on the feature map and the predicted position features corresponding to the feature map to obtain a fused feature map corresponding to the feature map; Feature extraction is performed on the fused feature map corresponding to the feature map to obtain the updated feature map corresponding to the feature map.
6. The pre-training method according to claim 1, wherein: The iterative training of the network model based on at least two of the error values: an error value between an updated feature map of the first global feature map and an updated feature map of the second global feature map, an error value between the updated feature map corresponding to each of the first global feature map and the updated feature map corresponding to each of the second local feature maps, and an error value between an updated feature map of each of the first local feature maps and the updated feature map corresponding to each of the second local feature maps, comprises: Connecting the updated feature maps corresponding to the first local feature maps to obtain a first connected feature map; connecting the updated feature maps corresponding to the second local feature maps to obtain a second connected feature map; The pre-trained model is iteratively trained based on at least two of the error values between the updated feature map of the first global feature map and the updated feature map of the second global feature map, the error value between the first connection feature map and the second connection feature map, and the error value between the updated feature map of the first global feature map and the second connection feature map.
7. The pre-training method according to claim 6, characterized in that The iteratively training the pre-trained model based on at least two of the error values among an error value between an updated feature map of the first global feature map and an updated feature map of the second global feature map, an error value between the first connection feature map and the second connection feature map, and an error value between the updated feature map of the first global feature map and the second connection feature map, comprises: Based on the MoCo loss function, calculating the error value between the updated feature map of the first global feature map and the updated feature map of the second global feature map, the error value between the first connection feature map and the second connection feature map, and the error value between the updated feature map of the first global feature map and the second connection feature map; The pre-trained model is iteratively trained based on a weighted sum of the error values.
8. A network model training method, characterized in that: include: Obtain a pre-trained model; wherein the pre-trained model is obtained according to the pre-training method of the network model according to any one of claims 1 to 7; Obtain new training samples corresponding to the target processing task; The pre-trained model is trained using the new training samples to obtain an image processing model corresponding to the target processing task.
9. A terminal, characterized in that: The terminal includes a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor is used to execute program data to implement the steps in the pre-training method of the network model according to any one of claims 1 to 7 or the training method of the network model according to claim 8.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps in the pre-training method for a network model according to any one of claims 1 to 7 or the training method for a network model according to claim 8.
Citation Information
Patent Citations
Network model training method and device, image processing method and storage medium
CN111340195A
Object detection model training method and device
CN111709471A