Industrial safety detection model cross-scene migration method

By introducing lighting and imaging distance transformation and KL divergence constraints in the industrial security detection model, the shortcomings of global feature alignment and full network fine-tuning methods are solved, and higher classification accuracy and stability are achieved in industrial environments where light and distance changes frequently.

CN120451891APending Publication Date: 2025-08-08SHANDONG SAIFEITE SAFETY ENG TECH DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510505357.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-22
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

In the prior art, the global feature alignment method does not model physical process parameters such as camera position and lighting intensity into calculating mathematical transformations, resulting in the feature space being unable to accurately reflect the actual imaging rules. In addition, the full network fine-tuning method requires the target domain annotation sample to achieve the available accuracy, which causes model degradation when the target domain data is insufficient, resulting in model overfitting.

Method used

The feature vectors of the source domain image are obtained through static feature encoding, and the transformation matrix is constructed to transform the target domain image by combining illumination intensity and imaging distance. The KL divergence and cross-entropy loss function are used to optimize the model, introduce a dynamic weight adjustment mechanism, balance the contribution of the loss function, and achieve consistency and adaptability of the feature distribution.

Benefits of technology

It improves the adaptability and accuracy of the model during cross-scene migration, especially in industrial environments where light and distance changes frequently, effectively retains the physical characteristic information of the image, reduces category aliasing phenomenon, avoids overfitting, and improves classification accuracy and robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120451891A_ABST
    Figure CN120451891A_ABST
Patent Text Reader

Abstract

The invention relates to a cross-scene migration method for an industrial safety detection model, which belongs to the technical field of cross-scene migration and comprises a static feature coding step, a parameter transformation adaptation step and a target scene monitoring step. The method comprises the following steps: acquiring an industrial safety monitoring model applied to a current scene, and extracting a first feature vector of a source domain image in the current scene through a backbone network of the industrial safety monitoring model; obtaining a target domain image, illumination intensity and a camera shooting distance in the target scene, constructing a transformation matrix, transforming the target domain image through the transformation matrix, and outputting a transformation image carrying illumination intensity information and camera shooting distance information; and inputting the transformed image into the backbone network for feature extraction to obtain a second feature vector, and inputting the first feature vector and the second feature vector into the classifier to obtain a classification result in the target scene, so that the adaptability of the model during cross-scene migration can be improved, the physical characteristic information of the image is effectively reserved, and the classification accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cross-scenario migration technology, and in particular to a cross-scenario migration method for an industrial safety detection model. Background Art

[0002] Current industrial safety detection algorithms mainly rely on two types of methods when migrating across scenarios. One is the global feature alignment method, such as the MMD method (Maximum Mean Discrepancy) and the CORAL method, which achieves migration by minimizing the overall feature distribution difference between the source domain and the target domain; the other is the full network fine-tuning method, which updates all parameters of the pre-trained model.

[0003] However, the global feature alignment methods mentioned above fail to model physical process parameters such as camera position and light intensity as computable mathematical transformations, resulting in a feature space that cannot accurately reflect actual imaging patterns. Global feature alignment can also disrupt class distinction boundaries, such as the appearance of category aliasing after MMD alignment of the feature distributions of the source and target domains.

[0004] Furthermore, full-network fine-tuning methods require a large number of labeled samples in the target domain to achieve usable accuracy. However, in real-world industrial scenarios, the availability of valid labeled samples is often limited, leading to model overfitting. This method also results in unnecessary updates to over 90% of the convolution kernel parameters, causing model degradation when insufficient target domain data is available. Summary of the Invention

[0005] In response to the shortcomings in the relevant technologies, the purpose of the present invention is to provide a method for cross-scene migration of industrial safety detection models to solve the technical problems in the existing technology, such as that the global feature alignment method does not consider the modeling of physical process parameters such as camera position and light intensity as computable mathematical transformations, resulting in the feature space being unable to accurately reflect the actual imaging laws, and that the global feature alignment will destroy the category discrimination boundary, and the full network fine-tuning method requires a large number of target domain labeled samples to achieve usable accuracy, which will cause model degradation when the target domain data is insufficient, resulting in model overfitting.

[0006] The present invention provides a method for migrating industrial safety detection models across scenarios, comprising the following steps:

[0007] Static feature encoding step: obtaining an industrial safety monitoring model applied to the current scene, and extracting a first feature vector of the source domain image in the current scene through the backbone network of the industrial safety detection model;

