Neural network model testing method, device, storage medium and electronic device

By recombining the low-frequency part of the target amplitude-frequency image with the high-frequency part of the source domain amplitude-frequency image, the problem of requiring additional training of domain classifiers and domain converters in the existing technology is solved, and efficient testing and adaptation of the neural network model is achieved. It avoids the coupling of training and testing and improves the applicability and efficiency of the model.

CN112232430BActive Publication Date: 2024-09-06ZHEJIANG DAHUA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011148597.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-23
Publication Date
2024-09-06
Estimated Expiration
2040-10-23

AI Technical Summary

Technical Problem

The existing technology requires additional training of domain classifiers and domain converters, and when target data increases or changes, retraining is required, resulting in a complex and inefficient training process.

Method used

By recombining the low-frequency part of the target amplitude-frequency image with the high-frequency part of the source domain amplitude-frequency image, and mapping it to the source domain, the neural network model is tested and domain adaptation technology is implemented, avoiding the need for additional training of domain classifiers and domain converters. requirements, and no data from the target domain is required during the testing phase.

Benefits of technology

It achieves the decoupling of training and testing, and the model can be directly reused without retraining, which improves efficiency and adaptability and is suitable for tasks such as image classification and target detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112232430B
    Figure CN112232430B
Patent Text Reader

Abstract

The present invention provides a neural network model testing method, device, storage medium and electronic device, wherein the method comprises: mapping a target amplitude-frequency map from a target domain to a source domain to obtain a mapped target image, wherein the target amplitude-frequency map is obtained by recombining a low-frequency part of the source domain amplitude-frequency map and a high-frequency part of the target domain amplitude-frequency map; testing a target neural network model according to the target image, wherein the target neural network model is obtained by training with data from the source domain, and the problem that a set of domain classifiers and domain converters need to be additionally trained in the related art, and the domain classifiers and domain converters need to be retrained when the target data is added or changed, is solved, the neural network model is trained with data from the source domain, and the model training does not require any data from the target domain, and the domain adaptation technology is used in the testing phase to achieve decoupling of training and testing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing, and in particular to a neural network model testing method, device, storage medium and electronic device. Background Art

[0002] Image understanding is the process by which a computer system uses an image as input and extracts information of interest from the image. It includes a variety of technologies such as image classification, target detection, and semantic segmentation. It has a wide range of applications in security monitoring, medical image processing, satellite remote sensing image processing, and other fields.

[0003] Most image understanding tasks today are completed by training convolutional neural networks using deep learning technology. In deep learning, although the source dataset used for model training and the target dataset faced in actual use (testing) have the same feature space, their feature distributions are often not completely consistent. For example, after the model is trained on the remote sensing data of city A, it is used on the remote sensing data of city B. Although the data of the two cities contain the same categories such as buildings, roads, green spaces, and rivers, there are differences in the architectural style, climate, lighting, vegetation, and other aspects of the two cities. When there are differences between the source dataset A and the target dataset B of the model, the performance of the model on the target dataset B usually has a certain loss, and the size of the loss is related to the size of the difference between the two datasets. Domain adaptation technology is a special form of transfer learning. When the feature space is the same, domain adaptation can bring the feature distribution of the source dataset A and the target dataset B closer, thereby reducing performance loss.

[0004] An unsupervised domain adaptation method based on an adversarial residual transformer network includes: training a domain converter, which maps source data to the domain of target data, and using the mapped data to train a target classifier; training a domain classifier at the same time to distinguish whether the data is from the target domain or from the domain converter, the domain classifier and the domain converter constitute a set of mutually adversarial networks, and using adversarial loss to guide the learning of the domain converter. An additional set of domain classifiers and domain converters need to be trained, and when the target data is added or changed, the domain classifiers and domain converters need to be retrained.

[0005] There is no solution to the problem in the related art that an additional set of domain classifiers and domain converters need to be trained, and when target data is added or changed, the domain classifiers and domain converters need to be retrained. Summary of the invention

[0006] Embodiments of the present invention provide a neural network model testing method, device, storage medium and electronic device to at least solve the problem in the related art that an additional set of domain classifiers and domain converters need to be trained, and when target data is added or changed, the domain classifiers and domain converters need to be retrained.

