Downhole image recognition model training method, device and electronic equipment

By training a downhole image recognition model and combining it with downhole scene transfer and distillation loss function optimization, the generated target image recognition model solves the problems of accuracy and efficiency in downhole safety helmet recognition, achieving efficient and low-cost safety helmet detection.

CN119963946BActive Publication Date: 2026-05-22CHINA COAL RES INST +1
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA COAL RES INST
Filing Date
2025-01-07
Publication Date
2026-05-22

AI Technical Summary

Technical Problem

In existing technologies, manual inspection of safety helmets is inefficient and susceptible to human factors, failing to meet the real-time inspection needs of underground operations. Furthermore, the intelligent development of industrial products places higher demands on the accuracy and efficiency of inspection.

Method used

A method for training downhole image recognition models is adopted. By acquiring initial teacher and student models and combining them with an image set of downhole scene transfers, a target image recognition model is generated. The training process is optimized using a distillation loss function to reduce costs and improve recognition accuracy.

Benefits of technology

The generated target image recognition model can efficiently identify safety helmets in downhole environments, reducing deployment and operating costs while improving recognition accuracy and adaptability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119963946B_ABST
    Figure CN119963946B_ABST
Patent Text Reader

Abstract

The present disclosure provides a downhole image recognition model training method and device and electronic equipment, comprising: training an initial teacher model based on a first image set to generate a target teacher model; training an initial student model based on the first image set and the target teacher model to generate a target student model; performing scene migration on a second image set according to a preset downhole scene to generate a third image set, and training the target student model based on the third image set to generate a target image recognition model. The target image recognition model generated by the above method not only learns the explicit knowledge of the teacher model, but also captures the implicit patterns and decision logic, thereby maintaining good performance and reducing the deployment and operation costs. Furthermore, retraining the target student model based on the second image set after scene migration can improve the practicality and prediction accuracy of the final generated target image recognition model in the downhole image recognition scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of image recognition technology, and in particular to a method, apparatus and electronic device for training downhole image recognition models. Background Technology

[0002] In coal mine production, worker safety is significantly impacted by current technological limitations and working conditions. Wearing a safety helmet is a crucial safety standard; correct and timely helmet use effectively protects workers and ensures normal mine production is not disrupted by unforeseen events. Therefore, to guarantee safety in production, it is essential to monitor helmet use. While manual helmet inspection was once the mainstream method, it is inefficient, susceptible to subjective human error, and cannot meet real-time monitoring requirements. Furthermore, the comprehensive intelligent development of manufacturing has placed new demands on the quality inspection of industrial products. Summary of the Invention

[0003] This disclosure aims to at least partially address one of the technical problems in the related art.

[0004] Therefore, one objective of this disclosure is to propose a method for training downhole image recognition models.

[0005] The second objective of this disclosure is to propose a training device for a downhole image recognition model.

[0006] The third objective of this disclosure is to propose an electronic device.

[0007] The fourth objective of this disclosure is to provide a non-transitory computer-readable storage medium.

[0008] The fifth objective of this disclosure is to provide a computer program product.

[0009] To achieve the above objectives, a first aspect of this disclosure proposes a method for training an underground image recognition model, comprising: acquiring a first image set, a second image set, an initial teacher model, and an initial student model; training the initial teacher model based on the first image set to generate a target teacher model; training the initial student model based on the first image set and the target teacher model to generate a target student model; performing scene transfer on the second image set according to a preset underground scene to generate a third image set, and training the target student model based on the third image set to generate a target image recognition model.

[0010] According to one embodiment of this disclosure, the step of performing scene transfer on the second image set according to a preset underground scene to generate a third image set includes: transforming the second image set using a pre-trained image transfer model to generate the third image set in the style of the underground scene.

[0011] According to one embodiment of this disclosure, training the initial student model based on the first image set and the target teacher model to generate a target student model includes: inputting the first image set into the target teacher model to generate target labels in the first image set; and training the initial student model based on the target labels and the first image set to generate the target student model.