[0008] Parameter transformation adaptation step: obtaining a target domain image, light intensity, and camera distance in a target scene, constructing a transformation matrix based on the light intensity and the camera distance, transforming the target domain image using the transformation matrix, and outputting a transformed image carrying light intensity information and camera distance information;

[0009] Target scene monitoring step: input the transformed image carrying light intensity information and camera distance information into the backbone network for feature extraction to obtain a second feature vector, input the first feature vector and the second feature vector into the classifier to obtain the classification result under the target scene.

[0010] The embodiment of the present invention extracts the first eigenvector of the source domain image through a static feature encoding step, and transforms the light intensity and camera distance of the target domain image in combination with a parameter transformation adaptation step, and finally realizes classification in the target scene monitoring step, thereby improving the adaptability of the model in cross-scene migration, especially in scenes where the light and distance change frequently in industrial environments, and can effectively retain the physical characteristic information of the image, thereby improving the classification accuracy.

[0011] In some embodiments of the present invention, the method further comprises:

[0012] Model optimization step: obtain the classification result in the current scenario through the backbone network of the industrial safety detection model, define the loss function through KL divergence and cross entropy loss, and calculate the loss value according to the classification result in the current scenario and the classification result in the target scenario.

[0013] The embodiment of the present invention defines the loss function through KL divergence and cross entropy loss, and calculates the loss value based on the classification results of the source domain and the target domain. This can effectively constrain the feature distribution differences of the model during cross-scene migration, reduce the occurrence of category aliasing, and enhance the generalization ability of the model, so that it can still maintain a high classification accuracy when the target domain data is small. It also avoids the risk of overfitting caused by full network fine-tuning and reduces the consumption of computing resources.

[0014] In some embodiments of the present invention, the target scene monitoring step is specifically as follows:

[0015] The first feature vector and the second feature vector are input into a classifier, the classifier is constrained by the KL divergence, a predicted probability distribution is output according to the classifier, and a classification result in the target scenario is determined according to the predicted probability distribution.

[0016] This embodiment of the present invention uses KL divergence to constrain the predicted probability distribution of the classifier output, ensuring consistent feature distributions between the source and target domains. This effectively mitigates performance degradation caused by distribution differences during cross-scenario migration and improves the robustness of the model. By calculating and optimizing the probability distribution, the model can more accurately capture the classification features of the target scene, achieving more stable detection results in complex industrial environments.

[0017] In some embodiments of the present invention, the calculation model of the predicted probability distribution is:

[0018]

[0019] P s =softmax(Wz s ),P l =softmax(Wz′ t )

[0020] Among them, D KL (P s ‖P l ) is the KL divergence constraint; C is the number of categories in the target scene; W is the weight.

[0021] This embodiment of the present invention quantifies the feature differences between the source and target domains using a KL divergence calculation model and probability distribution formula. By introducing the Softmax function and weight matrix, the model can more flexibly adapt to the classification requirements of different scenarios, significantly improving the accuracy of cross-scenario migration and further optimizing the model training process.

[0022] In some embodiments of the present invention, the calculation model of the loss function is:

[0023] L=L CE (y s ,P s )+λD KL (P s ‖P l );

[0024] λ=0.5*(1+cos(πt / T));

[0025] Where λ is the dynamic weight; t is the current training round; T is the total training round; y s is the classification result in the current scenario.

[0026] This embodiment of the present invention balances the contributions of cross-entropy loss and KL divergence constraints through a dynamic weight adjustment mechanism, effectively avoiding convergence difficulties caused by excessive KL divergence in the early stages of model training. It also gradually strengthens the constraints on distribution consistency as training progresses. The introduction of dynamic weights significantly improves the model's training stability and ultimate performance, enabling it to perform better in cross-scenario migration tasks.

[0027] In some embodiments of the present invention, the parameter transformation and adaptation step specifically includes:

[0028] Mapping function construction step: constructing a light intensity mapping function according to the target domain image and the light intensity;

[0029] Transformation matrix construction step: constructing an affine transformation matrix according to the camera distance;

[0030] Physical parameter adaptation step: transforming the target domain image through the illumination intensity mapping function and the affine transformation matrix, and outputting a transformed image carrying illumination intensity information and camera distance information.

