File image processing method and related equipment thereof
By performing initial recognition processing on the archival images and selecting appropriate processing models according to different clarity, the problem of difficult to balance the consumption and accuracy of identification resources in OCR technology is solved, and the recognition effect is improved and resource saving is achieved.
Patent Information
- Application Number
- CN202411590299.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-03-11
AI Technical Summary
In the prior art, when the archive resource identification is identified through OCR technology, it is difficult to balance the identification resource consumption and identification accuracy.
A method for processing an archive image is proposed, by receiving the archive image to be processed, and it is initially recognized and processed, and is divided into the first and second categories of archive image to be processed. The first type of image has a high definition and is input to the first preset processing model based on the preset recognition tag for processing; the second type of image has a low definition and is input to the preset recognition branch of the dual-mode comparison learning recognition model for processing.
The balance of identification resource consumption and identification accuracy is achieved, and the recognition effect of high-resolution and low-profile images is improved through appropriate processing model selection.
Smart Images

Figure CN119600611A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method for processing archival images and related equipment. Background Art
[0002] At present, digital archives are the new direction of archive development. That is, with the continuous development of computer technology, scanning technology, OCR technology, digital photography technology, database technology, multimedia technology, etc., it is necessary to convert archival resources in various carriers into digital form, and connect them through the network and use computer systems for efficient management.
[0003] In the process of converting archival resources (images) on various carriers, especially paper carriers, into digital form, it is necessary to digitally identify the archival resources. However, in the current process of digitally identifying archival resources, OCR technology is usually used for identification. However, it is difficult to balance the consumption of identification resources and the accuracy of identification by only using OCR technology. Summary of the invention
[0004] The main purpose of this application is to provide a method for processing archival images and related equipment, aiming to solve the technical problem of balancing recognition resource consumption and recognition accuracy when identifying archival resources through OCR technology.
[0005] To achieve the above purpose, the present application proposes a method for processing archive images, the method comprising:
[0006] Receiving the archival image to be processed, performing initial recognition processing on the archival image to be processed, and obtaining the first type of archival image to be processed or the second type of archival image to be processed, wherein the clarity of the first type of archival image to be processed is greater than that of the second type of archival image to be processed;
[0007] Inputting the first type of archive images to be processed into the first preset processing model to obtain a first processing result, and inputting the second type of archive images to be processed into the preset recognition branch of the second preset processing model to obtain a second processing result, wherein the first preset processing model is obtained by iteratively training the first preset basic model based on the first training data with the preset first recognition label, and the second preset processing model is a bimodal contrast learning recognition model, and the second preset processing model has a preset recognition branch and a preset contrast learning branch, and the preset contrast learning branch uses contrast learning to enable the preset recognition branch to extract image features that are farther from negative sample features and closer to positive sample features at the feature layer in the process of predicting the second type of archive images to be processed, and the negative sample features are features of other modalities different from the image features, and the resource consumption of the first preset processing model is lower than the resource consumption of the second preset processing model;
[0008] The first processing result and the second processing result are output.
[0009] In one embodiment, the step of inputting the first type of archival images to be processed into a first preset processing model to obtain a first processing result, and inputting the second type of archival images to be processed into a preset recognition branch of a second preset processing model comprises:
[0010] Determining a target processing volume of the archival images to be processed;
[0011] When the target processing volume is greater than or equal to the preset processing volume, and the current server-side load is less than the preset load, the first type of archive images to be processed are input into the first preset processing model through the preset system interface to obtain a first processing result, and the second type of archive images to be processed are input into the preset recognition branch of the second preset processing model through the preset system interface;
[0012] When the target processing volume is less than the preset processing volume, the first type of archival images to be processed are input into the first preset processing model through the preset user interface to obtain a first processing result, and the second type of archival images to be processed are input into the preset identification branch of the second preset processing model through the preset user interface, wherein the preset system interface and the preset user interface are connected to different objects.
[0013] In one embodiment, before the step of obtaining the archival image to be processed and performing initial recognition processing on the archival image to be processed to obtain the first type of archival image to be processed or the second type of archival image to be processed, the step includes:
[0014] Acquire the archive image to be processed, and perform recognition processing of a preset size on the archive image to be processed;
[0015] The archive images to be processed that do not meet the preset size range are regarded as the second type of archive images to be processed;
[0016] Preprocessing the archive images to be processed that meet the preset size range, wherein the preprocessing includes grayscale processing, noise reduction and normalization processing;
[0017] Inputting the preprocessed archive image to be processed into the initial recognition model, and determining whether the image to be processed is blurred or wrinkled by the initial recognition model;
[0018] The archival images to be processed without blur or wrinkles are regarded as the first category of archival images to be processed, and the archival images to be processed with blur or wrinkles are regarded as the second category of archival images to be processed; wherein the initial recognition model is obtained by iteratively training the first preset basic model based on the second training data with a preset second recognition label.
[0019] In one embodiment, the overall loss function of the second preset processing model includes a recognition loss function corresponding to a preset recognition branch and a contrastive learning branch loss function corresponding to a preset contrastive learning branch;
[0020] Before the step of inputting the second type of to-be-processed archive images into the preset recognition branch of the second preset processing model and obtaining the second processing result, the method includes:
[0021] Acquire sample data with a preset second identification tag, wherein the sample data includes a text sample and an image sample;
[0022] Determining image features based on the image sample with the preset second identification tag, and determining text features based on the text sample;
[0023] Based on the text features and the image features, determining a positive sample pair in which the image features and the text features are successfully matched, and determining a negative sample pair in which the image features and the text features are unmatched;
[0024] Based on the positive sample feature pairs, the negative sample feature pairs and the contrastive learning branch loss function, modal alignment is performed to train the contrastive learning branch, and based on the image features and the recognition loss function, the preset recognition branch is trained until the overall loss function is minimized, thereby obtaining a second preset processing model, wherein the contrastive learning branch of the current training round affects the preset recognition branch of the next training round.
[0025] In one embodiment, the weight relationship between the recognition loss function and the contrastive learning branch loss function and the overall loss function is not fixed.
[0026] In one embodiment, before the step of inputting the first type of archive images to be processed into the first preset processing model, the step includes:
[0027] Acquire first training data with a preset first identification label;
[0028] Inputting the first training data into a first preset basic model, and performing recognition processing on the first training data based on the first preset basic model to obtain a recognition result;
[0029] Calculate the difference between the recognition result and the preset first recognition tag to obtain an error result;
[0030] Based on the error result, determining whether the error result meets an error standard indicated by a preset error threshold range;
[0031] If the error result does not meet the error standard indicated by the preset error threshold range, the model parameters of the first preset basic model are adjusted in an orderly manner, and the step of performing recognition processing on the first training data based on the first preset basic model is returned until the error result meets the error standard indicated by the preset error threshold range, and the training is stopped to obtain the first preset processing model, wherein the model parameters include not only weights but also hyper parameters.
[0032] In addition, to achieve the above-mentioned purpose, the present application also proposes a device for processing archive images, the device comprising:
[0033] An acquisition module, used for acquiring the archival images to be processed, performing initial recognition processing on the archival images to be processed, and obtaining the first type of archival images to be processed or the second type of archival images to be processed, wherein the clarity of the first type of archival images to be processed is greater than that of the second type of archival images to be processed;
[0034] A processing module, used for inputting a first type of to-be-processed archival images into a first preset processing model to obtain a first processing result, and inputting a second type of to-be-processed archival images into a preset recognition branch of a second preset processing model to obtain a second processing result, wherein the first preset processing model is obtained by iteratively training a first preset basic model based on first training data having a preset first recognition label, and the second preset processing model is a bimodal contrastive learning recognition model, and the second preset processing model has a preset recognition branch and a preset contrastive learning branch, and the preset contrastive learning branch uses contrastive learning to enable the preset recognition branch to extract image features that are farther from negative sample features and closer to positive sample features at a feature layer in the process of predicting the second type of to-be-processed archival images, and the negative sample features are features of other modalities different from the image features, and the resource consumption of the first preset processing model is lower than that of the second preset processing model;
[0035] An output module is used to output the first processing result and the second processing result.
[0036] In one embodiment, the archival image processing device is used to implement:
[0037] Determining a target processing volume of the archival images to be processed;
[0038] When the target processing volume is greater than or equal to the preset processing volume, and the current server-side load is less than the preset load, the first type of archive images to be processed are input into the first preset processing model through the preset system interface to obtain a first processing result, and the second type of archive images to be processed are input into the preset recognition branch of the second preset processing model through the preset system interface;
[0039] When the target processing volume is less than the preset processing volume, the first type of archival images to be processed are input into the first preset processing model through the preset user interface to obtain a first processing result, and the second type of archival images to be processed are input into the preset identification branch of the second preset processing model through the preset user interface, wherein the preset system interface and the preset user interface are connected to different objects.
[0040] In one embodiment, the archival image processing device is used to implement:
[0041] Acquire the archive image to be processed, and perform recognition processing of a preset size on the archive image to be processed;
[0042] The archive images to be processed that do not meet the preset size range are regarded as the second type of archive images to be processed;
[0043] Preprocessing the archive images to be processed that meet the preset size range, wherein the preprocessing includes grayscale processing, noise reduction and normalization processing;
[0044] Inputting the preprocessed archive image to be processed into the initial recognition model, and determining whether the image to be processed is blurred or wrinkled by the initial recognition model;
[0045] The archival images to be processed without blur or wrinkles are regarded as the first category of archival images to be processed, and the archival images to be processed with blur or wrinkles are regarded as the second category of archival images to be processed; wherein the initial recognition model is obtained by iteratively training the first preset basic model based on the second training data with a preset second recognition label.
[0046] In one embodiment, the overall loss function of the second preset processing model includes a recognition loss function corresponding to a preset recognition branch and a contrastive learning branch loss function corresponding to a preset contrastive learning branch;
[0047] The archival image processing device is used to implement:
[0048] Acquire sample data with a preset second identification tag, wherein the sample data includes a text sample and an image sample;
[0049] Determining image features based on the image sample with the preset second identification tag, and determining text features based on the text sample;
[0050] Based on the text features and the image features, determining a positive sample pair in which the image features and the text features are successfully matched, and determining a negative sample pair in which the image features and the text features are unmatched;
[0051] Based on the positive sample feature pairs, the negative sample feature pairs and the contrastive learning branch loss function, modal alignment is performed to train the contrastive learning branch, and based on the image features and the recognition loss function, the preset recognition branch is trained until the overall loss function is minimized, thereby obtaining a second preset processing model, wherein the contrastive learning branch of the current training round affects the preset recognition branch of the next training round.
[0052] In one embodiment, the weight relationship between the recognition loss function and the contrastive learning branch loss function and the overall loss function is not fixed.
[0053] In one embodiment, the archival image processing device is used to implement:
[0054] Acquire first training data with a preset first identification label;
[0055] Inputting the first training data into a first preset basic model, and performing recognition processing on the first training data based on the first preset basic model to obtain a recognition result;
[0056] Calculate the difference between the recognition result and the preset first recognition tag to obtain an error result;
[0057] Based on the error result, determining whether the error result meets an error standard indicated by a preset error threshold range;
[0058] If the error result does not meet the error standard indicated by the preset error threshold range, the model parameters of the first preset basic model are adjusted in an orderly manner, and the step of performing recognition processing on the first training data based on the first preset basic model is returned until the error result meets the error standard indicated by the preset error threshold range, and the training is stopped to obtain the first preset processing model, wherein the model parameters include not only weights but also hyper parameters.
[0059] In addition, to achieve the above-mentioned purpose, the present application also proposes a device for processing archival images, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the method for processing archival images as described above.
[0060] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the archival image processing method described above are implemented.
[0061] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the archival image processing method as described above.
[0062] The above technical solution proposed in this application has the following technical effects:
[0063] Compared with the related art, which only recognizes archival resources such as archival images based on OCR technology, and it is difficult to balance the recognition resource consumption and recognition accuracy, the present application receives the archival images to be processed, performs initial recognition processing on the archival images to be processed, and obtains the first type of archival images to be processed or the second type of archival images to be processed, wherein the clarity of the first type of archival images to be processed is greater than that of the second type of archival images to be processed; inputs the first type of archival images to be processed into a first preset processing model to obtain a first processing result, and inputs the second type of archival images to be processed into a preset recognition branch of the second preset processing model to obtain a second processing result, wherein the first preset processing model is based on a preset processing model having a preset The first training data of the first recognition label is obtained by iteratively training the first preset basic model; the second preset processing model is a bimodal contrast learning recognition model; the second preset processing model has a preset recognition branch and a preset contrast learning branch; the preset contrast learning branch uses contrast learning to enable the preset recognition branch to extract image features that are farther from negative sample features and closer to positive sample features at the feature layer during the process of predicting the second type of archival images to be processed; the negative sample features are features of other modes different from the image features; the resource consumption of the first preset processing model is lower than that of the second preset processing model; and the first processing result and the second processing result are output. It can be understood that in the present application, for the archival images to be processed, the ones with high definition are processed by the first preset processing model. Since the resource consumption of the first preset processing model is lower than that of the second preset processing model, the archival images to be processed with high definition do not need to be processed by the second preset processing model with more resource consumption, thereby saving computing resources. In addition, for the archival images to be processed with low definition, they are processed based on the second preset processing model. Since the contrast learning branch preset by the second preset processing model uses contrast learning, the preset recognition branch extracts image features that are farther away from the negative sample features and closer to the positive sample features at the feature layer during the prediction of the second type of archival images to be processed. Therefore, the preset recognition branch described in the present application can make the archival images to be processed farther away from the negative sample features and closer to the positive sample features during the prediction process, that is, the preset recognition branch can be closer to the real result during the prediction process, thereby improving the recognition accuracy. Furthermore, the present application ensures a balance between recognition resource consumption and recognition accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0065] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0066] Figure 1 A first flow chart of the first embodiment of the method for processing archive images of the present application is provided;
[0067] Figure 2 A second flow chart of the second embodiment of the method for processing archive images of the present application is provided;
[0068] Figure 3 This is a third flow chart of the third embodiment of the method for processing archive images of the present application;
[0069] Figure 4 A schematic diagram of the device structure of the hardware operating environment involved in the method for processing archive images in the embodiment of the present application;
[0070] Figure 5 Schematic diagram of the module structure of the file image processing device of the embodiment of the present application.
[0071] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0072] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0073] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0074] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a file image processing device, etc. The following takes the file image processing device as an example to illustrate this embodiment and the following embodiments.
[0075] Based on this, the present application embodiment provides a method for processing an archive image, referring to Figure 1 , Figure 1This is a flow chart of the first embodiment of the method for processing archive images of the present application.
[0076] In this embodiment, the method for processing the archive image includes steps S10 to S30:
[0077] Step S10, receiving the archival image to be processed, performing initial recognition processing on the archival image to be processed, and obtaining the first type of archival image to be processed or the second type of archival image to be processed, wherein the clarity of the first type of archival image to be processed is greater than that of the second type of archival image to be processed;
[0078] It should be noted that there may be multiple archival images to be processed, and the archival images to be processed are transmitted to the archival image processing device via a corresponding transmission medium.
[0079] Specifically, the corresponding transmission medium can be any medium. For example, the archive image to be processed can be uploaded directly after the paper archive is photographed by a camera, or the archive image to be processed can be uploaded directly through the corresponding software after the paper archive is photographed by a camera, etc., without specific limitation.
[0080] It should be emphasized that the archival images to be processed can be uploaded in different ways according to their different secrecy levels to avoid security issues. For example, if the secrecy level is top secret, it can only be uploaded through a preset customized app. If the secrecy level is secret, it can be uploaded through a regular mini-program. The secrecy level of the archival image to be processed can be determined based on its identification.
[0081] Furthermore, the archive image to be processed may be in various formats, such as pdf format, or BMP format, etc., without specific limitation.
[0082] After receiving the archival image to be processed, the clarity of the archival image to be processed is determined (it should be noted that, in order to improve accuracy, the clarity is the clarity of the image portion after removing the blurred image due to encryption), and the archival image to be processed is initially recognized to obtain the first category of archival images to be processed or the second category of archival images to be processed, wherein the clarity of the first category of archival images to be processed is greater than that of the second category of archival images to be processed.
[0083] It is understandable that the clarity of the archive image to be processed can be determined based on a preset clarity algorithm such as the Brenner gradient method, the Tenegrad gradient method, the Laplace gradient method, the variance method, the energy gradient method, and the like.
[0084] After determining the clarity of the archival images to be processed, the archival images to be processed are divided into a first category of archival images to be processed or a second category of archival images to be processed, wherein the clarity of the first category of archival images to be processed is greater than that of the second category of archival images to be processed.
[0085] Step S20, inputting the first type of archive images to be processed into the first preset processing model to obtain a first processing result, and inputting the second type of archive images to be processed into the preset recognition branch of the second preset processing model to obtain a second processing result, wherein the first preset processing model is obtained by iteratively training the first preset basic model based on the first training data with the preset first recognition label, and the second preset processing model is a bimodal contrast learning recognition model, and the second preset processing model has a preset recognition branch and a preset contrast learning branch, and the preset contrast learning branch uses contrast learning to enable the preset recognition branch to extract image features that are farther from negative sample features and closer to positive sample features at the feature layer in the process of predicting the second type of archive images to be processed, and the negative sample features are features of other modalities different from the image features, and the resource consumption of the first preset processing model is lower than the resource consumption of the second preset processing model;
[0086] In this embodiment, it should be noted that extracting image features that are farther from the negative sample features and closer to the positive sample features at the feature layer can be achieved in the following ways:
[0087] The features of different modes are converted into matrix expressions, and then the distances between different features are determined by matrix calculation, so as to extract image features that are farther from the negative sample features and closer to the positive sample features at the feature layer. The matrix calculation method may be a Manhattan distance calculation method.
[0088] Alternatively, in this embodiment, the distances between different features may be determined by calculating the Euclidean distance, so as to extract image features that are farther from the negative sample features and closer to the positive sample features at the feature layer.
[0089] It should be noted that the first preset processing model is obtained by iteratively training the first preset basic model based on the first training data with the preset first identification label.
[0090] Specifically, based on the first training data with the preset first identification label, the specific process of iteratively training the first preset basic model may be:
[0091] The first training data is input into the first preset basic model to obtain a first recognition result. If the difference between the first recognition result and the preset first recognition label does not meet the requirements, the model parameters of the first preset basic model are adjusted, and the first preset basic model with adjusted parameters is iteratively trained until the first preset processing model is obtained.
[0092] In this embodiment, if the archival image to be processed is a second type of archival image to be processed, the second type of archival image to be processed is input into a preset recognition branch of a second preset processing model to obtain a second processing result.
[0093] In this embodiment, the second preset processing model has a preset recognition branch and a preset comparative learning branch, but in the application stage, recognition is only performed based on the preset recognition branch, while the preset comparative learning branch is trained together with the preset recognition branch in the training stage and affects the model parameters of the preset recognition branch.
[0094] Specifically, the preset contrast learning branch uses contrast learning to enable the preset recognition branch to extract image features that are farther from the negative sample features and closer to the positive sample features at the feature layer in the process of predicting the second type of archival images to be processed. The negative sample features are features of other modalities different from the image features. For example, the negative sample features and the positive sample features can be text features. That is, in the present application, rich and accurate information is provided through the text layer features. Since the present application extracts image features that are farther from the negative sample features and closer to the positive sample features at the feature layer, that is, the image features are close to the text layer features, the accuracy of the model can be improved. Furthermore, the first type of archival images to be processed whose clarity is lower than that processed by the first preset processing model can be accurately identified.
[0095] In this embodiment, the resource consumption of the first preset processing model is lower than that of the second preset processing model. Therefore, the present application only uses the second preset processing model to process images with poor clarity, thereby saving computing resources.
[0096] The overall loss function of the second preset processing model includes a recognition loss function corresponding to a preset recognition branch and a contrastive learning branch loss function corresponding to a preset contrastive learning branch;
[0097] Before the step of inputting the second type of to-be-processed archive images into the preset recognition branch of the second preset processing model and obtaining the second processing result, the method includes:
[0098] Step S01, acquiring sample data with a preset second identification tag, wherein the sample data includes a text sample and an image sample;
[0099] Step S02, determining image features based on the image sample with the preset second identification tag, and determining text features based on the text sample;
[0100] Step S03, based on the text features and the image features, determining positive sample pairs where the image features and the text features are successfully matched, and determining negative sample pairs where the image features and the text features are unmatched;
[0101] Step S04, based on the positive sample feature pair, the negative sample feature pair and the contrastive learning branch loss function, modal alignment is performed, and contrastive learning branches are trained to obtain contrastive learning branches. Based on image features and recognition loss functions, preset recognition branches are trained until the overall loss function is minimized, thereby obtaining a second preset processing model, wherein the contrastive learning branch of the current training round affects the preset recognition branch of the next training round.
[0102] In this embodiment, the training of the preset recognition branch and the contrastive learning branch sub-models is performed synchronously, and the basic models of the preset recognition branch and the contrastive learning branch sub-models can be completely the same or different.
[0103] In this embodiment, it should be noted that the loss function of the preset second training model is specially designed, and the special design can use the features of other modalities to constrain the learning of image features (after the constraint, in the next round of training, it affects the preset recognition branch), so that the preset recognition branch obtained by the corresponding training is in the prediction process. In the process of predicting the second type of archival images to be processed, the preset recognition branch extracts image features that are farther away from the negative sample features and closer to the positive sample features in the feature layer.
[0104] In this embodiment, specifically, sample data with a preset second identification label is obtained, the sample data including a text sample (other modal sample features) and an image sample, image features are determined based on the image sample with the preset second identification label, text features (other modal sample features) are determined based on the text sample, and then based on the text features (other modal sample features) and the image features, positive sample pairs in which the image features and the text features (other modal sample features) are successfully matched, and negative sample pairs in which the image features and the text features (other modal sample features) fail to match are determined (successful matching refers to, for example, that the image features are Other modal features are The image features With other modal features is a positive sample pair, image features With other modal features is a negative sample pair), in the current round, training is performed based on the positive sample feature pair, the negative sample feature pair and the contrastive learning branch loss function. At the same time, based on the image features, the preset recognition branch is trained, and the overall loss function of the two branches is calculated. If the overall loss function is not minimum, the model parameters of the two branches are adjusted, and training is continued until the overall loss function is minimized, thereby obtaining a second preset processing model, wherein the contrastive learning branch of the current training round affects the preset recognition branch of the next training round by affecting the corresponding model parameters.
[0105] In this embodiment, it should be noted that the weight relationship between the recognition loss function (loss1) and the contrastive learning branch loss function (loss2) and the overall loss function is not fixed. That is, the weight relationship (a) between the recognition loss function and the contrastive learning branch loss function and the overall loss function (LOSS = loss1 + a * loss2) can be adjusted. Specifically, for example, it can be adjusted according to the clarity of the archival image to be processed. If the clarity is higher than before, the proportion of the contrastive learning branch loss function can be lower. If the clarity is lower than before, the proportion of the contrastive learning branch loss function can be higher to improve the accuracy of the model (this is because, with high clarity, more information assistance from other modalities is needed for accurate recognition).
[0106] In this embodiment, since the weight relationships between the recognition loss function and the contrastive learning branch loss function and the overall loss function are not fixed, actual application requirements can be better met.
[0107] Compared with the related art, which only recognizes archival resources such as archival images based on OCR technology, and it is difficult to balance the recognition resource consumption and recognition accuracy, the present application receives the archival images to be processed, performs initial recognition processing on the archival images to be processed, and obtains the first type of archival images to be processed or the second type of archival images to be processed, wherein the clarity of the first type of archival images to be processed is greater than that of the second type of archival images to be processed; inputs the first type of archival images to be processed into a first preset processing model to obtain a first processing result, and inputs the second type of archival images to be processed into a preset recognition branch of the second preset processing model to obtain a second processing result, wherein the first preset processing model is based on a preset processing model having a preset The first training data of the first recognition label is obtained by iteratively training the first preset basic model; the second preset processing model is a bimodal contrast learning recognition model; the second preset processing model has a preset recognition branch and a preset contrast learning branch; the preset contrast learning branch uses contrast learning to enable the preset recognition branch to extract image features that are farther from negative sample features and closer to positive sample features at the feature layer during the process of predicting the second type of archival images to be processed; the negative sample features are features of other modes different from the image features; the resource consumption of the first preset processing model is lower than that of the second preset processing model; and the first processing result and the second processing result are output. It can be understood that in the present application, for the archival images to be processed, the ones with high definition are processed by the first preset processing model. Since the resource consumption of the first preset processing model is lower than that of the second preset processing model, the archival images to be processed with high definition do not need to be processed by the second preset processing model with more resource consumption, thereby saving computing resources. In addition, for the archival images to be processed with low definition, they are processed based on the second preset processing model. Since the contrast learning branch preset by the second preset processing model uses contrast learning, the preset recognition branch extracts image features that are farther away from the negative sample features and closer to the positive sample features at the feature layer during the prediction of the second type of archival images to be processed. Therefore, the preset recognition branch described in the present application can make the archival images to be processed farther away from the negative sample features and closer to the positive sample features during the prediction process, that is, the preset recognition branch can be closer to the real result during the prediction process, thereby improving the recognition accuracy. Furthermore, the present application ensures a balance between recognition resource consumption and recognition accuracy.
[0108] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above embodiment can be referred to the above introduction, and will not be repeated in the following. Figure 2The step of inputting the first type of archive images to be processed into the first preset processing model to obtain the first processing result, and inputting the second type of archive images to be processed into the preset recognition branch of the second preset processing model includes:
[0109] Step A1, determining the target processing volume of the archive image to be processed;
[0110] Step A2, when the target processing volume is greater than or equal to the preset processing volume and the current server-side load is less than the preset load, the first type of archive images to be processed are input into the first preset processing model through the preset system interface to obtain a first processing result, and the second type of archive images to be processed are input into the preset recognition branch of the second preset processing model through the preset system interface;
[0111] Step A3, when the target processing volume is less than the preset processing volume, the first type of archival images to be processed are input into the first preset processing model through the preset user interface to obtain a first processing result, and the second type of archival images to be processed are input into the preset identification branch of the second preset processing model through the preset user interface, wherein the preset system interface and the preset user interface are connected to different objects.
[0112] In this embodiment, it can be determined that there are different docking interfaces (preset user interface and preset system interface), which can input the first type of archive images to be processed into the first preset processing model, and input the second type of archive images to be processed into the second preset processing model. Specifically, the preset system interface has a larger processing capacity than the preset user interface. And the preset system interface and the preset user interface are docked with different objects, one is docked with other systems that batch generate archive images to be processed (preset system interface), and the other is docked with individual archive images to be processed (preset user interface).
[0113] When the target processing volume is greater than or equal to the preset processing volume (a large processing volume), it can be understood that a batch of archival images to be processed are coming over, and the current server-side load is less than the preset load (can continue to process), then the first type of archival images to be processed are input into the first preset processing model through the preset system interface (the system interface has a large capacity) to obtain a first processing result, and the second type of archival images to be processed are input into the preset identification branch of the second preset processing model through the preset system interface.
[0114] It can be understood that when the target processing volume is less than the preset processing volume (the processing volume is small, and the images are not coming in batches), the first type of archival images to be processed are input into the first preset processing model through the preset user interface to obtain the first processing result, and the second type of archival images to be processed are input into the preset identification branch of the second preset processing model through the preset user interface.
[0115] Furthermore, in this embodiment, it should be noted that a third interface other than the system interface and the user interface can be provided. There can be two third interfaces, and the carrying capacity of the two third interfaces is different. Different archive images to be processed can be input into the corresponding preset processing model according to the different carrying capacity (a rotary switch is provided, and the rotary switch determines which first preset processing model the docking interface is associated with). For example, if the carrying capacity of the M docking interface is greater than that of the N carrying interface, if there are more archive images of the first category to be processed at present, the archive images of the first category to be processed are input into the first preset processing model through the M docking interface, and if there are more archive images of the second category to be processed at present, the archive images of the second category to be processed are input into the second preset processing model through the M docking interface. That is, in this embodiment, through the design of the third interface, the needs of actual applications can be better met.
[0116] In this embodiment, before the step of obtaining the archival image to be processed and performing initial recognition processing on the archival image to be processed to obtain the first type of archival image to be processed or the second type of archival image to be processed, the following steps are included:
[0117] Step B1, obtaining an archive image to be processed, and performing recognition processing of a preset size on the archive image to be processed;
[0118] Step B2, treating the to-be-processed archive images that do not conform to the preset size range as the second type of to-be-processed archive images;
[0119] Step B3, preprocessing the archive images to be processed that meet the preset size range, wherein the preprocessing includes grayscale processing, noise reduction and normalization processing;
[0120] Step B4, inputting the pre-processed archive image to be processed into the initial recognition model, and determining whether the image to be processed is blurred or wrinkled by the initial recognition model;
[0121] Step B5, treating the archival images to be processed without blur or wrinkles as the first category of archival images to be processed, and treating the archival images to be processed with blur or wrinkles as the second category of archival images to be processed; wherein the initial recognition model is obtained by iteratively training the first preset basic model based on the second training data with a preset second recognition label.
[0122] In the present embodiment, a method for distinguishing between the first type of archival images to be processed and the second type of archival images to be processed is also provided. Specifically, firstly, the archival images to be processed that do not meet the preset size range are regarded as the second type of archival images to be processed (those that meet the size range are regarded as the first type of archival images to be processed, which can avoid the subsequent cumbersome steps and save processes and resources); then, the archival images to be processed that meet the preset size range are preprocessed, wherein the preprocessing includes grayscale processing, noise reduction and normalization processing, and the preprocessed archival images to be processed are input into the initial recognition model, and the initial recognition model is used to determine whether the images to be processed are blurred or wrinkled; the archival images to be processed that do not have blur or wrinkles are regarded as the first type of archival images to be processed, and the archival images to be processed that have blur or wrinkles are regarded as the second type of archival images to be processed; since the initial recognition model is well trained, it can accurately identify the two types of archival images to be processed. In the present embodiment, it should be noted that only the images that need to be further identified are input into the initial recognition model, instead of all of them, so as to achieve balanced recognition resource consumption and recognition accuracy.
[0123] Based on the first and second embodiments of the present application, in the third embodiment of the present application, the same or similar contents as those in the above embodiments can be referred to the above introduction, and will not be described in detail later. Figure 3 , before the step of inputting the first type of archive images to be processed into the first preset processing model, it includes:
[0124] Step C1, obtaining first training data with a preset first identification label;
[0125] Step C2, inputting the first training data into a first preset basic model, and performing recognition processing on the first training data based on the first preset basic model to obtain a recognition result;
[0126] Step C3, performing a difference calculation between the recognition result and the preset first recognition tag to obtain an error result;
[0127] Step C4, based on the error result, determining whether the error result meets the error standard indicated by a preset error threshold range;
[0128] Step C5, if the error result does not meet the error standard indicated by the preset error threshold range, the model parameters of the first preset basic model are adjusted in an orderly manner, and the step of performing recognition processing on the first training data based on the first preset basic model is returned until the error result meets the error standard indicated by the preset error threshold range, and the training is stopped to obtain the first preset processing model, wherein the model parameters include not only weights but also hyper parameters.
[0129] In this embodiment, in obtaining the first preset processing model, since what is adjusted is not only the weights of each model parameter, but also the hyperparameters that constitute the basic model (the hyperparameters are adjusted using the preset hyperparameter optimization algorithm, and the hyperparameters include the number of ec grid points, the depth of the model nodes, etc.), the first preset processing model can be made more accurate, that is, the overall model can be accurately trained, thereby improving recognition accuracy.
[0130] The present application also provides a device for processing archive images, referring to Figure 5 , the device comprises:
[0131] The acquisition module 10 is used to acquire the archival image to be processed, perform initial recognition processing on the archival image to be processed, and obtain the first type of archival image to be processed or the second type of archival image to be processed, wherein the clarity of the first type of archival image to be processed is greater than that of the second type of archival image to be processed;
[0132] The processing module 20 is used to input the first type of archive images to be processed into the first preset processing model to obtain a first processing result, and input the second type of archive images to be processed into the preset recognition branch of the second preset processing model to obtain a second processing result, wherein the first preset processing model is obtained by iteratively training the first preset basic model based on the first training data with the preset first recognition label, and the second preset processing model is a bimodal contrast learning recognition model, and the second preset processing model has a preset recognition branch and a preset contrast learning branch, and the preset contrast learning branch uses contrast learning to enable the preset recognition branch to extract image features that are farther from negative sample features and closer to positive sample features at the feature layer in the process of predicting the second type of archive images to be processed, and the negative sample features are features of other modalities different from the image features, and the resource consumption of the first preset processing model is lower than that of the second preset processing model;
[0133] The output module 30 is used to output the first processing result and the second processing result.
[0134] In one embodiment, the archival image processing device is used to implement:
[0135] Determining a target processing volume of the archival images to be processed;
[0136] When the target processing volume is greater than or equal to the preset processing volume, and the current server-side load is less than the preset load, the first type of archive images to be processed are input into the first preset processing model through the preset system interface to obtain a first processing result, and the second type of archive images to be processed are input into the preset recognition branch of the second preset processing model through the preset system interface;
[0137] When the target processing volume is less than the preset processing volume, the first type of archival images to be processed are input into the first preset processing model through the preset user interface to obtain a first processing result, and the second type of archival images to be processed are input into the preset identification branch of the second preset processing model through the preset user interface, wherein the preset system interface and the preset user interface are connected to different objects.
[0138] In one embodiment, the archival image processing device is used to implement:
[0139] Acquire the archive image to be processed, and perform recognition processing of a preset size on the archive image to be processed;
[0140] The archive images to be processed that do not meet the preset size range are regarded as the second type of archive images to be processed;
[0141] Preprocessing the archive images to be processed that meet the preset size range, wherein the preprocessing includes grayscale processing, noise reduction and normalization processing;
[0142] Inputting the preprocessed archive image to be processed into the initial recognition model, and determining whether the image to be processed is blurred or wrinkled by the initial recognition model;
[0143] The archival images to be processed without blur or wrinkles are regarded as the first category of archival images to be processed, and the archival images to be processed with blur or wrinkles are regarded as the second category of archival images to be processed; wherein the initial recognition model is obtained by iteratively training the first preset basic model based on the second training data with a preset second recognition label.
[0144] In one embodiment, the overall loss function of the second preset processing model includes a recognition loss function corresponding to a preset recognition branch and a contrastive learning branch loss function corresponding to a preset contrastive learning branch;
[0145] The archival image processing device is used to implement:
[0146] Acquire sample data with a preset second identification tag, wherein the sample data includes a text sample and an image sample;
[0147] Determining image features based on the image sample with the preset second identification tag, and determining text features based on the text sample;
[0148] Based on the text features and the image features, determining a positive sample pair in which the image features and the text features are successfully matched, and determining a negative sample pair in which the image features and the text features are unmatched;
[0149] Based on the positive sample feature pairs, the negative sample feature pairs and the contrastive learning branch loss function, modal alignment is performed to train the contrastive learning branch, and based on the image features and the recognition loss function, the preset recognition branch is trained until the overall loss function is minimized, thereby obtaining a second preset processing model, wherein the contrastive learning branch of the current training round affects the preset recognition branch of the next training round.
[0150] In one embodiment, the weight relationship between the recognition loss function and the contrastive learning branch loss function and the overall loss function is not fixed.
[0151] In one embodiment, the archival image processing device is used to implement:
[0152] Acquire first training data with a preset first identification label;
[0153] Inputting the first training data into a first preset basic model, and performing recognition processing on the first training data based on the first preset basic model to obtain a recognition result;
[0154] Calculate the difference between the recognition result and the preset first recognition tag to obtain an error result;
[0155] Based on the error result, determining whether the error result meets an error standard indicated by a preset error threshold range;
[0156] If the error result does not meet the error standard indicated by the preset error threshold range, the model parameters of the first preset basic model are adjusted in an orderly manner, and the step of performing recognition processing on the first training data based on the first preset basic model is returned until the error result meets the error standard indicated by the preset error threshold range, and the training is stopped to obtain the first preset processing model, wherein the model parameters include not only weights but also hyper parameters.
[0157] Compared with the prior art, the beneficial effects of the archival image processing device provided in the present application are the same as the beneficial effects of the archival image processing method provided in the above-mentioned embodiment, and other technical features in the archival image processing device are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.
[0158] The present application provides an archival image processing device, the archival image processing device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the archival image processing method in the above-mentioned embodiment one.
[0159] Reference below Figure 4, which shows a schematic diagram of the structure of an archival image processing device suitable for implementing the embodiment of the present application. The archival image processing device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The archival image processing device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0160] like Figure 4 As shown, the archival image processing device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the archival image processing device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the processing device of the archive image to communicate with other devices wirelessly or by wire to exchange data. Although the processing device of the archive image with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0161] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0162] The archival image processing device provided by the present application adopts the archival image processing method in the above embodiment, which can solve the technical problem of archival image processing. Compared with the prior art, the beneficial effects of the archival image processing device provided by the present application are the same as the beneficial effects of the archival image processing method provided by the above embodiment, and other technical features in the archival image processing device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0163] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0164] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0165] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the archival image processing method in the above-mentioned embodiment.
[0166] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0167] The computer-readable storage medium may be included in the archival image processing device; or it may exist independently without being assembled into the archival image processing device.
[0168] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the archival image processing device, the archival image processing device executes the archival image processing method.
[0169] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the client computer, partially on the client computer, as a separate software package, partially on the client computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the client computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0170] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0171] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0172] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned archival image processing method, and can solve the technical problem of archival image processing. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the archival image processing method provided by the above-mentioned embodiment, and will not be repeated here.
[0173] The present application also provides a computer program product, comprising a computer program, which implements the steps of the above-mentioned archival image processing method when executed by a processor.
[0174] The computer program product provided by the present application can solve the technical problem of processing archive images. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the archive image processing method provided by the above embodiment, which will not be repeated here.
[0175] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for processing an archive image, characterized in that: The method comprises: Receiving the archival image to be processed, performing initial recognition processing on the archival image to be processed, and obtaining the first type of archival image to be processed or the second type of archival image to be processed, wherein the clarity of the first type of archival image to be processed is greater than that of the second type of archival image to be processed; Inputting the first type of archive images to be processed into the first preset processing model to obtain a first processing result, and inputting the second type of archive images to be processed into the preset recognition branch of the second preset processing model to obtain a second processing result, wherein the first preset processing model is obtained by iteratively training the first preset basic model based on the first training data with the preset first recognition label, and the second preset processing model is a bimodal contrast learning recognition model, and the second preset processing model has a preset recognition branch and a preset contrast learning branch, and the preset contrast learning branch uses contrast learning to enable the preset recognition branch to extract image features that are farther from negative sample features and closer to positive sample features at the feature layer in the process of predicting the second type of archive images to be processed, and the negative sample features are features of other modalities different from the image features, and the resource consumption of the first preset processing model is lower than the resource consumption of the second preset processing model; The first processing result and the second processing result are output.
2. The method according to claim 1, characterized in that The step of inputting the first type of archive images to be processed into the first preset processing model to obtain the first processing result, and inputting the second type of archive images to be processed into the preset recognition branch of the second preset processing model includes: Determining a target processing volume of the archival images to be processed; When the target processing volume is greater than or equal to the preset processing volume, and the current server-side load is less than the preset load, the first type of archive images to be processed are input into the first preset processing model through the preset system interface to obtain a first processing result, and the second type of archive images to be processed are input into the preset recognition branch of the second preset processing model through the preset system interface; When the target processing volume is less than the preset processing volume, the first type of archival images to be processed are input into the first preset processing model through the preset user interface to obtain a first processing result, and the second type of archival images to be processed are input into the preset identification branch of the second preset processing model through the preset user interface, wherein the preset system interface and the preset user interface are connected to different objects.
3. The method according to claim 1, characterized in that Before the step of obtaining the archival image to be processed and performing initial recognition processing on the archival image to be processed to obtain the first type of archival image to be processed or the second type of archival image to be processed, the method includes: Acquire the archive image to be processed, and perform recognition processing of a preset size on the archive image to be processed; The archive images to be processed that do not meet the preset size range are regarded as the second type of archive images to be processed; Preprocessing the archive images to be processed that meet the preset size range, wherein the preprocessing includes grayscale processing, noise reduction and normalization processing; Inputting the preprocessed archive image to be processed into the initial recognition model, and determining whether the image to be processed is blurred or wrinkled by the initial recognition model; The archival images to be processed without blur or wrinkles are regarded as the first category of archival images to be processed, and the archival images to be processed with blur or wrinkles are regarded as the second category of archival images to be processed; wherein the initial recognition model is obtained by iteratively training the first preset basic model based on the second training data with a preset second recognition label.
4. The method according to claim 1, characterized in that The overall loss function of the second preset processing model includes a recognition loss function corresponding to a preset recognition branch and a contrastive learning branch loss function corresponding to a preset contrastive learning branch; Before the step of inputting the second type of to-be-processed archive images into the preset recognition branch of the second preset processing model and obtaining the second processing result, the method includes: Acquire sample data with a preset second identification tag, wherein the sample data includes a text sample and an image sample; Determining image features based on the image sample with the preset second identification tag, and determining text features based on the text sample; Based on the text features and the image features, determining a positive sample pair in which the image features and the text features are successfully matched, and determining a negative sample pair in which the image features and the text features are unmatched; Based on the positive sample feature pairs, the negative sample feature pairs and the contrastive learning branch loss function, modal alignment is performed to train the contrastive learning branch, and based on the image features and the recognition loss function, the preset recognition branch is trained until the overall loss function is minimized, thereby obtaining a second preset processing model, wherein the contrastive learning branch of the current training round affects the preset recognition branch of the next training round.
5. The method according to claim 4, characterized in that The weight relationship between the recognition loss function and the contrastive learning branch loss function and the overall loss function is not fixed.
6. The method according to claim 1, characterized in that Before the step of inputting the first type of archive images to be processed into the first preset processing model, the method includes: Acquire first training data with a preset first identification label; Inputting the first training data into a first preset basic model, and performing recognition processing on the first training data based on the first preset basic model to obtain a recognition result; Calculate the difference between the recognition result and the preset first recognition tag to obtain an error result; Based on the error result, determining whether the error result meets an error standard indicated by a preset error threshold range; If the error result does not meet the error standard indicated by the preset error threshold range, the model parameters of the first preset basic model are adjusted in an orderly manner, and the step of performing recognition processing on the first training data based on the first preset basic model is returned until the error result meets the error standard indicated by the preset error threshold range, and the training is stopped to obtain the first preset processing model, wherein the model parameters include not only weights but also hyper parameters.
7. A device for processing archive images, characterized in that: The device comprises: An acquisition module, used for acquiring the archival images to be processed, performing initial recognition processing on the archival images to be processed, and obtaining the first type of archival images to be processed or the second type of archival images to be processed, wherein the clarity of the first type of archival images to be processed is greater than that of the second type of archival images to be processed; A processing module, used for inputting a first type of to-be-processed archival images into a first preset processing model to obtain a first processing result, and inputting a second type of to-be-processed archival images into a preset recognition branch of a second preset processing model to obtain a second processing result, wherein the first preset processing model is obtained by iteratively training a first preset basic model based on first training data having a preset first recognition label, and the second preset processing model is a bimodal contrastive learning recognition model, and the second preset processing model has a preset recognition branch and a preset contrastive learning branch, and the preset contrastive learning branch uses contrastive learning to enable the preset recognition branch to extract image features that are farther from negative sample features and closer to positive sample features at a feature layer in the process of predicting the second type of to-be-processed archival images, and the negative sample features are features of other modalities different from the image features, and the resource consumption of the first preset processing model is lower than that of the second preset processing model; An output module is used to output the first processing result and the second processing result.
8. An archival image processing device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the method for processing archival images according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the method for processing archival images as described in any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, which, when executed by a processor, implements the steps of the method for processing archival images according to any one of claims 1 to 6.