Category: Study

8 Posts

【笔记】实用机器学习 – Data II
李沐老师实用机器学习笔记: Data II 1.3 网页数据的抓取 网页数据的抓取是获取训练数据的一个重要的方式。与爬虫不同,数据抓取是为了获取特定的信息,而非爬取整个网页的内容。 📽️ 授课视频: 1.3 网页数据抓取【斯坦福21秋季:实用机器学习中文版】_哔哩哔哩_bilibili 📓 课件: 讲义 工具 通常情况下,网站都会有防护措施,防止机器爬取数据。因此我们一般要使用 headless browser 像selenium。 而且,我们还需要大量的IP,一旦ip被禁止,我们可以换IP继续抓取数据。 案例学习 房屋价格的抓取 (省略),使用云平台,可以方便的更换ip,而且机器要求不高,价格不贵。 法律问题 数据抓取本身并不违法 但是,我们要避免抓取敏感数据:(1)需要登陆才能访问的数据,一般比较敏感。(2)不要爬取有版权的信息,(3)网站声明不允许爬取。 如果用做商业用途请咨询律师 1.4 数据标注 📽️ 授课视频: 1.4 数据标注【斯坦福21秋季:实用机器学习中文版】_哔哩哔哩_bilibili 📓 课件: 讲义 流程图 只有部分标签,没钱,不想人工标注数据:半监督学习 如果仅有一小部分的数据,可以使用半监督学习进行数据标注。这里我们的假设是: 数据有连续性:拥有相似特征的样本有相同的标签 聚类性:数据有聚类的特性,同一类有相同的标签 流体假设:数据的复杂度比输入的维度要小 自学习 首先,我们先用有限的标签训练一个模型。然后,我们用模型去预测未标记的数据,对于高置信的预测样本,我们把他们融合到标记的数据中,再继续训练我们的模型。 这里我们可以使用更深的模型,或者多个模型做集合预测。因为这里的深度学习模型只是用来打标签,并不会用来实际部署。 只有部分标签,不差钱,可以标注数据:众包标注 可以使用类似于Amazon Mechanical Turk的众包平台,人工标记大量数据。需要注意的是: 用户标注页面要尽可能地简单:越简单,对标记人员的要求越低,就可以找到更多的标记人员,就可以拿到更低的价格。比如,对于一个365类的分类问题,可以简化为365个二分类问题,标注人员只需要回答是或者否。 花费 质量控制:不同标注人员标注的质量不同 主动学习 对自学习进行升级,引入标记人员,进行主动学习。 学习那些更不确定的样本(现有知识难以理解,信息多)。 学习那些多模型预测不一致的样本 (多样性,信息多)。 这里,和自学习不同的地方在于:自学习,对于不确定的样本不做处理;主动学习,需要挑出最有代表性的不确定性的样本,进行标注。 质量控制 标注工人经常会犯错。 最简单的办法是:同一样本,多人多次标注,但花费更多。 解决办法:只对有异议的样本(比如,两人不一致的样本)进行多人标注,雇佣高质量的标注员工。 只有部分标签,没钱,想获得监督信号:弱监督学习 定义一些启发性的规则(heuristic programs),来过滤样本,进而产生一些标签,这些标签通常是比人工标记要差,但可以训练模型。 比如在评论分类(人评论的,机器评论的)模型里:对大量的评论可以通过查找关键词,使用其他模型(情绪模型)做预测,来找出最像 “人的评论” 和 “机器的评论。”
【笔记】实用机器学习 – Data I
李沐老师实用机器学习学习笔记,数据I 1.1 课程介绍 工业界有很多机器学习的应用, 例如传统的制造业中,可以利用传感器,自动找出出现问题的设备 📽️ 授课视频: 跟李沐学AI的个人空间_哔哩哔哩_Bilibili 📓 课件: Syllabus - Practical Machine Learning 机器学习工作流: 定义问题: 找出最关键的问题,在一个项目中,最能产生效果的问题 数据:收集高质量的数据,需要考虑隐私问题 训练模型:模型现在越来越复杂,成本越来越高 部署模型:为了实时化 监控:要不断的监控,可能存在偏向性问题 机器学习的角色: 软件设计工程师: 开发维护数据流,模型训练和服务流 领域专家:有商业眼光,发现问题 数据科学家:全栈能力,数据挖掘,模型训练和部署 机器学习专家:模型定制化,模型调优 1.2 数据获取 外部数据集 数据集的三种类型: 学术数据集:干净,简单,但是选择不多,通常是小规模的 比赛数据集:接近于真实的机器学习应用。缺点是简单,数量少 原始数据:有更大的灵活性,但需要更多的预处理 生成数据集 使用GAN 仿真 数据增广
BoTNet (Bottleneck Transformers)
BoTNet (2021-01): 将 Self-Attention 嵌入 ResNet 文章:Bottleneck Transformers for Visual Recognition 论文: https://arxiv.org/abs/2101.11605 摘要: We present BoTNet, a conceptually simple yet powerful backbone architecture that incorporates self-attention for multiple computer vision tasks including image classification, object detection and instance segmentation. By just replacing the spatial convolutions with global self-attention in the final three bottleneck blocks of a ResNet and no other changes, our approach improves upon the baselines significantly on instance segmentation and object detection while also reducing the parameters, with minimal overhead in latency. Through the design of BoTNet, we also point out how ResNet bottleneck blocks with self-attention can be viewed as Transformer blocks. Without any bells and whistles, BoTNet achieves 44.4% Mask AP and 49.7% Box AP on the COCO Instance Segmentation benchmark using the Mask R-CNN framework; surpassing the previous best published single model and single scale results of ResNeSt evaluated on the COCO validation set. Finally, we present a simple adaptation of the BoTNet design for image classification, resulting in models that achieve a strong performance of 84.7% top-1 accuracy…
[Reading Notes] Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization
Source Paper: [ICCV'2017] https://arxiv.org/abs/1703.06868 Authors: Xun Huang, Serge Belongie Code: https://github.com/xunhuang1995/AdaIN-style Contributions In this paper, the authors present a simple yet effective approach that for the first time enables arbitrary style transfer in real-time. Arbitrary style transfer: takes a content image $C$ and an arbitrary style image $S$ as inputs, and synthesizes an output image with the same content as $C$ and the same syle as $S$. Background Batch Normalization Given a input batch $x \in \mathbb{R}^{N \times C \times H \times W}$, batch normalization (BN) normalizes the mean and standard deviation for each individual feature channel: $$ \mathrm{BN}(x)=\gamma\left(\frac{x-\mu(x)}{\sigma(x)}\right)+\beta $$ where $\gamma , \beta \in \mathbb{R}^{C}$ are affine parameters learned from data. $\mu(x) , \sigma(x) \in \mathbb{R}^{C}$ are mean and standard deviation computed across batch size and spatial dimensions, independently. $$ \mu_{c}(x)=\frac{1}{N H W} \sum_{n=1}^{N} \sum_{h=1}^{H} \sum_{w=1}^{W} x_{n c h w} $$ $$ \sigma_{c}(x)=\sqrt{\frac{1}{N H W} \sum_{n=1}^{N} \sum_{h=1}^{H} \sum_{w=1}^{W}\left(x_{n c h w}-\mu_{c}(x)\right)^{2}+\epsilon} $$ Instance Normalization Original feed-forward stylization method [51] utilizes BN layers after the convolutional layer. Ulyanov et al. [52] found using Instance Normalization…
[Reading Notes] Collaborative Distillation for Ultra-Resolution Universal Style Transfer
Source Authors: Huan Wang, Yijun Li, Yuehai Wang, Haoji Hu, Ming-Hsuan YangPaper: [CVPR2020] https://arxiv.org/abs/2003.08436Code: https://github.com/mingsun-tse/collaborative-distillation Contributions It proposes a new knowledge distillation method "Collobrative Distillation" based on the exclusive collaborative relation between the encoder and its decoder. It proposes to restrict the students to learn linear embedding of the teacher's outputs, which boosts its learning. Experimetenal works are done with different stylization frameworks, like WCT and AdaIN. Related Works Style Transfer WCT: Li, Y., Fang, C., Yang, J., Wang, Z., Lu, X., & Yang, M. H. (2017). Universal style transfer via feature transforms. arXiv preprint arXiv:1705.08086.AdaIN: Huang, X., & Belongie, S. (2017). Arbitrary style transfer in real-time with adaptive instance normalization. In Proceedings of the IEEE International Conference on Computer Vision (pp. 1501-1510). Model Compression low-rank decomposition pruning quantization knowledge distillationKnowledge distillation is a promising model compression method by transferring the knowledge of large networks (called teacher) to small networks (called student), where the knowledge can be softened probability (which can reflect the inherent class similarity structure known as dark knowledge) or sample relations (which…
YOLObile: Real-Time Object Detection on Mobile Devices via Compression-Compilation Co-Design
Paper Information Paper: YOLObile: Real-Time Object Detection on Mobile Devices via Compression-Compilation Co-Design Authors: Yuxuan Cai, Hongjia Li, Geng Yuan, Wei Niu, Yanyu Li, Xulong Tang, Bin Ren, Yanzhi Wang Paper: https://arxiv.org/abs/2009.05697 Github: https://github.com/nightsnack/YOLObile Objective: Real-time object detection for mobile devices. Study notes and presentation: Download: https://connectpolyu-my.sharepoint.com/:p:/g/personal/18048204r_connect_polyu_hk/EcRbix5iqshBglmxuLurS-sBBFmbrk8chRkim1y54-yOXw?e=8Qdfmd This is an embedded Microsoft Office presentation, powered by Office.
A Image Quality Evaluation Toolbox For MATLIB
MeTriX MuX Visual Quality Assessment Package The name of the package is MeTriX MuX Visual Quality Assessment Package. The official website does not work (attempt on 08-Sep-2019), and the download link http://foulard.ece.cornell.edu/gaubatz/metrix_mux/metrix_mux_1.1.zip is invaild. I find a copy that is from a github repository https://github.com/sattarab/image-quality-tools/tree/master/metrix_mux Installation It can be easily followed at the index.html file. It is very simple, just run the command ">> configure_metrix_mux" in matlab. For "VIF" method there is a bug that need to change a function name from "_m"to "_M". Content It is a powerful toolbox that contains implementation of many evaluation algorithms: 'MSE': mean-squared-error 'PSNR': peak signal-to-noise-ratio 'SSIM': structural similarity index 'MSSIM': multi-scale SSIM index 'VSNR': visual signal-to-noise ratio 'VIF': visual information fidelity 'VIFP': pixel-based VIF 'UQI': universal quality index 'IFC': information fidelity criterion 'NQM': noise quality measure 'WSNR': weighted signal-to-noise ratio 'SNR': signal-to-noise ratio Usage distorted_ssim_index = metrix_mux( reference_image, distorted_image, 'SSIM')