[0031] By converting light intensity and camera distance into computable mathematical transformations, the embodiment of the present invention enables the model to more accurately compensate for the influence of physical parameters on imaging features, thereby improving the accuracy of feature extraction. It solves the problem of feature distortion caused by ignoring physical parameters in traditional cross-scene migration methods, and provides more reliable technical support for industrial safety detection.

[0032] In some embodiments of the present invention, the calculation model of the light intensity mapping function is:

[0033] C l (x t )=x t *K ij ;

[0034]

[0035] Among them, x t is the target domain image; G l (x t ) is the illumination intensity mapping function; K is the Gaussian kernel; i and j are the coordinate parameters of the Gaussian kernel; I is the value of the illumination intensity.

[0036] This embodiment of the present invention constructs a light intensity mapping function using a Gaussian kernel function, enabling adaptive adjustment of the target domain image's lighting conditions. This effectively compensates for deviations in feature representation under varying lighting conditions, significantly improving the model's robustness in complex lighting environments. By dynamically adjusting the Gaussian kernel parameters, the model can flexibly adapt to lighting changes in different scenes, providing more accurate feature representation for cross-scene transfer.

[0037] In some embodiments of the present invention, the calculation model of the affine transformation matrix is:

[0038]

[0039] Among them, T d is the affine transformation matrix; s is the scale factor; D is the camera distance; S is the size of the target object; and f is the focal length.

[0040] This embodiment of the present invention rescales the target domain image using an affine transformation matrix to adapt to imaging requirements at different camera distances. This effectively addresses the issue of image scale inconsistency caused by distance variations and significantly improves feature extraction accuracy. By incorporating parameters such as focal length and target size, the model more realistically reflects actual imaging patterns, providing more reliable technical support for cross-scene migration.

[0041] In some embodiments of the present invention, the static feature encoding step further includes:

[0042] Extracting a first eigenvector of a source domain image in a current scene and a third eigenvector of a target domain image in the current scene through the backbone network of the industrial safety detection model, and obtaining a second eigenvector through the backbone network based on the third eigenvector;

[0043] The extraction model of the first feature vector is:

[0044] z s =f θ (x s )

[0045] Among them, z s is the first eigenvector; f θ () is the backbone network; x s is the source domain image in the current scene;

[0046] The extraction model of the third eigenvector is:

[0047] z t =f θ (x t )

[0048] Among them, z t is the third eigenvector; x t is the target domain image in the current scene.

[0049] By extracting multiple sets of feature vectors from the source and target domains, the embodiments of the present invention enhance the model's representational capabilities, effectively capturing key information in cross-scenario migration and significantly improving classification performance. Through the flexible application of the backbone network, the model can simultaneously process data from both the source and target domains, providing more comprehensive feature support for cross-scenario migration.

[0050] In some embodiments of the present invention, the extraction model of the second feature vector is:

[0051] x′ t =T d ·G l (x t );

[0052] z′ t =f θ (x′ t );

[0053] Where x′ t is the transformed image carrying the illumination intensity information and the camera distance information; z′ t is the second eigenvector.

[0054] This embodiment of the present invention implements feature encoding for transformed images, effectively preserving key information after illumination and distance transformations, significantly improving the model's classification accuracy in target scenes. Through multiple feature extractions within the backbone network, the model can more deeply mine discriminative features within images, providing stronger technical support for cross-scene migration. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0056] Figure 1 A flowchart of a method for migrating an industrial safety detection model across scenarios provided by an embodiment of the present invention;

[0057] Figure 2 An application flow chart of a cross-scenario migration method for an industrial safety detection model provided by an embodiment of the present invention;

[0058] Figure 3 This is a flowchart of a parameter transformation and adaptation step S2 provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0059] In order to make the purpose, technical solutions and advantages of this application more clearly understood, the present application is described and illustrated below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely used to explain this application and are not intended to limit this application. Based on the embodiments provided in this application, all other embodiments obtained by those of ordinary skill in the art without making any creative efforts are within the scope of protection of this application.

[0060] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0061] Cross-scenario migration refers to the technology of migrating the model trained in the current scenario to the target scenario. In an actual industrial scenario, the embodiment of the present application is used in a number of chemical plants where cameras are deployed. A camera layout condition (including but not limited to the installation position and light intensity in the factory) is selected as the source domain, and the changes in camera layout conditions in other factories are used as the target domain. The safety helmets worn by the operators are identified and detected using the industrial safety detection model. The detection objects include whether the operator wears a safety helmet and the color of the safety helmet. The pre-training process and parameter adjustment process of the industrial safety monitoring model are not expanded in detail here. The migration method of the present application can also be applied to factory environments such as electronic manufacturing and mechanical assembly.