[0012] According to one embodiment of this disclosure, training the initial student model based on the target label and the first image set to generate a target student model includes: inputting training samples from the first image set into the initial student model to obtain training labels output by the initial student model; calculating a loss value based on the training labels and the target label; adjusting the initial student model based on the loss value; and repeating the above steps of inputting training samples from the first image set into the initial student model and subsequent steps until training is completed, thereby generating the target student model.

[0013] According to one embodiment of this disclosure, calculating the loss value based on the training label and the target label includes: obtaining preset distillation control parameters and distillation temperature; establishing a distillation loss function based on the distillation control parameters and the distillation temperature; and calculating the loss value based on the distillation loss function for the training label and the target label.

[0014] According to one embodiment of this disclosure, the distillation loss function is: wherein, the For the target confidence loss, the For the target confidence prediction of the student model, the For the confidence level of the true target, the For distillation loss, the λ D The distillation control parameters are... For classification loss, the For the predicted category, the For the true category, the stated It is the softmax classification distribution of the teacher model, the stated For bounding box regression loss, the For bounding box prediction of the student model, the For matching the true bounding box, the The bounding box predicted by the student model, The bounding box is predicted by the teacher model, where T is the distillation temperature and i is the number of training iterations.

[0015] According to one embodiment of this disclosure, training the initial teacher model based on the first image set includes: dividing the first image set into a training set and a validation set according to a preset ratio, and setting training parameter values; training the initial teacher model based on the training set within the range of the training parameter values ​​until training is completed, so as to generate a teacher model to be verified; verifying the teacher model to be verified based on the validation set, and determining the teacher model to be verified as the target teacher model if the verification is successful.

[0016] To achieve the above objectives, a second aspect of this disclosure provides a training apparatus for an underground image recognition model, comprising: an acquisition module for acquiring a first image set, a second image set, an initial teacher model, and an initial student model; a first training module for training the initial teacher model based on the first image set to generate a target teacher model; a second training module for training the initial student model based on the first image set and the target teacher model to generate a target student model; and a generation module for performing scene transfer on the second image set according to a preset underground scene to generate a third image set, and training the target student model based on the third image set to generate a target image recognition model.

[0017] To achieve the above objectives, a third aspect of this disclosure provides an electronic 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, the instructions being executed by the at least one processor to implement the downhole image recognition model training method as described in the first aspect of this disclosure.

[0018] To achieve the above objectives, a fourth aspect of this disclosure provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to implement the downhole image recognition model training method as described in the first aspect of this disclosure.

[0019] To achieve the above objectives, a fifth aspect of this disclosure provides a computer program product, including a computer program that, when executed by a processor, is used to implement the downhole image recognition model training method as described in the first aspect of this disclosure.

[0020] Therefore, the target image recognition model generated by the above method can not only learn the explicit knowledge of the teacher model, but also capture the implicit patterns and decision logic. This reduces the deployment and operation costs while maintaining good performance. Furthermore, retraining the target student model based on the second image set after scene transfer can improve the practicality and prediction accuracy of the final generated target image recognition model in downhole image recognition scenarios. Attached Figure Description

[0021] Figure 1 This is a schematic diagram of a downhole image recognition model training method according to one embodiment of the present disclosure;

[0022] Figure 2 This is a schematic diagram of an underground safety helmet identification method according to one embodiment of this disclosure;

[0023] Figure 3 This is a schematic diagram of another downhole image recognition model training method according to one embodiment of the present disclosure;

[0024] Figure 4 This is a schematic diagram of another downhole image recognition model training method according to one embodiment of the present disclosure;

[0025] Figure 5 This is a schematic diagram of a downhole image recognition model training device according to one embodiment of the present disclosure;

[0026] Figure 6 This is a schematic diagram of an electronic device according to one embodiment of the present disclosure. Detailed Implementation

[0027] Embodiments of this disclosure are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this disclosure, and should not be construed as limiting this disclosure.

[0028] The acquisition, storage, use, and processing of data in this disclosed technical solution all comply with the relevant provisions of relevant laws and regulations.

[0029] It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, it does not mean that the applicant has used or necessarily used the solution.