[0007] According to one embodiment of the present invention, a neural network model testing method is provided, comprising:

[0008] Mapping the target amplitude-frequency map from the target domain to the source domain to obtain a mapped target image, wherein the target amplitude-frequency map is obtained by recombining a low-frequency portion of the source domain amplitude-frequency map and a high-frequency portion of the target domain amplitude-frequency map;

[0009] A target neural network model is tested according to the target image, wherein the target neural network model is trained using source domain data.

[0010] Optionally, mapping the target amplitude-frequency map from the target domain to the source domain to obtain a mapped target image comprises:

[0011] The target amplitude-frequency map and the target domain phase-frequency map of the image of the target domain are subjected to fast inverse Fourier transform to obtain the domain-adaptive target image, wherein the target domain phase-frequency map is obtained by performing fast Fourier transform on the image of the target domain.

[0012] Optionally, before mapping the target amplitude-frequency map from the target domain to the source domain to obtain the mapped target image, the method further includes:

[0013] determining the source domain amplitude-frequency map representing data of the source domain, and determining the target domain amplitude-frequency map of images of the target domain;

[0014] The low-frequency part of the source domain amplitude-frequency map and the high-frequency part of the target domain amplitude-frequency map are recombined to obtain the target amplitude-frequency map.

[0015] Optionally, determining a source domain amplitude-frequency map representing data in the source domain and determining a target domain amplitude-frequency map of images in the target domain comprises:

[0016] Determine the target amplitude-frequency map or the average amplitude-frequency map selected from the amplitude-frequency map library as the source domain amplitude-frequency map, wherein the amplitude-frequency map library includes multiple amplitude-frequency maps of the source domain and the average of the multiple amplitude-frequency maps, and the average amplitude-frequency map is the average of the multiple amplitude-frequency maps;

[0017] Performing a fast Fourier transform on the image of the target area to obtain an amplitude-frequency map of the target area.

[0018] Optionally, before determining the target amplitude-frequency graph or the average amplitude-frequency graph selected from the amplitude-frequency graph library as the source domain amplitude-frequency graph, the method further includes:

[0019] Using the labeled source domain data to train the initial neural network model to obtain the trained target neural network model;

[0020] Performing fast Fourier transform on the images in the data of the source domain respectively to obtain the multiple amplitude-frequency graphs;

[0021] The multiple amplitude-frequency graphs are combined into the amplitude-frequency graph library, or the average of the multiple amplitude-frequency graphs is determined to obtain the average amplitude-frequency graph.

[0022] Optionally, recombining the low-frequency part of the source domain amplitude-frequency map with the high-frequency part of the target domain amplitude-frequency map to obtain the target amplitude-frequency map comprises:

[0023] Cutting off a region where a preset proportion of pixels of the source domain amplitude frequency map are located from the central region of the source domain amplitude frequency map to obtain a low-frequency portion of the source domain amplitude frequency map;

[0024] Removing the area where the preset proportion of pixels of the target field amplitude-frequency map are located from the central area of ​​the target field amplitude-frequency map to obtain a high-frequency part of the target field amplitude-frequency map;

[0025] The low-frequency part of the source domain amplitude-frequency map is superimposed with the high-frequency part of the target domain amplitude-frequency map to obtain the target amplitude-frequency map.

[0026] Optionally, using the target image to test the target neural network model includes:

[0027] The target neural network model is tested by inputting the target image into the target neural network model to obtain a recognition result of the target image.

[0028] According to another embodiment of the present invention, there is also provided a neural network model testing device, comprising:

[0029] A mapping module, used for mapping a target amplitude-frequency map from a target domain to a source domain to obtain a mapped target image, wherein the target amplitude-frequency map is obtained by recombining a low-frequency portion of the source domain amplitude-frequency map and a high-frequency portion of the target domain amplitude-frequency map;

[0030] A testing module is used to test a target neural network model according to the target image, wherein the target neural network model is trained using source domain data.

[0031] Optionally, the mapping module is also used to