[0062] In existing technologies, global feature alignment methods are often used for cross-scenario migration in the field of industrial safety testing. Global feature alignment methods achieve migration by minimizing the overall feature distribution differences between the source and target domains. This approach aims to eliminate inter-domain differences and ensure that the model's performance in the target domain is consistent with that in the source domain, eliminating the need for labeled data from the target domain. For example, the MMD method calculates the distance between two domains in the reproducing kernel Hilbert space, forcing distribution alignment; the CORAL method aligns the feature covariance matrices of the source and target domains.

[0063] However, global feature alignment methods ignore the impact of physical parameters such as camera distance and lighting intensity on imaging. For example, when the camera distance differs by more than 3 meters, the MMD method's AP50 performance in the helmet detection task drops by 18.7%. When the camera distance doubles, the target pixel area shrinks by a factor of four, but the MMD method fails to model the scale factor, resulting in distortion in the feature space.

[0064] In addition, the global feature alignment method will destroy the discriminative boundary by global alignment, resulting in an overlapping area of 32.4% between the source domain and target domain feature distribution, thereby reducing the classification accuracy.

[0065] When migrating across scenarios in the industrial safety testing field, full-network fine-tuning is often employed. This method performs end-to-end fine-tuning on all parameters of the pre-trained model on target domain data. By adjusting model parameters to adapt to the target domain distribution, it relies on a large amount of labeled data to optimize the model. However, full-network fine-tuning is highly data-dependent, typically requiring at least 5,000 labeled samples to achieve usable accuracy. In real-world industrial scenarios, however, there are typically fewer than 1,000 valid labeled samples, leading to overfitting.

[0066] In addition, the full-network fine-tuning method will also lead to parameter redundancy, causing more than 90% of the low-layer convolution parameters to be updated unnecessarily, wasting computing resources and easily causing model degradation.

[0067] In the absence of conflict, the embodiments of the present invention and the features thereof may be combined with each other.

[0068] The technical solution of the present invention is described in detail below in conjunction with specific embodiments and the accompanying drawings.

[0069] like Figure 1-Figure 2 As shown, the present invention provides a method for migrating industrial safety detection models across scenarios, comprising the following steps:

[0070] Static feature encoding step S1: obtaining an industrial safety monitoring model applied to the current scene, and extracting a first feature vector of the source domain image in the current scene through the backbone network of the industrial safety detection model; optionally, the backbone network of the industrial safety detection model is a ResNet-50 network, and by freezing the feature parameters of the first to fourth convolution kernels of the ResNet-50 network, retaining common features, extracting and outputting a 2048-dimensional first feature vector;

[0071] Parameter transformation adaptation step S2: obtaining the target domain image, light intensity, and camera distance of the target scene, constructing a transformation matrix based on the light intensity and camera distance, transforming the target domain image using the transformation matrix, and outputting a transformed image that carries the light intensity information and camera distance information;

[0072] Target scene monitoring step S3: Input the transformed image carrying the light intensity information and the camera distance information into the backbone network for feature extraction to obtain the second feature vector, input the first feature vector and the second feature vector into the classifier to obtain the classification result under the target scene.

[0073] Based on the above method, by extracting the first eigenvector of the source domain image and combining it with the parameter transformation adaptation step to transform the light intensity and camera distance of the target domain image, classification is finally achieved in the target scene monitoring step, which improves the adaptability of the model in cross-scene migration. Especially in scenes with frequent changes in lighting and distance in industrial environments, it can effectively retain the physical characteristics information of the image, thereby improving classification accuracy.

[0074] In some embodiments of the present invention, the cross-scenario migration method further includes:

[0075] Model optimization step S4: Obtain the classification results in the current scenario through the backbone network of the industrial safety detection model, define the loss function through KL divergence and cross entropy loss, and calculate the loss value based on the classification results in the current scenario and the classification results in the target scenario.