[0030] Figure 1 This is a schematic diagram of a downhole image recognition model training method according to one embodiment of the present disclosure, as shown below. Figure 1As shown, the training method for the downhole image recognition model includes the following steps:

[0031] S101, obtain the first image set, the second image set, the initial teacher model, and the initial student model.

[0032] The downhole image recognition model training method of this application embodiment can be applied to the scenario of downhole safety helmet recognition. The execution subject of the downhole image recognition model training of this application embodiment can be the downhole image recognition model training device of this application embodiment, which can be installed on an electronic device.

[0033] In the embodiments disclosed herein, the first image set and the second image set may be manually created or may be collected in real time in the scenario where the model needs to be applied; no limitations are made here.

[0034] It should be noted that the first image set and the second image set also include tags, which can be carried on the images at the same time or can be marked later; no restrictions are made here.

[0035] It should be noted that the initial teacher model and the initial student model are pre-built and can be neural network models.

[0036] The task of the teacher model is to provide high-quality predictions that will be used to guide the learning of the student model. Teacher models are typically resource-intensive because they may have more layers, a larger parameter scale, or be the result of long-term training.

[0037] A student model is a smaller, simpler neural network model whose goal is to "learn" knowledge from a teacher model. Student models are typically much simpler in structure than teacher models, which reduces inference time, memory usage, and computational cost.

[0038] It should be noted that the initial teacher model can use YOLOv5 6.1 as the system's baseline model and be pre-trained on a general dataset to obtain basic weight parameters. Based on the pre-trained weights, the model can converge more quickly, improving training efficiency. During pre-training, parameters such as the learning rate and weight decay are adjusted to optimize the model, giving it higher generalization ability and laying the foundation for subsequent scene-adaptive training.

[0039] S102, The initial teacher model is trained based on the first image set to generate the target teacher model.

[0040] It is understandable that model training is an iterative process. The model is trained by continuously adjusting the network parameters until the overall loss function value of the model is less than the preset value, or the overall loss function value of the model no longer changes or changes slowly, and the model converges, resulting in a well-trained model.

[0041] In this embodiment of the disclosure, a loss value can be calculated based on the labels of the first image set and the labels output by the initial teacher model, and the model parameters of the initial teacher model can be adjusted based on the loss value. This process continues until the training is complete, at which point the target teacher model is generated.

[0042] It should be noted that the training termination conditions in this embodiment can be various, and no limitation is made here. For example, the training termination conditions can be that the training has reached a preset number of training iterations, or that the loss value is less than a loss threshold.

[0043] S103, The initial student model is trained based on the first image set and the target teacher model to generate the target student model.

[0044] S104, the second image set is transferred according to the preset underground scene to generate a third image set, and the target student model is trained based on the third image set to generate a target image recognition model.

[0045] In practice, the underground environment is dark and damp, and dust can contaminate the lenses of the image acquisition devices. Therefore, directly applying a trained target student model to image recognition operations underground does not yield good results.

[0046] Therefore, in this embodiment, after obtaining the target student model, the target student model is retrained based on the second image set after scene transfer. This can improve the practicality and prediction accuracy of the final generated target image recognition model.

[0047] In this embodiment, the preset underground scene is pre-designed and can be changed according to actual design and usage needs; no limitations are imposed here. For example, the preset underground scene can be a dark, dusty scene.

[0048] In this embodiment of the disclosure, there are various methods for scene migration of the second image set according to a preset underground scene, and no limitation is made here.

[0049] In one possible implementation, the second image set can be processed using a transfer model to generate a third image set. This transfer model is pre-designed and can be stored in the electronic device's storage space for easy retrieval when needed.

[0050] In another possible implementation, a transfer algorithm can be used to calculate the second image set to generate the image. This transfer algorithm is pre-designed and can be modified according to actual design needs, without any limitations here.

[0051] It should be noted that the target image recognition model in this embodiment can be applied to various scenarios, and no limitations are made here. For example, it can be applied to the scenario of underground safety helmet recognition. By recognizing whether underground workers are wearing safety helmets, the safety of underground operations can be improved. Figure 2 As shown, a target image recognition model is used to identify and lock onto safety helmets in images or videos sent by an image acquisition device.