[0032] The target amplitude-frequency map and the target domain phase-frequency map of the image of the target domain are subjected to fast inverse Fourier transform to obtain the domain-adaptive target image, wherein the target domain phase-frequency map is obtained by performing fast Fourier transform on the image of the target domain.

[0033] Optionally, the device further comprises:

[0034] A first determination module is used to determine the source domain amplitude-frequency map representing the data of the source domain, and determine the target domain amplitude-frequency map of the image of the target domain;

[0035] The recombining module is used to recombine the low-frequency part of the source domain amplitude-frequency diagram with the high-frequency part of the target domain amplitude-frequency diagram to obtain the target amplitude-frequency diagram.

[0036] Optionally, the first determining module includes:

[0037] A determination submodule, configured to determine a target amplitude-frequency graph or an average amplitude-frequency graph selected from an amplitude-frequency graph library as the source domain amplitude-frequency graph, wherein the amplitude-frequency graph library includes a plurality of amplitude-frequency graphs in the source domain and an average of the plurality of amplitude-frequency graphs, and the average amplitude-frequency graph is the average of the plurality of amplitude-frequency graphs;

[0038] The transformation submodule is used to perform fast Fourier transformation on the image of the target area to obtain the amplitude-frequency diagram of the target area.

[0039] Optionally, the device further comprises:

[0040] A training module, used to train the initial neural network model using the labeled source domain data to obtain the trained target neural network model;

[0041] A transformation module, used for performing fast Fourier transformation on the images in the data of the source domain respectively to obtain the multiple amplitude-frequency maps;

[0042] The second determination module is used to combine the multiple amplitude-frequency graphs into the amplitude-frequency graph library, or determine the average of the multiple amplitude-frequency graphs to obtain the average amplitude-frequency graph.

[0043] Optionally, the recombination module comprises:

[0044] A cutting submodule, used for cutting an area where a preset proportion of pixels of the source domain amplitude-frequency map are located from the central area of ​​the source domain amplitude-frequency map to obtain a low-frequency part of the source domain amplitude-frequency map;

[0045] A removal submodule, configured to remove an area where the preset proportion of pixels of the target field amplitude-frequency map are located from a central area of ​​the target field amplitude-frequency map to obtain a high-frequency part of the target field amplitude-frequency map;

[0046] The superposition submodule is used to superimpose the low-frequency part of the source domain amplitude-frequency map with the high-frequency part of the target domain amplitude-frequency map to obtain the target amplitude-frequency map.

[0047] Optionally, the test module is also used to

[0048] The target neural network model is tested by inputting the target image into the target neural network model to obtain a recognition result of the target image.

[0049] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.

[0050] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0051] Through the present invention, a target amplitude-frequency map is mapped from a target domain to a source domain to obtain a mapped target image, wherein the target amplitude-frequency map is obtained by recombining a low-frequency portion of the source domain amplitude-frequency map and a high-frequency portion of the target domain amplitude-frequency map; a target neural network model is tested according to the target image, wherein the target neural network model is obtained by training using data from the source domain, which can solve the problem in the related art that a set of domain classifiers and domain converters need to be additionally trained, and when the target data is added or changed, the domain classifiers and domain converters need to be retrained. The neural network model is trained by data from the source domain, and model training does not require any data from the target domain. Domain adaptation technology is used in the testing phase to achieve decoupling of training and testing. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0053] Figure 1 is a hardware structure block diagram of a mobile terminal of a neural network model testing method according to an embodiment of the present invention;

[0054] Figure 2 is a flow chart of a neural network model testing method according to an embodiment of the present invention;

[0055] Figure 3 is a schematic diagram of a domain adaptation method according to an embodiment of the present invention;

[0056] Figure 4 is a block diagram of a neural network model testing device according to an embodiment of the present invention;

[0057] Figure 5 4 is a block diagram of a neural network model testing device according to a preferred embodiment of the present invention. DETAILED DESCRIPTION

[0058] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.

[0059] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. Example 1