[0076] By defining the loss function through KL divergence and cross entropy loss, and calculating the loss value based on the classification results of the source and target domains, the model can effectively constrain the feature distribution differences during cross-scenario migration, reduce the occurrence of category aliasing, and enhance the generalization ability of the model, so that it can maintain high classification accuracy even when there is less data in the target domain. It also avoids the risk of overfitting caused by full network fine-tuning and reduces the consumption of computing resources.

[0077] In some embodiments of the present invention, the target scene monitoring step S3 is specifically as follows:

[0078] The first eigenvector and the second eigenvector are input into a classifier, the classifier is constrained by KL divergence, a predicted probability distribution is output according to the classifier, and the classification result in the target scenario is determined according to the predicted probability distribution; optionally, a fine-tunable fully connected layer is used as the classifier.

[0079] By constraining the predicted probability distribution of the classifier's output using KL divergence, we ensure consistent feature distributions between the source and target domains, effectively alleviating performance degradation caused by distribution differences during cross-scenario migration and improving the model's robustness. By calculating and optimizing the probability distribution, the model can more accurately capture the classification features of the target scene, achieving more stable detection results in complex industrial environments.

[0080] In some embodiments of the present invention, the calculation model for predicting probability distribution is:

[0081]

[0082] P s =softmax(Wz s ),P l =softmax(Wz′ t )

[0083] Among them, D KL (P s ‖P l ) is the KL divergence constraint; C is the number of classifications in the target scenario; W is the weight, and the weight is adjusted to minimize the combined loss of cross entropy loss and KL divergence constraint.

[0084] The KL divergence calculation model and probability distribution formula quantify the feature differences between the source and target domains. The introduction of the Softmax function and weight matrix allows the model to more flexibly adapt to the classification requirements of different scenarios, significantly improving the accuracy of cross-scenario migration and further optimizing the model training process.

[0085] In some embodiments of the present invention, the calculation model of the loss function is:

[0086] L=L CE (y s ,P s )+λD KL (P s ‖P l );

[0087] λ=0.5*(1+cos(πt / T));

[0088] Where λ is the dynamic weight; t is the current training round; T is the total training round; y s is the classification result in the current scenario.

[0089] Optionally, λ is adjusted through a cosine annealing strategy to balance the contributions of cross entropy loss and KL divergence loss, ensuring that cross entropy loss and KL divergence loss are properly considered during the optimization process. The adjustment range of λ is [0.1, 1.0].

[0090] Among them, the cosine annealing strategy is a learning rate adjustment strategy, which aims to optimize the model training effect by periodically adjusting the learning rate, especially in the later stage of training to help the model escape the local optimal solution and improve the generalization ability.

[0091] The dynamic weight adjustment mechanism balances the contributions of cross-entropy loss and KL divergence constraints, effectively avoiding convergence difficulties caused by excessive KL divergence in the early stages of model training. It also gradually strengthens the constraints on distribution consistency as training progresses. The introduction of dynamic weights significantly improves the model's training stability and final performance, enabling it to perform better in cross-scenario migration tasks.

[0092] refer to Figure 3 As shown, the parameter transformation and adaptation step S2 specifically includes:

[0093] Mapping function construction step S21: constructing a light intensity mapping function according to the target domain image and light intensity;

[0094] Transformation matrix construction step S22: constructing an affine transformation matrix according to the camera distance;

[0095] Physical parameter adaptation step S23: transforming the target domain image through the illumination intensity mapping function and the affine transformation matrix, and outputting a transformed image carrying illumination intensity information and camera distance information.

[0096] By converting light intensity and camera distance into computable mathematical transformations, the model can more accurately compensate for the impact of physical parameters on imaging features, thereby improving the accuracy of feature extraction. It solves the problem of feature distortion caused by ignoring physical parameters in traditional cross-scene migration methods, and provides more reliable technical support for industrial safety detection.

[0097] In some embodiments of the present invention, the calculation model of the light intensity mapping function is:

[0098] G l (x t )=x t *K ij ;

[0099]

[0100] Among them, x t is the target domain image; G l (x t ) is the illumination intensity mapping function; K is the Gaussian kernel; i and j are the coordinate parameters of the Gaussian kernel; I is the value of the illumination intensity.

[0101] The light intensity is a value of the light intensity near the identification target measured by a light sensor in the target scene.

[0102] Optionally, the Gaussian kernel K ij Usually K 3×3 or K 5×5 .