[0052] In this embodiment, a first image set, a second image set, an initial teacher model, and an initial student model are first acquired. Then, the initial teacher model is trained based on the first image set to generate a target teacher model. Next, the initial student model is trained based on the first image set and the target teacher model to generate a target student model. Then, the second image set is transferred to a preset underground scene to generate a third image set. The target student model is then trained based on the third image set to generate a target image recognition model. Therefore, the target image recognition model generated by the above method can not only learn the explicit knowledge of the teacher model but also capture implicit patterns and decision logic. This reduces deployment and operating costs while maintaining good performance. Furthermore, retraining the target student model based on the transferred second image set can improve the practicality and prediction accuracy of the final target image recognition model in underground image recognition scenarios.

[0053] In this embodiment of the disclosure, the second image set is transferred according to a preset underground scene to generate a third image set. The second image set can be transformed by a pre-trained image transfer model to generate a third image set in the style of an underground scene.

[0054] It should be noted that the labels of the migrated third image set are exactly the same as those of the second image set.

[0055] It should be noted that, in order to adapt to the downhole environment, the image transfer model in this embodiment can be trained and generated based on images collected in real time downhole.

[0056] In the above embodiments, the initial student model is trained based on the first image set and the target teacher model to generate the target student model. It can also be achieved through... Figure 3 To further explain, the method includes:

[0057] S301, Input the first image set into the target teacher model to generate target labels from the first image set.

[0058] S302, The initial student model is trained based on the target label and the first image set to generate the target student model.

[0059] In this embodiment of the disclosure, training samples from the first image set can be input into the initial student model to obtain the training labels output by the initial student model. Then, the loss value is calculated based on the training labels and the target label. Finally, the initial student model is adjusted based on the loss value. The above steps of inputting training samples from the first image set into the initial student model and subsequent steps are repeated until the training is completed and the target student model is generated.

[0060] In the above embodiments, the loss value is calculated based on the training label and the target label. First, the preset distillation control parameters and distillation temperature are obtained. Then, a distillation loss function is established based on the distillation control parameters and distillation temperature. Finally, the training label and the target label are calculated based on the distillation loss function to obtain the loss value.

[0061] It's important to note that the distillation temperature (T) and distillation control parameters affect the shape of the probability distribution output by the teacher model. Lower temperatures result in a sharper distribution, meaning the highest probability value is significantly higher than others, similar to hard labeling. Conversely, higher temperatures smooth the distribution, with all categories having relatively large probability values, which helps the student model learn the decision boundaries and uncertainties of the teacher model. The distillation control parameters range from [0,1], with values ​​closer to 1 indicating a higher emphasis on the distillation loss and a higher emphasis on the detect loss.

[0062] It should be noted that the distillation loss function can be expressed as follows:

[0063]

[0064] Among them, among them, For target confidence loss, For predicting the target confidence score of the student model, Confidence level for the true target For distillation losses, λ D These are distillation control parameters. For classifying losses, For predicting categories, For the real category, It is the softmax classification distribution of the teacher model. For bounding box regression loss, For bounding box prediction of the student model, For matching the true bounding box, The bounding boxes predicted by the student model. is the bounding box predicted by the teacher model, T is the distillation temperature, and i is the number of training iterations.

[0065] It should be noted that, It is the loss of target confidence, including detection loss. Target confidence prediction for student model confidence level with respect to the true target Matching between them; and distillation loss Where λ D This represents the distillation control parameter, dist.

[0066] The classification loss is similar. include Category prediction for student models Compared to the real category Perform cross-entropy optimization; and distillation loss. The weights of the distillation loss component here are determined by the target confidence of the teacher model. The weighting is applied to ensure that the student model focuses more on samples that the teacher model deems important. It is the softmax classification distribution of the teacher model, which provides information on class correlation.

[0067] There's also the bounding box regression loss. It also includes two parts. Partial bounding box predictions for the student model Matching with the true bounding box Optimization is performed (e.g., L1 loss or IoU loss), followed by the distillation process. The weights of the distillation component are determined by the target confidence of the teacher model, representing the samples that the teacher model considers worth learning. The student model needs to align its bounding box predictions. bounding boxes predicted by the teacher model