[0060] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 is a hardware structure block diagram of a mobile terminal of a neural network model testing method according to an embodiment of the present invention, such as Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the mobile terminal may also include a transmission device 106 for communication functions and an input and output device 108. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0061] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the neural network model testing method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0062] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0063] In this embodiment, a neural network model testing method running on the above mobile terminal or network architecture is provided. Figure 2 is a flow chart of a neural network model testing method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0064] Step S202, mapping the target amplitude-frequency map from the target domain to the source domain to obtain a mapped target image, wherein the target amplitude-frequency map is obtained by recombining the low-frequency part of the source domain amplitude-frequency map and the high-frequency part of the target domain amplitude-frequency map;

[0065] In an embodiment of the present invention, the above-mentioned step S202 may specifically include: performing a fast inverse Fourier transform on the target amplitude-frequency map and the target domain phase-frequency map of the image of the target domain to obtain the domain-adaptive target image, wherein the target domain phase-frequency map is obtained by performing a fast Fourier transform on the image of the target domain.

[0066] Step S204, testing the target neural network model according to the target image, wherein the target neural network model is trained using source domain data.

[0067] In this embodiment, the above step S204 may specifically include: testing the target neural network model by inputting the target image into the target neural network model to obtain a recognition result of the target image.

[0068] Through the above steps S202 to S204, the problem in the related art that an additional set of domain classifiers and domain converters need to be trained, and when the target data is added or changed, the domain classifiers and domain converters need to be retrained can be solved. The neural network model is trained by the data of the source domain, and the model training does not require any data of the target domain. The domain adaptation technology is used in the testing phase to achieve decoupling of training and testing.

[0069] In an optional embodiment, before mapping the target amplitude-frequency map from the target domain to the source domain to obtain the mapped target image, the source domain amplitude-frequency map representing the data of the source domain is determined, and the target domain amplitude-frequency map of the image of the target domain is determined. Further, the target amplitude-frequency map or the average amplitude-frequency map selected from the amplitude-frequency map library is determined as the source domain amplitude-frequency map, wherein the amplitude-frequency map library includes multiple amplitude-frequency maps of the source domain and the average of the multiple amplitude-frequency maps, and the average amplitude-frequency map is the average of the multiple amplitude-frequency maps. Fast Fourier transform is performed on the image of the target domain to obtain the target domain amplitude-frequency map and the average amplitude-frequency map. A target domain phase-frequency map; recombining the low-frequency part of the source domain amplitude-frequency map with the high-frequency part of the target domain amplitude-frequency map to obtain the target amplitude-frequency map, and further, intercepting the area where the pixels of the preset proportion of the source domain amplitude-frequency map are located from the central area of ​​the source domain amplitude-frequency map to obtain the low-frequency part of the source domain amplitude-frequency map; removing the area where the pixels of the preset proportion of the target domain amplitude-frequency map are located from the central area of ​​the target domain amplitude-frequency map to obtain the high-frequency part of the target domain amplitude-frequency map; superimposing the low-frequency part of the source domain amplitude-frequency map with the high-frequency part of the target domain amplitude-frequency map to obtain the target amplitude-frequency map.

[0070] In another optional embodiment, before determining the target amplitude-frequency map or the average amplitude-frequency map selected from the amplitude-frequency map library as the source domain amplitude-frequency map, the initial neural network model is trained using the labeled source domain data to obtain the trained target neural network model; the images in the source domain data are respectively subjected to fast Fourier transform to obtain the multiple amplitude-frequency maps; the multiple amplitude-frequency maps are combined into the amplitude-frequency map library, or the mean of the multiple amplitude-frequency maps is determined to obtain the average amplitude-frequency map.