[0103] By constructing a light intensity mapping function using a Gaussian kernel function, we achieve adaptive adjustment of the target domain image's lighting conditions. This effectively compensates for feature representation deviations under varying lighting conditions, significantly improving the model's robustness in complex lighting environments. By dynamically adjusting the Gaussian kernel parameters, the model can flexibly adapt to lighting changes in different scenes, providing more accurate feature representation for cross-scene transfer.

[0104] In some embodiments of the present invention, the calculation model of the affine transformation matrix is:

[0105]

[0106] Among them, T dis the affine transformation matrix; s is the scale factor; D is the camera distance; S is the size of the target; f is the focal length.

[0107] By rescaling the target domain image using an affine transformation matrix to adapt to imaging requirements at different camera distances, this effectively addresses image scale inconsistencies caused by distance variations and significantly improves feature extraction accuracy. By introducing parameters such as focal length and target size, the model more realistically reflects actual imaging patterns, providing more reliable technical support for cross-scene migration.

[0108] In some embodiments of the present invention, the static feature encoding step S1 further includes:

[0109] The backbone network of the industrial safety detection model extracts the first eigenvector of the source domain image in the current scene and the third eigenvector of the target domain image in the current scene, and the backbone network extracts the second eigenvector based on the third eigenvector;

[0110] The extraction model of the first eigenvector is:

[0111] z s =f θ (x s )

[0112] Among them, z s is the first eigenvector; f θ () is the backbone network; x s is the source domain image in the current scene;

[0113] The extraction model of the third eigenvector is:

[0114] z t =f θ (x t )

[0115] Among them, z t is the third eigenvector; x t is the target domain image in the current scene.

[0116] By extracting multiple sets of feature vectors from the source and target domains, the model's representational capabilities are enhanced, effectively capturing key information in cross-scenario migration and significantly improving classification performance. Through the flexible application of the backbone network, the model can simultaneously process data from both the source and target domains, providing more comprehensive feature support for cross-scenario migration.

[0117] In some embodiments of the present invention, the extraction model of the second eigenvector is:

[0118] x′ t =T d ·G l (xt );

[0119] z′ t =f θ (x′ t );

[0120] Where x′ t is the transformed image carrying the information of light intensity and camera distance; z′ t is the second eigenvector.

[0121] By encoding the features of the transformed image, key information after illumination and distance transformations can be effectively preserved, significantly improving the model's classification accuracy in the target scene. Through multiple feature extractions in the backbone network, the model can more deeply explore the discriminative features in the image, providing stronger technical support for cross-scene migration.

[0122] When the target domain experiences extreme conditions with sudden changes in illumination, such as sudden changes in illumination at a workshop entrance or the activation of nighttime fill lights, the migration method of this embodiment can eliminate the impact of such extreme conditions on the detection model. This invention explicitly compensates for differences in illumination and distance through physical parameter modeling, making the feature space more consistent with actual imaging patterns and improving the AP50 for helmet detection from 72.1% to 89.3%.

[0123] By freezing the backbone network, retaining common features, and only fine-tuning the classifier, the adaptation time for new scenes is shortened from 72 hours to 4 hours with only 200 unlabeled images, and GPU memory usage is reduced by 58%.

[0124] Compared with the full network fine-tuning method, the cross-domain accuracy is improved by 12.7%; compared with the MMD method, the feature distribution difference is reduced by 23%.

[0125] It should be noted that the above is a reference method for migrating industrial safety detection models across scenarios, and the present invention is not limited to this.

[0126] The embodiments of the present invention achieve the goal of improving the adaptability of the model during cross-scene migration by transforming the light intensity and camera distance of the target domain image, especially in scenes where the light and distance change frequently in industrial environments, and can effectively retain the physical characteristic information of the image, thereby improving classification accuracy. It solves the technical problems that the global feature alignment method in the prior art does not consider the modeling of physical process parameters such as camera position and light intensity as computable mathematical transformations, resulting in the feature space being unable to accurately reflect the actual imaging laws, and the global feature alignment will destroy the category discrimination boundary. The full network fine-tuning method requires a large number of target domain labeled samples to achieve usable accuracy, which causes model degradation when the target domain data is insufficient, resulting in model overfitting.

[0127] Finally, it should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0128] The above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the same. Although the present invention has been described in detail with reference to preferred embodiments, persons skilled in the art should understand that the specific implementation methods of the present invention may still be modified or some technical features may be replaced by equivalents without departing from the spirit of the technical solutions of the present invention, and all of these should fall within the scope of the technical solutions claimed for protection by the present invention.

