Infrared image hot spot segmentation method, model training method, device and medium
By constructing a dynamic fitting model and adjusting the k-value of the labels from multiple infrared images, the problem of inconsistent hot spot segmentation results in different scenarios using the interquartile range detection method was solved, and high-precision hot spot segmentation of infrared images was achieved.
Patent Information
- Application Number
- CN202211622140.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-16
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2042-12-16
AI Technical Summary
In existing technologies, the interquartile range detection method does not consider the distribution characteristics of temperature data in single-channel infrared temperature distribution images with high tension and low resolution, resulting in significant differences in hot spot segmentation effects of infrared images under different scenes and time periods.
By acquiring multiple infrared images from different scenes and time points, a dynamic fitting model is constructed. The dynamic fitting model training method is used to adjust the model based on image features and label k values until the model converges, and the hot spot segmentation threshold is dynamically determined.
It achieves accurate hotspot segmentation of infrared images in various scenarios, improving the accuracy and applicability of hotspot segmentation.
Smart Images

Figure CN116797621B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of infrared imaging technology, and in particular to an infrared image hotspot segmentation method, model training method, device, and medium. Background Technology
[0002] For high-tensile-rate, low-resolution single-channel infrared temperature distribution images, thresholding methods with low algorithm complexity are generally used to determine the hot spot segmentation threshold in the infrared image. The most common threshold calculation method is the interquartile range (IQR) detection method. This method treats hot spots in the infrared image as anomalous blocks distinct from the background region and segments all hot spots together using a threshold. Specifically, it uses the interquartile range (IQR) of the boxplot to detect outliers, providing a standard for outlier identification: values greater than QU + K * IQR are considered outliers.
[0003] IQR: Interquartile Range, is the difference between the upper quartile (QU) and the lower quartile (QL), i.e., (75th quartile - 25th quartile), encompassing half of all observations; QL: Lower quartile, i.e., the 25th quartile, indicating that one-quarter of all observations have values smaller than it; QU: Upper quartile, i.e., the 75th quartile, indicating that one-quarter of all observations have values larger than it; K: An empirical coefficient, typically set to 1.5, corresponding to a moderately abnormal range, and 3, corresponding to a severely abnormal range.
[0004] It can be seen that the existing interquartile range detection method uses a relatively fixed calculation method to determine outliers, without taking into account the distribution characteristics of temperature data. This also leads to significant differences in the hot spot segmentation effect of infrared images collected in different scenarios and at different time periods. Summary of the Invention
[0005] Therefore, it is necessary to provide infrared image hotspot segmentation methods, model training methods, equipment, and media to solve the problem that existing methods do not take into account the distribution characteristics of temperature data, resulting in large differences in hotspot segmentation effects among different infrared images.
[0006] A method for training a dynamic fitting model, the method comprising:
[0007] Acquire L training images; where the acquisition scenarios or acquisition time points of different training images are different;
[0008] Obtain the hot spot segmentation threshold labeled for each image to be trained, and calculate the corresponding label k value based on the hot spot segmentation threshold to obtain the label k value corresponding to each of the L images to be trained.
[0009] An image feature set is constructed based on the temperature distribution within each image to be trained, so as to obtain the image feature set corresponding to each of the L images to be trained.
[0010] A dynamic fitting model is constructed based on the label k value and image feature set corresponding to each of the L images to be trained, and the fitting k value output by the dynamic fitting model is obtained. The dynamic fitting model is adjusted based on the difference between the label k value and the fitting k value until the dynamic fitting model converges.
[0011] In one embodiment, acquiring L images to be trained includes:
[0012] An infrared image set is acquired, and infrared images are extracted from each scene in the infrared image set at equal time intervals to obtain N candidate infrared images; wherein, the infrared image set includes multiple infrared images acquired in multiple scenes and multiple time periods;
[0013] In the N candidate infrared images, the similarity between all infrared image groups is calculated and all infrared image groups are sorted based on the similarity to obtain an infrared image sequence. M pairs of infrared image groups with equal first similarity are extracted from the infrared image sequence; wherein each infrared image group consists of any two images from the N candidate infrared images.
[0014] In the M pairs of infrared images, duplicate infrared images are removed to obtain Z images to be trained.
[0015] The Z training images are expanded based on the N candidate infrared images to obtain L training images.
[0016] In one embodiment, the step of expanding the Z training images based on the N candidate infrared images to obtain L training images includes:
[0017] In a cyclical manner, an infrared image that meets the expansion condition is added to the image set to be trained from the non-training image set until there are no infrared images in the non-training image set that meet the expansion condition. The image set to be trained initially consists of the Z images to be trained, and the image set to be trained consists of all infrared images in the N candidate infrared images other than those in the image set to be trained. The expansion condition is that there exists an infrared image in the non-training image set whose similarity to all the infrared images to be trained in the current image set is greater than a second similarity, and the second similarity is less than the first similarity.
[0018] In one embodiment, after extracting infrared images from each scene of the infrared image set at equal time intervals to obtain N candidate infrared images, the method further includes:
[0019] Within each candidate infrared image, all temperature values lower than the first preset quantile are updated to the first preset quantile, and all temperature values higher than the second preset quantile are updated to the second preset quantile; wherein, the first preset quantile is less than the 25th percentile, and the second preset quantile is greater than the 75th percentile;
[0020] Normalization is performed based on the first preset quantile, the second preset quantile, and all temperature values that have not been updated;
[0021] After obtaining the hotspot segmentation threshold labeled for each image to be trained, the process further includes:
[0022] All acquired hot spot segmentation thresholds are normalized.
[0023] In one embodiment, the formula for calculating the corresponding tag k value based on the hot spot segmentation threshold is:
[0024]
[0025] The P% quantile indicates the adjusted preset quantile, where P% < 75%.
[0026] In one embodiment, constructing an image feature set based on the temperature distribution within each image to be trained includes:
[0027] Within each training image, the temperature values of all pixels are divided into multiple intervals based on a preset temperature interval, and the number of pixels falling within each interval is counted as the first image feature.
[0028] Calculate the interquartile range as a second image feature;
[0029] The first image feature and the second image feature are used as the image feature set.
[0030] In one embodiment, the step of constructing a dynamic fitting model based on the label k values and image feature sets corresponding to the L images to be trained includes:
[0031] Obtain n sets of training input data; where each set of training input data includes: multiple training samples, and each training sample includes the label k value and image feature set corresponding to an image to be trained;
[0032] For each set of training input data, the Gini coefficient under different features in the image feature set is calculated, and a decision tree corresponding to each set of input data is constructed based on the principle of minimizing the Gini coefficient. The random forest composed of the obtained n decision trees is used as the dynamic fitting model. Each decision tree uses signal features as judgment nodes, and the signal features with small Gini coefficients are the parent nodes of signal features with large Gini coefficients.
[0033] A method for segmenting hot spots in infrared images, the method comprising:
[0034] Acquire the infrared image to be segmented, and construct an image feature set based on the temperature distribution within the infrared image to be segmented;
[0035] The image feature set of the infrared image to be segmented is input into a dynamic fitting model, and the target k value is obtained from the output; wherein, the dynamic fitting model is trained by the method described in claim 1;
[0036] The hot spot segmentation threshold of the infrared image to be segmented is calculated based on the target k value, and the hot spot in the infrared image to be segmented is segmented based on the hot spot segmentation threshold.
[0037] A computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the infrared image hotspot segmentation method and model training method described above.
[0038] An infrared image hotspot segmentation device includes a memory and a processor. The memory stores a computer program, which, when executed by the processor, causes the processor to perform the steps of the infrared image hotspot segmentation method and the model training method described above.
[0039] This invention provides an infrared image hotspot segmentation method, model training method, device, and medium. In the model training phase, L training images are first acquired. The acquisition scenarios or time points of the different training images differ, ensuring the images are differentiated. Further, a hotspot segmentation threshold is obtained for each training image, and a corresponding label k-value is calculated based on the hotspot segmentation threshold to obtain the label k-values for each of the Z training images. This label k-value indicates the actual k-value for each training image. Further, an image feature set is constructed based on the temperature distribution within each training image to obtain the image feature sets for each of the Z training images. This considers the distribution characteristics of temperature data within each training image, facilitating the dynamic determination of the k-value based on the temperature distribution. Finally, the model is constructed and continuously optimized, including building a dynamic fitting model based on the label k-values and image feature sets for each of the Z training images, obtaining the fitted k-values output by the dynamic fitting model, and adjusting the constructed dynamic fitting model based on the difference between the label k-values and the fitted k-values until the constructed dynamic fitting model converges. In practical applications, an image feature set can be constructed based on the temperature distribution within the infrared image to be segmented. This image feature set can be input into a trained dynamic fitting model to obtain a target k value that matches the infrared image to be segmented, rather than a fixed empirical k value. Furthermore, by combining this with the existing interquartile range detection method, accurate hot spot segmentation can be achieved in various scenarios. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] in:
[0042] Figure 1 This is a schematic diagram of cutting a hot spot based on the existing interquartile range detection method in one embodiment;
[0043] Figure 2 This is a flowchart illustrating the training method for a dynamically fitted model in one embodiment.
[0044] Figure 3 This is a schematic diagram of the process of obtaining L images to be trained in one embodiment;
[0045] Figure 4 This is a flowchart illustrating the normalization operation on N candidate infrared images in one embodiment.
[0046] Figure 5 This is a schematic diagram illustrating the process of constructing an image feature set in one embodiment;
[0047] Figure 6 This is a flowchart illustrating the process of constructing a dynamic fitting model in one embodiment;
[0048] Figure 7 This is a schematic diagram illustrating the output of the fitted k value through a dynamic fitting model in one embodiment.
[0049] Figure 8 This is a flowchart illustrating an infrared image hotspot segmentation method in one embodiment;
[0050] Figure 9 This is a comparative schematic diagram of the hot spot segmentation effect in one embodiment;
[0051] Figure 10 This is a structural block diagram of an infrared image hotspot segmentation device in one embodiment. Detailed Implementation
[0052] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0053] The technical problem addressed by this invention is as follows: From the existing interquartile range (IQR) threshold formula for calculating high-temperature anomaly points, it can be seen that when K is greater than 0, the threshold must be greater than the base threshold QU, which is greater than the 75th percentile. This means that the area of hot spots in the image must be less than 25% of the total image area; otherwise, large hot spots will be reduced, causing segmentation distortion. For example… Figure 1 Image (a) shows the infrared image before segmentation, which includes a large hot spot, occupying approximately one-third of the image area. However, after calculating the threshold using the formula QU+1.5*IQR and segmenting the hot spot, the result is as follows: Figure 1 The hot spot image shown in (b) only has some color patches at extremely high temperatures extracted, and most of the hot spot components have been removed, resulting in severe distortion.
[0054] The above examples reveal that when the area of a hotspot is relatively large compared to the total area in a scene, the hotspot can no longer be considered an anomalous block. Using a fixed empirical value of k to calculate the threshold may result in an overestimation, leading to the hotspot being clipped. Therefore, this invention sets the coefficient K in the formula to no longer take a fixed empirical value, such as... Figure 2 As shown, Figure 2This is a flowchart illustrating the training method of a dynamic fitting model in one embodiment. The dynamic fitting model can dynamically select the value k based on the temperature distribution of the temperature map, so that the calculated threshold is more consistent with the actual scenario and ensures the accuracy of segmentation.
[0055] The training method for the dynamic fitting model in this embodiment includes the following steps:
[0056] S201, Obtain L images to be trained.
[0057] The different training images are acquired in different scenarios or at different times. In other words, this step aims to acquire as many infrared images as possible with different temperature distributions as training images.
[0058] In one specific embodiment, such as Figure 3 As shown, L training images are obtained through the following specific steps:
[0059] S2011, Obtain an infrared image set, extract infrared images from each scene of the infrared image set at equal time intervals to obtain N candidate infrared images.
[0060] The infrared image set comprises multiple infrared images captured across multiple scenes and time periods. For example, in scene A (station), multiple infrared images are continuously captured between 12:00 and 1:00, and again between 5:00 and 6:00. In scene B (alley), multiple infrared images are continuously captured between 12:00 and 1:00, and again between 5:00 and 6:00. In scene C (restaurant), multiple infrared images are continuously captured between 12:00 and 1:00, and again between 5:00 and 6:00. All these infrared images constitute the infrared image set. Then, infrared images are extracted at equal intervals, for example, one image per minute, forming N candidate infrared images. It is understood that the scenes, time periods, and time intervals can be set according to requirements and are not specifically limited.
[0061] Optionally, considering that K is a dimensionless value, independent of the magnitude of the temperature data but related to the distribution of temperature values, i.e., related to the quantity corresponding to each type of temperature value, to simplify subsequent calculations, such as... Figure 4 As shown, the following operations can also be performed:
[0062] S2012a, in each candidate infrared image, all temperature values less than the first preset quantile are updated to the first preset quantile, and all temperature values greater than the second preset quantile are updated to the second preset quantile.
[0063] The first preset quantile is less than the 25th quantile, and the second preset quantile is greater than the 75th quantile. For example, the first preset quantile is the 5th quantile, and the second preset quantile is the 99th quantile. This operation does not change the 25th and 75th quantiles of the frame data, and therefore does not change the K value corresponding to the frame data, but it can improve the efficiency of subsequent normalization processing.
[0064] S2012b performs normalization based on the first preset quantile, the second preset quantile, and all temperature values that have not been updated.
[0065]
[0066] Where new_t is the normalized temperature value, t is the temperature value before normalization, min_v is the first preset quantile, and max_v is the second preset quantile.
[0067] This allows for the fastest normalization of temperature values within N candidate infrared images to the same range, and also improves the efficiency of subsequent calculations.
[0068] S2013, in N candidate infrared images, calculate the similarity between all infrared image groups and sort all infrared image groups based on the size of the similarity to obtain an infrared image sequence, and extract M pairs of infrared image groups with equal first similarity in the infrared image sequence.
[0069] Each infrared image group consists of any two images from N candidate infrared images. For example, if the N candidate infrared images are numbered 1, 2, 3, then there are three infrared image groups: 12, 13, and 23. When calculating similarity, for an infrared image with 24*32 = 768 temperature point values in one frame, the following formula is used:
[0070]
[0071] Where, x n and y n These are the temperature values at coordinate position n for two infrared images within the same infrared image group.
[0072] Furthermore, by arranging the similarity between each pair of N frames of data in ascending order, an infrared image sequence can be obtained, and M pairs of data can be extracted at the first similarity d1. Here, the first similarity d1 depends on the amount that can be manually labeled. The smaller d1 is, the larger M can be obtained, and the more data needs to be labeled. Since this step is a coarse selection, d1 can be set slightly larger.
[0073] S2015, in the M pairs of infrared images, duplicate infrared images are removed to obtain Z images to be trained.
[0074] That is, in 2M infrared images, only one duplicate image is kept, leaving Z infrared images as training images. Since the distance between these Z frames meets the two key points of spanning the maximum range and being relatively uniform, the K value corresponding to each frame also has a large difference.
[0075] S2017, based on N candidate infrared images, expand Z training images to obtain L training images.
[0076] Considering that the K values corresponding to the Z images to be trained obtained after the initial selection in S2015 are not uniform enough and are not numerous enough, further fine screening can be performed to select more infrared images from the N candidate infrared images.
[0077] Specifically, in a iterative process, an infrared image that meets the expansion criteria is added to the training image set from the non-training image set until no infrared image that meets the expansion criteria remains in the non-training image set, resulting in L training images. The initial training image set consists of Z training images, and the non-training image set comprises all infrared images from the N candidate infrared images excluding those in the training image set. The expansion criteria are that there exists an infrared image in the non-training image set whose similarity to all training infrared images in the current training image set is greater than a second similarity d2, and the second similarity d2 is less than a first similarity d1.
[0078] For example, at the beginning of the expansion, the training image set includes the Z training images obtained in S2015, and the non-training image set includes NZ infrared images. The two image sets do not overlap. Among these NZ infrared images, if there exists an infrared image A whose similarity to all of the current Z training images is greater than the second similarity d2, then infrared image A is added to the training image set. At this time, the training image set includes Z+1 training images, and the non-training image set includes NZ-1 infrared images. The above expansion steps are repeated until there are no infrared images in the non-training image set that meet the expansion conditions, thus obtaining L training images.
[0079] After the above processing, we can obtain a sufficient number of training images with sufficiently uniform k values. It is understood that N, M, Z, and L in the above are preset values and can be set according to actual needs. For example, N = 10000, M = 1000, Z = 1500, L = 5000.
[0080] S202, obtain the hot spot segmentation threshold labeled for each image to be trained, and calculate the corresponding label k value based on the hot spot segmentation threshold to obtain the label k value corresponding to each of the L images to be trained.
[0081] Because the k values of the L training images obtained based on S201 are sufficiently uniform, the hotspot segmentation thresholds will also be sufficiently uniform. It can be understood that for a training image, if the proportion of hotspots is larger, the hotspot segmentation threshold should be smaller, and vice versa. The annotators mark the hotspot segmentation thresholds based on the hotspot contours in the images, obtaining L hotspot segmentation thresholds for each of the L training images. Optionally, the L hotspot segmentation thresholds can also be normalized.
[0082] Optionally, a calculation formula based on the existing hotspot segmentation threshold can be used:
[0083] Hotspot segmentation threshold = 75th percentile + label K value * (75th percentile - 25th percentile)
[0084] It can be deduced that the formula for calculating the label k value is:
[0085]
[0086] Based on the above formula, the label k value corresponding to each of the L images to be trained can be calculated.
[0087] Furthermore, in combination Figure 1 As shown in the example, in scenarios where the hotspot area occupies approximately 1 / 3 of the image area, the first 75th quantile in the existing hotspot segmentation threshold calculation formula is too large. Therefore, the allowable hotspot area cannot exceed 25% of the total area, which significantly leads to an overestimation of the calculated threshold, causing distortion in the segmented hotspot. Therefore, we consider setting the first 75% in the hotspot segmentation threshold calculation formula to P%, where P% indicates the adjusted preset quantile (P% < 75%). Furthermore, based on statistical data, the hotspot area in infrared temperature distribution maps generally does not exceed 40% of the total area. Therefore, we change the first 75th quantile QU in the formula to the 60th quantile to address the issue of an overly large minimum value obtained from the threshold calculation formula. The adjusted formula is:
[0088] Hotspot segmentation threshold = 60th percentile + label K value * (75th percentile - 25th percentile)
[0089] Accordingly, the formula for calculating the label k value is:
[0090]
[0091] This allows the formula for calculating the tag k-value to be applied to hot spot segmentation over a larger area. This means that high-temperature objects can be present in infrared illumination scenarios, or the installation height of infrared devices can be further reduced, making infrared devices suitable for more scenarios.
[0092] S203, construct an image feature set based on the temperature distribution in each image to be trained, so as to obtain the image feature sets corresponding to each of the L images to be trained.
[0093] In one specific embodiment, such as Figure 5 As shown, the image feature set is constructed through the following steps:
[0094] S2031, In each image to be trained, the temperature values of all pixels are divided into multiple intervals based on a preset temperature interval, and the number of pixels falling in each interval is counted as the first image feature.
[0095] For example, for a normalized image to be trained, the minimum temperature value is 0 and the maximum temperature value is 1. The range of 0-1 is divided into 25 intervals from smallest to largest according to a preset temperature interval of 0.04. The amount of data falling in each interval is counted to obtain 25 feature data, which are used as the first image feature here.
[0096] S2032, calculate the interquartile range as a second image feature.
[0097] That is, the "75th percentile - 25th percentile" is calculated as the second image feature.
[0098] S2033, take the first image features and the second image features as the image feature set.
[0099] By performing steps S2031-S2033 on each image to be trained, we can obtain the image feature sets corresponding to each of the L images to be trained.
[0100] S204. Based on the label k values and image feature sets corresponding to each of the L images to be trained, a dynamic fitting model is constructed, and the fitting k value output by the dynamic fitting model is obtained. The dynamic fitting model is adjusted based on the difference between the label k value and the fitting k value until the dynamic fitting model converges.
[0101] In one specific embodiment, such as Figure 6 As shown, the dynamic fitting model is constructed through the following specific steps:
[0102] S2041, Obtain n sets of training input data.
[0103] One set of training input data (S) i (i∈n) includes: multiple training samples, each training sample includes the label k value and image feature set corresponding to an image to be trained.
[0104] The L images to be trained are split into a training set and a test set at a specific ratio, for example, splitting the L images into a training set and a test set at an 8:2 ratio. From the training set, m training samples are randomly sampled n times with replacement, resulting in n sets of training input data. For example, n = 50 can be set in actual training. This ensures that the data are not identical, that as many training samples as possible are used, and that each constructed decision tree is also different, thus improving the overall generalization ability of the random forest model. The test set is used to test the accuracy after the decision trees are constructed.
[0105] S2042, calculate the Gini coefficient for each set of training input data under different features in the image feature set, and construct the decision tree corresponding to each set of input data based on the principle of minimizing the Gini coefficient. Use the random forest composed of the obtained n decision trees as the dynamic fitting model.
[0106] One set of training input data is used to construct a decision tree. Each decision tree uses different features within the image feature set as judgment nodes, and the signal features with small Gini coefficients serve as the parent nodes of the signal features with large Gini coefficients.
[0107] Specifically, the i-th training input data in n sets of training input data is designated as the first set of data, where 1 ≤ i ≤ n. Construction begins from the root node of the first decision tree, where the root node has a layer number j = 1. If the image feature set includes temperature values within 25 intervals and interquartile ranges, then the total feature is A1-A. 26 Then, based on the principle of minimizing the Gini coefficient, feature A1-A is determined. 26 Any one of the following is used as a decision node (e.g., temperature values falling within 0-0.04), and the split point of that decision node (e.g., the number of values within 0-0.04 is greater than 1). Based on this split point, the i-th set of training input data is split into two sets of training input data. Simultaneously, j is incremented by 1, and the two sets of input data are respectively identified as the data of two child nodes within the j-th layer. For the child nodes of these two root nodes and subsequent extended nodes, the decision node and target split point are determined using the same method as the root node. The above steps are repeated until any preset termination condition is met, at which point the construction of the decision tree stops. Repeating the above construction process yields n decision trees, which are used as a dynamic fitting model.
[0108] See Figure 7 Each decision tree outputs a result, and voting on these results yields the desired fit value (k). Of course, in the early stages of training, the fit value output by the dynamic fitting model differs significantly from the manually labeled and calculated label k value. Therefore, the constructed dynamic fitting model can be further adjusted based on the difference between the label k value and the fit k value. Furthermore, the model's convergence can be tested periodically using a test set.
[0109] In one specific embodiment, the segmented test set is input into each decision tree, resulting in n test results output by the decision trees. The test results are then validated based on the label k value in the test set. If the test result matches the label k value, the validation is considered successful; otherwise, the validation is considered unsuccessful. If every test result is validated successfully, or the percentage of validated decision trees is greater than a preset value P%, then the constructed dynamic fitting model is confirmed to have converged.
[0110] The above model training method first acquires L training images. These images are acquired at different times or in different scenarios, ensuring their diversity. Next, a hotspot segmentation threshold is obtained for each training image, and a corresponding label k-value is calculated based on this threshold to obtain the label k-values for each of the Z training images. This label k-value indicates the actual k-value for each training image. Further, an image feature set is constructed based on the temperature distribution within each training image to obtain the image feature sets for each of the Z training images. This considers the temperature data distribution characteristics within each training image, facilitating the dynamic determination of the k-value based on the temperature distribution. Finally, the model is constructed and continuously optimized. This includes building a dynamic fitting model based on the label k-values and image feature sets for each of the L training images, obtaining the fitted k-values output by the dynamic fitting model, and adjusting the dynamic fitting model based on the difference between the label k-values and the fitted k-values until the dynamic fitting model converges.
[0111] like Figure 8 As shown, the present invention also proposes an infrared image hotspot segmentation method. In this embodiment, the infrared image hotspot segmentation steps include:
[0112] S801, acquire the infrared image to be segmented, and construct an image feature set based on the temperature distribution within the infrared image to be segmented.
[0113] In a specific implementation scenario, S801 is basically the same as S203 in the training method of the dynamic fitting model. The difference is that the object is the infrared image to be segmented, which will not be elaborated here.
[0114] S802, input the image feature set of the infrared image to be segmented into the dynamic fitting model, and obtain the target k value of the output.
[0115] The dynamic fitting model is trained using the aforementioned training methods S201-S204, which will not be elaborated further.
[0116] S803, calculate the hot spot segmentation threshold of the infrared image to be segmented based on the target k value, and segment the hot spot in the infrared image to be segmented based on the hot spot segmentation threshold.
[0117] Optionally, the hotspot segmentation threshold can be calculated based on the following formula:
[0118] Hotspot segmentation threshold = 60th quantile + target K value * (75th quantile - 25th quantile)
[0119] The above formula for calculating the hot spot segmentation threshold can be applied to hot spot segmentation of larger areas. Then, pixels in the infrared image to be segmented whose temperature values are greater than the hot spot segmentation threshold are segmented as hot spots.
[0120] For example, such as Figure 9 As shown, the first image in each row from left to right is the original data image, the second image is the hotspot image segmented after calculating the threshold according to the empirical formula "75th percentile + 1.5 * (75th percentile - 25th percentile)", and the third image is the hotspot image segmented after calculating the threshold according to the improved formula "60th percentile + target k value * (75th percentile - 25th percentile)" according to this invention. Figure 9 (a) After inputting the dynamic fitting model, the target k value is calculated to be 0.98. Figure 9 (d) After inputting the dynamic fitting model, the target k value is calculated to be 0.72, which means that the second row of the graph should be segmented to show more hot spots.
[0121] Depend on Figure 9 (b) and Figure 9 (c) As can be seen from the comparison, the threshold obtained by the empirical formula is too large, resulting in excessive loss of the hot spot in the segmented form, and the original hot spot outline is lost. Figure 9 (c) The hot spot in the image was segmented more completely from the hot spot in the original image, which proves that the threshold was more accurate. Figure 9 (d) thermal spot ratio Figure 9 (a) is larger, and the threshold calculated by the empirical formula is more biased, leading to... Figure 9 (d) All pixels are smaller than the threshold, so the second image in the second row is displayed as blank, but the segmentation by the method of this invention... Figure 9 (f) can still accurately segment the hot spots of the original data, which shows the superiority of the present invention, enabling accurate hot spot segmentation in various scenarios.
[0122] Figure 10 An internal structural diagram of an infrared image hotspot segmentation device in one embodiment is shown. Figure 10As shown, the infrared image hotspot segmentation device includes a processor, a memory, and a network interface connected via a system bus. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and may also store a computer program. When executed by the processor, this computer program enables the processor to implement the infrared image hotspot segmentation method. The internal memory may also store a computer program, which, when executed by the processor, enables the processor to perform the infrared image hotspot segmentation method. Those skilled in the art will understand that… Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the infrared image hot spot segmentation device to which the present application is applied. A specific infrared image hot spot segmentation device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0123] An infrared image hotspot segmentation device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the following steps: acquiring L training images; acquiring a hotspot segmentation threshold labeled for each training image, and calculating the corresponding label k value based on the hotspot segmentation threshold to obtain the label k value corresponding to each of the L training images; constructing an image feature set based on the temperature distribution within each training image to obtain the image feature set corresponding to each of the L training images; constructing a dynamic fitting model based on the label k value and image feature set corresponding to each of the L training images, and acquiring the fitted k value output by the dynamic fitting model; adjusting the constructed dynamic fitting model based on the difference between the label k value and the fitted k value until the constructed dynamic fitting model converges.
[0124] The process involves the following steps: acquiring the infrared image to be segmented and constructing an image feature set based on the temperature distribution within the infrared image; inputting the image feature set of the infrared image to be segmented into a dynamic fitting model and obtaining the output target k value; calculating the hot spot segmentation threshold of the infrared image to be segmented based on the target k value, and segmenting the hot spot within the infrared image to be segmented based on the hot spot segmentation threshold.
[0125] A computer-readable storage medium storing a computer program, which, when executed by a processor, performs the following steps: acquiring L images to be trained; acquiring a hotspot segmentation threshold labeled for each image to be trained, and calculating the corresponding label k value based on the hotspot segmentation threshold to obtain the label k value corresponding to each of the L images to be trained; constructing an image feature set based on the temperature distribution within each image to be trained, to obtain the image feature set corresponding to each of the L images to be trained; constructing a dynamic fitting model based on the label k value corresponding to each of the L images to be trained and the image feature set, and acquiring the fitting k value output by the dynamic fitting model; adjusting the constructed dynamic fitting model based on the difference between the label k value and the fitting k value, until the constructed dynamic fitting model converges.
[0126] The process involves the following steps: acquiring the infrared image to be segmented and constructing an image feature set based on the temperature distribution within the infrared image; inputting the image feature set of the infrared image to be segmented into a dynamic fitting model and obtaining the output target k value; calculating the hot spot segmentation threshold of the infrared image to be segmented based on the target k value, and segmenting the hot spot within the infrared image to be segmented based on the hot spot segmentation threshold.
[0127] It should be noted that the above-mentioned infrared image hotspot segmentation method, model training method, device and medium belong to a general inventive concept, and the contents of the infrared image hotspot segmentation method, model training method, device and medium embodiments are applicable to each other.
[0128] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0129] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0130] The above embodiments merely illustrate several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A training method for a dynamic fitting model, characterized in that, The method includes: Acquire L training images; where the acquisition scenarios or acquisition time points of different training images are different; Obtain the hot spot segmentation threshold labeled for each image to be trained, and calculate the corresponding label k value based on the hot spot segmentation threshold to obtain the label k value corresponding to each of the L images to be trained. An image feature set is constructed based on the temperature distribution within each image to be trained, so as to obtain the image feature set corresponding to each of the L images to be trained. A dynamic fitting model is constructed based on the label k value and image feature set corresponding to each of the L images to be trained, and the fitting k value output by the dynamic fitting model is obtained. The dynamic fitting model is adjusted based on the difference between the label k value and the fitting k value until the dynamic fitting model converges. The formula for calculating the corresponding tag k value based on the hot spot segmentation threshold is as follows: The P% quantile indicates the adjusted preset quantile, where P% < 75%.
2. The method according to claim 1, characterized in that, The acquisition of L images to be trained includes: An infrared image set is acquired, and infrared images are extracted from each scene in the infrared image set at equal time intervals to obtain N candidate infrared images; wherein, the infrared image set includes multiple infrared images acquired in multiple scenes and multiple time periods; In the N candidate infrared images, the similarity between all infrared image groups is calculated and all infrared image groups are sorted based on the similarity to obtain an infrared image sequence. M pairs of infrared image groups with equal first similarity are extracted from the infrared image sequence; wherein each infrared image group consists of any two images from the N candidate infrared images. In the M pairs of infrared images, duplicate infrared images are removed to obtain Z images to be trained. The Z training images are expanded based on the N candidate infrared images to obtain L training images.
3. The method according to claim 2, characterized in that, The step of expanding the Z training images based on the N candidate infrared images to obtain L training images includes: In a cyclical manner, an infrared image that meets the expansion condition is added to the image set to be trained from the non-training image set until there are no infrared images in the non-training image set that meet the expansion condition. The image set to be trained initially consists of the Z images to be trained, and the image set to be trained consists of all infrared images in the N candidate infrared images other than those in the image set to be trained. The expansion condition is that there exists an infrared image in the non-training image set whose similarity to all the infrared images to be trained in the current image set is greater than a second similarity, and the second similarity is less than the first similarity.
4. The method according to claim 2, characterized in that, After extracting infrared images from each scene of the infrared image set at equal time intervals to obtain N candidate infrared images, the process further includes: Within each candidate infrared image, all temperature values lower than the first preset quantile are updated to the first preset quantile, and all temperature values higher than the second preset quantile are updated to the second preset quantile; wherein, the first preset quantile is less than the 25th percentile, and the second preset quantile is greater than the 75th percentile; Normalization is performed based on the first preset quantile, the second preset quantile, and all temperature values that have not been updated; After obtaining the hotspot segmentation threshold labeled for each image to be trained, the process further includes: All acquired hot spot segmentation thresholds are normalized.
5. The method according to claim 1, characterized in that, The construction of an image feature set based on the temperature distribution within each image to be trained includes: Within each training image, the temperature values of all pixels are divided into multiple intervals based on a preset temperature interval, and the number of pixels falling within each interval is counted as the first image feature. Calculate the interquartile range as a second image feature; The first image feature and the second image feature are used as the image feature set.
6. The method according to claim 1, characterized in that, The construction of a dynamic fitting model based on the label k values and image feature sets corresponding to the L images to be trained includes: Obtain n sets of training input data; where each set of training input data includes: multiple training samples, and each training sample includes the label k value and image feature set corresponding to an image to be trained; For each set of training input data, the Gini coefficient under different features in the image feature set is calculated, and a decision tree corresponding to each set of input data is constructed based on the principle of minimizing the Gini coefficient. The random forest composed of the obtained n decision trees is used as the dynamic fitting model. Each decision tree uses signal features as judgment nodes, and the signal features with small Gini coefficients are the parent nodes of signal features with large Gini coefficients.
7. A method for segmenting hot spots in infrared images, characterized in that, The method includes: Acquire the infrared image to be segmented, and construct an image feature set based on the temperature distribution within the infrared image to be segmented; The image feature set of the infrared image to be segmented is input into a dynamic fitting model, and the target k value is obtained from the output; wherein, the dynamic fitting model is trained by the method described in claim 1; The hot spot segmentation threshold of the infrared image to be segmented is calculated based on the target k value, and the hot spot in the infrared image to be segmented is segmented based on the hot spot segmentation threshold.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it causes the processor to perform the steps of the method as described in any one of claims 1 to 7.
9. An infrared image hotspot segmentation device, comprising a memory and a processor, characterized in that, The memory stores a computer program that, when executed by the processor, causes the processor to perform the steps of the method as described in claim 7.
Citation Information
Patent Citations
Solar photovoltaic panel light spot recognition method
CN108108736A
Methods and apparatus to determine an audience composition based on thermal imaging and facial recognition
US20220060785A1