Target identification method and device in low-light environment, and storage medium
By enhancing the image and feature extraction in a low-light environment, fusing the feature matrix to generate the ultimate feature representation, and inputting the classification model for target recognition, the problem of difficulty in target recognition in a low-light environment is solved and the accurate recognition of the target is achieved.
Patent Information
- Application Number
- CN202411561746.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-02-28
AI Technical Summary
In low-light environments, object recognition becomes difficult because image details are lost, color distorted, noise increases and contrast decreases, making the target difficult to distinguish from the background. Existing methods such as increasing exposure time will lead to motion blur and frame rate reduction, further difficult to identify targets.
By acquiring the original image in a low-light environment, image enhancement is performed to obtain the enhanced image, and feature extraction is performed on the original and enhanced images, respectively, to obtain the first and second feature vector matrices. Then, the two feature matrices are fused to generate the ultimate feature representation, and input the classification model for object recognition.
This method not only uses the information of the original image, but also fully considers the pre-enhanced image characteristics. Through dual-channel feature extraction, the image representation is enriched from different perspectives, and ultimately achieves accurate identification of the target in a low-light environment.
Smart Images

Figure CN119540524A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to a method, device and storage medium for target recognition in a low-light environment. Background Art
[0002] In low-light environments, people's visual ability will be reduced, which makes people more likely to encounter danger in certain situations, such as water activities. In this scenario, effective monitoring means are needed to accurately identify targets so that people can get help in time when they are in danger. When identifying targets in low-light environments, the images captured by the camera may lose some details, colors may be distorted, and noise may increase. These factors will make target detection and recognition more difficult. At the same time, the contrast of the image may be reduced, which may make it more difficult to distinguish the target from the background. In addition, if there are both bright and dark areas in the scene, the camera may not be able to capture details in all areas at the same time, which will also affect the effect of target recognition.
[0003] To address the above issues, existing methods usually use longer exposure times to capture enough light. However, this approach will cause motion blur (especially when the target or camera is moving). In addition, too long exposure time may also reduce the frame rate of the camera, thereby affecting target tracking and making target recognition more difficult. Summary of the invention
[0004] The present application provides a method, device and storage medium for target recognition in a low-light environment, which can accurately recognize targets in a low-light environment.
[0005] On the one hand, the present application provides a method for target recognition in a low-light environment, the method comprising:
[0006] Obtain an original image containing the target to be identified in a low-light environment;
[0007] The original image is enhanced to obtain an enhanced image containing the target to be identified in the low-light environment;
[0008] Performing feature extraction on the original image to obtain a first feature vector matrix, and performing feature extraction on the enhanced image to obtain a second feature vector matrix;
[0009] By fusing the first eigenvector matrix and the second eigenvector matrix, an ultimate feature representation of the original image containing the target to be identified in the low-light environment is obtained;
[0010] The ultimate feature representation is input into a classification model for target recognition.
[0011] On the other hand, the present application provides a target recognition device in a low-light environment, the device comprising:
[0012] An image acquisition module is used to acquire an original image containing a target to be identified in a low-light environment;
[0013] An image enhancement module, used to enhance the original image to obtain an enhanced image containing the target to be identified in the low-light environment;
[0014] A feature extraction module, used for performing feature extraction on the original image to obtain a first feature vector matrix, and performing feature extraction on the enhanced image to obtain a second feature vector matrix;
[0015] A fusion module, configured to obtain a final feature representation of the original image containing the target to be identified in the low-light environment by fusing the first feature vector matrix and the second feature vector matrix;
[0016] The recognition module is used to input the ultimate feature representation into a classification model for target recognition.
[0017] In a third aspect, the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the technical solution of the method for target recognition in a low-light environment as described above when executing the computer program.
[0018] In a fourth aspect, the present application provides a storage medium storing a computer program, which, when executed by a processor, implements the steps of the technical solution of the target recognition method in a low-light environment as described above.
[0019] From the technical solution provided by the present application, it can be seen that after the original image containing the target to be identified in the low-light environment is enhanced to obtain the enhanced image containing the target to be identified in the low-light environment, feature extraction is performed on the original image to obtain a first feature vector matrix, and feature extraction is performed on the enhanced image to obtain a second feature vector matrix, and then the first feature vector matrix and the second feature vector matrix are fused to obtain the ultimate feature representation of the original image containing the target to be identified in the low-light environment, and finally the ultimate feature representation is input into the classification model for target recognition. The technical solution of the present application not only utilizes the information of the original image, but also fully considers the characteristics of the image after pre-enhancement, and through dual-channel feature extraction, enriches the representation of the image from different perspectives, and finally fuses the features, so that the target in the low-light environment can be accurately recognized. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0021] Figure 1 is a flow chart of a method for target recognition in a low-light environment provided by an embodiment of the present application;
[0022] Figure 2 is a schematic diagram of the structure of a target recognition device in a low-light environment provided by an embodiment of the present application;
[0023] Figure 3 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0025] In this specification, adjectives such as first and second may be used only to distinguish one element or action from another element or action, without necessarily requiring or implying any actual such relationship or order. Where circumstances permit, reference to an element or component or step (etc.) should not be interpreted as being limited to only one of the elements, components, or steps, but may be one or more of the elements, components, or steps, etc.
[0026] In this specification, for the convenience of description, the sizes of various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0027] In low-light environments, people's visual ability will be reduced, which makes people more likely to encounter danger in certain situations, such as water activities. In this scenario, effective monitoring means are needed to accurately identify the target so that people can get help in time when they are in danger. In target recognition in low-light environments, the image captured by the camera may lose some details, the color may be distorted, and the noise may increase. These factors will make target detection and recognition more difficult. At the same time, the contrast of the image may be reduced, which may make it more difficult to distinguish the target from the background. In addition, if there are both bright and dark areas in the scene, the camera may not be able to capture details of all areas at the same time, which will also affect the effect of target recognition. To address the above problems, existing methods usually use longer exposure times to capture enough light. However, this method will cause motion blur (especially when the target or camera is moving). In addition, too long exposure time may also reduce the frame rate of the camera, thereby affecting target tracking and making target recognition more difficult.
[0028] In view of the above problems in the prior art, this application proposes a method for target recognition in a low-light environment, the flow chart of which is shown in the attached figure. Figure 1 As shown, it mainly includes steps S101 to S105, which are described in detail as follows:
[0029] Step S101: Acquire an original image containing a target to be identified in a low-light environment.
[0030] The so-called low-light environment refers to a scene with poor light intensity, such as at night, on a rainy day, etc. The target to be identified may be a person or other object. Generally, the original image containing the target to be identified in the low-light environment can be obtained through a camera.
[0031] Step S102: enhancing the original image to obtain an enhanced image containing the target to be identified in a low-light environment.
[0032] Generally speaking, due to the intensity of light, images in low-light environments will show defects such as blurriness and low recognition. In order to provide a more comprehensive and detailed data basis for subsequent analysis and recognition tasks, the original image can be enhanced to obtain an enhanced image containing the target to be identified in a low-light environment. In principle, adjusting the brightness and sharpness of the original image can be regarded as a technical means for enhancing the original image. As an embodiment of the present application, enhancing the original image to obtain an enhanced image containing the target to be identified in a low-light environment can be achieved through steps S1021 to S1023, as described in detail as follows:
[0033] Step S1021: Determine an image enhancement transformation function according to the need to enhance the original image.
[0034] Considering that some areas of the original image may be underexposed, while some areas may be overexposed, the grayscale of some areas of the original image may be limited to a very small grayscale range. At this time, the image may be very blurry, or the grayscale range of some areas is very wide, and the image is highlighted. First, according to the need to enhance the original image, the image enhancement transformation function can be determined to expand the required image detail grayscale, enhance the contrast, and compress the unnecessary image detail grayscale. Therefore, in an embodiment of the present application, the image enhancement transformation function can be a piecewise function. Here, determining the image enhancement transformation function according to the need to enhance the original image means that it is necessary to determine in which grayscale value ranges (i.e., the range defined by the interval endpoints) the image enhancement transformation function performs different linear transformation operations based on specific image processing goals or requirements. For example, if most of the pixels of the original image are concentrated in a certain grayscale interval, such as a low grayscale interval, and it is desired to enhance the contrast of this interval, the low grayscale interval can be determined as an interval endpoint range of the image enhancement transformation function; for another example, if it is desired to enhance the contrast of the dark area (the part with lower grayscale values) in the original image, it may be necessary to determine an interval endpoint containing a lower grayscale value as the interval endpoint of the image enhancement transformation function, so as to perform a special linear transformation processing on the grayscale values in this interval to make the details of the dark area clearer or enhance the contrast; for another example, if it is desired to adjust the brightness of the original image, the interval endpoint of the image enhancement transformation function is determined according to the degree of brightness that you want to increase or decrease; conversely, if you want to brighten the image as a whole, you can determine an interval endpoint containing a lower grayscale value as the interval endpoint of the image enhancement transformation function, so as to increase the grayscale values in this interval through linear transformation, and so on.
[0035] Step S1022: traverse each pixel in the original image, and calculate the grayscale value of the enhanced image according to the original grayscale value of the pixel and the image enhancement transformation function.
[0036] By traversing each pixel in the original image, if the grayscale value of a pixel in the original image is in a certain interval, the segmented part corresponding to the image enhancement transformation function is used to calculate the grayscale value of the pixel as the grayscale value of the corresponding pixel in the enhanced image.
[0037] Step S1023: updating the calculated grayscale value of the enhanced image to the corresponding pixel position in the original image, to obtain an enhanced image containing the target to be identified in a low-light environment.
[0038] The above-mentioned steps S1021 to S1023 are image enhancement technical solutions based on the spatial domain. In fact, the original image can also be enhanced by using an image enhancement technical solution based on the frequency domain. Specifically, as another embodiment of the present application, the original image is enhanced to obtain an enhanced image containing the target to be identified in a low-light environment. This can be achieved through steps S'1021 to S'1023, which are described in detail as follows:.
[0039] Step S'1021: starting from a pixel point at a specific position of the original image, traverse the pixel points of the original image.
[0040] Essentially, an image can be viewed as a square matrix consisting of pixels as elements. Starting from a pixel at a specific position in the original image, traversing the pixels of the original image is essentially starting from a specific position, for example, the upper left corner of the original image, and scanning the original image horizontally or vertically.
[0041] Step S'1022: overlap the central element of the preset m-order matrix with the pixel point of the traversed original image, where m is an odd number not less than 3.
[0042] As mentioned above, the image can be regarded as a square matrix composed of individual pixels as elements. In an embodiment of the present application, the size of the m-order matrix determines the neighborhood range considered when calculating the new value of each pixel. For example, matrices of sizes such as 3×3 and 5×5 can be selected. The more the order of the matrix, the more obvious the smoothing effect on the noise in the original image may be, but it will also make the original image more blurred and the amount of calculation will increase accordingly. The m-order matrix here, for example, a 3×3 matrix is like a sliding window, sliding on the original image with a step distance of one pixel or several pixels at a time, and each time it slides, the central element of the m-order matrix coincides with a pixel of the original image traversed once.
[0043] Step S'1023: For the overlapped pixel point, a weighted average value of the pixel values in its neighborhood and the corresponding element value in the m-order matrix is calculated as the new pixel value of the overlapped pixel point.
[0044] Specifically, for the overlapped pixel points, the values of the pixel points in its neighborhood (i.e., the range covered by the m-order matrix) are multiplied by the corresponding element values in the m-order matrix; then, these products are added to obtain a sum; finally, this sum is divided by the sum of all element values in the m-order matrix, and the result is the new pixel value of the overlapped pixel point. It should be noted that the reason why the sum obtained by directly adding the products of the pixel points in the neighborhood of the overlapped pixel points and the corresponding element values in the m-order matrix is not used as the new pixel value of the overlapped pixel point, but the sum is divided by the sum of all element values in the m-order matrix as the new pixel value of the overlapped pixel point is to ensure that the processed pixel values are within a reasonable range and maintain the overall brightness of the image and other characteristics.
[0045] The process from step S'1021 to step S'1023 is repeated until all the pixels of the original image are traversed and new pixel values of all the pixels of the original image are obtained.
[0046] As mentioned above, the size of the m-order matrix determines the neighborhood range considered when calculating the new value of each pixel. The more the order of the m-order matrix, the more obvious the smoothing effect on the noise in the original image may be, but at the same time, the original image will become more blurred, and the amount of calculation will increase accordingly, which means that it is necessary to reasonably preset an m-order matrix and its corresponding function. Therefore, the above embodiment also includes presetting the function corresponding to the m-order matrix according to the characteristics of the original image. In the embodiment of the present application, the parameter δ in the function corresponding to the m-order matrix can reflect the average degree of each element value of the m-order matrix, that is, the larger δ is, the more average the values of each element in the m-order matrix are; the smaller δ is, the more obvious the advantage of the central element value of the m-order matrix relative to the surrounding element value. Therefore, according to the characteristics of the original image, the function corresponding to the preset m-order matrix can be specifically: if the original image has more noise points and it is desired to significantly remove the noise points, the value of δ can be set to be larger, for example, the value of δ is set to be greater than a certain threshold; if it is desired to retain more image details of the original image, for example, high-frequency information such as edges, the value of δ can be set to be smaller, for example, the value of δ is set to be less than a certain threshold.
[0047] The reason why the value of δ is set to be larger is that a larger δ makes the element values of the m-order matrix relatively average in a larger range, which can comprehensively process pixels in a larger range and effectively smooth noise. Conversely, the value of δ is set to be smaller because a smaller δ value will make the weight of the central element of the m-order matrix larger, and the influence range on the surrounding pixels during filtering is relatively small, thereby reducing the blurring of details such as edges.
[0048] Step S103: extracting features from the original image to obtain a first feature vector matrix, and extracting features from the enhanced image to obtain a second feature vector matrix.
[0049] Specifically, the original image and the enhanced image can be input into the convolutional neural network CNN respectively. Through the convolution layer, pooling layer and other operations of CNN, a first eigenvector matrix consisting of a set of eigenvectors and a second eigenvector matrix consisting of another set of eigenvectors are obtained respectively. The eigenvectors in these eigenvector matrices contain various feature information in the original image and the enhanced image B, such as abstract representations of features such as edges, textures, and shapes in the image.
[0050] Step S104: The first eigenvector matrix and the second eigenvector matrix are fused to obtain the ultimate feature representation of the original image containing the target to be identified in the low-light environment.
[0051] Specifically, as an embodiment of the present application, by fusing the first eigenvector matrix and the second eigenvector matrix, obtaining the ultimate feature representation of the original image containing the target to be identified in the low-light environment can be achieved through steps S1041 to S1043, which are described in detail as follows:
[0052] Step S1041: By mapping the first eigenvector matrix and the second eigenvector matrix to the shared attention space, the corresponding first attention weight matrix and the second attention weight matrix are obtained respectively.
[0053] Specifically, by mapping the first eigenvector matrix and the second eigenvector matrix to the shared attention space, the corresponding first attention weight matrix and the second attention weight matrix can be obtained respectively: the eigenvectors f in the first eigenvector matrix are q and the eigenvector f in the second eigenvector matrix k are query vectors and key vectors to each other; by calculating the similarity between the query vector and the key vector, the corresponding first attention score and the second attention score are obtained respectively; the first attention score and the second attention score are normalized to obtain the corresponding first attention weight matrix and the second attention weight matrix.
[0054] In the above embodiment, the query vector can be understood as a representation of a demand or a goal. q Or the eigenvector f k When used as a query, it represents a specific focus on image features in the current task. For example, you may want to use the feature vector f q This query vector, in the feature vector f k Find the most relevant part in the feature vector, just like using a query statement to find relevant data in a database. The key vector is the element that matches the query vector. q Or the eigenvector f kWhen used as a key vector, it provides a basis for comparison with the query vector. For example, the feature vector f q When used as a query vector, the feature vector f k As the key vector, by comparing a certain relationship (eg, similarity) between them, it is determined which parts should be focused on. When calculating the similarity between the query vector and the key vector, the dot product between the query vector and the key vector may be specifically calculated.
[0055] It should be noted that, in the embodiment of the present application, the first attention weight matrix, the second attention weight matrix, the first eigenvector matrix and the second eigenvector matrix should be matrices of the same order.
[0056] Step S1042: Perform a weighted summation of the weights in the first attention weight matrix and the corresponding elements of the first eigenvector matrix to obtain a third eigenvector matrix, and perform a weighted summation of the weights in the second attention weight matrix and the corresponding elements of the second eigenvector matrix to obtain a fourth eigenvector matrix.
[0057] Corresponding to the query vector and key vector of the aforementioned embodiment, when the weights in the first attention weight matrix are weighted and summed with the corresponding elements of the first eigenvector matrix, the eigenvectors in the first eigenvector matrix actually play the role of the value vector. In the embodiment of the present application, the value vector is the data content corresponding to the key vector. When the eigenvector in the first eigenvector matrix is used as a value vector, once the focus is determined by matching the query vector and the key vector, the value vector provides the actual feature information related to these focus parts. For example, by matching the query vector and the key vector, some important feature positions are determined, and then the value vector provides the specific feature content at these positions. Integrating the query vector and the key vector into the core operation of the attention mechanism by playing these roles respectively is to use this relationship between them to readjust the focus on image features, so as to better perform subsequent tasks, such as improving feature recognition, etc.
[0058] Taking into account that in the attention space, the attention scores corresponding to the orthogonal eigenvectors are unrelated, which means that the model can independently adjust the degree of attention to each feature without affecting the attention to other features. Therefore, in an embodiment of the present application, the above method also includes: before obtaining the corresponding first attention score and the second attention score respectively by calculating the similarity of the query vector and the key vector, using orthogonal matrix multiplication to make the eigenvectors of the first eigenvector matrix and the second eigenvector matrix mutually orthogonal in the shared attention space, specifically, the first eigenvector matrix and the second eigenvector matrix are multiplied by the orthogonal matrix respectively.
[0059] Step S1043: perform element-wise addition of the third eigenvector matrix and the fourth eigenvector matrix to obtain a final eigenrepresentation.
[0060] Adding the third eigenvector matrix obtained by weighted summation to the fourth eigenvector matrix at element level can enhance information fusion, that is, the important feature information extracted from the first eigenvector matrix and the second eigenvector matrix can be further integrated, so that the ultimate feature representation can more comprehensively and accurately reflect the characteristics of the image.
[0061] Step S104: input the final feature representation into the classification model for target recognition.
[0062] The final feature representation is input into the classification model, and its fully connected layer performs the final hierarchical classification task. The fully connected layer can map the previously obtained feature representation to a specific classification category, thereby completing the image classification task. The entire solution goes through such a process, from the acquisition and preprocessing of low-light images, to feature extraction, attention mechanism calculation, and then to the final classification task, gradually improving the feature recognition of the image and optimizing the visual effect of the image under low-light conditions to meet specific analysis needs.
[0063] From the above attached Figure 1 From the target recognition method in the example of low-light environment, it can be seen that after the original image containing the target to be recognized in the low-light environment is enhanced to obtain the enhanced image containing the target to be recognized in the low-light environment, the feature extraction of the original image is performed to obtain the first feature vector matrix, and the feature extraction of the enhanced image is performed to obtain the second feature vector matrix, and then the ultimate feature representation of the original image containing the target to be recognized in the low-light environment is obtained by fusing the first feature vector matrix and the second feature vector matrix, and finally the ultimate feature representation is input into the classification model for target recognition. The technical solution of the present application not only utilizes the information of the original image, but also fully considers the characteristics of the image after pre-enhancement, and enriches the representation of the image from different perspectives through dual-channel feature extraction, and finally fuses the features, so that the target in the low-light environment can be accurately recognized.
[0064] Please see attached Figure 2 , is a target recognition device in a low-light environment provided by an embodiment of the present application, the device may include an image acquisition module 201, an image enhancement module 202, a feature extraction module 203, a fusion module 204 and a recognition module 205, which are described in detail as follows:
[0065] An image acquisition module 201 is used to acquire an original image containing a target to be identified in a low-light environment;
[0066] An image enhancement module 202 is used to enhance the original image to obtain an enhanced image containing the target to be identified in a low-light environment;
[0067] A feature extraction module 203, configured to perform feature extraction on the original image to obtain a first feature vector matrix, and perform feature extraction on the enhanced image to obtain a second feature vector matrix;
[0068] A fusion module 204, configured to obtain a final feature representation of an original image containing a target to be identified in a low-light environment by fusing the first feature vector matrix with the second feature vector matrix;
[0069] The recognition module 205 is used to input the final feature representation into the classification model for target recognition.
[0070] From the above attached Figure 2 It can be seen from the target recognition device in the example of a low-light environment that after enhancing the original image containing the target to be recognized in the low-light environment to obtain the enhanced image containing the target to be recognized in the low-light environment, feature extraction is performed on the original image to obtain a first feature vector matrix, and feature extraction is performed on the enhanced image to obtain a second feature vector matrix, and then the first feature vector matrix and the second feature vector matrix are fused to obtain the ultimate feature representation of the original image containing the target to be recognized in the low-light environment, and finally the ultimate feature representation is input into the classification model for target recognition. The technical solution of the present application not only utilizes the information of the original image, but also fully considers the characteristics of the pre-enhanced image, and through dual-channel feature extraction, enriches the representation of the image from different perspectives, and finally fuses the features, so that the target in the low-light environment can be accurately recognized.
[0071] Figure 3 Schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Figure 3 As shown, the electronic device 3 of this embodiment mainly includes: a processor 30, a memory 31, and a computer program 32 stored in the memory 31 and executable on the processor 30, such as a program of a method for identifying a target in a low-light environment. When the processor 30 executes the computer program 32, the steps in the method for identifying a target in a low-light environment are implemented, such as Figure 1 Alternatively, when the processor 30 executes the computer program 32, the functions of each module / unit in the above-mentioned device embodiments are implemented, for example Figure 2 The functions of the image acquisition module 201, the image enhancement module 202, the feature extraction module 203, the fusion module 204 and the recognition module 205 are shown.
[0072] Exemplarily, the computer program 32 of the target recognition method in a low-light environment mainly includes: obtaining an original image containing a target to be recognized in a low-light environment; enhancing the original image to obtain an enhanced image containing the target to be recognized in a low-light environment; extracting features from the original image to obtain a first eigenvector matrix, and extracting features from the enhanced image to obtain a second eigenvector matrix; fusing the first eigenvector matrix and the second eigenvector matrix to obtain the ultimate feature representation of the original image containing the target to be recognized in a low-light environment; inputting the ultimate feature representation into a classification model for target recognition. The computer program 32 can be divided into one or more modules / units, one or more modules / units are stored in the memory 31, and executed by the processor 30 to complete the present application. One or more modules / units can be a series of computer program instruction segments that can complete specific functions, and the instruction segments are used to describe the execution process of the computer program 32 in the electronic device 3. For example, the computer program 32 can be divided into the functions of an image acquisition module 201, an image enhancement module 202, a feature extraction module 203, a fusion module 204 and a recognition module 205 (modules in the virtual device), and the specific functions of each module are as follows: the image acquisition module 201 is used to acquire the original image containing the target to be identified in a low-light environment; the image enhancement module 202 is used to enhance the original image to obtain an enhanced image containing the target to be identified in a low-light environment; the feature extraction module 203 is used to extract features from the original image to obtain a first eigenvector matrix, and to extract features from the enhanced image to obtain a second eigenvector matrix; the fusion module 204 is used to obtain the ultimate feature representation of the original image containing the target to be identified in a low-light environment by fusing the first eigenvector matrix with the second eigenvector matrix; the recognition module 205 is used to input the ultimate feature representation into a classification model for target recognition.
[0073] The electronic device 3 may include but is not limited to a processor 30 and a memory 31. Those skilled in the art will appreciate that Figure 3 It is only an example of the electronic device 3 and does not constitute a limitation of the electronic device 3. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.
[0074] The processor 30 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0075] The memory 31 may be an internal storage unit of the electronic device 3, such as a hard disk or memory of the electronic device 3. The memory 31 may also be an external storage device of the electronic device 3, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 3. Further, the memory 31 may also include both an internal storage unit of the electronic device 3 and an external storage device. The memory 31 is used to store computer programs and other programs and data required by the electronic device. The memory 31 may also be used to temporarily store data that has been output or is to be output.
[0076] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned device can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0077] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0078] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example 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 performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0079] In the embodiments provided in the present application, it should be understood that the disclosed devices / equipment and methods can be implemented in other ways. For example, the device / equipment embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0080] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0081] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0082] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program of the target recognition method in a low-light environment can be stored in a storage medium. When the computer program is executed by the processor, it can implement the steps of each of the above-mentioned method embodiments, that is, obtaining an original image containing a target to be recognized in a low-light environment; enhancing the original image to obtain an enhanced image containing a target to be recognized in a low-light environment; extracting features from the original image to obtain a first eigenvector matrix, and extracting features from the enhanced image to obtain a second eigenvector matrix; by fusing the first eigenvector matrix and the second eigenvector matrix, the ultimate feature representation of the original image containing the target to be recognized in a low-light environment is obtained; and the ultimate feature representation is input into the classification model for target recognition. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. Storage media may include: any entity or device capable of carrying computer program code, recording media, USB flash drives, mobile hard disks, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content contained in the storage medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, storage media do not include electric carrier signals and telecommunication signals.
[0083] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application is described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some of the technical features therein by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. The specific implementation methods described above further describe the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only the specific implementation method of the present application, and is not used to limit the protection scope of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present invention.
Claims
1. A method for target recognition in a low-light environment, characterized in that: The method comprises: Obtain an original image containing the target to be identified in a low-light environment; The original image is enhanced to obtain an enhanced image containing the target to be identified in the low-light environment; Performing feature extraction on the original image to obtain a first feature vector matrix, and performing feature extraction on the enhanced image to obtain a second feature vector matrix; By fusing the first eigenvector matrix and the second eigenvector matrix, an ultimate feature representation of the original image containing the target to be identified in the low-light environment is obtained; The ultimate feature representation is input into a classification model for target recognition.
2. The target recognition method in a low-light environment as claimed in claim 1, characterized in that: The step of enhancing the original image to obtain an enhanced image containing the target to be identified in the low-light environment includes: Determining an image enhancement transformation function according to a requirement for enhancing the original image; Traversing each pixel in the original image, and calculating the grayscale value of the enhanced image according to the original grayscale value of the pixel and the image enhancement transformation function; The calculated grayscale value of the enhanced image is updated to the corresponding pixel position in the original image to obtain an enhanced image containing the target to be identified in the low-light environment.
3. The target recognition method in a low-light environment as claimed in claim 1, characterized in that: The step of enhancing the original image to obtain an enhanced image containing the target to be identified in the low-light environment includes: Starting from a pixel point at a specific position of the original image, traversing the pixel points of the original image; Overlapping the central element of a preset m-order matrix with the traversed pixel point of the original image, where m is an odd number not less than 3; For the overlapped pixel point, a weighted average value of the pixel values in its neighborhood and the corresponding element value in the m-order matrix is calculated as the new pixel value of the overlapped pixel point; The above process is repeated until all the pixels of the original image are traversed to obtain new pixel values of all the pixels of the original image.
4. The target recognition method in a low-light environment as claimed in claim 3, characterized in that: The method further comprises: According to the characteristics of the original image, the function corresponding to the m-order matrix is preset.
5. The target recognition method in a low-light environment as claimed in claim 1, characterized in that: The method of fusing the first eigenvector matrix and the second eigenvector matrix to obtain the ultimate feature representation of the original image containing the target to be identified in the low-light environment includes: By mapping the first eigenvector matrix and the second eigenvector matrix to the shared attention space, a corresponding first attention weight matrix and a second attention weight matrix are obtained respectively; Performing a weighted summation of the weights in the first attention weight matrix and the corresponding elements of the first eigenvector matrix to obtain a third eigenvector matrix, and performing a weighted summation of the weights in the second attention weight matrix and the corresponding elements of the second eigenvector matrix to obtain a fourth eigenvector matrix; The third eigenvector matrix and the fourth eigenvector matrix are added element-wise to obtain a final eigenrepresentation.
6. The target recognition method in a low-light environment as claimed in claim 5, characterized in that: The first eigenvector matrix and the second eigenvector matrix are mapped to the shared attention space to obtain the corresponding first attention weight matrix and the second attention weight matrix, respectively, including: The eigenvectors f in the first eigenvector matrix are respectively q and the eigenvector f in the second eigenvector matrix k They are query vectors and key vectors to each other; By calculating the similarity between the query vector and the key vector, a corresponding first attention score and a corresponding second attention score are obtained respectively; The first attention score and the second attention score are normalized to obtain the corresponding first attention weight matrix and second attention weight matrix.
7. The target recognition method in a low-light environment as claimed in claim 6, characterized in that: The method further comprises: Before respectively obtaining the corresponding first attention score and the second attention score by calculating the similarity between the query vector and the key vector, orthogonal matrix multiplication is used to make the eigenvectors of the first eigenvector matrix and the second eigenvector matrix orthogonal to each other in the shared attention space.
8. A target recognition device in a low-light environment, characterized in that: The device comprises: An image acquisition module is used to acquire an original image containing a target to be identified in a low-light environment; An image enhancement module, used to enhance the original image to obtain an enhanced image containing the target to be identified in the low-light environment; A feature extraction module, used for performing feature extraction on the original image to obtain a first feature vector matrix, and performing feature extraction on the enhanced image to obtain a second feature vector matrix; A fusion module, configured to obtain a final feature representation of the original image containing the target to be identified in the low-light environment by fusing the first feature vector matrix and the second feature vector matrix; The recognition module is used to input the ultimate feature representation into a classification model for target recognition.
9. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.