Claims

1. A cross-scenario migration method for industrial safety detection models, characterized in that: The steps include: Static feature encoding step: obtaining an industrial safety monitoring model applied to the current scene, and extracting a first feature vector of the source domain image in the current scene through the backbone network of the industrial safety detection model; Parameter transformation adaptation step: obtaining a target domain image, light intensity, and camera distance in a target scene, constructing a transformation matrix based on the light intensity and the camera distance, transforming the target domain image using the transformation matrix, and outputting a transformed image carrying light intensity information and camera distance information; Target scene monitoring step: input the transformed image carrying light intensity information and camera distance information into the backbone network for feature extraction to obtain a second feature vector, input the first feature vector and the second feature vector into the classifier to obtain the classification result under the target scene.

2. The cross-scenario migration method of industrial safety detection models according to claim 1 is characterized in that: The method further comprises: Model optimization step: obtain the classification result in the current scenario through the backbone network of the industrial safety detection model, define the loss function through KL divergence and cross entropy loss, and calculate the loss value according to the classification result in the current scenario and the classification result in the target scenario.

3. The cross-scenario migration method of industrial safety detection models according to claim 2 is characterized in that: The target scene monitoring steps are specifically as follows: The first feature vector and the second feature vector are input into a classifier, the classifier is constrained by the KL divergence, a predicted probability distribution is output according to the classifier, and a classification result in the target scenario is determined according to the predicted probability distribution.

4. The cross-scenario migration method of the industrial safety detection model according to claim 3 is characterized in that: The calculation model of the predicted probability distribution is: P s =softmax(Wz s ),P l =softmax(Wz′ t ) Among them, D KL (P s ‖P l ) is the KL divergence constraint; C is the number of categories in the target scene; W is the weight.

5. The cross-scenario migration method of industrial safety detection models according to claim 4 is characterized in that: The calculation model of the loss function is: L=L CE (y s ,P s )+λD KL (P s ‖P l ); λ=0.5*(1+cos(πt / T)); Where λ is the dynamic weight; t is the current training round; T is the total training round; y s is the classification result in the current scenario.

6. The cross-scenario migration method of industrial safety detection models according to claim 1 is characterized in that: The parameter transformation and adaptation step specifically includes: Mapping function construction step: constructing a light intensity mapping function according to the target domain image and the light intensity; Transformation matrix construction step: constructing an affine transformation matrix according to the camera distance; Physical parameter adaptation step: transforming the target domain image through the illumination intensity mapping function and the affine transformation matrix, and outputting a transformed image carrying illumination intensity information and camera distance information.

7. The cross-scenario migration method of industrial safety detection models according to claim 6 is characterized in that: in, The calculation model of the light intensity mapping function is: G l (x t )=x t *K ij ; Among them, x t is the target domain image; G l (x t ) is the illumination intensity mapping function; K is the Gaussian kernel; i and j are the coordinate parameters of the Gaussian kernel; I is the value of the illumination intensity.

8. The cross-scenario migration method of industrial safety detection models according to claim 7 is characterized in that: The calculation model of the affine transformation matrix is: Among them, T d is the affine transformation matrix; s is the scale factor; D is the camera distance; S is the size of the target object; and f is the focal length.

9. The method for migrating industrial safety detection models across scenarios according to any one of claims 1 to 9, characterized in that: The static feature encoding step further includes: Extracting a first eigenvector of a source domain image in a current scene and a third eigenvector of a target domain image in the current scene through the backbone network of the industrial safety detection model, and obtaining a second eigenvector through the backbone network based on the third eigenvector; The extraction model of the first feature vector is: z s =f θ (x s ) Among them, z s is the first eigenvector; f θ () is the backbone network; x s is the source domain image in the current scene; The extraction model of the third eigenvector is: z t =f θ (x t ) Among them, z t is the third eigenvector; x t is the target domain image in the current scene.

10. The method for cross-scenario migration of industrial safety detection models according to claim 9, characterized in that: The extraction model of the second feature vector is: x′ t =T d ·G l (x t ); z′ t =f θ (x′ t ); Where x′ t is the transformed image carrying the illumination intensity information and the camera distance information; z′ t is the second eigenvector.