Training method, image detection method, device, equipment and medium
Through the two-stage training method, fine-grained features are first extracted on the sub-image, and then fine-tuned on the original image, solving the problem of failing to fully utilize image details and adapting to pictures with different resolutions in the prior art, and improving the accuracy and robustness of image detection.
Patent Information
- Application Number
- CN202411741756.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-07
AI Technical Summary
The existing image detection methods have limitations in identifying virtual pictures, such as failing to make full use of image details and insufficient adaptability to pictures with different resolutions, resulting in poor detection results.
Using a two-stage training method, the model is first trained on the sub-images obtained by segmenting the original image to extract fine-grained features; then trained on the original image to fine-tune with richer global information.
By combining fine-grained feature extraction and global information utilization, the accuracy and robustness of the image detection model are improved, and the ability to detect image authenticity is enhanced.
Smart Images

Figure CN119580000A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a training method, an image detection method, a device, equipment and a medium. Background Art
[0002] With the development of artificial intelligence generation technology, virtual image generation has been increasingly widely used. The importance of fake image generation technology lies in that it can be applied to multiple fields. This technology can help people save time and cost, and can also create a more realistic virtual world. However, this technology may also be used to deceive and mislead. Existing detection methods mainly meet the requirements of identifying generated images by directly training on virtual images, but this method still has certain limitations. For example, the existing model mainly focuses on analyzing the overall characteristics of the entire image, but fails to make full use of the detailed information in the image, which limits its detection ability to a certain extent. In addition, when processing images of different resolutions, the existing model usually needs to be retrained, showing insufficient adaptability to images of different resolutions. These limitations together lead to the poor performance of existing methods when detecting fake images.
[0003] Therefore, how to optimize the model training method to improve the accuracy of the trained model in image authenticity detection has become an urgent problem to be solved. Summary of the invention
[0004] Based on this, a training method, an image detection method, an apparatus, a device and a medium are provided to solve the problem of how to optimize the training method of the model so as to improve the accuracy of the trained model in image authenticity detection.
[0005] In a first aspect, an embodiment of the present invention provides a method for training an image detection model, comprising: Acquire training samples, wherein the training samples include a first sample formed by associating an original image with a true or false label corresponding to the original image, and a second sample formed by associating a sub-image obtained by segmenting the original image with a true or false label corresponding to the sub-image, wherein the true or false label includes a real image label and a false image label; According to the second sample, a preset image detection model is trained to obtain a pre-trained image detection model; The pre-trained image detection model is trained according to the first sample to obtain a target image detection model.
[0006] In a second aspect, an embodiment of the present invention provides an image detection method, including: Obtain a target image detection model obtained by the image detection model training method described in the first aspect; Acquire an image to be detected, input the image to be detected into the target image detection model, and output the authenticity result of the image to be detected.
[0007] In a third aspect, an embodiment of the present invention provides a training device for an image detection model, comprising: A sample acquisition module, used to acquire training samples, wherein the training samples include a first sample formed by associating an original image with a true or false label corresponding to the original image, and a second sample formed by associating a sub-image obtained by segmenting the original image with a true or false label corresponding to the sub-image, wherein the true or false label includes a real image label and a false image label; A pre-training module, used for training a preset image detection model according to the second sample to obtain a pre-trained image detection model; A fine-tuning module is used to train the pre-trained image detection model according to the first sample to obtain a target image detection model.
[0008] In a fourth aspect, an embodiment of the present invention provides an image detection device, including: A model acquisition module, used to acquire a target image detection model obtained by the training method of the image detection model described in the first aspect; The model prediction module is used to obtain the image to be detected, input the image to be detected into the target image detection model, and output the authenticity result of the image to be detected.
[0009] In a fifth aspect, an embodiment of the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the training method of the image detection model of the first aspect or the image detection method of the second aspect is implemented.
[0010] In a sixth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the training method of the image detection model of the first aspect or the image detection method of the second aspect is implemented.
[0011] The technical effects achieved by the present invention are different from those achieved by the prior art solutions: the present invention obtains training samples, the training samples include a first sample formed by associating an original image with a true or false label corresponding to the original image, and a second sample formed by associating a sub-image obtained by segmenting the original image with a true or false label corresponding to the sub-image, the true or false label includes a real image label and a false image label, and according to the second sample, a preset image detection model is trained to obtain a pre-trained image detection model, and according to the first sample, the pre-trained image detection model is trained to obtain a target image detection model. Among them, through a two-stage training method for the image detection model, in the first stage, the model is trained on the sub-image obtained by segmenting the original image to better extract fine-grained features and improve its ability to extract small-range features. In the second stage, the model is trained on the original image to use richer information for fine-tuning, and further improve its ability to use more extensive global information. By combining fine-grained feature extraction and global information utilization, the accuracy of the trained target image detection model in image authenticity detection and the robustness of the model are improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0013] Figure 1 It is a schematic diagram of an application environment of a training method of an image detection model and an image detection method provided in Embodiment 1 of the present invention; Figure 2 It is a flowchart of a training method for an image detection model provided in Embodiment 2 of the present invention; Figure 3 It is a flowchart of a training method for an image detection model provided in Embodiment 3 of the present invention; Figure 4 is a flowchart of an image detection method provided by Embodiment 4 of the present invention; Figure 5 It is a structural schematic diagram of a training device for an image detection model provided in Embodiment 5 of the present invention; Figure 6 is a structural schematic diagram of an image detection device provided by Embodiment 6 of the present invention; Figure 7 It is a structural diagram of a computer device provided in Embodiment 7 of the present invention. DETAILED DESCRIPTION
[0014] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0015] It should be understood that the order of execution of the steps in the following embodiments does not imply a precedence of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0016] The first embodiment of the present invention provides an image detection model training method and an image detection method, which can be applied in the following aspects: Figure 1 In the application environment, the server communicates with the client, the server provides image detection model training services and image authenticity detection services, and the client triggers image detection model training tasks and image authenticity detection tasks to the server. The client includes but is not limited to PDAs, desktop computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, cloud computing devices, personal digital assistants (PDAs), and other devices. The computer device corresponding to the server can be implemented with an independent server or a server cluster consisting of multiple servers.
[0017] like Figure 2 FIG. 1 is a flow chart of a method for training an image detection model provided in Embodiment 2 of the present invention, which may include the following steps: Step S201: Obtain training samples.
[0018] In this embodiment, the training samples include a first sample formed by associating an original image with a true or false label corresponding to the original image, and a second sample formed by associating a sub-image obtained by segmenting the original image with a true or false label corresponding to the sub-image. The true or false labels include a real image label and a false image label. The original image may refer to a basic image directly used for image detection model training without any form of segmentation or cropping. The sub-image may refer to an image obtained after segmentation of the original image. The real image label may refer to an image that has not been tampered with and is directly obtained through an image capture device such as a camera. The false image label may refer to a virtual image that has been tampered with or generated based on artificial intelligence technology.
[0019] Specifically, at least one original image and an authenticity label corresponding to the original image are obtained, the original image and the authenticity label corresponding to the original image are associated to form a first sample, the original image is segmented to obtain at least two sub-images, the authenticity labels of all sub-images are obtained, and the sub-images and the authenticity labels corresponding to the sub-images are associated to form a second sample.
[0020] Step S202: According to the second sample, the preset image detection model is trained to obtain a pre-trained image detection model.
[0021] Step S203: According to the first sample, the pre-trained image detection model is trained to obtain a target image detection model.
[0022] In this embodiment, the preset image detection model may refer to a pre-set initial image detection model, the pre-trained image detection model may refer to an image detection model after the preset image detection model is trained according to the second sample, and the target image detection model may refer to an image detection model after the pre-trained image detection model is trained according to the first sample.
[0023] Specifically, the sub-image in the second sample and the authenticity label of the corresponding sub-image are input into the preset image detection model for forward propagation training, and the training error value between the model prediction result and the true label is calculated according to the preset loss function. According to the training error value, the preset image detection model is back-propagated and optimized. When the preset training termination conditions are met, such as reaching the preset training rounds, the loss function value reaches the preset threshold, or the model converges on the training data, the pre-trained image detection model is obtained.
[0024] Accordingly, the original image in the first sample and the true and false labels corresponding to the original image are input into the pre-trained image detection model for forward propagation training, and the training error value between the model prediction result and the true label is calculated according to the preset loss function. According to the training error value, the pre-trained image detection model is back-propagated and optimized, and when the preset training termination conditions are met, the target image detection model is obtained.
[0025] In this embodiment, a two-stage training method for the image detection model is used. In the first stage, the model is trained on the sub-images obtained by segmenting the original image to better extract fine-grained features and improve its ability to extract small-range features. In the second stage, the model is trained on the original image to use richer information for fine-tuning, and further improve its ability to use broader global information. By combining fine-grained feature extraction and global information utilization, the accuracy of image authenticity detection of the trained target image detection model and the robustness of the model are improved.
[0026] like Figure 3As shown, it is a flow chart of a training method of an image detection model provided in Embodiment 3 of the present invention. In the above step S202, the preset image detection model is trained according to the second sample to obtain a pre-trained image detection model, which may include the following steps: Step S301: for any sub-image in the second sample, forward propagation training is performed on a preset image detection model according to the sub-image and the authenticity label of the sub-image to obtain a first training prediction result.
[0027] Step S302: Calculate a first training error value between a first training prediction result and a true or false label of a sub-image according to a preset loss function.
[0028] Step S303: According to the first training error value, update the parameters of the preset image detection model to obtain a pre-trained image detection model.
[0029] In this embodiment, the first training prediction result may refer to the authenticity prediction result of the sub-image during the training process of the preset image detection model, and the preset loss function may refer to a pre-set function for measuring the difference between the training prediction result and the authenticity label. For example, the preset loss function may be a binary classification loss function, and the first training error value may refer to the error value between the first training prediction result and the authenticity label of the corresponding sub-image.
[0030] Specifically, in the process of performing the first stage training of the preset image detection model according to the second sample, first, the first training error value between the first training prediction result and the true or false label of the corresponding sub-image can be calculated according to the preset loss function, and then, the parameters of the preset image detection model are updated according to the first training error value and the back propagation algorithm. When the preset training termination condition is reached, the pre-trained image detection model is obtained.
[0031] Accordingly, in the process of performing the second stage training of the pre-trained image detection model according to the first sample, the parameters of the first few layers of the pre-trained image detection model are frozen, and only the subsequent layers are fine-tuned. For any original image in the first sample, the pre-trained image detection model is forward propagated trained according to the original image and the authenticity label of the original image to obtain a second training prediction result. According to a preset loss function, a second training error value between the second training prediction result and the authenticity label of the original image is calculated. According to the second training error value, the parameters of the pre-trained image detection model are updated, and when the preset training termination condition is met, the target image detection model is obtained.
[0032] In this embodiment, a two-stage training method for the image detection model is used. In the first stage, the model is trained on the sub-images obtained by segmenting the original image to better extract fine-grained features and improve its ability to extract small-range features. In the second stage, the model is trained on the original image to use richer information for fine-tuning, and further improve its ability to use broader global information. By combining fine-grained feature extraction and global information utilization, the accuracy of image authenticity detection of the trained target image detection model and the robustness of the model are improved.
[0033] like Figure 4 FIG. 1 is a flow chart of an image detection method provided in Embodiment 4 of the present invention, which may include the following steps: Step S401: Acquire a target image detection model obtained by a training method of an image detection model.
[0034] Step S402: Acquire the image to be detected, input the image to be detected into the target image detection model, and output the authenticity result of the image to be detected.
[0035] In this embodiment, the image to be detected may refer to an image to be authenticated.
[0036] For example, in the scenario of insurance claims, insurance companies often need to review claim images submitted by customers to verify the authenticity of the images. They can obtain the trained target image detection model, obtain the image to be detected from the claim documents submitted by the customer, input the image to be detected into the target image detection model, and output the authenticity result of the image to be detected. If the image is judged to be a false image (such as image stitching, tampering, etc.), the claim request can be rejected based on this judgment result, and further investigation can be conducted to determine whether the customer has committed fraud.
[0037] In this embodiment, the target image detection model is used to perform authenticity judgment on the image to be detected, thereby improving the accuracy of image authenticity detection.
[0038] like Figure 5 As shown, a training device for an image detection model provided in Embodiment 5 of the present invention is provided. The training device for the image detection model corresponds one-to-one to the training method for the image detection model in the above embodiment. The training device for the image detection model includes a sample acquisition module 51, a pre-training module 52 and a fine-tuning module 53. The functional modules are described in detail as follows: The sample acquisition module 51 is used to acquire training samples, wherein the training samples include a first sample formed by associating an original image with a true or false label corresponding to the original image, and a second sample formed by associating a sub-image obtained by segmenting the original image with a true or false label corresponding to the sub-image, wherein the true or false label includes a real image label and a false image label; A pre-training module 52, configured to train a preset image detection model according to the second sample to obtain a pre-trained image detection model; The fine-tuning module 53 is used to train the pre-trained image detection model according to the first sample to obtain a target image detection model.
[0039] Optionally, the training device of the image detection model further includes: A first sample construction module, configured to obtain at least one original image and an authenticity label corresponding to the original image, and associate the original image with the authenticity label corresponding to the original image to form the first sample; The second sample construction module is used to segment the original image to obtain at least two sub-images, obtain authenticity labels of all sub-images, and associate the sub-images with the authenticity labels of corresponding sub-images to form the second sample.
[0040] Optionally, the pre-training module 52 includes: A first training unit is configured to perform forward propagation training on the preset image detection model for any sub-image in the second sample according to the sub-image and the authenticity label of the sub-image to obtain a first training prediction result; A first error calculation unit, configured to calculate a first training error value between the first training prediction result and the true or false label of the sub-image according to a preset loss function; The first optimization unit is used to update the parameters of the preset image detection model according to the first training error value to obtain the pre-trained image detection model.
[0041] Optionally, the fine-tuning module 53 includes: A second training unit is used to perform forward propagation training on the pre-trained image detection model for any original image in the first sample according to the original image and the authenticity label of the original image to obtain a second training prediction result; A second error calculation unit, used to calculate a second training error value between the second training prediction result and the true or false label of the original image according to the preset loss function; The second optimization unit is used to update the parameters of the pre-trained image detection model according to the second training error value to obtain the target image detection model.
[0042] Optionally, the pre-training module 52 further includes: A first training termination unit, configured to stop training the preset image detection model when the preset image detection model meets a preset training termination condition, so as to obtain the pre-trained image detection model; Optionally, the fine-tuning module 53 further includes: The second training termination unit is used to stop the training of the pre-trained image detection model when the pre-trained image detection model meets the preset training termination condition to obtain the target image detection model.
[0043] For the specific definition of the training device of the image detection model, please refer to the definition of the training method of the image detection model above, which will not be repeated here. Each module in the above-mentioned training device of the image detection model can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0044] like Figure 6 As shown, an image detection device provided in Embodiment 6 of the present invention is provided, and the image detection device corresponds one-to-one with the image detection method in the above-mentioned embodiment. The image detection device includes a model acquisition module 61 and a model prediction module 62. The functional modules are described in detail as follows: A model acquisition module 61 is used to acquire a target image detection model obtained by the training method of the image detection model; The model prediction module 62 is used to obtain the image to be detected, input the image to be detected into the target image detection model, and output the authenticity result of the image to be detected.
[0045] For the specific definition of the image detection device, please refer to the definition of the image detection method above, which will not be repeated here. Each module in the above-mentioned image detection device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0046] Figure 7 This is a schematic diagram of the structure of a computer device provided in Embodiment 7 of the present invention. Figure 7 As shown, the computer device of this embodiment includes: at least one processor ( Figure 7 Only one is shown in the figure), a memory, and a computer program stored in the memory and executable on at least one processor, wherein when the processor executes the computer program, the training method of any of the above-mentioned image detection models or the steps in the image detection method embodiment are implemented.
[0047] The computer device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that Figure 7This is merely an example of a computer device and does not constitute a limitation on the computer device. The computer device may include more or fewer components than those shown in the figure, or a combination of certain components, or different components. For example, it may also include a network interface, a display screen, and an input device.
[0048] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0049] The memory includes a readable storage medium, an internal memory, etc., wherein the internal memory may be the memory of a computer device, and the internal memory provides an environment for the operation of the operating system and computer-readable instructions in the readable storage medium. The readable storage medium may be a hard disk of a computer device, and in other embodiments, it may also be an external storage device of the computer device, for example, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device. Further, the memory may also include both an internal storage unit of the computer device and an external storage device. The memory is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of a computer program, etc. The memory may also be used to temporarily store data that has been output or is to be output.
[0050] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention. The specific working process of the units and modules in the above-mentioned device can refer to the corresponding process in the above-mentioned method embodiment, which will not be repeated here. 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 such understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned method embodiment can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying computer program code, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0051] The present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by a computer program product. When the computer program product runs on a computer device, the computer device can implement the steps in the above-mentioned method embodiment when executing.
[0052] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0053] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0054] In the embodiments provided by the present invention, it should be understood that the disclosed devices / computer equipment and methods can be implemented in other ways. For example, the device / computer equipment embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple 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, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0055] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0056] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the aforementioned embodiments, or replace some of the technical features therein by equivalents, and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention. The non-company software tools or components appearing in the embodiments of this application are merely examples and do not represent actual use.
Claims
1. A training method for an image detection model, characterized in that: include: Acquire training samples, wherein the training samples include a first sample formed by associating an original image with a true or false label corresponding to the original image, and a second sample formed by associating a sub-image obtained by segmenting the original image with a true or false label corresponding to the sub-image, wherein the true or false label includes a real image label and a false image label; According to the second sample, a preset image detection model is trained to obtain a pre-trained image detection model; The pre-trained image detection model is trained according to the first sample to obtain a target image detection model.
2. The method for training an image detection model according to claim 1, wherein: Before obtaining the training sample, the method further includes: Acquire at least one original image and an authenticity label corresponding to the original image, and associate the original image with the authenticity label corresponding to the original image to form the first sample; The original image is segmented to obtain at least two sub-images, authenticity labels of all sub-images are obtained, and the sub-images are associated with the authenticity labels of corresponding sub-images to form the second sample.
3. The training method of the image detection model according to claim 1, characterized in that: The step of training a preset image detection model according to the second sample to obtain a pre-trained image detection model includes: For any sub-image in the second sample, performing forward propagation training on the preset image detection model according to the sub-image and the authenticity label of the sub-image to obtain a first training prediction result; Calculating a first training error value between the first training prediction result and the true or false label of the sub-image according to a preset loss function; According to the first training error value, the parameters of the preset image detection model are updated to obtain the pre-trained image detection model.
4. The training method of the image detection model as claimed in claim 3, characterized in that: The step of training the pre-trained image detection model according to the first sample to obtain a target image detection model includes: For any original image in the first sample, performing forward propagation training on the pre-trained image detection model according to the original image and the authenticity label of the original image to obtain a second training prediction result; Calculating a second training error value between the second training prediction result and the true or false label of the original image according to the preset loss function; According to the second training error value, the parameters of the pre-trained image detection model are updated to obtain the target image detection model.
5. The method for training an image detection model according to claim 1, wherein: The step of training a preset image detection model according to the second sample to obtain a pre-trained image detection model further includes: When the preset image detection model meets the preset training termination condition, the training of the preset image detection model is stopped to obtain the pre-trained image detection model; Correspondingly, the pre-trained image detection model is trained according to the first sample to obtain a target image detection model, and further includes: When the pre-trained image detection model meets the preset training termination condition, the training of the pre-trained image detection model is stopped to obtain the target image detection model.
6. An image detection method, characterized in that: include: Obtain a target image detection model obtained by the training method of the image detection model according to any one of claims 1 to 5; Acquire an image to be detected, input the image to be detected into the target image detection model, and output the authenticity result of the image to be detected.
7. A training device for an image detection model, characterized in that: include: A sample acquisition module, used to acquire training samples, wherein the training samples include a first sample formed by associating an original image with a true or false label corresponding to the original image, and a second sample formed by associating a sub-image obtained by segmenting the original image with a true or false label corresponding to the sub-image, wherein the true or false label includes a real image label and a false image label; A pre-training module, used for training a preset image detection model according to the second sample to obtain a pre-trained image detection model; A fine-tuning module is used to train the pre-trained image detection model according to the first sample to obtain a target image detection model.
8. An image detection device, characterized in that: include: A model acquisition module, used to acquire a target image detection model obtained by the training method of the image detection model according to any one of claims 1 to 5; The model prediction module is used to obtain the image to be detected, input the image to be detected into the target image detection model, and output the authenticity result of the image to be detected.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, it implements the training method of the image detection model as described in any one of claims 1 to 5, or the image detection method as described in claim 6.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it implements the training method of the image detection model as described in any one of claims 1 to 7, or the image detection method as described in claim 6.