[0068] Therefore, by scaling with a target, and by controlling the distillation control parameters and distillation temperature, the optimization direction and training effect of the final generated student model can be controlled, thereby improving the practicality of the disclosed solution.

[0069] In one possible implementation, the code for the distillation part can be obtained by modifying the training file, modifying the structure of the student network, adding new parameters, and preventing overlearning.

[0070] In the above embodiments, the initial teacher model is trained based on the first image set, and can also be trained by... Figure 4 To further explain, the method includes:

[0071] S401, Divide the first image set into a training set and a validation set according to a preset ratio, and set the training parameter values.

[0072] In this embodiment of the disclosure, the ratio of training set to validation set can be adjusted according to actual design needs.

[0073] It should be noted that the training parameter values ​​are the specific configuration parameters that control the model training. There are various possible values ​​for the training parameters, and no restrictions are placed here. For example, as shown in the table below:

[0074]

[0075] S402, based on the training set within the range of training parameter values, train the initial teacher model until training ends, in order to generate the teacher model to be validated.

[0076] S403: Validate the teacher model to be validated based on the validation set. If the validation passes, determine the teacher model to be validated as the target teacher model.

[0077] In this embodiment, a validation set can be input into the teacher model to be validated, and then the teacher model can be validated based on validation metrics to monitor the loss function and some performance metrics, such as precision and recall. It should be noted that the validation metrics in this embodiment can be various, and no limitation is made here; the specific metrics can be limited according to actual design needs. For example, the validation metrics can be shown in the table below:

[0078]

[0079]

[0080] During the validation process, model parameters (such as the IOU threshold) are adjusted based on the evaluation results to optimize the model's detection performance and computational efficiency, in order to generate the final target teacher model.

[0081] In this embodiment, yolov5m is used as the teacher model and yolov5s as the student model, and distillation is performed as an example. The model after distillation is compared with the model before distillation to observe whether the distillation reduces overhead while maintaining accuracy as much as possible.

[0082] Corresponding to the downhole image recognition model training methods provided in the above embodiments, one embodiment of this disclosure also provides a downhole image recognition model training device. Since the downhole image recognition model training device provided in this disclosure corresponds to the downhole image recognition model training methods provided in the above embodiments, the implementation methods of the above downhole image recognition model training methods are also applicable to the downhole image recognition model training device provided in this disclosure, and will not be described in detail in the following embodiments.

[0083] Figure 5 This is a schematic diagram of a downhole image recognition model training device according to one embodiment of the present disclosure, such as... Figure 5 As shown, the downhole image recognition model training device 500 includes: an acquisition module 510, a first training module 520, a second training module 530, and a generation module 540.

[0084] The acquisition module 510 is used to acquire the first image set, the second image set, the initial teacher model, and the initial student model.

[0085] The first training module 520 is used to train the initial teacher model based on the first image set to generate the target teacher model.

[0086] The second training module 530 is used to train the initial student model based on the first image set and the target teacher model to generate the target student model.

[0087] The generation module 540 is used to perform scene transfer on the second image set according to the preset underground scene to generate a third image set, and to train the target student model based on the third image set to generate a target image recognition model.

[0088] In one embodiment of this disclosure, the second image set is transferred according to a preset underground scene to generate a third image set, including: transforming the second image set through a pre-trained image transfer model to generate a third image set in the style of an underground scene.

[0089] In one embodiment of this disclosure, training an initial student model based on a first image set and a target teacher model to generate a target student model includes: inputting the first image set into the target teacher model to generate target labels in the first image set; and training the initial student model based on the target labels and the first image set to generate the target student model.

[0090] In one embodiment of this disclosure, training an initial student model based on a target label and a first image set to generate a target student model includes: inputting training samples from the first image set into the initial student model to obtain training labels output by the initial student model; calculating a loss value based on the training label and the target label; adjusting the initial student model based on the loss value; and repeating the above steps of inputting training samples from the first image set into the initial student model and subsequent steps until training is completed, thereby generating the target student model.

