Safety belt state recognition method, electronic equipment and computer readable storage medium
By extracting the feature map of the seat area inside the car window and enhancing the extended area features, and combining the positional relationship between the driver and the steering wheel, using cross-attention processing and a large language model, the problem of low accuracy in seat belt status recognition inside the car window is solved, and more efficient seat belt status recognition is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG DAHUA TECH CO LTD
- Filing Date
- 2025-12-11
- Publication Date
- 2026-05-08
AI Technical Summary
Current technology for imaging inside vehicle windows is affected by factors such as lighting, weather, and angle, making it difficult for drivers to judge the status of their seat belts and resulting in low accuracy.
By extracting feature maps of the baseline and extended regions of the seating area, enhancing the features within the extended region, and utilizing cross-attention processing and a large language model to identify seat belt status, combined with the relationship between the driver and the steering wheel position, the recognition accuracy is improved.
It improves the accuracy and robustness of seat belt status recognition in complex environments, reduces false judgments, and enhances recognition efficiency.
Smart Images

Figure CN121999445A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to a seat belt status recognition method, electronic device, and computer-readable storage medium. Background Technology
[0002] With continuous improvements in technology and computing power, the intelligence of road monitoring equipment has been significantly enhanced, greatly improving the effectiveness of monitoring and recording traffic violations. Drivers not wearing seatbelts is one such violation of concern. However, various factors such as visibility through the vehicle window, lighting and weather, nighttime illumination, and capture angle pose significant challenges to the imaging of the scene inside the vehicle. Furthermore, the driver's own posture and movements also introduce further difficulties in judging the seatbelt's status. Summary of the Invention
[0003] The main technical problem addressed by this application is to provide a seat belt status recognition method, electronic device, and computer-readable storage medium that can improve the accuracy of seat belt status recognition.
[0004] To address the aforementioned technical problems, the first aspect of this application provides a seatbelt status recognition method. The method includes: extracting a seat feature map corresponding to a seat area from a target image, wherein the seat feature map includes a reference area representing the location of a preset seatbelt and an extended area extending outward from the reference area; enhancing at least some features within the extended area of the seat feature map to obtain a target feature map; and using the target feature map to perform seatbelt status recognition to obtain a status recognition result corresponding to the seat area, wherein the status recognition result includes whether the target in the seat area is wearing a seatbelt.
[0005] The seat belt status recognition method further includes, after extracting the seat feature map corresponding to the seat area from the target image, obtaining a first weight map corresponding to the seat feature map, wherein the first weight map contains first weights corresponding to each position point within a key region of the seat feature map, the key region including the reference region and the extended region; enhancing at least some features within the extended region of the seat feature map to obtain a target feature map includes: adjusting the first weight map, wherein at least one position point in the extended region can have its features enhanced by the adjusted first weight; fusing the adjusted first weight map with the seat feature map or a local feature map to obtain a target feature map, wherein the local feature map is the feature map corresponding to the key region in the seat feature map.
[0006] Wherein, the first weight in the first weight map before adjustment satisfies at least one of the following conditions: the maximum weight value and the minimum weight value in the first weight map before adjustment are respectively the reference maximum weight value and the reference minimum weight value; the first weight of each position point in the reference region is the reference maximum weight value; the first weight of each position point in the extended region decreases with distance from the reference region; the first weight of each position point in the extended region decreases with distance from the reference region according to a Gaussian distribution; and / or, in the first weight map before adjustment, the position point with the first weight of interest is the position point of interest, and the position point of interest is located between the reference maximum weight value and the reference minimum weight value; in the first weight map after adjustment, the first weight of the position point of interest is the largest, and the position point with the first weight before adjustment that is closer to the position point of interest has a larger first weight after adjustment; and / or, the first weight of each position point in the first weight map after adjustment is greater than or equal to the reference maximum weight value.
[0007] The step of enhancing at least some features within the extended region of the seat feature map to obtain a target feature map is performed when the seat feature map is used to preliminarily determine that the target in the seat area is wearing a seat belt. Before using the target feature map to perform seat belt status recognition and obtain the status recognition result corresponding to the seat area, the seat belt status recognition method further includes: if the seat feature map is used to preliminarily determine that the target is not present in the seat area or that the target in the seat area is not wearing a seat belt, the seat feature map or a local feature map is used as the target feature map, wherein the local feature map is the feature map corresponding to a key region in the seat feature map, and the key region includes the reference region and the extended region.
[0008] The seat belt status recognition method further includes, after extracting the seat feature map corresponding to the seat area from the target image, the method further includes: performing a preliminary judgment using the seat feature map; if the preliminary judgment indicates that the target in the seat area is wearing a seat belt, generating a first weight map corresponding to the seat feature map, wherein the first weight map includes the first weights corresponding to each position point within a key region of the seat feature map, the key region including the reference region and the extended region, the first weights of each position point in the reference region being the maximum reference weight value, and the first weights of each position point in the extended region decreasing with distance from the reference region; if the preliminary judgment indicates that the target is not present in the seat area or that the target in the seat area is not wearing a seat belt, generating a second weight map corresponding to the seat feature map as the weight map corresponding to the seat feature map, wherein the second weight map includes the key region of the seat feature map. The second weights corresponding to each location point within the domain, wherein the second weights of each location point in the key region are all reference minimum weight values; the enhancement of at least some features in the extended region of the seat feature map to obtain a target feature map includes: adjusting the first weight map, wherein at least one location point in the extended region can have its features enhanced by the adjusted first weight; fusing the adjusted first weight map with the seat feature map or local feature map to obtain a target feature map, wherein the local feature map is the feature map corresponding to the key region in the seat feature map; the use of the seat feature map or local feature map as the target feature map includes: adjusting the second weight map, wherein the adjusted second weights of each location point in the key region can make the features of the corresponding location point unchanged after fusion; fusing the adjusted second weight map with the seat feature map or local feature map to obtain a target feature map.
[0009] The adjustment of the first weight map, or the adjustment of the second weight map, includes: for each location point within the key region, obtaining the first difference between the first weight / second weight of the location point before adjustment and the focus weight value, and subtracting the square of the first difference from the target upper limit weight value to obtain the second difference, which is used as the adjusted first weight / second weight of the location point; and / or, the fusion of the adjusted first weight map with the seat feature map or local feature map, or the fusion of the adjusted second weight map with the seat feature map or local feature map, includes: multiplying the adjusted first weight map / second weight map with the seat feature map or local feature map.
[0010] Before using the target feature map to perform seat belt status recognition and obtain the status recognition result corresponding to the seat area, the seat belt status recognition method further includes: performing cross-attention processing on the target feature map and the seat feature map to obtain a new target feature map for use in the seat belt status recognition.
[0011] The step of extracting the seat feature map corresponding to the seat area from the target image includes: obtaining an initial feature map of the target image; extracting features within a preset area from the initial feature map as a region feature map; using the region feature map as the region feature map corresponding to the seat area, or performing cross-attention processing on the region feature map and the initial feature map to obtain the region feature map corresponding to the seat area.
[0012] The step of performing cross-attention processing on the target feature map and the seat feature map, or the step of performing cross-attention processing on the region feature map and the initial feature map, includes: performing feature transformation on the first feature map to obtain query features, performing feature transformation on the second feature map to obtain key features and value features; and performing cross-attention processing using the query features, key features, and value features; wherein the first feature map is the target feature map, and the second feature map is the seat feature map; or, the first feature map is the search region feature map, and the second feature map is the initial feature map.
[0013] The step of using the target feature map to perform seat belt status recognition and obtain the status recognition result corresponding to the seat area is executed by a large language model; and / or, before using the target feature map to perform seat belt status recognition and obtain the status recognition result corresponding to the seat area, the method further includes: using the initial feature map of the target image to identify the positional relationship between a preset part of the driver's target in the target image and the steering wheel; and the step of using the target feature map to perform seat belt status recognition and obtain the status recognition result corresponding to the seat area includes: using the positional relationship and the target feature map corresponding to each seat area in the target image to perform seat belt status recognition and obtain the status recognition result corresponding to each seat area in the target image.
[0014] The step of using the positional relationship and the target feature map corresponding to each seat area in the target image to perform seat belt status recognition and obtain the status recognition result corresponding to each seat area in the target image includes: concatenating the positional relationship, the features corresponding to each seat area in the target image, and the prompt words to obtain concatenated features, wherein the features corresponding to each seat area are the target feature map corresponding to the seat area, or the sequence features obtained by serializing the target feature map corresponding to the seat area; and using the large language model to predict the concatenated features to obtain the status recognition result corresponding to each seat area in the target image.
[0015] To address the aforementioned technical problems, a second aspect of this application provides an electronic device comprising a memory and a processor. The memory stores program instructions, and the processor executes the program instructions to implement the aforementioned seatbelt status recognition method.
[0016] To address the aforementioned technical problems, a third aspect of this application provides a computer-readable storage medium for storing program instructions that can be executed to implement the aforementioned seatbelt status recognition method.
[0017] The aforementioned technical solution enhances at least some features within the extended region by selectively and adaptively enhancing diagonal local features related to the seatbelt, based on the discriminability of features at corresponding locations in the shallow stages of the network. When the visible portion of the seatbelt is small, the network can enhance the features of these key areas to highlight the weak signals of the seatbelt, making features that might otherwise be ignored or difficult to distinguish more apparent, thereby improving the sensitivity and recognition ability of these features. Attached Figure Description
[0018] Figure 1 This is a flowchart illustrating an embodiment of the seatbelt status recognition method provided in this application; Figure 2 This is a schematic diagram of an embodiment of the target image provided in this application; Figure 3 This is a schematic diagram illustrating the enhancement of at least some features within the extended region provided in this application; Figure 4 This is a schematic diagram of another embodiment of the target image provided in this application; Figure 5 yes Figure 1 The flowchart of step S11 shown is a schematic diagram of one embodiment. Figure 6 This is a schematic diagram of the region feature map corresponding to the seat area provided in this application; Figure 7 yes Figure 1 The flowchart of step S12 shown is a schematic diagram of one embodiment; Figure 8 This is a schematic diagram of an embodiment of the seat belt status recognition device provided in this application; Figure 9 This is a schematic diagram of the structure of an embodiment of the electronic device provided in this application; Figure 10 This is a schematic diagram of an embodiment of the computer-readable storage medium provided in this application. Detailed Implementation
[0019] The embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0020] In the following description, specific details such as particular system architectures, interfaces, and technologies are presented for illustrative purposes rather than for limiting purposes, in order to provide a thorough understanding of this application.
[0021] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship. Furthermore, "many" in this document means two or more. Moreover, the term "at least one" in this document means any combination of at least two of any one or more of a plurality of objects. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.
[0022] Please see Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the seatbelt status recognition method provided in this application. It should be noted that if substantially the same result is achieved, this embodiment does not necessarily reflect that outcome. Figure 1 The illustrated process sequence is limited. For example... Figure 1 As shown, this embodiment includes: Step S11: Extract the seat feature map corresponding to the seat area from the target image.
[0023] In this embodiment, a seat feature map corresponding to the seat area is extracted from the target image; wherein, the seat feature map includes a reference area representing the location of the preset seat belt and an extended area extending outward from the reference area.
[0024] Seat belts are fixed devices installed on seats, and their application only covers the seat area. Each seat belt has a corresponding seat, and it only provides its intended protection when the passenger is seated and wearing the seat belt correctly. Therefore, the area related to seat belts is the seat area. Extracting the seat feature map corresponding to the seat area from the target image allows for the separation of seat belt identification-related information from the complex overall target image, avoiding interference from other irrelevant areas. This enables subsequent processing of features directly related to the seat and seat belt status, significantly improving the targeting and accuracy of seat belt status identification. Furthermore, narrowing down the large target image to the relatively small area of the seat feature map reduces the amount of data to be processed and the computational complexity. Instead of searching for seat belt-related information throughout the entire target image, analysis is performed within a specific seat feature map area, thereby improving the efficiency of seat belt status identification and accelerating processing speed.
[0025] Considering that seat belts are typically pulled out from the sides of the vehicle and fastened by interlocking the buckle with the central slot, the seat belt generally runs diagonally. Therefore, the reference area representing the preset seat belt position is the diagonal area within the seating area. Furthermore, extracting features solely from a baseline region representing the predefined location of the seatbelt may miss some information surrounding the seatbelt that aids in seatbelt status recognition. However, by setting an extended region, environmental features around the seatbelt and features of objects connected to or related to it can be considered. These features may be related to seatbelt status recognition, and the extended region can comprehensively capture these features, providing richer information for more accurate seatbelt status identification. On the other hand, in real-world scenarios, the seatbelt position may shift or deform to some extent due to factors such as passenger posture and seat adjustments. If relying solely on the baseline region, minor changes in seatbelt position may prevent accurate feature extraction, affecting the recognition results. The extended region can accommodate such reasonable changes in seatbelt position. Even if the seatbelt is not entirely within the baseline region, its relevant features can still be captured within the extended region, providing a degree of tolerance for minor changes in seatbelt position and improving the robustness of seatbelt status recognition.
[0026] It should be noted that the seat feature map corresponding to the seat area extracted from the target image can be the seat feature map corresponding to the driver's seat area, or the seat feature map corresponding to the passenger seat area. Of course, it can also be the seat feature map corresponding to the driver's seat area and the seat feature map corresponding to the passenger seat area extracted separately.
[0027] In one implementation, such as Figure 2As shown, Figure 2 This is a schematic diagram of an embodiment of the target image provided in this application. The target image is a car window image.
[0028] Step S12: Enhance at least some features within the extended region of the seat feature map to obtain the target feature map.
[0029] In this embodiment, at least some features within the extended region of the seat feature map are enhanced to obtain the target feature map.
[0030] The extracted seat feature map clearly defines a baseline region representing the pre-defined seat belt location, directly integrating prior information about the seat belt position into the feature extraction stage. By pre-defining a baseline region where the seat belt might exist, a clear scope of focus is provided in subsequent processing, rather than blindly searching for seat belt features across the entire image or seat area. In addition to the baseline region, an extended region extending outward from it is also set. This takes into account the possibility that the seat belt may have a certain degree of offset or deformation in real-world scenarios. The extended region can accommodate such reasonable changes in the seat belt position, further enriching the positional information related to the seat belt. This allows for a more comprehensive capture of the features of the seat belt and its surrounding environment, better adapting to the uncertainty of the seat belt position, and overall strengthening the utilization of prior information about the seat belt position.
[0031] In the shallow stages of a network, features at different locations exhibit varying degrees of discriminability. For seatbelt status recognition, the features within the baseline region and its surrounding extended region are most closely related to seatbelt status recognition. Since these regions directly correspond to the possible locations where seatbelts may be present, their features possess higher information content and discriminability in characterizing seatbelt status.
[0032] Enhancing at least some features within the extended region essentially involves adaptively enhancing diagonal local features related to the seatbelt based on the discriminability of features at corresponding locations in the shallower stages of the network. When the visible portion of the seatbelt is small, the network can enhance features in these key areas to highlight weak signals from the seatbelt, making features that might otherwise be ignored or difficult to distinguish more apparent, thereby improving sensitivity and recognition capabilities for these features. For example, if only a small portion of the seatbelt is exposed, enhancing the features of its corresponding diagonal local area allows the network to better capture these features and thus accurately determine the seatbelt's condition.
[0033] In one embodiment, the target feature map includes only a reference area representing the location of the preset seat belt and an extended area extending outward from the reference area; that is, the target feature map includes only the key area of the seat feature map.
[0034] The target feature map only includes a reference region representing the preset location of the seat belt and an extended region extending outward from the reference region. Considering that the actual direction of the seat belt may not necessarily meet a strict diagonal direction, in one specific embodiment, before using the target feature map to perform seat belt state recognition and obtain the state recognition result corresponding to the seat area, the target feature map and the seat feature map are subjected to cross-attention processing to obtain a new target feature map for use in seat belt state recognition. That is, the target feature map and the seat feature map are subjected to cross-attention processing to obtain a new target feature map to ensure that key features are not lost.
[0035] In one specific implementation, cross-attention processing is performed on the target feature map and the seat feature map. Specifically, the target feature map is transformed to obtain query features, and the seat feature map is transformed to obtain key features and value features. Cross-attention processing is then performed using the query features, key features, and value features. Specifically, the target feature map is transformed to obtain query features, and the seat feature map is transformed to obtain key features and value features. Then, cross-attention calculation is performed on the query features, key features, and value features to ensure that no crucial features are lost, resulting in a new target feature map.
[0036] In one specific implementation, such as Figure 3 As shown, Figure 3 This is a schematic diagram illustrating the enhancement of at least some features within an extended region, as provided in this application. At least some features within the extended region are enhanced in the seat feature maps corresponding to the driver's seat and the passenger seat, respectively, resulting in target feature maps corresponding to the driver's seat and the passenger seat, and a seat feature map corresponding to the passenger seat area. For The diagonal direction is set as the actual direction of the seat belt, and the target feature map corresponding to the driver's seat is... Perform feature transformation to obtain the query feature Q corresponding to the driver's seat, and generate the seat feature map corresponding to the driver's seat. Perform feature transformation to obtain the key feature K and value feature V corresponding to the driver's seat; perform Cross Attention calculation on the query feature Q corresponding to the driver's seat and the corresponding key feature K and value feature V to obtain a new target feature map corresponding to the driver's seat, denoted as . .for The diagonal direction is set as the actual direction of the seat belt, and the target feature map corresponding to the passenger seat is... Perform feature transformation to obtain the query feature Q corresponding to the passenger seat, and generate the seat feature map corresponding to the passenger seat. Perform feature transformation to obtain the key feature K and value feature V corresponding to the passenger seat; perform Cross Attention calculation on the query feature Q corresponding to the passenger seat and the corresponding key feature K and value feature V to obtain a new target feature map corresponding to the passenger seat, denoted as . .
[0037] It should be noted that when the feature dimension h of the target feature maps corresponding to the driver's seat and the passenger's seat is not equal to w / 2, in Determine the diagonal within the range.
[0038] In one specific implementation, after performing cross-attention processing on the target feature map and the seat feature map to obtain a new target feature map, the new target feature map is processed using a visual Transformer encoder.
[0039] For example, at least some features within the extended regions of the seat feature maps corresponding to the driver's seat and the passenger seat are enhanced to obtain the target feature map corresponding to the driver's seat. Target feature map corresponding to the passenger seat ; Target feature map corresponding to the driver's seat Target feature map corresponding to the passenger seat After passing through the visual Transformer encoder, the results are obtained. and .
[0040] Step S13: Use the target feature map to identify the seat belt status and obtain the status identification result corresponding to the seat area.
[0041] In this embodiment, seatbelt status recognition is performed using the target feature map to obtain the status recognition result corresponding to the seat area; wherein, the status recognition result includes whether the target in the seat area is wearing a seatbelt. Enhancing at least some features within the extended area is essentially an adaptive enhancement of diagonal local features related to the seatbelt, based on the ease of discrimination of the corresponding positional features in the shallow stages of the network. When the visible portion of the seatbelt is small, the network can enhance the features of these key areas to highlight the weak signal of the seatbelt, making features that might otherwise be ignored or difficult to distinguish more obvious, thereby improving the sensitivity and recognition ability of these features.
[0042] In one embodiment, the step of using the target feature map to perform seat belt status recognition and obtain the status recognition result corresponding to the seat area is performed by a large language model.
[0043] In one embodiment, before using the target feature map to perform seat belt status recognition and obtain the status recognition result corresponding to the seat area, the initial feature map of the target image is used to identify the positional relationship between a preset part of the driver's target in the target image and the steering wheel. At this time, using the target feature map to perform seat belt status recognition and obtain the status recognition result corresponding to the seat area specifically involves: using the positional relationship and the target feature map corresponding to each seat area in the target image to perform seat belt status recognition and obtain the status recognition result corresponding to each seat area in the target image.
[0044] The preset location could be the driver's face. Factors such as vehicle type, seat height, and driver's posture can also affect the visible portion of the seatbelt. Compared to the front passenger seat, the presence of the steering wheel in the driver's seat can easily cause interruptions or partial obstruction of the visible seatbelt, adding extra difficulty to judging its status. Figure 4 As shown, Figure 4 This is a schematic diagram of another embodiment of the target image provided in this application, from... Figure 4 It can be observed that the closer the driver's face is to the steering wheel, the less information about the seatbelt can be observed in front of the body, and the shadow of the steering wheel can easily interfere with the judgment of seatbelt status. Therefore, by identifying the positional relationship between a preset part of the driver's face and the steering wheel in the target image, additional usable information is introduced, thereby improving the accuracy of seatbelt status recognition.
[0045] In one specific implementation, the steering wheel and the driver's face are well-defined and easily detectable targets. Therefore, to identify the positional relationship between a preset part of the driver's face and the steering wheel in the target image, a pre-trained detection mini-model can be used to detect the positions of the driver's face and the steering wheel. The output positional relationship between the preset part of the driver's face and the steering wheel is a normalized coordinate. The initial default value can be set to a value with special meaning to handle the case where no one is present. In addition, the detection mini-model is frozen during training, and its parameters are not updated.
[0046] In one specific implementation, seatbelt status recognition is performed using positional relationships and target feature maps corresponding to each seat area in the target image to obtain status recognition results for each seat area in the target image. Specifically, the positional relationships, features corresponding to each seat area in the target image, and prompt words are concatenated to obtain concatenated features. The features corresponding to each seat area are either target feature maps corresponding to those seat areas, or sequence features obtained by serializing the target feature maps corresponding to those seat areas. A large language model is then used to predict the concatenated features to obtain the status recognition results for each seat area in the target image. In other words, using a large language model as a decoder fully utilizes the generalization ability of the large language model, improving the accuracy of seatbelt status recognition.
[0047] The positional relationship between the preset location of the driver's seat and the steering wheel provides spatial clues about the seat belt's location within the seating area, such as its position relative to the seat back and cushion. This helps to define the approximate extent of the seat belt in the target image. The target feature map or sequence features contain visual features of the seat belt, such as details like color, texture, and shape. Cue words guide the large language model to focus on key information related to seat belt status recognition, such as "is the seat belt fastened?" or "is the seat belt twisted?" By combining these three elements, the large language model can comprehensively utilize this multi-dimensional information to more accurately determine the seat belt status and reduce misjudgments caused by insufficient information from a single source.
[0048] Furthermore, real-world images may contain various interfering factors, such as changes in lighting and obstructions. The positional relationship between the preset part of the driver's seat and the steering wheel can help the large language model distinguish the seat belt from nearby but unrelated objects. Target feature maps or sequence features can capture the unique visual features of the seat belt, thereby reducing the impact of interference on the recognition results. Cue words can further clarify the recognition task, allowing the large language model to focus more on features related to the seat belt status, thus improving the accuracy of seat belt status recognition.
[0049] For example, the prompt could be "Please output the seat belt status recognition results for the driver and passenger based on the above information".
[0050] In one specific implementation, during the training phase of the large language model, the target state of the driver's position that the large language model can learn may include: no target in the driver's seat, the driver's target not wearing a seat belt, and the driver's target wearing a seat belt; the target state of the passenger's position may include: no target in the passenger's seat, the passenger's target not wearing a seat belt, and the passenger's target wearing a seat belt.
[0051] In one specific implementation, the loss between the prediction result of the large language model and the true label is denoted as Loss. llm By minimizing the lossdnet The parameters of the large language model are continuously updated until the large language model converges.
[0052] Please see Figure 5 , Figure 5 yes Figure 1 The diagram shows a flowchart of one embodiment of step S11. It should be noted that if substantially the same result is achieved, this embodiment does not necessarily follow the same pattern. Figure 5 The illustrated process sequence is limited. For example... Figure 5 As shown, this embodiment includes: Step S51: Obtain the initial feature map of the target image.
[0053] In this embodiment, an initial feature map of the target image is obtained. Specifically, a patch is applied to the target image. h ×patch w Patch Embedding is performed on a pixel window to obtain the initial feature map of the target image. This initial feature map is denoted as F. emb ∈R h×w×c Where h = H / patch h w=W / patch w c represents the dimension of each feature in the initial feature map, which can be set to 512.
[0054] Step S52: Extract features from a preset region from the initial feature map to form a region feature map.
[0055] In this embodiment, features within a preset region are extracted from the initial feature map and used as the region feature map.
[0056] The preset area can be the seat area corresponding to the driver's seat, in which case the seat belt status of the driver's seat will be identified; the preset area can also be the seat area corresponding to the passenger seat, in which case the seat belt status of the passenger seat will be identified; the preset area can also include the seat areas corresponding to the driver's seat and the passenger seat respectively, in which case the seat belt status of the driver's seat and the passenger seat will be identified separately.
[0057] In one implementation, such as Figure 6 As shown, Figure 6 This is a schematic diagram of obtaining the region feature map corresponding to the seat area provided in this application. The target image is a car window image. The initial feature map of the target image is split according to the left and right directions to obtain the region feature map corresponding to the driver's seat and the region feature map corresponding to the passenger seat.
[0058] Step S53: Use the region feature map as the region feature map corresponding to the seat area, or perform cross-attention processing on the region feature map and the initial feature map to obtain the region feature map corresponding to the seat area.
[0059] In this embodiment, the area feature map is used as the area feature map corresponding to the seating area. That is, the area feature map can be directly used as the area feature map corresponding to the seating area.
[0060] For example, if the target image is a car window image and the preset regions include the seat regions corresponding to the driver's seat and the passenger seat, respectively, the initial feature map F of the target image is... emb The system is split into two regions, left and right, to obtain the feature map of the area corresponding to the driver's seat and the area corresponding to the passenger seat. The feature map of the area corresponding to the driver's seat is used as the feature map of the area corresponding to the driver's seat, and the feature map of the area corresponding to the passenger seat is used as the feature map of the area corresponding to the passenger seat.
[0061] Considering the potential for skewed imaging angles from the vehicle window and the influence of the driver's posture and movements, if key features such as the seatbelt, the driver's arm, or body happen to be near the dividing line of the preset area, these features will be fragmented, with some remaining within the preset area and others outside. This results in incomplete information obtained from the preset area. Therefore, in this embodiment, the region feature map can also undergo cross-attention processing with the initial feature map to obtain the region feature map corresponding to the seat area. In other words, the region feature map can also undergo cross-attention processing with the initial feature map to obtain the region feature map corresponding to the seat area, ensuring that no key features are lost.
[0062] In one embodiment, cross-attention processing is performed between the regional feature map and the initial feature map. Specifically, the regional feature map is transformed to obtain query features, and the initial feature map is transformed to obtain key features and value features. Cross-attention processing is then performed using the query features, key features, and value features. Specifically, the regional feature map is transformed to obtain query features, and the initial feature map is transformed to obtain key features and value features. Then, cross-attention calculation is performed between the query features and the key and value features to ensure that no crucial features are lost, resulting in the regional feature map corresponding to the seating area.
[0063] In one specific implementation, such as Figure 2As shown, the target image is a car window image. The initial feature map of the target image is split along the left and right directions to obtain the feature maps of the driver's seat and the passenger seat. The feature maps of the driver's seat and the passenger seat are then transformed sequentially to obtain query features Q1 and Q2. Additionally, the initial feature map of the target image is transformed to obtain key features K and value features V. Cross-Attention is then applied to query features Q1 and Q2 with key features K and value features V to ensure no key features are lost, resulting in the feature maps of the driver's seat area and the passenger seat area. The feature map of the driver's seat area is denoted as... Regional feature map of the seating area corresponding to the front passenger seat. .
[0064] Please see Figure 7 , Figure 7 yes Figure 1 The flowchart shown is a schematic diagram of one embodiment of step S12. It should be noted that if substantially the same result is achieved, this embodiment does not necessarily follow the same pattern. Figure 7 The illustrated process sequence is limited. For example... Figure 7 As shown, after extracting the seat feature map corresponding to the seat region from the target image, a first weight map corresponding to the seat feature map is obtained. The first weight map contains the first weights corresponding to each position point within the key region of the seat feature map. The key region includes a reference region and the extended region. This embodiment includes: Step S71: Adjust the first weight graph.
[0065] In this embodiment, the first weight map is adjusted; wherein, at least one location point in the extended region can have its features enhanced by the adjusted first weight. In other words, by adjusting the weights of each location point within the key region of the seating feature map, the features of the corresponding location point can be enhanced.
[0066] In one embodiment, the first weights in the first weight map before adjustment satisfy at least one of the following conditions: the maximum weight value and the minimum weight value in the first weight map before adjustment are respectively the reference maximum weight value and the reference minimum weight value; the first weights of each location point in the reference region are all the reference maximum weight values; the first weights of each location point in the extended region decrease with the distance from the reference region; and the first weights of each location point in the extended region decrease with the distance from the reference region according to a Gaussian distribution.
[0067] In one implementation, in the first weight map before adjustment, the location point with the first weight as the weight of interest is the location point of interest, and the weight of interest lies between the maximum reference weight value and the minimum reference weight value. In the first weight map after adjustment, the location point of interest has the largest first weight, and the closer the location point's first weight was to the weight of interest before adjustment, the larger its weight will be after adjustment. In the first weight map after adjustment, the closer the first weight of a location point was to the weight of interest before adjustment, the more difficult it is to determine the seat belt status at that location point, and the weight of that location point needs to be explicitly increased.
[0068] The weight value can be the median of the maximum and minimum reference weight values. The maximum reference weight value can be 1, and the minimum reference weight value can be 0.
[0069] In one embodiment, the first weight of each point in the adjusted first weight map is greater than or equal to the reference maximum weight value.
[0070] In one specific implementation, a discriminant network can be used to analyze the discriminability of the feature maps corresponding to the key regions to obtain the first weight map corresponding to the seat feature map, that is, to obtain the first weights corresponding to each position point in the baseline region and the extended region. The discriminant network can be a lightweight discriminant network such as DNet, and is not limited here.
[0071] For example, taking the area feature map of the seat area corresponding to the driver's seat as an example. For example: The feature map of the seating area corresponding to the driver's seat is as follows: The first weight graph is obtained by analyzing the output of the discriminant network. The first weight map contains the first weights corresponding to each location point in the key area. The first weights are between 0 and 1. The closer the first weight of a location point is to 1, the more likely it is that the seat belt is fastened.
[0072] In one specific implementation, during the training of the discriminant network, the loss function can be used. Constraints are imposed on the training of the discriminant network.
[0073] Step S72: Fuse the adjusted first weight map with the seat feature map or local feature map to obtain the target feature map.
[0074] In this embodiment, the adjusted first weight map can be fused with the seat feature map to obtain a target feature map, thereby enhancing the features of each location point within the key area of the seat feature map. Alternatively, the feature map corresponding to the key area can be extracted from the seat feature map as a local feature map, and then fused with the adjusted first weight map to enhance the features of each location point within the key area.
[0075] Instead of enhancing features at all locations, features from only the baseline and extended regions were sampled, and then weights were adjusted. This sampling method reduces the computational load for subsequent seatbelt status recognition.
[0076] For example, taking the area feature map of the seat area corresponding to the driver's seat as an example. The first weighted graph corresponding to the driver's seat is For example: the feature map of the area corresponding to the driver's seat. With the corresponding first weight graph The feature map corresponding to the driver's seat is obtained by fusion. .
[0077] In one embodiment, the step of enhancing at least some features in the extended region of the seat feature map to obtain the target feature map is performed when the target in the seat area is preliminarily determined to be wearing a seat belt using the seat feature map. Before using the target feature map to perform seat belt status recognition and obtain the status recognition result corresponding to the seat area, if the target in the seat area is preliminarily determined to be absent or not wearing a seat belt using the seat feature map, the seat feature map or a local feature map is used as the target feature map. The local feature map is the feature map corresponding to the key area in the seat feature map, and the key area includes the base area and the extended area.
[0078] In one specific implementation, after extracting the seat feature map corresponding to the seat area from the target image, the seat feature map is used for preliminary discrimination. If it is preliminarily determined that the target in the seat area is wearing a seat belt, a first weight map corresponding to the seat feature map is generated. The first weight map includes the first weights corresponding to each position point within a key region of the seat feature map. The key region includes a base region and an extended region. The first weights of each position point in the base region are all reference maximum weight values, and the first weights of each position point in the extended region decrease with distance from the base region. If it is preliminarily determined that there is no target in the seat area or that the target in the seat area is not wearing a seat belt, a second weight map corresponding to the seat feature map is generated as the weight map corresponding to the seat feature map. The second weight map includes the first weights corresponding to each position point within the key region of the seat feature map. The second weight, where the second weight of each position point in the key region is a reference minimum weight value; enhancing at least some features in the extended region of the seat feature map to obtain the target feature map, specifically: adjusting the first weight map, wherein at least one position point in the extended region can have its features enhanced by the adjusted first weight; fusing the adjusted first weight map with the seat feature map or local feature map to obtain the target feature map, where the local feature map is the feature map corresponding to the key region in the seat feature map; using the seat feature map or local feature map as the target feature map, specifically: adjusting the second weight map, wherein the second weight of each position point in the key region can ensure that the features of the corresponding position point remain unchanged after fusion; fusing the adjusted second weight map with the seat feature map or local feature map to obtain the target feature map.
[0079] In other words, if it is initially determined that the target in the seating area is wearing a seatbelt, a first weight map is generated. The first weight map contains the first weights corresponding to each position point within the key area of the seat feature map. The key area includes a base area and an extended area. The first weights of each position point in the base area are all referenced maximum weight values, while the first weights of each position point in the extended area decrease with the distance from the base area. If it is initially determined that the target in the seating area is not wearing a seatbelt, a second weight map is generated. The second weight map contains the second weights corresponding to each position point within the key area of the seat feature map. The second weights of each position point in the key area are all referenced minimum weight values.
[0080] For example, if it is initially determined that the target in the seating area is wearing a seatbelt, a first weight map is generated. The first weight map contains the first weights corresponding to each position point in the key area of the seat feature map. The first weight of each position point in the base area is 1. The first weight of each position point in the extended area decreases with the distance from the base area. That is, it decreases symmetrically on both sides of the diagonal according to a Gaussian distribution. The closer to the diagonal, the closer the first weight is to 1. If it is initially determined that the target in the seating area is not wearing a seatbelt, a second weight map is generated. The second weight map contains the second weights corresponding to each position point in the key area of the seat feature map. The second weight of each position point in the key area is 0.
[0081] It should be noted that if it is determined that there is no target in the seating area, a second weighted map is generated.
[0082] In one specific implementation, adjusting the first weight map or the second weight map involves: for each location point within the key region, obtaining the first difference between the first weight / second weight of the location point before adjustment and the focus weight value; and subtracting the square of the first difference from the target upper limit weight value to obtain the second difference, which is then used as the first weight / second weight of the location point after adjustment. The specific formula is as follows:
[0083] Where 1.25 represents the target upper limit weight value, which can be 1.25; Indicates location point The first weight / second weight before adjustment; 0.5 indicates the weight value to focus on, which can be 0.5.
[0084] In one specific implementation, the adjusted first weight map is fused with the seat feature map or local feature map, or the adjusted second weight map is fused with the seat feature map or local feature map. Specifically, the adjusted first weight map / second weight map is multiplied by the seat feature map or local feature map. The specific formula is as follows:
[0085] in, This indicates the adjusted first weighted graph or the adjusted second weighted graph; This represents a seat feature map or a partial feature map, specifically the seat feature map or partial feature map corresponding to the driver's seat, i.e. It can also be a feature map or partial feature map of the passenger seat, that is, ; This represents the target feature map, specifically the target feature map corresponding to the driver's seat, i.e. It can also be a feature map or partial feature map of the passenger seat, that is, .
[0086] Please see Figure 8 , Figure 8 This is a schematic diagram of an embodiment of the seat belt status recognition device provided in this application. The seat belt status recognition device 80 includes an extraction module 81, an enhancement module 82, and a recognition module 83. The extraction module 81 is used to extract a seat feature map corresponding to the seat area from a target image, wherein the seat feature map includes a reference area representing the location of a preset seat belt and an extended area extending outward from the reference area. The enhancement module 82 is used to enhance at least some features in the extended area of the seat feature map to obtain a target feature map. The recognition module 83 is used to perform seat belt status recognition using the target feature map to obtain a status recognition result corresponding to the seat area, wherein the status recognition result includes whether the target in the seat area is wearing a seat belt.
[0087] The extraction module 81, after extracting the seat feature map corresponding to the seat region from the target image, includes: obtaining a first weight map corresponding to the seat feature map, wherein the first weight map contains the first weights corresponding to each position point within the key region of the seat feature map, and the key region includes a base region and an extended region; the enhancement module 82 is used to enhance at least some features within the extended region of the seat feature map to obtain a target feature map, including: adjusting the first weight map, wherein at least one position point in the extended region can have its features enhanced by the adjusted first weight; and fusing the adjusted first weight map with the seat feature map or a local feature map to obtain the target feature map, wherein the local feature map is the feature map corresponding to the key region in the seat feature map.
[0088] Wherein, the first weight in the first weight map before adjustment satisfies at least one of the following conditions: the maximum weight value and the minimum weight value in the first weight map before adjustment are respectively the reference maximum weight value and the reference minimum weight value; the first weight of each position point in the reference region is the reference maximum weight value; the first weight of each position point in the extended region decreases with distance from the reference region; the first weight of each position point in the extended region decreases with distance from the reference region according to a Gaussian distribution; and / or, in the first weight map before adjustment, the position point with the first weight of interest is the position point of interest, and the position point of interest is located between the reference maximum weight value and the reference minimum weight value; in the first weight map after adjustment, the first weight of the position point of interest is the largest, and the position point with the first weight of interest closer to the position point of interest before adjustment has a larger first weight after adjustment; and / or, the first weight of each position point in the first weight map after adjustment is greater than or equal to the reference maximum weight value.
[0089] The step of enhancing at least some features in the extended area of the seat feature map to obtain the target feature map is performed when the target in the seat area is preliminarily determined to be wearing a seat belt using the seat feature map. The recognition module 83 is used to perform seat belt status recognition using the target feature map to obtain the status recognition result corresponding to the seat area before: when the target in the seat area is preliminarily determined to be without a target or without a seat belt using the seat feature map, the seat feature map or a local feature map is used as the target feature map, and the local feature map is the feature map corresponding to the key area in the seat feature map, the key area including the base area and the extended area.
[0090] The identification module 83, after extracting the seat feature map corresponding to the seat area from the target image, includes: performing preliminary discrimination using the seat feature map; if it is preliminarily determined that the target in the seat area has a seat belt, generating a first weight map corresponding to the seat feature map, wherein the first weight map contains the first weights corresponding to each position point within the key region of the seat feature map, the key region including a reference region and an extended region, the first weights of each position point in the reference region being the maximum reference weight value, and the first weights of each position point in the extended region decreasing with the distance from the reference region; if it is preliminarily determined that there is no target in the seat area or that the target in the seat area does not have a seat belt, generating a second weight map corresponding to the seat feature map as the weight map corresponding to the seat feature map, wherein the second weight map contains the second weights corresponding to each position point within the key region of the seat feature map, and so on. The second weights of each location point in the key region are all reference minimum weight values; the enhancement module 82 is used to enhance at least some features in the extended region of the seat feature map to obtain a target feature map, including: adjusting the first weight map, wherein at least one location point in the extended region can enhance the feature of the corresponding location point with the adjusted first weight; fusing the adjusted first weight map with the seat feature map or local feature map to obtain a target feature map, wherein the local feature map is the feature map corresponding to the key region in the seat feature map; the recognition module 83 is used to use the seat feature map or local feature map as the target feature map, including: adjusting the second weight map, wherein each location point in the key region can make the feature of the corresponding location point unchanged after fusion with the adjusted second weight; fusing the adjusted second weight map with the seat feature map or local feature map to obtain a target feature map.
[0091] The identification module 83 is used to adjust the first weight map or the second weight map, including: for each location point in the key area, obtaining the first difference between the first weight / second weight of the location point before adjustment and the focus weight value, and subtracting the square of the first difference from the target upper limit weight value to obtain the second difference, which is used as the first weight / second weight of the location point after adjustment; and / or, the identification module 83 is used to fuse the adjusted first weight map with the seat feature map or the local feature map, or to fuse the adjusted second weight map with the seat feature map or the local feature map, including: multiplying the adjusted first weight map / second weight map with the seat feature map or the local feature map.
[0092] The recognition module 83 is used to perform cross-attention processing on the target feature map and the seat feature map before obtaining the status recognition result corresponding to the seat area by using the target feature map to recognize the seat belt status. This is done to obtain a new target feature map for use in seat belt status recognition.
[0093] The extraction module 81 is used to extract the seat feature map corresponding to the seat area from the target image, including: obtaining the initial feature map of the target image; extracting features within a preset area from the initial feature map as the region feature map; using the region feature map as the region feature map corresponding to the seat area, or performing cross-attention processing on the region feature map and the initial feature map to obtain the region feature map corresponding to the seat area.
[0094] The extraction module 81 is used to perform cross-attention processing on the target feature map and the seat feature map, or on the region feature map and the initial feature map, including: performing feature transformation on the first feature map to obtain query features, and performing feature transformation on the second feature map to obtain key features and value features; and performing cross-attention processing using the query features, key features, and value features; wherein the first feature map is the target feature map and the second feature map is the seat feature map; or, the first feature map is the region feature map and the second feature map is the initial feature map.
[0095] The steps described above, such as using the target feature map to perform seat belt status recognition and obtain the status recognition result corresponding to the seat area, are performed by the large language model; and / or, before using the target feature map to perform seat belt status recognition and obtain the status recognition result corresponding to the seat area, the recognition module 83 is used to: use the initial feature map of the target image to identify the positional relationship between a preset part of the driver's target in the target image and the steering wheel; and the recognition module 83 is used to use the target feature map to perform seat belt status recognition and obtain the status recognition result corresponding to the seat area, including: using the positional relationship and the target feature map corresponding to each seat area in the target image to perform seat belt status recognition and obtain the status recognition result corresponding to each seat area in the target image.
[0096] The recognition module 83 is used to recognize the seat belt status by utilizing the positional relationship and the target feature map corresponding to each seat area in the target image, and to obtain the status recognition result corresponding to each seat area in the target image. This includes: splicing the positional relationship, the features corresponding to each seat area in the target image, and the prompt words to obtain spliced features, wherein the features corresponding to the seat area are the target feature map corresponding to the seat area, or the sequence features obtained by serializing the target feature map corresponding to the seat area; and using a large language model to predict the spliced features to obtain the status recognition result corresponding to each seat area in the target image.
[0097] Please see Figure 9 , Figure 9 This is a schematic diagram of an embodiment of the electronic device provided in this application. The electronic device 90 includes a memory 91 and a processor 92 coupled to each other. The processor 92 is used to execute program instructions stored in the memory 91 to implement the steps of any of the above-described seat belt status recognition method embodiments. In a specific implementation scenario, the electronic device 90 may include, but is not limited to, a microcomputer or a server. In addition, the electronic device 90 may also include mobile devices such as laptops and tablets, which are not limited here.
[0098] Specifically, processor 92 controls itself and memory 91 to implement the steps of any of the above-described seatbelt status recognition method embodiments. Processor 92 can also be referred to as a CPU (Central Processing Unit). Processor 92 may be an integrated circuit chip with signal processing capabilities. Processor 92 can also be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor can be a microprocessor or any conventional processor. Furthermore, processor 92 can be implemented using integrated circuit chips.
[0099] Please see Figure 10 , Figure 10This is a schematic diagram of an embodiment of the computer-readable storage medium provided in this application. The computer-readable storage medium 100 of this application embodiment stores program instructions 101. When executed, these program instructions 101 implement the method provided by any embodiment of the seatbelt status recognition method and any non-conflicting combination thereof. The program instructions 101 can form a program file and be stored in the aforementioned computer-readable storage medium 100 in the form of a software product, so that a computer device (which may be a personal computer, server, or network device, etc.) can execute all or part of the steps of the methods of various embodiments of this application. The aforementioned computer-readable storage medium 100 includes various media capable of storing program code, such as a USB flash drive, mobile hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, or terminal devices such as computers, servers, mobile phones, and tablets.
[0100] If the technical solution of this application involves personal information, the product using this technical solution has clearly informed the user of the personal information processing rules and obtained the user's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using this technical solution has obtained the user's separate consent before processing the sensitive personal information, and also meets the requirement of "express consent". For example, at personal information collection devices such as cameras, clear and prominent signs are set up to inform users that they have entered the scope of personal information collection and that personal information will be collected. If an individual voluntarily enters the collection scope, it is deemed that they have agreed to the collection of their personal information; or on the personal information processing device, with clear signs / information informing users of the personal information processing rules, authorization is obtained from the individual through pop-up information or by asking the individual to upload their personal information; wherein, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the types of personal information processed.
[0101] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for recognizing the status of a seatbelt, characterized in that, The method includes: Extract the seat feature map corresponding to the seat area from the target image, wherein the seat feature map includes a reference area representing the location of the preset seat belt and an extended area extending outward from the reference area; At least some features within the extended region of the seat feature map are enhanced to obtain the target feature map; The target feature map is used to identify the seat belt status, and the status identification result corresponding to the seat area is obtained. The status identification result includes whether the target in the seat area is wearing a seat belt.
2. The method according to claim 1, characterized in that, After extracting the seat feature map corresponding to the seat region from the target image, the method further includes: Obtain a first weight map corresponding to the seat feature map, wherein the first weight map contains the first weights corresponding to each position point within the key region of the seat feature map, and the key region includes the reference region and the extended region; The enhancement of at least a portion of the features within the extended region of the seat feature map to obtain the target feature map includes: The first weight map is adjusted, wherein at least one location point in the extended region can have its features enhanced by the adjusted first weight; The adjusted first weight map is fused with the seat feature map or local feature map to obtain the target feature map, wherein the local feature map is the feature map corresponding to the key area in the seat feature map.
3. The method according to claim 2, characterized in that, The first weight in the first weight graph before adjustment satisfies at least one of the following conditions: the maximum weight value and the minimum weight value in the first weight graph before adjustment are respectively the reference maximum weight value and the reference minimum weight value; The first weight of each location point in the reference region is the reference maximum weight value; The first weight of each location point in the extended region decreases with the distance from the reference region; The first weight of each location point in the extended region decreases according to a Gaussian distribution as its distance from the reference region decreases. And / or, in the first weight map before the adjustment, the first weight is the position point of the weight value of interest, and the weight value of interest is located between the reference maximum weight value and the reference minimum weight value; In the adjusted first weight map, the first weight of the focus location point is the largest, and the closer the first weight of the location point before adjustment is to the focus weight value, the larger the first weight of the location point after adjustment. And / or, the first weight of each point in the adjusted first weight map is greater than or equal to the reference maximum weight value.
4. The method according to claim 1, characterized in that, The step of enhancing at least some features within the extended area of the seat feature map to obtain a target feature map is performed when the target in the seat area is preliminarily identified using the seat feature map as having a seat belt fastened. Before using the target feature map to perform seat belt status recognition and obtain the status recognition result corresponding to the seat area, the method further includes: If, based on the seat feature map, it is initially determined that the target is not present in the seat area or that the target in the seat area is not a seatbelt, the seat feature map or a local feature map is used as the target feature map. The local feature map is the feature map corresponding to the key area in the seat feature map, and the key area includes the reference area and the extended area.
5. The method according to claim 4, characterized in that, After extracting the seat feature map corresponding to the seat region from the target image, the method further includes: Preliminary identification is made using the aforementioned seat feature map; If it is initially determined that the target in the seat area is wearing a seat belt, a first weight map corresponding to the seat feature map is generated. The first weight map includes the first weight of each position point in the key area of the seat feature map. The key area includes the reference area and the extended area. The first weight of each position point in the reference area is a reference maximum weight value. The first weight of each position point in the extended area decreases with the distance from the reference area. If it is initially determined that the target is not present in the seat area or that the target in the seat area is not a seatbelt, a second weight map corresponding to the seat feature map is generated as the weight map corresponding to the seat feature map. The second weight map includes the second weights corresponding to each position point within the key region of the seat feature map, and the second weights of each position point within the key region are all reference minimum weight values. The enhancement of at least some features within the extended region of the seat feature map to obtain the target feature map includes: The first weight map is adjusted, wherein at least one location point in the extended region can have its features enhanced by the adjusted first weight; The adjusted first weight map is fused with the seat feature map or local feature map to obtain the target feature map, wherein the local feature map is the feature map corresponding to the key region in the seat feature map; The step of using the seat feature map or local feature map as the target feature map includes: The second weight map is adjusted such that the features of each location point in the key region remain unchanged after fusion. The adjusted second weight map is fused with the seat feature map or local feature map to obtain the target feature map.
6. The method according to any one of claims 2 to 5, characterized in that, Adjusting the first weight map, or adjusting the second weight map, includes: For each location point within the key area, obtain the first difference between the first weight / second weight of the location point before adjustment and the attention weight value, and subtract the square of the first difference from the target upper limit weight value to obtain the second difference, which is used as the first weight / second weight of the location point after adjustment. And / or, the step of fusing the adjusted first weight map with the seat feature map or local feature map, or fusing the adjusted second weight map with the seat feature map or local feature map, includes: Multiply the adjusted first weight map / second weight map with the seat feature map or local feature map.
7. The method according to claim 1, characterized in that, Before using the target feature map to perform seat belt status recognition and obtain the status recognition result corresponding to the seat area, the method further includes: The target feature map and the seat feature map are subjected to cross-attention processing to obtain a new target feature map for use in seat belt status recognition.
8. The method according to claim 1, characterized in that, The step of extracting the seat feature map corresponding to the seat region from the target image includes: Obtain the initial feature map of the target image; Extract features within a preset region from the initial feature map to obtain a region feature map; The region feature map is used as the region feature map corresponding to the seat area, or the region feature map and the initial feature map are subjected to cross-attention processing to obtain the region feature map corresponding to the seat area.
9. The method according to claim 7 or 8, characterized in that, The step of performing cross-attention processing on the target feature map and the seat feature map, or the step of performing cross-attention processing on the region feature map and the initial feature map, includes: The first feature map is transformed to obtain the query features, and the second feature map is transformed to obtain the key features and value features. Cross-attention processing is performed using the query features, key features, and value features. Wherein, the first feature map is the target feature map and the second feature map is the seat feature map; or, the first feature map is the region feature map and the second feature map is the initial feature map.
10. The method according to claim 1, characterized in that, The step of using the target feature map to identify the seat belt status and obtain the status identification result corresponding to the seat area is performed by the large language model; And / or, before using the target feature map to perform seat belt status recognition and obtain the status recognition result corresponding to the seat area, the method further includes: using the initial feature map of the target image to identify the positional relationship between a preset part of the driver's target in the target image and the steering wheel; and, the step of using the target feature map to perform seat belt status recognition and obtain the status recognition result corresponding to the seat area includes: using the positional relationship and the target feature map corresponding to each seat area in the target image to perform seat belt status recognition and obtain the status recognition result corresponding to each seat area in the target image.
11. The method according to claim 10, characterized in that, The step of using the positional relationship and the target feature map corresponding to each seat area in the target image to perform seat belt status recognition, and obtaining the status recognition result corresponding to each seat area in the target image, includes: The positional relationship, the features corresponding to each seat area in the target image, and the prompt words are concatenated to obtain concatenated features. The features corresponding to the seat areas are either the target feature map corresponding to the seat areas or the sequence features obtained by serializing the target feature map corresponding to the seat areas. The spliced features are predicted using the large language model to obtain the state recognition results corresponding to each seat region in the target image.
12. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory being used to store program instructions, and the processor being used to execute the program instructions to implement the seat belt status recognition method as described in any one of claims 1-11.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store program instructions that can be executed to implement the seatbelt status recognition method as described in any one of claims 1-11.