Jungle scene illumination and cluster degree dual-adaptive animal detection method
By combining tag synchronization enhancement and illumination adaptive transformer, the problem of animal detection under low-light and cluster occlusion conditions in jungles was solved, improving detection accuracy and stability, and reducing false detections and redundancy of small targets in low light and cluster occlusion.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGXI YIJIE TECH CO LTD
- Filing Date
- 2026-01-12
- Publication Date
- 2026-04-21
AI Technical Summary
Under low-light conditions in the jungle and infrared imaging conditions, imaging degradation and animal clustering occlusion coexist, resulting in weakened feature expression in the middle layer of the detection network. The front-end screening parameters and non-maximum suppression threshold of the candidate boxes are not linked with the brightness state and crowding, causing small low-light targets to be systematically eliminated in the initial screening stage and clustered individuals to be excessively deleted in the suppression stage, leading to continuous missed detection and localization errors of rare classes and small targets.
By implementing scene consistency enhancement through tag synchronization, linking geometric and lighting perturbations and including boundary correction, embedding a lighting adaptive transformer in parallel in the middle layer of the backbone, fusing gated residuals and deriving the brightness proxy quantity, establishing a monotonic mapping between the target confidence threshold and the initial intersection-union ratio threshold based on the brightness proxy quantity and the target scale, and combining it with neighborhood consistency screening, the detection results are output.
It improves the accuracy of animal detection in low-light and clustered occlusion conditions in jungle scenes, reduces the false negative rate of small targets in low light and the redundant bounding boxes of clustered occlusion, and maintains the stability and comparability of detection.
Smart Images