[0091] In one embodiment of this disclosure, calculating a loss value based on training labels and target labels includes: obtaining preset distillation control parameters and distillation temperature; establishing a distillation loss function based on the distillation control parameters and distillation temperature; and calculating the loss value based on the distillation loss function for the training labels and target labels.

[0092] In one embodiment of this disclosure, the distillation loss function is: in, For target confidence loss, For predicting the target confidence level of the student model, Confidence level for the true target For distillation losses, λ D These are distillation control parameters. For classifying losses, For predicting categories, For the real category, It is the softmax classification distribution of the teacher model. For bounding box regression loss, For bounding box prediction of the student model, For matching the true bounding box, The bounding boxes predicted by the student model. is the bounding box predicted by the teacher model, T is the distillation temperature, and i is the number of training iterations.

[0093] In one embodiment of this disclosure, training an initial teacher model based on a first image set includes: dividing the first image set into a training set and a validation set according to a preset ratio, and setting training parameter values; training the initial teacher model based on the training set within the range of training parameter values ​​until training is completed, to generate a teacher model to be validated; validating the teacher model to be validated based on the validation set, and determining the teacher model to be validated as the target teacher model if the validation passes.

[0094] Therefore, the target image recognition model generated by the above method can not only learn the explicit knowledge of the teacher model, but also capture the implicit patterns and decision logic. This reduces the deployment and operation costs while maintaining good performance. Furthermore, retraining the target student model based on the second image set after scene transfer can improve the practicality and prediction accuracy of the final generated target image recognition model in downhole image recognition scenarios.

[0095] To implement the above embodiments, this disclosure also proposes an electronic device 600. Figure 6 This is a schematic diagram of an electronic device according to one embodiment of the present disclosure, such as... Figure 6 As shown, the electronic device 600 includes: a processor 601 and a memory 602 communicatively connected to the processor. The memory 602 stores instructions executable by at least one processor. The instructions are executed by at least one processor 601 to implement the functions described in this disclosure. Figures 1-4 The example describes a method for training a downhole image recognition model.

[0096] To implement the above embodiments, this disclosure also proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to implement the present disclosure. Figures 1-4 The example describes a method for training a downhole image recognition model.

[0097] To implement the above embodiments, this disclosure also proposes a computer program product, including a computer program, which, when executed by a processor, implements the features of this disclosure. Figures 1-4 The example describes a method for training a downhole image recognition model.

[0098] It should be noted that personal information collected from users should be used for legitimate and reasonable purposes and should not be shared or sold outside of these legitimate uses. Furthermore, such collection / sharing should only be conducted after receiving the user's informed consent, including but not limited to notifying the user to read the user agreement / user notice and sign an agreement / authorization that includes authorization of relevant user information before the user uses the function. In addition, any necessary steps must be taken to protect and safeguard access to such personal information data and ensure that others with access to personal information data comply with their privacy policies and procedures.

[0099] This application is intended to provide an implementation scheme for users to selectively prevent the use or access to their personal information data. Specifically, this disclosure is intended to provide hardware and / or software to prevent or block access to such personal information data. Once personal information data is no longer needed, risks can be minimized by restricting data collection and deleting data. Furthermore, where applicable, such personal information is de-identified to protect user privacy.

[0100] In the foregoing descriptions of the embodiments, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0101] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0102] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.

[0103] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that contains, stores, communicates, propagates, or transmits programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.

[0104] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0105] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.

[0106] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0107] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.

Claims