[0071] In the embodiment of the present invention, the RGB color image of the source domain is converted into a grayscale image according to the equation Grey = 0.299*R + 0.587*G+ 0.114*B, and the grayscale value is normalized to the range of [0,1]. The above-mentioned normalized grayscale image of the source domain is subjected to a fast Fourier transform, and the zero frequency point is moved to the center of the image to obtain a source domain amplitude-frequency image and a source domain phase-frequency image; the RGB color image of the target domain is converted into a grayscale image, and the grayscale value is normalized to the range of [0,1]. The above-mentioned normalized grayscale image of the target domain is subjected to a fast Fourier transform, and the zero frequency point is moved to the center of the image to obtain a target domain amplitude-frequency image or a target domain phase-frequency image; in the amplitude-frequency image, the part close to the center of the image belongs to the low-frequency part, and the part close to the edge of the image belongs to the high-frequency part, and the high-frequency part of the source domain amplitude-frequency image is fused with the low-frequency part of the target domain amplitude-frequency image. In the fusion process, the rectangular area with the center side length of the image being 0.5% of the image side length is used as the low-frequency part, and the other areas are used as the high-frequency part. The setting of this area ensures that the texture information of the target domain image will not leak into the source domain image; the amplitude-frequency image after the fusion of the high and low frequencies is combined with the phase-frequency image of the target domain, and after the inverse fast Fourier transform, a fused grayscale image after domain adaptation is obtained, and the pixel values ​​in the grayscale image are clipped to the range of [0,1] to prevent false colors from appearing in the image; the above-mentioned cropped fused grayscale image is divided pixel by pixel by the source domain grayscale image to obtain the transformation ratio of each pixel, and then the transformation ratio of each pixel is multiplied pixel by pixel by the RGB value of the source domain RGB image to obtain the RGB color image after domain adaptation.

[0072] This embodiment is an unsupervised domain adaptation method based on Fourier transform. In the testing phase, the target domain image is mapped to the source domain. This method does not require additional training of auxiliary models and does not require any target domain data during the training process. Therefore, when the target data is added or changed, the original model can be directly reused without retraining.

[0073] Figure 3 is a schematic diagram of a domain adaptation method according to an embodiment of the present invention. Figure 3 As shown, using labeled source domain data Training a Deep Neural Network , by minimizing the loss function between the network prediction and the label To optimize the network parameters; sequentially sample the images in the source domain and perform fast Fourier transform on them ,in is the transformed amplitude-frequency diagram, is the transformed phase-frequency diagram; the amplitude-frequency diagram obtained by sampling and transforming in the source domain forms an amplitude-frequency library , or take the average of all sampled amplitude-frequency graphs to get the average amplitude-frequency graph ; The complete image understanding model is composed of a neural network and an amplitude-frequency library / average amplitude-frequency map; in the testing phase, for data from the target domain The image input is fast Fourier transformed ,in is the transformed amplitude-frequency diagram, is the transformed phase-frequency diagram; from the amplitude-frequency library Random sampling, or directly using the average amplitude-frequency graph , and obtain the amplitude-frequency diagram representing the source field ; The low-frequency part of the source domain amplitude-frequency map and the high-frequency part of the target domain amplitude-frequency map are recombined to obtain a new amplitude-frequency map, which is combined with the target domain phase-frequency map and subjected to a fast inverse Fourier transform to obtain a domain-adaptive image. ,in It is a low-pass filter, corresponding to the small red box in the figure below. is a high-pass filter that satisfies ; Send the domain-adapted image to the trained neural network to obtain the prediction result of the image understanding model .

[0074] The domain adaptation method for image understanding based on Fourier transform maps the data of the target domain to the source domain only in the testing phase. Therefore, no data of the target domain is required when training the model. When the target data is added or changed, the model can be reused directly without retraining. The use of fast Fourier transform does not require additional training of domain converters, domain classifiers, encoders, decoders and other auxiliary networks, and the system is simple and efficient. It can be widely used in image understanding tasks such as image classification, object detection, semantic segmentation, etc., and has extremely strong generalization.

[0075] By using Fourier transform, the low-frequency part of the source domain amplitude-frequency map and the high-frequency part of the target domain amplitude-frequency map are recombined, and then through inverse Fourier transform, the mapping of the image from the target domain to the source domain is realized. Domain adaptation technology is only used in the testing phase to achieve decoupling of training and testing, and model training does not require any data from the target domain. Example 2

[0076] According to another embodiment of the present invention, a neural network model testing device is also provided. Figure 4 is a block diagram of a neural network model testing device according to an embodiment of the present invention. Figure 4 As shown, including:

[0077] A mapping module 42 is used to map the target amplitude-frequency map from the target domain to the source domain to obtain a mapped target image, wherein the target amplitude-frequency map is obtained by recombining the low-frequency part of the source domain amplitude-frequency map and the high-frequency part of the target domain amplitude-frequency map;

[0078] The testing module 44 is used to test the target neural network model according to the target image, wherein the target neural network model is trained using source domain data.

[0079] Optionally, the mapping module 42 is further configured to

[0080] The target amplitude-frequency map and the target domain phase-frequency map of the image of the target domain are subjected to fast inverse Fourier transform to obtain the domain-adaptive target image, wherein the target domain phase-frequency map is obtained by performing fast Fourier transform on the image of the target domain.

[0081] Figure 5 is a block diagram of a neural network model testing device according to a preferred embodiment of the present invention. Figure 5 As shown, the device also includes:

[0082] A first determination module 52 is used to determine the source domain amplitude-frequency map representing the data of the source domain, and determine the target domain amplitude-frequency map of the image of the target domain;

[0083] The recombining module 54 is used to recombine the low-frequency part of the source domain amplitude-frequency diagram with the high-frequency part of the target domain amplitude-frequency diagram to obtain the target amplitude-frequency diagram.

[0084] Optionally, the first determining module includes:

[0085] A determination submodule, configured to determine a target amplitude-frequency graph or an average amplitude-frequency graph selected from an amplitude-frequency graph library as the source domain amplitude-frequency graph, wherein the amplitude-frequency graph library includes a plurality of amplitude-frequency graphs in the source domain and an average of the plurality of amplitude-frequency graphs, and the average amplitude-frequency graph is the average of the plurality of amplitude-frequency graphs;

[0086] The transformation submodule is used to perform fast Fourier transformation on the image of the target area to obtain the amplitude-frequency diagram and the phase-frequency diagram of the target area.

[0087] Optionally, the device further comprises:

[0088] A training module, used to train the initial neural network model using the labeled source domain data to obtain the trained target neural network model;

[0089] A transformation module, used for performing fast Fourier transformation on the images in the data of the source domain respectively to obtain the multiple amplitude-frequency maps;

[0090] The second determination module is used to combine the multiple amplitude-frequency graphs into the amplitude-frequency graph library, or determine the average of the multiple amplitude-frequency graphs to obtain the average amplitude-frequency graph.

[0091] Optionally, the recombination module comprises:

[0092] A cutting submodule, used for cutting an area where a preset proportion of pixels of the source domain amplitude-frequency map are located from the central area of ​​the source domain amplitude-frequency map to obtain a low-frequency part of the source domain amplitude-frequency map;

[0093] A removal submodule, configured to remove an area where the preset proportion of pixels of the target field amplitude-frequency map are located from a central area of ​​the target field amplitude-frequency map to obtain a high-frequency part of the target field amplitude-frequency map;

[0094] The superposition submodule is used to superimpose the low-frequency part of the source domain amplitude-frequency map with the high-frequency part of the target domain amplitude-frequency map to obtain the target amplitude-frequency map.

[0095] Optionally, the testing module 44 is also used to

[0096] The target neural network model is tested by inputting the target image into the target neural network model to obtain a recognition result of the target image.

[0097] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination. Example 3

[0098] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0099] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:

[0100] S1, mapping the target amplitude-frequency map from the target domain to the source domain to obtain a mapped target image, wherein the target amplitude-frequency map is obtained by recombining the low-frequency part of the source domain amplitude-frequency map and the high-frequency part of the target domain amplitude-frequency map;

[0101] S2, testing a target neural network model according to the target image, wherein the target neural network model is trained using data from the source domain.

[0102] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs. Example 4

[0103] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0104] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0105] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0106] S1, mapping the target amplitude-frequency map from the target domain to the source domain to obtain a mapped target image, wherein the target amplitude-frequency map is obtained by recombining the low-frequency part of the source domain amplitude-frequency map and the high-frequency part of the target domain amplitude-frequency map;

[0107] S2, testing a target neural network model according to the target image, wherein the target neural network model is trained using data from the source domain.