Figure CN121904804A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, specifically to a dual adaptive animal detection method based on both lighting and clustering degree in a jungle scene. Background Technology
[0002] An infrared trail camera is an intelligent monitoring device that uses passive infrared (PIR) sensing technology to trigger image capture. It is primarily used to record wildlife activity in environments without human intervention. These devices are often deployed along animal trails or at watering points, and are used by zoologists and environmentalists to investigate wild animal population sizes, behavioral patterns, and habitat distribution. Through automatic triggering, it can capture image data at night or in concealed environments, providing crucial support for biodiversity monitoring and ecological conservation.
[0003] Jungle ecological monitoring often relies on passive infrared-triggered cameras to collect images over long periods of time without human intervention. The scenes exhibit complex characteristics such as numerous obstructions, strong camouflage, large lighting ranges, and frequent animal gatherings.
[0004] Existing recognition technologies, represented by single-stage object detection frameworks, are real-time in general environments, but they exhibit systemic defects in such scenarios: First, partial occlusion caused by vegetation and terrain, combined with animal camouflage patterns, weakens local discriminative features, resulting in a false negative rate of 30% to 50% on typical data. Second, low light at night, infrared imaging noise, and strong shadows collectively reduce the signal-to-noise ratio of edges and textures, with recall rates in low-light subsets often falling below 70%. Third, large differences in target scale lead to unstable localization of small targets (less than 5% of pixels), resulting in an average accuracy decrease of more than 20%. Fourth, species with similar appearances are prone to class confusion. Fifth, training data often exhibits a long-tail distribution, with rare class samples often accounting for less than 1%, causing confidence and decision boundaries to shift towards common classes. More importantly, mainstream workflows generally place low-light enhancement in the pixel preprocessing stage, which can easily introduce artifacts and amplify errors. The front threshold of candidate boxes and subsequent non-maximum suppression are mostly fixed or only rely on the degree of overlap for softening rules, which cannot adapt to brightness and crowding. Therefore, when low light and clustering coexist, a chain error of "discarding the front first and then deleting small clusters" is likely to occur, which seriously affects the stability and comparability of long-term monitoring.
[0005] Therefore, the current technical problem is:
[0006] Under low-light conditions in the jungle and infrared imaging conditions, imaging degradation and animal clustering occlusion coexist, resulting in weakened feature expression in the middle layer of the detection network. Furthermore, the front-end screening parameters and non-maximum suppression threshold of the candidate boxes are not linked to the brightness state and crowding degree, but are driven only by fixed values or single overlap. This leads to the systematic elimination of small low-light targets in the initial screening stage and the excessive deletion of clustered individuals in the suppression stage, resulting in continuous missed detection and localization errors of rare classes and small targets. Summary of the Invention
[0007] (a) Technical problems to be solved
[0008] To address the shortcomings of existing technologies, this invention provides a dual adaptive animal detection method based on illumination and clustering in jungle scenes. This method implements scene consistency enhancement with synchronized labeling, links geometric and illumination perturbations with boundary correction and failure rollback. An adaptive illumination transformer is embedded in parallel within the backbone layer, and gated residual fusion is used to derive a luminance surrogate quantity. Based on the luminance surrogate quantity and target scale, a monotonic mapping between the target confidence threshold and the initial intersection-union ratio (IUU) threshold is established, combined with neighborhood consistency screening. Non-maximum suppression is softened by jointly scheduling clustering and luminance surrogate quantity, and the detection results are output. This method considers low illumination, small targets, and cluster occlusion, improving sample usability and candidate cleanliness. It solves the technical problems described in the background art.
[0009] (II) Technical Solution
[0010] To achieve the above objectives, the present invention provides the following technical solution:
[0011] A dual adaptive animal detection method based on illumination and clustering in a jungle scene includes: reorganizing the data domain of the original image and annotations; synthesizing the data according to rare category conditions and subjecting it to triple quality checks of fidelity, category consistency, and diversity; constructing a balanced training set using progressive matching and source labeling; and saving the pass rate percentage curve and data.
[0012] Scene consistency enhancement is performed on the balanced training set with label synchronization. Geometric and lighting perturbations are applied to the image and bounding box. Cropping and repair are performed when the boundary is exceeded. The failure rate is exceeded, triggering amplitude recovery and rollback, and the boundary rate and failure rollback are recorded.
[0013] An adaptive illumination transformer is introduced as a parallel branch in the middle layer of the backbone network. It outputs the features after color correction and power-order correction and fuses them with the gated residual of the main branch. At the same time, it calculates the full-image brightness proxy for subsequent steps and keeps the size consistent.
[0014] Based on the brightness proxy quantity and the target scale, a monotonic mapping is established for the target confidence threshold and the initial intersection-union ratio threshold of the candidate box. The front-end candidate set and the associated threshold log are formed by combining the neighborhood consistency screening and the results are saved and smoothed.
[0015] The front-end candidate set is clustered into clusters according to intersection, union, ratio, and connectivity. The cluster-level clustering degree is calculated, and the attenuation intensity and suppression threshold of the softening non-maximum suppression are jointly scheduled using the clustering degree and the brightness proxy. The final detection result is output and the parameters are recorded.
[0016] Furthermore, rare category synthetic samples are generated based on category conditions and written with source tags; synthetic samples are added to the balanced training set with progressive matching according to the training progress, while common categories are downsampled to maintain consistent category proportions.
[0017] Furthermore, the triple quality control includes statistical fidelity in a fixed perceptual feature space; determining class consistency using frozen class discriminator output; statistical diversity using paired perceptual distance; and discarding or reprocessing synthetic samples that do not meet the threshold and recording the threshold caliber.
[0018] Furthermore, the geometric perturbation consists of rotation, translation, and scaling in a homogeneous affine chain order, which synchronously transforms the image and the four vertices of the bounding box; the illumination perturbation is performed within the segmented range of brightness, contrast, saturation, and hue; and the out-of-bounds vertices are clipped and written back to the detection annotation format.
[0019] Furthermore, when the enhancement degradation rate or out-of-bounds rate within a batch exceeds the threshold, a failure rollback is executed in the following order: first, reduce the angle and scaling, then reduce the occlusion area, and finally roll back within that batch. The out-of-bounds rate, degradation rate, number of rollbacks, and configuration version are written to the consistency log for reference in subsequent steps.
[0020] Furthermore, the illumination adaptive transformer first projects the backbone features into three-channel pseudo-color features through channel projection, then applies a shared color correction matrix and channel grouping power correction sequentially, and then restores them to a tensor that is homologous to the backbone features through inverse projection, and generates fused features by gated residual fusion.
[0021] Furthermore, the luminance surrogate is obtained by linearly converging the fused features point by point. The convergence weight vector is non-negative and normalized according to the first norm, and is recorded synchronously with the gating coefficients. The luminance surrogate is used for threshold mapping and subsequently for suppression parameter scheduling.
[0022] Furthermore, based on the brightness proxy amount and the target area ratio, a target confidence threshold and an initial intersection-union ratio threshold are generated respectively. The two are monotonic mappings and are written to the threshold log at the batch level. The threshold is updated exponentially across batches and the smoothing coefficient and batch number are recorded.
[0023] Furthermore, the neighborhood consistency screening constructs candidate neighborhoods based on spatial radius and scale difference. The spatial radius is based on the diagonal of the candidate box, and the scale difference is limited by the logarithmic distance. For each candidate, the maximum intersection-union ratio (IU) within the neighborhood is taken and compared with the initial IU threshold to determine whether to retain or remove the candidate and write it into the screening log.
[0024] Furthermore, the initial intersection-union ratio threshold is used as the connectivity criterion to cluster overlapping candidates into clusters; for each cluster, the number of overlapping boxes, the average intersection-union ratio within the cluster, and the cluster area ratio are counted, and the three are used to form the cluster degree; the cluster number, connectivity threshold, and statistics are written into the cluster-level log.
[0025] Furthermore, in the softening nonmaximum suppression, the attenuation intensity and suppression threshold are jointly mapped by the clustering degree and the brightness surrogate quantity and are constrained by upper and lower bounds; within each cluster, the candidate with the highest confidence is used as the benchmark, and its neighboring candidates are continuously attenuated according to the degree of overlap, and the attenuation parameters and benchmark index are recorded.
[0026] Furthermore, the suppressed and retained candidates are subjected to geometric steady-state correction within the cluster: the candidate centroid is updated with the overlap of the neighboring candidates and the decayed confidence as weights, and the width and height are linearly converged according to the overlap within the cluster; the coordinates, weights and cluster numbers before and after correction are written into the geometric correction log.
[0027] Furthermore, the lower and upper bounds of the attenuation intensity and the lower and upper bounds of the suppression threshold are uniformly injected by the configuration file and synchronously adjusted according to the brightness segment; all boundary values and mapping version numbers are recorded and timestamp aligned during the training and inference phases respectively.
[0028] (III) Beneficial Effects
[0029] This invention provides a dual adaptive animal detection method based on both lighting and clustering degree in a jungle scene, which has the following beneficial effects:
[0030] By relying on data domain reorganization, rare class conditional synthesis, triple quality checks and progressive matching, and writing source labels for samples, a balanced training set covering multiple poses, lighting and backgrounds is constructed, so that rare classes receive continuous attention throughout the training process, reducing missed detections and class bias caused by long-tail distribution, and retaining pass rate and proportion records.
[0031] By using scene-consistent enhancement with synchronized labels, rotation, translation, cropping, and brightness, contrast, and saturation adjustments are applied in conjunction with the image and bounding box. Out-of-bounds repair and failure rollback ensure that the enhancement actions are consistent with the detection annotations, thereby improving the sample effectiveness and training stability under low light, strong shadow, occlusion, and scale change conditions.
[0032] The third stage of the backbone network embeds a parallel illumination adaptive transformer to perform color correction and power-law correction on the mid-layer features and fuses them with the gated residuals of the main branch. At the same time, it calculates the brightness surrogate quantity and writes it into the metadata, making the edges and textures in low-light and infrared noise scenes more separable and providing a unified control quantity for subsequent steps.
[0033] Based on the brightness proxy quantity and target scale, step four establishes a monotonic mapping between the target confidence threshold and the initial intersection-union ratio threshold, and generates a front-end candidate set and threshold log with neighborhood consistency screening and inter-batch smoothing, thereby retaining effective candidates in low-light small target scenes and suppressing background triggering in bright field isolated scenes.
[0034] The front-end candidate set is clustered into clusters based on intersection-union ratio connectivity and spatial proximity. The clustering degree is calculated, and the attenuation intensity and suppression threshold of the softening non-maximum suppression are jointly scheduled with the clustering degree and brightness proxy quantity. This reduces redundant boxes in clustered scenes while maintaining the detection continuity of adjacent individuals. Attached Figure Description
[0035] Figure 1 This is a schematic diagram of the process of the dual adaptive animal detection method based on lighting and clustering degree in a jungle scene according to the present invention;
[0036] Figure 2 This is a schematic diagram illustrating the effect of animal testing methods. Detailed Implementation
[0037] 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.
[0038] Please see Figure 1 and Figure 2 This invention provides a dual adaptive animal detection method based on both lighting and grouping degree in a jungle scene, comprising:
[0039] Step 1: Construct a balanced training set with source and quality labels by data domain reshaping and rare class synthesis. Furthermore, through a continuously computable proportion scheduling and backsampling mechanism, rare categories are consistently and fully visible throughout the entire training phase, while maintaining semantic fidelity and appearance diversity.
[0040] In jungle monitoring images, rare category samples are extremely rare and often accompanied by occlusion, low illumination, and background camouflage. Direct training can cause the decision boundary to shift towards common categories; simple copying or coarse perturbation can introduce label drift and structural artifacts. It is necessary to first ensure the authenticity of semantics and texture, and then use a well-defined proportion function and sampling probability to gradually correct the category distribution, thereby eliminating the sources of long tails and biases.
[0041] First, complete the condition generation and triple quality check for rare classes to obtain the synthetic sample. Then, based on the training progress... Determine the composition proportion function for the independent variable and with sampling probability Perform class-balanced extraction; finally, compare with the real samples. Merge to form a balanced training set This also provides category tags for subsequent steps. - Brightness segmentation - Occlusion segmentation - Uniform metadata for source identification.
[0042] As an example, a passive infrared camera was deployed at both the forest edge water source and the forest underpass. After one data collection cycle, the operators collected real samples. The images are compiled and stored, and identifiable individuals are marked with rectangular borders. For rare categories in the annotation set, conditions are triggered one by one to generate candidate images. These candidate images undergo a triple quality check, and those meeting all thresholds are written into the synthetic sample. And synchronously write the category tag. Brightness segmentation, occlusion segmentation, and source identification.
[0043] Subsequently, according to the composition ratio function The number of synthetic samples was gradually increased in the early, middle, and late stages of training. Proportion, and sampling probability To determine the optimal training set, a sample list is constructed before each training round. Once completed, a balanced training set is obtained. Its naming and labeling will be directly referenced in subsequent steps.
[0044] Furthermore, to avoid false details and cross-class aliasing, the generation process uses category tags. The main axis is used to lock the attitude and imaging conditions through conditional input; quality control is based on triple quality inspection, and if any one of them is not met, it will be rejected or reworked.
[0045] In fixed category tag Driven by random noise Starting with the generator A metric-preserving mapping is established from the noise domain to the image domain, coupling the morphology, pose, and background of rare classes to the global appearance and local texture of a single sample. Furthermore, category labeling, brightness segmentation, and occlusion segmentation are embedded in the sample header metadata. Specifically:
[0046]
[0047] Where: generator The generator is a generative operator that transforms the noise domain into the image domain. Its function is to synthesize rare class candidate samples, and its value is a learnable function. The generator is the image generation sub-network in the generative adversarial network. It is one of the two major components of the generative adversarial network and is used to synthesize image samples of rare animal categories during the training phase. The generator takes random noise vectors and class labels as inputs and restores spatial resolution step by step through multi-layer convolution and upsampling structures. Style mapping, feature modulation and other operations are superimposed inside the network to make the output image approximate the statistical distribution of real rare animal images in jungle scenes in terms of overall contour, local texture and background structure.
[0048] Random noise Generate a random vector for the starting point, with values in a real-number vector space; the dimension is fixed before training. (Class labeling) : Discrete labels indicating rare categories, with values taken from the set of positive integers; synthetic samples : via generator The resulting candidate sample set will then proceed to the quality inspection process.
[0049] First, label by category Lock in the semantic skeleton, and then use random noise. Inject appearance differences, and finally use a generator. The parameters are stably mapped to the image domain and written into metadata. Semantic skeleton and appearance difference modeling are separated to maintain category consistency and ensure detailed differences between samples; metadata allows subsequent steps to directly read brightness and occlusion segments without secondary parsing; generation and label are mapped one-to-one to reduce label drift.
[0050] Furthermore, to avoid the one-sidedness of a single indicator, a joint judgment function is constructed, which imposes constraints on fidelity, category consistency, and diversity in parallel, and uses a veto system to screen out unqualified samples:
[0051]
[0052] In the formula: Qualification Whether the sample is included in the balanced training set The indicator value, which takes the value 0 or 1; indicator function : 1 if all inequalities within the parentheses are satisfied, 0 otherwise; Frechet sensing distance Kernel sensing distance: Measures the distance between the synthetic distribution and the true distribution in the perceptual feature space, taking a non-negative real number as its value; : Distribution distance calculated using kernel embedding, with values being non-negative real numbers; Class confidence. The pre-trained class discriminator scores the class consistency, with a value ranging from 0 to 1.
[0053] Perceptual similarity : The diversity among samples is characterized by differences in perceived features, with a value range from 0 to 1; threshold The fixed judgment threshold for triple quality inspection is determined after scenario calibration.
[0054] Frachert perceptual distance: in a fixed perceptual feature space (such as a frozen perceptual extractor) The output dimension is Calculate the Freschert distance between the two distributions on the vector ( ):
[0055]
[0056] In the formula, the perceived mean : These are synthetic samples and real samples processed by the perceptron extractor, respectively. The mean of the samples after the change; perceived covariance : The covariance matrix of the corresponding sample; trace operation Matrix trace.
[0057] Based on the frozen intermediate layer vectors of the perceptron, the layer number is fixed in the configuration and stored in the database; the mean and covariance are obtained from the batch samples using a closed-form formula.
[0058] Kernel sensing distance (a bounded version of the maximum mean difference):
[0059]
[0060]
[0061] In the formula, sample Synthetic and realistic perceptual vectors; kernel function Take the polynomial kernel The remaining symbols are the same as before.
[0062] To avoid nominalization and abstraction, we provide paired measures before averaging:
[0063]
[0064] In the formula, the qualified candidate set Synthetic samples screened for class consistency and fidelity; bandwidth Positive real numbers, fixed in configuration; Euclidean norm within the exponent kernel. The 2-norm of the channel dimension, and the isometric sampling from similar synthetic candidates. Calculation Combined into the database.
[0065] Then, the above four types of indicators are calculated and compared with their respective thresholds for qualification determination. The decision-making process involves selecting which samples to keep and which to discard. Unqualified samples are either recycled or discarded, while qualified samples are stored and their metadata is retained. The judgment results are not backpropagated to the indicator branches to avoid biasing the generation behavior. Therefore, a sample-level hard threshold is used to set the bottom line for the quality of the training set. The three dimensions are parallel, ensuring that the samples pass while simultaneously meeting the requirements of close resemblance to the real distribution, semantic consistency, and appearance diversity. The indicators and thresholds are searchable and verifiable, meeting traceability and compliance requirements.
[0066] Furthermore, if a high proportion of synthetic samples are introduced in the early stages of training... The real structural signal will be diluted; if the proportion is too low in the later stage of training, the long tail gap cannot be made up.
[0067] It is necessary to construct a continuous, monotonic, and recordable proportion curve for the synthetic sample. Training begins with a small number of samples and gradually increases in number; simultaneously, sampling probabilities are set with inverse weights based on the number of samples in each category, ensuring that low-frequency categories are not ignored in any training phase. The training progress is then normalized to a training schedule. The introduction rhythm, characterized by an initial slowdown followed by a rise and eventual stabilization, is described using an exponential growth function:
[0068]
[0069] Where: the composite proportion function Training progress refers to the training progress. At that time, the synthetic sample In a balanced training set The percentage in, ranging from 0 to 1; training progress : Dimensionless variables ranging from 0 to 1, describing the relative progress of training from start to finish; minimum proportion The lower limit of the percentage during the initial stage of training, with a value between 0 and 1; the maximum percentage. The upper limit of the proportion in the later stage of training, with a value between 0 and 1; growth coefficient. The positive real number controlling the growth rate of the curve determines the introduction rhythm and smoothness; natural exponential bottom. : A mathematical constant used as the base of an exponential function, and its value is an irrational number.
[0070] Calculate the composition percentage function for each training round before the start of each training round. Based on this, the true sample can be determined. With synthetic samples The proportions are then combined with the sampling probability of the next technical point to generate the sample list for that round. Thus, the proportions change continuously with the progress, initially based on real samples. Stable weights, with synthetic samples used in the mid-to-late stages. Complete the long tail; once the parameters are set, they can be reproduced across platforms, and the ratio at any time can be reconstructed based on the function during auditing.
[0071] Furthermore, to ensure that low-frequency categories are continuously sampled while avoiding excessive suppression of high-frequency categories, a backsampling probability based on the number of samples per category is defined:
[0072]
[0073] Where: sampling probability Category tags The probability of being selected in the current batch ranges from 0 to 1; the number of samples in each category. Category tags In a balanced training set The sample count in the index is a positive integer; the exponent parameter... : A positive real number that adjusts the strength of the inverse weights, used to control the boost magnitude for rare classes; summation index : Iterate through the indices of all categories, taking the values of a set of positive integers.
[0074] Before each batch is built, the synthesis proportion function is used. Determine the ratio of real to synthetic quantities, and then use sampling probability. Sampling is performed within each category to ensure that low-frequency categories have a definite probability of being included in training in each batch. When the number of samples in each category... When reduced, sampling probability Improvements are made to ensure that rare classes are not ignored; when the number of samples in each class... When the sampling probability is high, The temperature naturally decreases but does not drop to zero, maintaining the overall distribution pattern; this aligns with the qualification criteria. In this way, the rare classes used in training are high-quality samples, avoiding the introduction of noise by increasing the sampling probability.
[0075] Step 2: Without changing the semantics of the detection annotations, the image-detection annotations are synchronously perturbed using a unified affine chain and illumination chain. By over-boundary repair, the geometric validity of the bounding boxes is maintained, and by failure rollback, the proportion of effective samples within the batch is maintained. This process constructs training samples that fit the jungle scene and preserves the source and transformation records for direct reference in subsequent steps.
[0076] Among them, jungle images simultaneously have rotating viewpoints, occlusion, low illumination and background camouflage. If the image is perturbed without being synchronized with the detection annotation, the bounding box will be disconnected from the shape and position of the target. If there is no out-of-bounds repair, degenerate boxes and empty annotations are likely to be generated after enhancement. If there is no failure rollback, a disproportionate number of invalid samples will appear in the batch.
[0077] Based on this, a calculable, rollbackable, and auditable geometry chain-lighting chain-occlusion chain needs to be consistently applied to the image and detection annotations. Out-of-bounds repair ensures the legality of the output, failure rollback ensures the availability within the batch, and source markers and segment labels are used throughout the process to maintain a consistent standard.
[0078] A unified affine chain is formed by rotation, translation, and scaling. First, a traceable affine matrix is established in the image space, and then the vertex coordinates of the detection annotations are mapped using the same matrix. To avoid discrepancies in accuracy, all rotation angles, translation amounts, and scaling factors are driven by the source label set, brightness segmentation, and occlusion segmentation, ensuring that the image and detection annotations of the same sample share the same source parameters.
[0079] The process involves first generating affine parameters, then synthesizing affine matrices, and finally performing a uniform transformation on the image and bounding box vertices.
[0080] Based on the brightness segmentation and occlusion segmentation of the sample, the rotation angle, translation amount, and scaling factor are extracted to generate an affine matrix; the affine matrix is simultaneously applied to the homogeneous coordinates of the four vertices of the image grid and the bounding box to generate the transformed image and annotation; the affine parameters and random number seed are written into the metadata to enable playback.
[0081]
[0082] Where: affine matrix A two-dimensional homogeneous affine matrix composed of translation matrix and translation amount, rotation matrix and rotation angle, scaling matrix and scaling factor; Real matrix;
[0083] Translation matrix A two-dimensional homogeneous translation matrix consisting of horizontal and vertical translations. Real matrix; Rotation matrix A two-dimensional homogeneous rotation matrix consisting of rotation angles. Real matrix; Scaling matrix A two-dimensional homogeneous scaling matrix consisting of horizontal and vertical scaling factors; its values are... Real matrix; used to scale the image and vertex coordinates along two axes.
[0084] Then, the homogeneous coordinate vectors of the four vertices of the bounding box are multiplied by an affine matrix on the left to obtain the synchronized vertex coordinates:
[0085]
[0086] Wherein, vertex vector Shaped like Homogeneous coordinates, a 3D column vector, representing the positions of the bounding box vertices; transform vertex vectors Homogeneous vertex coordinates after affine matrix transformation, a three-dimensional column vector, used to obtain synchronized annotation coordinates;
[0087] Thus, the image and detection annotation are transformed under the same affine matrix, eliminating the misalignment where the image changes but the annotation remains unchanged; the homogeneous coordinate representation ensures that the cascaded rotation, translation, and scaling are traceable under the same caliber; after the parameters and random number seeds are stored in the database, any enhancement batch can be replayed according to the log to obtain completely consistent images and annotations.
[0088] Furthermore, considering the combination of shadows under the trees, upward and downward views from the slope, and tree trunk occlusion in the jungle scene, the affine parameters need to be bound to the source markers: for samples with low brightness, the rotation angle is increased to present a handheld, shaky perspective; for samples with medium to high occlusion, the scaling factor is slightly higher in the vertical direction than in the horizontal direction to simulate longitudinal compression.
[0089] The process involves first reading in the source marker, then mapping it to parameter intervals segment by segment to form a one-to-one relationship between source and parameter, thus avoiding arbitrary perturbations. For each sample, the source marker, brightness segment, and occlusion segment are read and mapped to a defined interval of rotation angle, translation amount, and scaling factor. The interval mapping function is explicitly specified in the configuration and cold-backed up. The generated affine parameters are written to the enhancement log along with the samples to ensure consistency across batches.
[0090] When used, samples from the same source have a consistent geometric perturbation spectrum, making the sensitivity of the training process to scene factors controllable; segmented constraints suppress unnecessary extreme affines and avoid meaningless deformations during training.
[0091] Furthermore, under low-light and infrared imaging conditions, brightness, contrast, and saturation need to be adjusted in segments, and random occlusion needs to be inserted to simulate intertwined branches and leaves. To avoid excessive occlusion compromising annotation validity, a lighting chain must be applied before occlusion, followed by boundary evaluation of the occlusion location, and finally, out-of-bounds or degraded bounding boxes must be clipped or revoked. This ensures the priority order of perceptual disturbances, occlusion, and geometric validity.
[0092] The process involves reading the brightness and occlusion segments of the sample; determining the adjustment range of brightness and contrast based on the brightness segments; placing several occlusion blocks on the image, with the position and scale of the occlusion blocks driven by the occlusion segments; then performing boundary crossing and degradation detection on each transformed bounding box, cropping to the image boundary if it crosses the boundary, and removing the occlusion block or recycling the sample if it degrades; and writing the repair and undo actions to the log simultaneously.
[0093] Furthermore, to make the occlusion intensity computably dependent on brightness and class scarcity, an occlusion intensity parameter and a joint mapping are introduced:
[0094]
[0095] Where: shading intensity parameter : A dimensionless quantity that controls the area and number of occluding blocks; its value is... to Base value The minimum occlusion strength value without considering brightness and scarcity. to Average brightness : The average brightness of the current sample image, a non-negative real number, used to reflect the brightness of the image;
[0096] Brightness upper limit : An upper limit constant for brightness estimation, a positive real number used to normalize the mean brightness; a rarity scoring parameter. Scarcity measure calculated based on the number of samples in each category. to This allows rare classes to adopt more cautious occlusion strategies. Specifically, the rarity score parameter is based on the number of samples of each class in the balanced training set. The monotonic mapping value is obtained by normalizing the maximum number of samples, the minimum number of samples, and the number of samples of that class.
[0097] Therefore, the occlusion intensity responds monotonically to brightness and scarcity, resulting in gentler occlusion for low-light samples and rare samples; boundary repair ensures the legality of the bounding box, and degradation cancellation ensures the proportion of usable samples within the batch; the occlusion parameters are linked to the source marker, which facilitates the differentiation between local overlap caused by occlusion and true clustering when calculating the clustering degree in step five.
[0098] Furthermore, augmentation operations inevitably produce failed samples, such as annotation degradation caused by the superposition of multiple transformations. To address this, a batch failure rate is defined, and an amplitude recovery amount is calculated accordingly. The transformation amplitude of subsequent samples is continuously converged until the failure rate falls below a threshold. This strategy gradually converges the transformation intensity within the same batch, avoiding the complete rejection of the entire batch.
[0099] At the end of each batch, the number of failed samples is counted and the failure rate is calculated. The excess portion of the failure rate exceeding a threshold is used to calculate the magnitude recovery amount. This recovery amount is applied to the rotation angle, translation amount, occlusion intensity, and brightness adjustment magnitude of the next batch. The failure rate, recovery amount, affected parameters, and source marker quadruple are recorded in the rollback log.
[0100]
[0101] Where: Amplitude recovery amount : The amount of amplitude reduction used for the next batch, a non-negative real number, used to convert the excess portion of the failure rate into amplitude convergence; failure rate The percentage of failed samples in this batch is: to Characterizes the enhanced quality of this batch; failure rate threshold : Maximum allowed failure rate, value to Used to determine whether recycling is necessary; recycling coefficient : Maps the failure rate excess to a proportional coefficient for amplitude recovery, a positive real number; used to set the convergence speed.
[0102] When in use, failure rollback suppresses the accumulation of failure rate through a continuous amplitude convergence mechanism, ensuring the availability of the next batch of samples; log-based rollback makes problems localizable and replayable; amplitude recovery is constrained within a unified parameter family, avoiding the misadjustment of irrelevant parameters.
[0103] As an example, after data engineers complete sample import at the forest sampling points, they initiate the enhancement process for this step. The system first starts from the balanced training set. The system reads a batch of samples; for samples belonging to the low-light-medium occlusion segment, it generates rotation angle, translation amount, and scaling factor, synthesizes an affine matrix, and synchronously maps bounding boxes; then it adjusts brightness and contrast according to brightness segment, and places two occlusion blocks in the lower right region of the image; the system immediately performs out-of-bounds detection, and if it finds that the high-level occlusion of a sample causes the area of the two bounding boxes to be lower than the threshold, it determines it as degradation and removes the occlusion, and writes this event to the out-of-bounds repair log; at the end of the batch, the system calculates the amplitude recovery amount based on the difference between the failure rate and the threshold, lowers the upper limit of the rotation angle and the occlusion intensity of the next batch, and writes the relevant rollback parameters to the rollback log.
[0104] Step 3: In the third stage of the backbone network (resolution is one-eighth of the input, number of channels is 256), a parallel illumination adaptive transformer is introduced. The transformer output and backbone features are residually fused by gating coefficients. Color correction and power-law correction of the feature domain are completed first inside the transformer. Then the fused features are sent to the detection head, and the brightness proxy is calculated on the fused features to provide a quantized signal that can be directly consumed for subsequent thresholding and post-processing.
[0105] In jungle scenes, low light and infrared imaging weaken the edge contrast and texture details of mid-level features. If prior enhancement of the pixel domain is still relied upon, noise and artifacts are easily introduced into the deep structure. Furthermore, the decoupling from the detection network makes it impossible to correct the weakened discriminative subbands on the same scale.
[0106] By embedding illumination correction into the mid-layer feature domain of the third stage of the backbone network, it is possible to directly perform directional correction on the subbands that carry the contours and textures. Then, the gating coefficient is used to control the ratio of the correction amount to the original features, which avoids over-modification, ensures sustainable and stable training for different illumination segments, and derives a stable brightness proxy for subsequent threshold and suppression algorithms.
[0107] As an example, after nighttime images from field monitoring sites enter the training pipeline, the system augments these images from the enhanced samples. A batch of samples is read and fed into the backbone network. In the third stage, the backbone network generates a set of mid-level features with dimensions of batch number × 256 × height / octave × width / octave. Simultaneously, the system calls the illumination adaptive transformer branch to perform color correction and power-law correction on these mid-level features. Then, using gating coefficients, the transformer output and the backbone features are fused position-by-position after channel alignment to obtain the fused features. Upon completion of the fusion, the system compresses the luminance surrogate value from the fused features and writes these two values (gating coefficients and luminance surrogate value) along with the sample source identifier into the log for subsequent threshold scheduling and cluster-level suppression calls.
[0108] In the third stage of the backbone network, mid-level features are selected as inputs to the parallel branches. One-to-one channel mapping ensures that the parallel outputs are fully aligned with the backbone features in space and channels. Then, a gating coefficient is introduced to control the fusion intensity, so that the fusion can cover the low-light sub-bands without destroying the high-discrimination regions already learned by the backbone.
[0109] The process involves first extracting the backbone features in the third stage and feeding them into an adaptive illumination transformer to obtain the corrected features; then maintaining consistency with the 256 channels of the backbone features through channel mapping; and finally introducing gating coefficients into the position-by-position addition residual path to achieve a smooth and controllable transition from zero correction to significant correction.
[0110]
[0111] In the formula: fusion features The intermediate feature tensor to be fed into the subsequent detection head has a size of batch number × 256 × height / octave × width / octave, and the value is a real number; correction feature The mid-level feature tensor output by the illumination adaptive transformer, with dimensions similar to... Consistent, taking values of real numbers; main characteristics : The mid-level feature tensor from the output of the third stage of the backbone network, with real numbers as values; gating coefficients : Dimensionless coefficient that controls the linear matching ratio of the two characteristic paths, with a value range from 0 to 1.
[0112] Therefore, the gating semantics are interpretable, the fusion strength is continuously adjustable, and when the gating coefficient approaches zero, the system degenerates to using only the backbone features; when the gating coefficient approaches one, the system fully adopts the correction features; the gating coefficient can be recorded in both the training and inference stages to form a traceable trajectory.
[0113] The structural constraints of the third stage of access are due to the fact that this stage has both good texture resolution and an acceptable computational burden; an earlier layer will not be able to correct the color due to the coarse texture, and a later layer will weaken the meaning of color correction due to semantic abstraction.
[0114] The illumination adaptive transformer maintains 256 channels and a spatial scale of one-eighth at both the input and output ends, forming a parallel structure with the backbone features at a homogeneous scale. To avoid interpolation errors caused by scale inconsistency, no upsampling or downsampling is performed during the process. If necessary, a point-by-point transformation layer is introduced inside the branch to refine the channel distribution, but the number of channels and spatial scale outside are not changed.
[0115] Therefore, the fixed access level ensures the semantic stability of the mid-level subbands being corrected; maintaining the homogeneous scale eliminates the need for interpolation alignment in position-by-position fusion, avoiding numerical diffusion and geometric misalignment; and the parallel structure can be independently frozen or unfrozen during training, ensuring the controllability of overall convergence.
[0116] Color correction is performed first in the feature domain, followed by power-law correction to avoid pixel-domain enhancement amplifying noise unnecessarily. To ensure that the color correction has a physical correspondence, the 256-channel mid-layer features are first compressed into three-channel pseudo-color features through channel projection using the learned channels. After applying the color correction matrix, the features are projected back to the 256 channels, and power-law correction is applied within each channel to finally obtain the corrected features.
[0117] The illumination adaptive transformer internally performs channel projection → color correction → inverse projection → power-law correction sequentially, with all operators executed consistently for each spatial location. The three-channel color correction matrix is shared across spatial locations, and the power-law exponent can be set by channel grouping, where:
[0118]
[0119] Where: Correction characteristics The mid-layer feature tensor after color correction and power-law correction is a real number; the backbone features Consistent with the aforementioned definition; channel projection operator A linear operator that projects 256 channels into three-channel pseudo-color features, with values taken as learnable matrices; channel inverse projection operator. : Restore the three-channel pseudo-color features to a 256-channel linear operator, with values taken as learnable matrices; channel projection and inverse projection Fixed as a pointwise linear mapping: Initialization Find the least squares solution and apply it during training. Singular values are subject to soft constraints to prevent numerical divergence; the constraint coefficient is written into the configuration.
[0120] Color correction matrix A 3x3 real matrix, corresponding to a linear transformation for color correction, with shared spatial positions; power exponent. : An exponential parameter grouped by channel or shared across all channels, a positive real number.
[0121] When used, the structure of compression followed by restoration gives color correction a clear three-channel interpretation, avoiding direct fitting of unstructured linear transformations on high-dimensional channels; power-law correction integrates the adjustment of dark details and bright area suppression, reducing the interference of overexposure and underexposure on subsequent discrimination.
[0122] Furthermore, to ensure that subsequent steps have available external control quantities when entering the threshold and post-processing domains, a luminance proxy quantity is derived from the fusion features, and the gating coefficients are scheduled continuously in the training progress to prevent early overcorrection from damaging the structure already learned by the backbone.
[0123] The fusion features are averaged and compressed in the spatial dimension. First, the channel information is aggregated into a single-channel response using a pointwise linear function, and then the average value of the entire image is taken as the brightness proxy. The gating coefficients are updated according to a monotonically increasing function as training progresses. In the initial stage, the gating coefficients are biased towards the backbone, and the proportion of the transformer is gradually increased as training progresses, stably injecting the correction capability into the fusion channel. Among them:
[0124]
[0125] Where: Luminance proxy : The brightness value of the fused feature across the entire space, taking the value of a non-negative real number; height ,width Spatial dimensions of the fused features, positive integers; location coordinates. , : Spatial index, positive integer;
[0126] Point-by-point convergence function The 256 channels are compressed into a single-channel linear function or a pointwise transformation with nonlinearity, and the parameters are fixed and shared across the entire image. A linear convergence function is preferred, i.e., a set of channel weights is pre-set or trained, and the features of each channel are summed according to the weights; the weight vector is non-negative and normalized, so that the converged scalar has a clear and stable physical meaning. ψ(·) is applied to all spatial locations on the entire fused feature map, and then averaged over the spatial dimension to obtain the brightness proxy used in steps four and five of this scheme.
[0127] Furthermore, the training schedule function for the gating coefficients is then defined:
[0128]
[0129] Where: gating coefficient Training progress is The gating value at any given time ranges from 0 to 1; minimum gating value. Maximum gate The gating boundaries at the start and end points, with values ranging from 0 to 1 and satisfying a magnitude relationship; growth coefficient. : Positive real numbers controlling the growth rate; training progress : Dimensionless variables ranging from 0 to 1.
[0130] When in use, the luminance proxy maps the global brightness and darkness of the fused features into a single available quantity, which can be directly called by the threshold in step four and the suppression parameters in step five; the gating coefficient is monotonically updated with the training progress to prevent excessive reliance on the correction branch in the early stage, which would lead to unstable convergence, and gradually exerts its correction capability in the later stage to form a stable and reproducible training trajectory.
[0131] Furthermore, the linear fusion of gated residuals is performed position-by-position in both channels and space, ensuring that the introduction of corrections is geometrically consistent with the main features, avoiding new misalignments; it guarantees numerical stability without interpolation, reducing feature diffusion; parallel branches can be frozen independently, conforming to the gradual rollout strategy of engineering deployment. This clarifies the physical meaning of the color correction matrix; power-law correction provides complementary adjustment to dark and bright areas, improving the discernibility of edges and textures in the feature domain. The luminance surrogate compresses complex features into a single external control quantity, directly serving steps four and five.
[0132] Step 4: Before entering post-processing, construct a joint threshold of target confidence threshold and initial intersection-union ratio threshold based on the brightness proxy quantity and target scale quantity, and perform segmented mapping and consistency screening using a monotonic traceable family of functions, thereby completing the initial screening of candidate box front-end legalization, normalization and auditability under a unified standard.
[0133] In jungle photography, candidate bounding boxes often exhibit both low confidence due to low lighting and geometric instability caused by small targets. If a fixed threshold is used for screening, systematic elimination will occur in the low-light-small-target intersection area. Conversely, if the same lenient threshold is maintained in bright areas, false candidates triggered by background textures are easily allowed. Therefore, it is necessary to use the brightness proxy quantity derived in step three as external control and the target scale quantity in this step as internal correction to construct a monotonic and recordable mapping, establishing a one-to-one correspondence between the target confidence threshold, the initial intersection-union threshold, and the brightness-scale. This is further supplemented by neighborhood intersection-union consistency screening, so that the initial screening results retain effective candidates for low-light small targets while suppressing bright-field background candidates.
[0134] As an example: After the feature domain illumination correction is completed in step three, a set of nighttime samples from a forest walkway enters this step. The system reads the brightness proxy calculated from the fused features and calculates the target area ratio of each candidate on the candidate box set. Based on this, the system generates a pair of thresholds for the samples in this batch: a targetability confidence threshold and an initial intersection-union (IU) threshold. Subsequently, the maximum IU value is calculated in the local neighborhood of each candidate for consistency screening. Candidates that pass the screening are written to the screening log and retained, while those that fail are noted in the log with the reason and the corresponding threshold. After the full batch processing is completed, the system writes the mapping of brightness segmentation - scale segmentation - threshold value - screening result into the record and hands it over to step five for further processing.
[0135] Among them, the brightness proxy output in step three is used as the independent variable to construct a monotonic function from low illumination to bright field, and the target confidence threshold is directly obtained. The function is approximately equal to the lower limit near zero brightness and asymptotically approaches the upper limit as brightness increases, thus naturally widening in the low illumination segment and gradually tightening in the bright field segment.
[0136] Read the luminance proxy value generated by the fusion features, and input it into a monotonic mapping function at the sample level or batch level to obtain the threshold; write the threshold and luminance proxy value together into a record for subsequent review and playback, wherein:
[0137]
[0138] Where: Target confidence threshold : A threshold used to filter out low-confidence candidates, with values ranging from 0 to 10. arrive Minimum threshold Maximum threshold The value at the boundary between extremely dark and extremely bright conditions, with a range of values. arrive And it satisfies the size relationship; growth coefficient : A positive real number representing the rate of increase of the adjustment function; luminance surrogate quantity : A non-negative real number derived from step three, representing the brightness of the entire image.
[0139] When in use, the threshold is automatically lowered in low-light conditions to preserve candidates, and the threshold is gradually raised in bright-field conditions to suppress false candidates. Only three types of boundary quantities and growth coefficients need to be recorded as parameters to reproduce the same threshold curve in any deployment environment.
[0140] Furthermore, using the target area ratio as the independent variable, the initial crossover ratio threshold is scale-sensitively corrected: the smaller the area, the higher the threshold tends to be, in order to constrain the geometric stability of small targets; at the same time, the brightness surrogate is used as the second independent variable to ensure that the threshold in the low-light segment is not too strict, thus avoiding early loss.
[0141] The target area ratio is calculated based on the ratio of the pixel area of the candidate box to the total number of pixels in the image. The area ratio and the brightness proxy are simultaneously substituted into the function to obtain the initial intersection-union (IU) threshold, which forms a pair of thresholds with the obtained target confidence threshold, where:
[0142]
[0143] Where: Initial crossover ratio threshold : The lower limit of geometric overlap used in the initial screening stage, with a value of arrive Baseline constant : The reference value at neutral brightness and medium scale. arrive ;coefficient , : Positive real numbers that control the influence intensity of the luminance and scale terms respectively; luminance surrogate quantity Consistent with the above; target area percentage The ratio of the candidate bounding box pixel area to the total number of pixels in the image. arrive Small target threshold : A fixed value used to characterize an area smaller than this, which is considered a small target; the value ranges from this. arrive .
[0144] When the target is small (the area percentage is close to zero), the fractional term approaches... The threshold is raised; when the target is large, the fractional term decays and the threshold returns to the baseline; after adding the brightness term, the threshold in the low-light segment is not too strict, thus balancing geometric stability of small targets and low-light recall.
[0145] In addition to the threshold function, a local consistency constraint is introduced: the same candidate should have sufficient overlap stability across scales or among neighboring candidates; otherwise, it is judged as geometrically unstable and removed from the initial screening. This consistency does not depend on external annotations and is entirely self-consistently calculated by the candidate set.
[0146] In this process, a local neighborhood is established for each candidate, and the maximum intersection-union ratio (IUR) between the candidate and other candidates within that neighborhood is calculated. If the maximum IUR is lower than the corresponding threshold, the candidate is eliminated due to inconsistency. All decisions are written to a filtering log, with the threshold from which they originated noted.
[0147]
[0148] Where: the set to be retained The candidate set retained after initial screening; the complete candidate set. The complete set of candidates output by the detection head; candidates Neighborhood Candidates : set element; neighborhood A finite set defined by geometric proximity and scale proximity criteria, including candidates Candidates that are spatially close to or aligned across scales;
[0149] Confidence function Candidate The target score, with a range of values, is as follows: arrive intersection and union ratio The degree of overlap between each pair of candidates, with a value range of [value range missing]. arrive Brightness proxy Initial intersection-union threshold Target confidence threshold Percentage of target area Consistent with the aforementioned definition.
[0150] The confidence function refers to the mathematical mapping step that maps the raw scores output by the detection network to a single confidence value for each candidate box. The detection head outputs a one-dimensional target logarithmic score and several-dimensional class logarithmic scores for each candidate box. These scores are first transformed into target probability and class probability respectively through a standard mapping function. Then, the product of the target probability and the target class probability is taken, and this product is used as the confidence function output value of the candidate box. When only the largest class is considered, the target probability can be multiplied by the largest class probability as the confidence function value of the candidate box.
[0151] When used, a consistency guarantee is added in addition to the threshold mapping to filter out isolated and unstable geometric candidates; this screening is based entirely on the internal relationships of the candidates, without relying on external annotations or introducing additional models.
[0152] Furthermore, considering the threshold jitter caused by uneven brightness distribution within a batch, the confidence level is recalibrated by a power-law and the threshold is smoothed in one step to keep the screening results stable when the brightness of adjacent batches changes slightly.
[0153] Power-law weights are generated using luminance proxy as the independent variable. A single-point transformation is performed on the candidate confidence scores, followed by exponential smoothing with reference to the previous batch thresholds to obtain the final implementation threshold. The smoothed threshold is then written into a record.
[0154]
[0155] Where: recalibration confidence level The candidate confidence score after power transformation takes the value of . arrive Original confidence level Consistent with the above; Luminous proxy quantity Consistent with the above.
[0156] Power weight A positive real function that monotonically changes with brightness, taking values greater than 0; where the brightness surrogate quantity is... Values in Between 1 and 1 Defined as:
[0157]
[0158] here, This is the lower limit of the power-law weight, used for baselines with high brightness or where significant recalibration is not required; This is the upper limit of the power-law weight, used to increase the recalibration intensity when the brightness is low; parameter It is a positive real number used to control how quickly the power weight changes with brightness.
[0159] When using it, the original confidence level of the candidate boxes Calculate the confidence level of recalibration Substitute the brightness proxy of the same image into This allows the degree of confidence compression or stretching in low-brightness and high-brightness scenes to vary with brightness in a calculable and reproducible manner according to a unified rule.
[0160] In practice, the low-light segment uses power-law weighting to reduce the penalty for low confidence, while the bright-field segment increases the penalty intensity, thus complementing the threshold. Threshold smoothing reduces intra-batch fluctuations, making the screening log more stable in similar scenarios. Therefore, a monotonic mapping relationship is established between external brightness quantities and the target threshold, ensuring that low-light samples are not prematurely eliminated; scale-sensitive correction is applied to the initial intersection-union (IUU) threshold using area proportion, improving geometric stability in small target scenarios; and local consistency is provided as a safety net, ensuring that widening the threshold does not lead to a large number of unstable candidates remaining.
[0161] Step 5: Before entering the final output, the candidate set retained in Step 4 is clustered according to spatial-scale proximity, the clustering degree is calculated, and the attenuation intensity and suppression threshold of softening suppression are jointly scheduled with the dual independent variables of clustering degree and brightness. This ensures that neighboring individuals are retained when clusters coexist with low illumination, and redundancy is removed when bright fields and isolated targets coexist, resulting in a stable and traceable final detection set.
[0162] In jungle scenes, a complex situation often arises where similar individuals move in groups, occlusion overlaps, and edges are blurred due to low illumination. If a fixed threshold suppression is used, adjacent individuals in the clusters are easily weakened simultaneously; if the threshold is simply relaxed, isolated background candidates in bright areas will remain. Therefore, it is necessary to elevate the spatial structure of candidates to cluster-level statistics and establish a functional relationship between cluster crowding and overall image brightness. This allows for the simultaneous adjustment of the attenuation and threshold of softening suppression, achieving paired behavior of crowding-low illumination preservation and sparseness-bright area suppression. This approach naturally connects with the brightness proxy and threshold log derived in steps three and four, forming a continuous chain from the feature domain to the threshold domain to cluster-level suppression.
[0163] Using the retained set output from step four as input, local neighborhoods are constructed with spatial radius and scale difference constraints. Within the neighborhoods, clusters are formed by aggregation based on the intersection-union ratio (IUR) as the connection criterion. Subsequently, three types of statistics are extracted: the number of overlapping boxes, the average IUR within the cluster, and the cluster area. The clustering degree is defined by their rational combination to ensure that it reflects both the crowding and avoids the blind relaxation of the area of large clusters.
[0164] Here, the set retained in step four is denoted as For any candidate, collect its neighbors within the spatial radius and scale difference boundaries, and establish connectivity relationships according to the lower limit of intersection-union ratio to generate a cluster. The normalized area ensures comparability between different map sizes; after obtaining the statistics, the clustering degree is defined by the following formula:
[0165]
[0166] Where: Clustering degree :cluster The crowding metric, a non-negative real number, is used to schedule the softening suppression parameter; the number of overlapping boxes. Number of candidates within the cluster, a positive integer; average intersection-union ratio within the cluster. The average of the pairwise intersection-union ratios within a cluster, in intervals. This reflects the intensity of local overlap; cluster area : The ratio of the area of the union of the inner bounding boxes of a cluster to the area of the entire graph, within a certain interval. This reflects the space occupied by the cluster; cluster Candidate subsets obtained by aggregation of connectivity relations; intersection-union ratio : Overlap between two frames, range .
[0167] When used, the clustering degree increases with the number of people, the overlap is stronger, and the footprint is smaller, which can accurately depict the crowding degree of dense occlusion; area normalization makes different shooting scales comparable; at the same time, the statistics based on clusters allow subsequent suppression to be carried out at the structural level, rather than isolated decisions on a frame-by-frame basis.
[0168] The boundaries of the attenuation parameters and thresholds are set around the suppressable range within different brightness segments, and the brightness proxy quantity derived in step three is used. Use it as a global control variable to ensure that any mapping is constrained by upper and lower bounds, thus avoiding excessive looseness or excessive strictness in extremely low light or extremely crowded conditions.
[0169] Record each batch of samples , and , Four boundary constants are used as the upper and lower bounds of the softening attenuation intensity and the suppression threshold, respectively; in the low-light segment, they are appropriately shifted upwards based on the threshold log. and move down The bright field segment is processed in the opposite way; then the luminance proxy is adjusted. Including clustering Perform specific mapping.
[0170] When using this method, setting boundaries first ensures that subsequent functions, regardless of their shape, are confined to a feasible range, guaranteeing project stability. Boundary adjustments and threshold logs are cross-referenced to ensure consistency between this step and step four. Cluster-level and global double-layer variables leave room for subsequent linkages.
[0171] Furthermore, the softening attenuation intensity is mapped using clustering degree and brightness as dual independent variables, and a successive selection-softening process is adopted within the cluster, prioritizing the retention of high-confidence baseline boxes while exponentially attenuating adjacent boxes. The mapping function is required to monotonically increase with clustering degree and monotonically decrease with brightness to meet the need for gentler suppression when crowded and low-light conditions coexist.
[0172] Specifically, an attenuation intensity mapping is defined under boundary constant constraints, and softening suppression is performed on each candidate within the cluster:
[0173]
[0174] Where: attenuation intensity The denominator of the exponential decay in softening suppression is a positive real number, subject to upper and lower bounds; the lower bound is... Upper Realm : The attenuation intensity boundary from technical point B, a positive real number satisfying the magnitude relationship; clustering degree Calculated from the aforementioned steps, it is a non-negative real number; the crowding sensitivity constant. : A positive real number that controls the strength of clustering influence; luminance proxy Step 3: Export non-negative real numbers; brightness sensitivity parameters. : A positive real number that adjusts the slope of the brightness term.
[0175] Furthermore, using the baseline frame Perform softening decay on neighborhood candidates:
[0176]
[0177] Where: confidence level after attenuation Candidate Update confidence level, interval Original confidence level Step four retains the candidate confidence level, in intervals. ; reference frame The candidate with the highest current confidence within the cluster; intersection-union ratio. : The degree of overlap between the candidate and the baseline box, in intervals Attenuation intensity Consistent with the above formula.
[0178] As an example, a set of images of the forest edge transect is entered into this step after the initial screening in step four. The system first constructs neighborhoods based on spatial radius and scale difference, forming three clusters. In a grassy area, two deer of similar size form a highly overlapping cluster. The system reads that the brightness proxy is low and calculates the clustering degree of this cluster, resulting in a high crowding judgment. Then, based on the box with high confidence, its neighborhood candidates are exponentially attenuated, and the attenuated confidence is written to the cluster-level log. The boxes corresponding to the two deer are retained, and a background candidate far from the cluster is removed in the subsequent threshold comparison.
[0179] When used, in crowded and low-light conditions, the attenuation intensity increases due to the linkage, making the score of adjacent individuals decrease more gradually and avoiding being deleted all at once; in bright and sparse conditions, the attenuation intensity decreases, and redundant boxes are suppressed more quickly; the cluster-level logs form an evidence chain of baseline-neighborhood-attenuated confidence.
[0180] Furthermore, after attenuation, clustering degree and brightness are used together to determine whether to delete or retain. By using a dual-variable mapping of the suppression threshold, the crowded-low illumination segment is made more lenient and the sparse-bright field segment is made more stringent. At the same time, a steady-state correction is performed on the geometry of the retained boxes within the cluster, so that the center of gravity and edge of the box tend to be consistent within the cluster, avoiding the amplification of slight offsets caused by occlusion.
[0181] Furthermore, within the threshold boundaries, the threshold mapping is given by the following equation:
[0182]
[0183] Where: Suppression threshold Threshold for comparison with decayed confidence, interval upper bound of threshold Threshold lower bound Threshold boundaries, satisfying size relationships; clustering degree Crowding sensitivity constant Consistent with the above; Luminous proxy quantity Consistent with the above; brightness slope parameter : A positive real number that controls the intensity of the brightness term.
[0184] Geometric steady-state correction: The centroids of the retained boxes within the cluster are fine-tuned using a neighborhood-weighted summation, with the weights being the product of the intersection-union ratio and the decayed confidence. Then, a linear convergence is performed on the edges using the minimum bounding rectangle to prevent occluded edges from expanding outwards. This correction does not change the box semantics of the external interface; it only compacts the geometry within the cluster.
[0185] When in use, the threshold is lowered in the high-brightness-low cluster segment to avoid mistakenly deleting adjacent individuals; it is raised in the low-brightness-high cluster segment to reduce false candidates; geometric steady-state correction unifies the edge information within the cluster to the reference frame, reduces the center of gravity drift caused by occlusion, and provides a consistent geometric baseline for subsequent evaluation and display.
[0186] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0187] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0188] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0189] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0190] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A dual adaptive animal detection method based on illumination and clustering degree in a jungle scene, characterized in that: include, The original images and annotations are reorganized in the data domain, synthesized according to rare category conditions, and subjected to triple quality checks of fidelity, category consistency and diversity. A balanced training set is constructed using progressive matching and source labeling, and the pass rate percentage curve and data are saved. Scene consistency enhancement is performed on the balanced training set with label synchronization. Geometric and lighting perturbations are applied to the image and bounding box. Cropping and repair are performed when the boundary is exceeded. The failure rate is exceeded, triggering amplitude recovery and rollback, and the boundary rate and failure rollback are recorded. An adaptive illumination transformer is introduced as a parallel branch in the middle layer of the backbone network. It outputs the features after color correction and power-order correction and fuses them with the gated residual of the main branch. At the same time, it calculates the full-image brightness proxy for subsequent steps and keeps the size consistent. Based on the brightness proxy quantity and the target scale, a monotonic mapping is established for the target confidence threshold and the initial intersection-union ratio threshold of the candidate box. The front-end candidate set and the associated threshold log are formed by combining the neighborhood consistency screening and the results are saved and smoothed. The front-end candidate set is clustered into clusters according to intersection, union, ratio, and connectivity. The cluster-level clustering degree is calculated, and the attenuation intensity and suppression threshold of the softening non-maximum suppression are jointly scheduled using the clustering degree and the brightness proxy. The final detection result is output and the parameters are recorded.
2. The dual adaptive animal detection method according to claim 1, characterized in that: Based on the category conditions, generate synthetic samples of rare categories and write the source label; according to the training progress, add the synthetic samples to the balanced training set in a progressive ratio, while performing downsampling on common categories to maintain the consistency of category proportion; Triple quality checks include statistical fidelity in a fixed perceptual feature space; Category consistency is determined by the output of the frozen type discriminator; diversity is statistically analyzed by pairwise sensing distance; synthetic samples that do not reach the threshold are discarded or recycled and the threshold caliber is recorded.
3. The dual adaptive animal detection method according to claim 2, characterized in that: Geometric perturbations consist of rotation, translation, and scaling in a homogeneous affine chain order, synchronously transforming the image and the four vertices of the bounding box; illumination perturbations are performed within the segmented ranges of brightness, contrast, saturation, and hue; out-of-bounds vertices are clipped and then written back to the detection annotation format.
4. The dual adaptive animal detection method according to claim 3, characterized in that: When the enhancement degradation rate or out-of-bounds rate within a batch exceeds the threshold, a failure rollback is performed in the following order: first, reduce the angle and scaling, then reduce the occlusion area, and finally roll back within that batch. The out-of-bounds rate, degradation rate, number of rollbacks, and configuration version are written to the consistency log for reference in subsequent steps.
5. The dual adaptive animal detection method according to claim 4, characterized in that: The illumination adaptive transformer first projects the backbone features into three-channel pseudo-color features through channel projection, then applies a shared color correction matrix and channel grouping power correction sequentially, and then restores them to a tensor that is homologous to the backbone features through inverse projection, and generates fused features by gated residual fusion. The luminance surrogate is obtained by linearly converging the fused features point by point. The convergence weight vector is non-negative and normalized according to the first norm, and is recorded synchronously with the gating coefficients. The luminance surrogate is used for threshold mapping and subsequently for suppression parameter scheduling.
6. The dual adaptive animal detection method according to claim 5, characterized in that: Based on the brightness proxy quantity and the target area ratio, a target confidence threshold and an initial intersection-union ratio threshold are generated respectively. The two are monotonic mappings and are written to the threshold log at the batch level. Exponential smoothing is used to update the threshold across batches, and the smoothing coefficient and batch number are recorded.
7. The dual adaptive animal detection method according to claim 6, characterized in that: Neighborhood consistency screening constructs candidate neighborhoods based on spatial radius and scale difference. The spatial radius is based on the diagonal of the candidate box, and the scale difference is limited by the logarithmic distance. For each candidate, the maximum intersection-union ratio (IU) within the neighborhood is taken and compared with the initial IU threshold to determine whether to retain or remove the candidate and write it into the screening log.
8. The dual adaptive animal detection method according to claim 7, characterized in that: Using the initial intersection-union ratio (IU) threshold as the connectivity criterion, overlapping candidates are clustered together; for each cluster, the number of overlapping boxes, the average IU within the cluster, and the cluster area ratio are counted, and the three are used to form the cluster degree; the cluster number, connectivity threshold, and statistics are written together into the cluster-level log.
9. The dual adaptive animal detection method according to claim 8, characterized in that: In the softening nonmaximum suppression, the attenuation intensity and suppression threshold are jointly mapped by the clustering degree and the brightness surrogate quantity and are constrained by the upper and lower bounds. Within each cluster, the candidate with the highest confidence is used as the benchmark, and its neighboring candidates are continuously attenuated according to the degree of overlap, and the attenuation parameters and benchmark index are recorded.
10. The dual adaptive animal detection method according to claim 9, characterized in that: For the suppressed and retained candidates, perform geometric steady-state correction within the cluster: update the candidate centroid with the overlap of the neighboring candidates and the decayed confidence as weights, and perform linear convergence on the width and height according to the overlap within the cluster; The coordinates, weights, and cluster numbers before and after correction are written to the geometry correction log; The lower and upper bounds of the attenuation intensity and the lower and upper bounds of the suppression threshold are uniformly injected by the configuration file and synchronously adjusted according to the brightness segment; all boundary values and mapping version numbers are recorded and timestamped during the training and inference phases respectively.