1. A method for training a downhole image recognition model, characterized in that, include: Obtain the first image set, the second image set, the initial teacher model, and the initial student model; The initial teacher model is trained based on the first image set to generate the target teacher model; Training the initial student model based on the first image set and the target teacher model to generate the target student model includes: The first image set is input into the target teacher model to generate target labels from the first image set; The training samples from the first image set are input into the initial student model to obtain the training labels output by the initial student model; Calculate the loss value based on the training labels and the target labels; The initial student model is adjusted based on the loss value, and the above steps of inputting training samples from the first image set into the initial student model and subsequent steps are repeated until the training ends, generating the target student model. The calculation of the loss value includes: Obtain the preset distillation control parameters and distillation temperature; A distillation loss function is established based on the distillation control parameters and the distillation temperature, wherein the distillation loss function is expressed as: in, For bounding box regression loss, For matching the true bounding box, For bounding box prediction of the student model, The bounding boxes predicted by the teacher model. These are distillation control parameters. For classifying losses, For the real category, It is the softmax classification distribution of the teacher model. For target confidence loss, Confidence level for the true target For predicting the target confidence level of the student model, It is the target confidence level of the teacher model; The target confidence loss includes detection loss and distillation loss. Detection loss represents the match between the student model's predicted target confidence and the true target confidence. Distillation loss is... ; The classification loss includes cross-entropy optimization between the student model's class predictions and the true class, as well as distillation loss. The weights of the distillation loss are weighted by the target confidence of the teacher model; The bounding box loss includes optimizing the matching between the student model's bounding box predictions and the ground truth bounding boxes, as well as distillation loss. The weight of the distillation loss is determined by the target confidence of the teacher model, which represents the samples that the teacher model considers worth learning; The training labels and the target labels are calculated based on the distillation loss function to obtain the loss value; The second image set is transferred according to a preset underground scene to generate a third image set, and the target student model is trained based on the third image set to generate a target image recognition model.

2. The method according to claim 1, characterized in that, The step of performing scene migration on the second image set according to a preset underground scene to generate a third image set includes: The second image set is transformed using a pre-trained image transfer model to generate the third image set in the style of an underground scene.

3. The method according to claim 1, characterized in that, The training of the initial teacher model based on the first image set includes: The first image set is divided into a training set and a validation set according to a preset ratio, and training parameter values ​​are set. Based on the training set within the range of the training parameter values, the initial teacher model is trained until the training ends, so as to generate a teacher model to be verified. The teacher model to be verified is verified based on the verification set. If the verification is successful, the teacher model to be verified is determined to be the target teacher model.

4. A downhole image recognition model training device, characterized in that, include: The acquisition module is used to acquire the first image set, the second image set, the initial teacher model, and the initial student model. The first training module is used to train the initial teacher model based on the first image set to generate the target teacher model; The second training module is used to train the initial student model based on the first image set and the target teacher model to generate the target student model; The second training module is specifically used for: The first image set is input into the target teacher model to generate target labels from the first image set; The training samples from the first image set are input into the initial student model to obtain the training labels output by the initial student model; Calculate the loss value based on the training labels and target labels; The initial student model is adjusted based on the loss value, and the above steps of inputting training samples from the first image set into the initial student model and subsequent steps are repeated until the training ends, generating the target student model. The calculation of the loss value includes: Obtain the preset distillation control parameters and distillation temperature; A distillation loss function is established based on the distillation control parameters and the distillation temperature, wherein the distillation loss function is expressed as: in, For bounding box regression loss, For matching the true bounding box, For bounding box prediction of the student model, The bounding boxes predicted by the teacher model. These are distillation control parameters. For classifying losses, For the real category, It is the softmax classification distribution of the teacher model. For target confidence loss, Confidence level for the true target For predicting the target confidence score of the student model, It is the target confidence level of the teacher model; The target confidence loss includes detection loss and distillation loss. Detection loss represents the match between the student model's predicted target confidence and the true target confidence. Distillation loss is... ; The classification loss includes cross-entropy optimization between the student model's class predictions and the true class, as well as distillation loss. The weights of the distillation loss are weighted by the target confidence of the teacher model; The bounding box loss includes optimizing the matching between the student model's bounding box predictions and the ground truth bounding boxes, as well as distillation loss. The weight of the distillation loss is determined by the target confidence of the teacher model, which represents the samples that the teacher model considers worth learning; The training labels and the target labels are calculated based on the distillation loss function to obtain the loss value; The generation module is used to perform scene migration on the second image set according to a preset underground scene to generate a third image set, and to train the target student model based on the third image set to generate a target image recognition model.

5. An electronic device, characterized in that, Including memory and processor; The processor reads executable program code stored in the memory to run a program corresponding to the executable program code, so as to implement the method as described in any one of claims 1-3.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-3.