## 3 Design of a Memory-Efficient Lightweight Object-Detection Model
### Memory Consumption Analysis  
In designing a lightweight object-detection model, addressing memory consumption is paramount for ensuring efficient operation on embedded devices. The approach involves a detailed analysis of the memory usage across various convolution operations. Among the techniques explored, DSC stands out. Originally proposed in 2017 and subsequently implemented in Google's MobileNet [38], DSC splits standard convolution into depthwise and pointwise convolution, reducing both the computational burden and the parameter count. Depthwise convolution (DC) processes each input channel independently with a convolutional filter, and the results are concatenated as shown in Figure 3. In Figure 3, '1, 2, 3...N' represents the input channels, with each number corresponding to a specific input channel feature map. During depthwise convolution, each channel undergoes a separate convolution operation, rather than being convolved across all channels simultaneously. Subsequently, these processed channel feature maps are combined through pointwise convolution to produce the output feature map. In this analysis, parameters, memory, and floating point operations are abbreviated as P, M, and F, respectively, to simplify the presentation of mathematical formulas. Consider an input feature map of size \(W\times H\), with \(C_{i}\) input channels and \(C_{o}\) output channels, and a kernel size of \(k\). The parameters and computational costs are computed as follows:  
\[\mathrm{P}_{\mathrm{DC}}=C_{i}\times k^{2} \tag{1}\]  
\[\mathrm{F}_{\mathrm{DC}}=C_{i}\times k^{2}\times H\times W \tag{2}\]  
For pointwise convolution (PC), the parameter count and computational cost are calculated as:  
\[\mathrm{P}_{\mathrm{PC}}=C_{i}\times C_{o} \tag{3}\]  
\[\mathrm{F}_{\mathrm{PC}}=C_{i}\times C_{o}\times H\times W \tag{4}\]  
Thus, the total parameter count and computational cost for DSC are:  
\[\mathrm{P}_{\mathrm{DSC}}=C_{i}\times k^{2}+C_{i}\times C_{o} \tag{5}\]  
\[\mathrm{F}_{\mathrm{DSC}}=C_{i}\times k^{2}\times H\times W+C_{i}\times C_{o} \times H\times W \tag{6}\]  
Figure 2: Overall structure of the proposed model. Comparing these values, the overall parameters and computational costs for DSC relative to standard convolution are:  
\[\frac{\text{P}_{\text{DSC}}}{\text{P}_{\text{std}}}=\frac{1}{C_{o}}+\frac{1}{k^{2}} \tag{7}\]  
Using a convolution layer with 100 input and output channels and a kernel size of 5, replacing standard convolution with DSC can reduce the parameter count and computational cost to one-twentieth of the original, significantly decreasing the computational resource requirement. Although DSC can reduce the number of parameters and computational costs, its performance on embedded devices, which require frequent memory accesses due to per-channel convolution operations, may not necessarily be better than that of standard convolution [34]. Moreover, using DSC can lead to a drop in detection precision [39], necessitating an increase in the number of channels to compensate. For instance, in MobileNetV2, the width of DSC is expanded six times, increasing memory access and ultimately resulting in slower performance compared to standard convolution-based CNN networks. The memory usage of DSC compared to standard convolution can be calculated as follows:  
\[\text{M}_{\text{DSC}}=H\times W\times 2c^{\prime}+k^{2}\times c^{\prime} \approx H\times W\times 2c^{\prime} \tag{8}\]  
\[\mathrm{P}_{\mathrm{DC}}=C_{i}\times k^{2} \tag{1}\]0  
Here, \(c^{\prime}\) usually is larger than \(c\) due to the expanded number of channels in the feature map for DSC, potentially leading to higher memory usage for DSC than standard convolution. To address these issues, the partial convolution (PConv) is proposed [34].