[0108] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

[0109] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0110] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A neural network model testing method, characterized in that: include: Mapping the target amplitude-frequency map from the target domain to the source domain to obtain a mapped target image, wherein the target amplitude-frequency map is obtained by recombining a low-frequency portion of the source domain amplitude-frequency map and a high-frequency portion of the target domain amplitude-frequency map; Testing a target neural network model according to the target image, wherein the target neural network model is trained using source domain data; The step of mapping the target amplitude-frequency map from the target domain to the source domain to obtain a mapped target image includes: The target amplitude-frequency map and the target domain phase-frequency map of the image of the target domain are subjected to fast inverse Fourier transform to obtain the domain-adaptive target image, wherein the target domain phase-frequency map is obtained by performing fast Fourier transform on the image of the target domain.

2. The method according to claim 1, characterized in that: Before mapping the target amplitude-frequency map from the target domain to the source domain to obtain the mapped target image, the method further includes: determining the source domain amplitude-frequency map representing the source domain data, and determining the target domain amplitude-frequency map of the image in the target domain; The low-frequency part of the source domain amplitude-frequency map and the high-frequency part of the target domain amplitude-frequency map are recombined to obtain the target amplitude-frequency map.

3. The method according to claim 2, characterized in that Determining a source domain amplitude-frequency map representing the source domain data and determining a target domain amplitude-frequency map of the image in the target domain includes: Determine the target amplitude-frequency map or the average amplitude-frequency map selected from the amplitude-frequency map library as the source domain amplitude-frequency map, wherein the amplitude-frequency map library includes multiple amplitude-frequency maps of the source domain and the average of the multiple amplitude-frequency maps, and the average amplitude-frequency map is the average of the multiple amplitude-frequency maps; Performing a fast Fourier transform on the image of the target area to obtain an amplitude-frequency map of the target area.

4. The method according to claim 3, characterized in that Before determining the target amplitude-frequency graph or the average amplitude-frequency graph selected from the amplitude-frequency graph library as the source domain amplitude-frequency graph, the method further includes: Using the labeled source domain data to train the initial neural network model to obtain the trained target neural network model; Performing fast Fourier transform on the images in the source domain data respectively to obtain the multiple amplitude-frequency graphs; The multiple amplitude-frequency graphs are combined into the amplitude-frequency graph library, or the average of the multiple amplitude-frequency graphs is determined to obtain the average amplitude-frequency graph.

5. The method according to claim 2, characterized in that: Recombining the low-frequency part of the source domain amplitude-frequency map with the high-frequency part of the target domain amplitude-frequency map to obtain the target amplitude-frequency map includes: Cutting off a region where a preset proportion of pixels of the source domain amplitude frequency map are located from the central region of the source domain amplitude frequency map to obtain a low-frequency portion of the source domain amplitude frequency map; Removing the area where the preset proportion of pixels of the target field amplitude-frequency map are located from the central area of ​​the target field amplitude-frequency map to obtain a high-frequency part of the target field amplitude-frequency map; The low-frequency part of the source domain amplitude-frequency map is superimposed with the high-frequency part of the target domain amplitude-frequency map to obtain the target amplitude-frequency map.

6. The method according to any one of claims 1 to 5, characterized in that Testing the target neural network model using the target image includes: The target neural network model is tested by inputting the target image into the target neural network model to obtain a recognition result of the target image.

7. A neural network model testing device, characterized in that: include: A mapping module, used for mapping a target amplitude-frequency map from a target domain to a source domain to obtain a mapped target image, wherein the target amplitude-frequency map is obtained by recombining a low-frequency portion of the source domain amplitude-frequency map and a high-frequency portion of the target domain amplitude-frequency map; A testing module, used for testing a target neural network model according to the target image, wherein the target neural network model is trained using source domain data; Wherein, the mapping module is also used to perform fast inverse Fourier transform on the target amplitude-frequency map and the target domain phase-frequency map of the image of the target domain to obtain the domain-adaptive target image, wherein the target domain phase-frequency map is obtained by performing fast Fourier transform on the image of the target domain.

8. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 6 when executed.

9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 6.